This commit is contained in:
2026-02-11 18:22:06 +03:00
parent 652fbd0890
commit 4e08d985c9
8 changed files with 244 additions and 136 deletions

View File

@@ -1,5 +1,5 @@
#include <print>
#include <list>
#include <print>
#include <mcc_netserver_proto.h>
@@ -24,7 +24,7 @@ int main()
msg2_t msg2("ACK", 12.43298042, "EEE", std::chrono::seconds(10), vd);
// msg2_t msg2("ACK");
std::println("msg.bytes = <{}>",msg2.byteRepr());
std::println("msg.bytes = <{}>", msg2.byteRepr());
std::println("msg.key = <{}>", msg2.keyword());
std::println("msg.par[1] = <{}>", msg2.param(1));
std::println("msg.par[2] = <{}>", msg2.param(2));
@@ -58,16 +58,20 @@ int main()
mcc::impl::MccSkyPoint spt(mcc::impl::MccSkyRADEC_APP{"10:00:00.0"_hms, 12.098687_degs});
msg2.construct("ACK", "MOUNT", spt);
msg2.construct("ACK", "MOUNT", mcc::MccSerializedAngleFormatPrec{3, 2}, spt);
std::println("msg2.bytes = <{}>", msg2.byteRepr());
auto spt_d = msg2.paramValue<mcc::impl::MccSkyPoint>(1);
if (spt_d){
std::println("msg2.parvalue(1).epoch() = {}", spt_d->epoch().MJD()+mcc::MCC_MJD_ZERO);
if (spt_d) {
std::println("msg2.parvalue(1).pairKind() = {}", MccCoordPairKindToStr(spt_d->pairKind()));
std::println("msg2.parvalue(1).epoch() = {}", spt_d->epoch().MJD() + mcc::MCC_MJD_ZERO);
} else {
std::println("cannot deserialize MccSkyPoint value!");
}
msg2.construct("ACK", "MOUNT", mcc::MccSerializedCoordPairFormat::MCC_SERIALIZED_FORMAT_DEGREES, spt);
std::println("msg2.bytes = <{}>", msg2.byteRepr());
return 0;
}