add tests for control protocol and angle representation parsing

This commit is contained in:
2025-02-03 23:03:07 +03:00
parent 61afd0f4a7
commit a2e2896f29
5 changed files with 133 additions and 18 deletions

View File

@@ -41,10 +41,10 @@ static constexpr std::string_view CONTROL_PROTO_STR_TAG_MINALT = "tagMINALT";
static constexpr std::string_view CONTROL_PROTO_STR_TAG_MAXALT = "tagMAXALT";
// moving
static constexpr std::string_view CONTROL_PROTO_STR_SLEW_AZALT = "slewAZALT";
static constexpr std::string_view CONTROL_PROTO_STR_SLEW_RADEC = "slewRADEC";
static constexpr std::string_view CONTROL_PROTO_STR_SLEW_XVEL = "slewXVEL"; // velocity along Az/RA
static constexpr std::string_view CONTROL_PROTO_STR_SLEW_YVEL = "slewYVEL"; // velocity along ALT/DEC
static constexpr std::string_view CONTROL_PROTO_STR_SLEW_AZALT = "slewAZALT"; // slew and stop
static constexpr std::string_view CONTROL_PROTO_STR_SLEW_RADEC = "slewRADEC"; // slew and track
static constexpr std::string_view CONTROL_PROTO_STR_SLEW_XVEL = "slewXVEL"; // velocity along Az/RA
static constexpr std::string_view CONTROL_PROTO_STR_SLEW_YVEL = "slewYVEL"; // velocity along ALT/DEC
static constexpr std::string_view CONTROL_PROTO_STR_TRACK_XVEL = "trackXVEL";
static constexpr std::string_view CONTROL_PROTO_STR_TRACK_YVEL = "trackYVEL";
static constexpr std::string_view CONTROL_PROTO_STR_STOP = "stop";
@@ -52,8 +52,33 @@ static constexpr std::string_view CONTROL_PROTO_STR_STOP = "stop";
// site coordinates
static constexpr std::string_view CONTROL_PROTO_STR_SITE_LON = "siteLON";
static constexpr std::string_view CONTROL_PROTO_STR_SITE_LAT = "siteLAT";
static constexpr std::string_view CONTROL_PROTO_STR_SITE_ELEV = "siteELEV";
static constexpr std::array CONTROL_PROTO_VALID_COMMAND = {CONTROL_PROTO_STR_SLEW_AZALT, CONTROL_PROTO_STR_SLEW_RADEC};
// meteo
static constexpr std::string_view CONTROL_PROTO_STR_METEO_TEMP = "atmTEMP";
static constexpr std::string_view CONTROL_PROTO_STR_METEO_PRES = "atmPRES";
static constexpr std::string_view CONTROL_PROTO_STR_METEO_HUM = "atmHUM";
// PCS
// network setup:
// format: netCONF=<iface>:<IP-addr>/<net-mask>,<gateway>,<broadcast>
// netCONF=eth0:192.168.1.10/24,192.168.1.1,192.168.1.255
static constexpr std::string_view CONTROL_PROTO_STR_NET_CONF = "netCONF";
static constexpr std::array CONTROL_PROTO_VALID_COMMAND = {
CONTROL_PROTO_STR_TAG_AZ, CONTROL_PROTO_STR_TAG_ALT, CONTROL_PROTO_STR_TAG_AZALT,
CONTROL_PROTO_STR_TAG_RA, CONTROL_PROTO_STR_TAG_DEC, CONTROL_PROTO_STR_TAG_RADEC,
CONTROL_PROTO_STR_TEL_RA, CONTROL_PROTO_STR_TEL_DEC, CONTROL_PROTO_STR_TEL_RADEC,
CONTROL_PROTO_STR_UTC_DATE, CONTROL_PROTO_STR_LOC_DATE, CONTROL_PROTO_STR_UTC_TIME,
CONTROL_PROTO_STR_LOC_TIME, CONTROL_PROTO_STR_UTC_DT, CONTROL_PROTO_STR_LOC_DT,
CONTROL_PROTO_STR_JDN, CONTROL_PROTO_STR_TAG_MINALT, CONTROL_PROTO_STR_TAG_MAXALT,
CONTROL_PROTO_STR_SLEW_AZALT, CONTROL_PROTO_STR_SLEW_RADEC, CONTROL_PROTO_STR_SLEW_XVEL,
CONTROL_PROTO_STR_SLEW_YVEL, CONTROL_PROTO_STR_TRACK_XVEL, CONTROL_PROTO_STR_TRACK_YVEL,
CONTROL_PROTO_STR_STOP, CONTROL_PROTO_STR_SITE_LON, CONTROL_PROTO_STR_SITE_LAT,
CONTROL_PROTO_STR_SITE_ELEV, CONTROL_PROTO_STR_METEO_TEMP, CONTROL_PROTO_STR_METEO_PRES,
CONTROL_PROTO_STR_METEO_HUM, CONTROL_PROTO_STR_NET_CONF,
};
class ControlProtoParser
{