...
This commit is contained in:
@@ -1012,31 +1012,59 @@ protected:
|
||||
MccCelestialPoint cp{.pair_kind = MccCoordPairKind::COORDS_KIND_RADEC_ICRS};
|
||||
|
||||
auto sz = input_msg.paramSize();
|
||||
if (sz) { // set or get operation
|
||||
auto vc = input_msg.template paramValue<MccCelestialPoint>(0); // is it set operation?
|
||||
if (vc) { // coordinates are given - set operation
|
||||
auto m_err = mount_ptr->setPointingTarget(vc.value());
|
||||
if (m_err) {
|
||||
if (sz) { // set or get operation
|
||||
auto vp = input_msg.template paramValue<MccCoordPairKind>(0); // is it get operation?
|
||||
if (vp) { // coordinate pair kind is given, it is get operation
|
||||
cp.pair_kind = vp.value();
|
||||
err = coordsFromTelemetryData(*mount_ptr, true, cp);
|
||||
if (!err) {
|
||||
output_msg.construct(MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR, MCC_COMMPROTO_KEYWORD_TARGET_STR,
|
||||
_coordFormat, _coordPrec, cp);
|
||||
}
|
||||
} else { // here a celestial point must be given
|
||||
auto vc = input_msg.template paramValue<MccCelestialPoint>(0);
|
||||
if (vc) { // set operation
|
||||
auto m_err = mount_ptr->setPointingTarget(vc.value());
|
||||
if (m_err) {
|
||||
err = mcc_deduce_error_code(m_err,
|
||||
MccGenericMountNetworkServerErrorCode::ERROR_MOUNT_SET_TARGET);
|
||||
if (m_err) {
|
||||
err = mcc_deduce_error_code(
|
||||
m_err, MccGenericMountNetworkServerErrorCode::ERROR_MOUNT_SET_TARGET);
|
||||
}
|
||||
} else {
|
||||
output_msg.construct(MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR, input_msg.byteRepr());
|
||||
}
|
||||
} else {
|
||||
output_msg.construct(MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR, input_msg.byteRepr());
|
||||
}
|
||||
} else {
|
||||
auto vp = input_msg.template paramValue<MccCoordPairKind>(0);
|
||||
if (vp) { // coordinate pair kind is given
|
||||
cp.pair_kind = vp.value();
|
||||
err = coordsFromTelemetryData(*mount_ptr, true, cp);
|
||||
if (!err) {
|
||||
output_msg.construct(MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR, MCC_COMMPROTO_KEYWORD_TARGET_STR,
|
||||
_coordFormat, _coordPrec, cp);
|
||||
}
|
||||
} else { // invalid command!!!
|
||||
err = vp.error();
|
||||
err = vc.error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// auto vc = input_msg.template paramValue<MccCelestialPoint>(0); // is it set operation?
|
||||
// if (vc) { // coordinates are given - set
|
||||
// operation
|
||||
// auto m_err = mount_ptr->setPointingTarget(vc.value());
|
||||
// if (m_err) {
|
||||
// if (m_err) {
|
||||
// err = mcc_deduce_error_code(m_err,
|
||||
// MccGenericMountNetworkServerErrorCode::ERROR_MOUNT_SET_TARGET);
|
||||
// }
|
||||
// } else {
|
||||
// output_msg.construct(MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR, input_msg.byteRepr());
|
||||
// }
|
||||
// } else {
|
||||
// auto vp = input_msg.template paramValue<MccCoordPairKind>(0);
|
||||
// if (vp) { // coordinate pair kind is given
|
||||
// cp.pair_kind = vp.value();
|
||||
// err = coordsFromTelemetryData(*mount_ptr, true, cp);
|
||||
// if (!err) {
|
||||
// output_msg.construct(MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR,
|
||||
// MCC_COMMPROTO_KEYWORD_TARGET_STR,
|
||||
// _coordFormat, _coordPrec, cp);
|
||||
// }
|
||||
// } else { // invalid command!!!
|
||||
// err = vp.error();
|
||||
// }
|
||||
// }
|
||||
} else { // get operation
|
||||
err = coordsFromTelemetryData(*mount_ptr, true, cp);
|
||||
if (!err) {
|
||||
|
||||
Reference in New Issue
Block a user