2024-07-23 21:14:22 +01:00
|
|
|
#include "TargetPinDescriptor.hpp"
|
|
|
|
|
|
2024-08-16 22:50:06 +01:00
|
|
|
#include "src/Services/StringService.hpp"
|
|
|
|
|
|
2024-07-23 21:14:22 +01:00
|
|
|
namespace Targets
|
|
|
|
|
{
|
|
|
|
|
TargetPinDescriptor::TargetPinDescriptor(
|
|
|
|
|
const std::string& position,
|
2024-08-16 22:50:06 +01:00
|
|
|
const std::optional<std::string>& padKey
|
2024-07-23 21:14:22 +01:00
|
|
|
)
|
2024-08-16 22:50:06 +01:00
|
|
|
: position(position)
|
2024-10-27 00:28:41 +01:00
|
|
|
, numericPosition(
|
|
|
|
|
Services::StringService::isNumeric(this->position)
|
|
|
|
|
? Services::StringService::toUint16(this->position, 10)
|
|
|
|
|
: 0
|
|
|
|
|
)
|
2024-08-16 22:50:06 +01:00
|
|
|
, padKey(padKey)
|
2024-07-23 21:14:22 +01:00
|
|
|
{}
|
|
|
|
|
}
|