3411 lines
113 KiB
C++
3411 lines
113 KiB
C++
|
|
|
|
|
|
#include "training_area_telegrams.h"
|
|
#include <utility>
|
|
|
|
#include <QtCore/QJsonArray>
|
|
#include <QtCore/QJsonDocument>
|
|
#include <QtCore/QJsonObject>
|
|
|
|
namespace TrainingAreaBase
|
|
{
|
|
namespace TetraIcd
|
|
{
|
|
|
|
JsonException::JsonException(const QJsonObject &obj, const QString &key)
|
|
: m_obj(obj)
|
|
, m_key(key)
|
|
, m_what("Could not find key '" + key.toUtf8() + "' in json ('" + QJsonDocument(obj).toJson(QJsonDocument::Compact) + "')")
|
|
{}
|
|
|
|
template <typename E>
|
|
QJsonValue enumToJson(E e)
|
|
{
|
|
static_assert(std::is_enum<E>::value, "Only useable with enumerations");
|
|
return static_cast<int>(e);
|
|
}
|
|
|
|
template <typename A>
|
|
QJsonValue arrayToJson(const std::vector<A> &cont)
|
|
{
|
|
QJsonArray arr;
|
|
for (const A &s : cont)
|
|
arr += s.toJson();
|
|
return arr;
|
|
}
|
|
|
|
template <>
|
|
QJsonValue arrayToJson(const std::vector<int> &cont)
|
|
{
|
|
QJsonArray arr;
|
|
for (const int i : cont)
|
|
arr += i;
|
|
return arr;
|
|
}
|
|
|
|
template <>
|
|
QJsonValue arrayToJson(const std::vector<unsigned char> &cont)
|
|
{
|
|
|
|
return QString::fromLatin1(QByteArray::fromRawData(reinterpret_cast<const char *>(cont.data()), cont.size()).toHex());
|
|
}
|
|
|
|
template <typename T>
|
|
bool get(const QJsonObject &obj, const QString &key, T &val, bool bOptional = false)
|
|
{
|
|
if (bOptional)
|
|
{
|
|
try
|
|
{
|
|
val = T::fromJson(obj[key].toObject());
|
|
}
|
|
catch (const JsonException &e)
|
|
{
|
|
Q_UNUSED(e);
|
|
return false;
|
|
}
|
|
}
|
|
else
|
|
val = T::fromJson(obj[key].toObject());
|
|
return true;
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, QJsonArray &val, bool bOptional)
|
|
{
|
|
const auto jVal = obj[key];
|
|
if (!jVal.isArray())
|
|
{
|
|
if (bOptional)
|
|
return false;
|
|
throw JsonException(obj, key);
|
|
}
|
|
val = jVal.toArray();
|
|
return true;
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, bool &val, bool bOptional)
|
|
{
|
|
const auto jVal = obj[key];
|
|
if (!jVal.isBool())
|
|
{
|
|
if (bOptional)
|
|
return false;
|
|
throw JsonException(obj, key);
|
|
}
|
|
val = jVal.toBool();
|
|
return true;
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, qint32 &val, bool bOptional)
|
|
{
|
|
const auto jVal = obj[key];
|
|
if (!jVal.isDouble())
|
|
{
|
|
if (bOptional)
|
|
return false;
|
|
throw JsonException(obj, key);
|
|
}
|
|
val = jVal.toInt();
|
|
return true;
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, quint32 &val, bool bOptional)
|
|
{
|
|
const auto jVal = obj[key];
|
|
if (!jVal.isDouble())
|
|
{
|
|
if (bOptional)
|
|
return false;
|
|
throw JsonException(obj, key);
|
|
}
|
|
val = uint32_t(jVal.toDouble());
|
|
return true;
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, qint64 &val, bool bOptional)
|
|
{
|
|
const auto jVal = obj[key];
|
|
if (!jVal.isDouble())
|
|
{
|
|
if (bOptional)
|
|
return false;
|
|
throw JsonException(obj, key);
|
|
}
|
|
val = int64_t(jVal.toDouble());
|
|
return true;
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, double &val, bool bOptional)
|
|
{
|
|
const auto jVal = obj[key];
|
|
if (!jVal.isDouble())
|
|
{
|
|
if (bOptional)
|
|
return false;
|
|
throw JsonException(obj, key);
|
|
}
|
|
val = jVal.toDouble();
|
|
return true;
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, QString &val, bool bOptional)
|
|
{
|
|
const auto jVal = obj[key];
|
|
if (!jVal.isString())
|
|
{
|
|
if (bOptional)
|
|
return false;
|
|
throw JsonException(obj, key);
|
|
}
|
|
val = jVal.toString();
|
|
return true;
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, std::string &val, bool bOptional)
|
|
{
|
|
const auto jVal = obj[key];
|
|
if (!jVal.isString())
|
|
{
|
|
if (bOptional)
|
|
return false;
|
|
throw JsonException(obj, key);
|
|
}
|
|
val = jVal.toString().toStdString();
|
|
return true;
|
|
}
|
|
|
|
template <typename T>
|
|
bool get(const QJsonObject &obj, const QString &key, std::vector<T> &val, bool bOptional = false)
|
|
{
|
|
const QJsonValue jVal = obj[key];
|
|
if (!jVal.isNull() && !jVal.isArray())
|
|
{
|
|
if (bOptional)
|
|
return false;
|
|
throw JsonException(obj, key);
|
|
}
|
|
if (jVal.isNull())
|
|
return false;
|
|
const QJsonArray arr = jVal.toArray();
|
|
val.clear();
|
|
val.reserve(arr.size());
|
|
for (const auto &ele : arr)
|
|
val.push_back(T::fromJson(ele.toObject()));
|
|
return true;
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, std::vector<int> &val, bool bOptional)
|
|
{
|
|
const auto jVal = obj[key];
|
|
if (!jVal.isArray())
|
|
{
|
|
if (bOptional)
|
|
return false;
|
|
throw JsonException(obj, key);
|
|
}
|
|
const QJsonArray arr = jVal.toArray();
|
|
val.clear();
|
|
val.reserve(arr.size());
|
|
for (const auto &v : arr)
|
|
{
|
|
if (!v.isDouble())
|
|
throw JsonException(obj, key);
|
|
val.push_back(v.toInt());
|
|
}
|
|
return true;
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, std::vector<unsigned char> &val, bool bOptional)
|
|
{
|
|
QString sPayload;
|
|
if (!get(obj, key, sPayload, bOptional))
|
|
return false;
|
|
const QByteArray ba = QByteArray::fromHex(sPayload.toLatin1());
|
|
val.clear();
|
|
val.reserve(ba.size());
|
|
std::copy(ba.begin(), ba.end(), std::back_inserter(val));
|
|
return true;
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, VulnerabilityState &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
|
|
val = static_cast<VulnerabilityState>(iVal);
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, OriginatorType &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<OriginatorType>(iVal))
|
|
{
|
|
case OriginatorType::Initialisation:
|
|
case OriginatorType::ObserverController:
|
|
case OriginatorType::ExerciseControl:
|
|
case OriginatorType::FunctionalArea:
|
|
case OriginatorType::MedicTimeout:
|
|
case OriginatorType::Sanitation:
|
|
case OriginatorType::MedicDecontamination:
|
|
case OriginatorType::MaintainanceRepair:
|
|
case OriginatorType::MaintainanceDecontamination:
|
|
val = static_cast<OriginatorType>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, FunctionalAreaOperatingMode &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<FunctionalAreaOperatingMode>(iVal))
|
|
{
|
|
case FunctionalAreaOperatingMode::NotUsed:
|
|
case FunctionalAreaOperatingMode::OperatedByOC:
|
|
case FunctionalAreaOperatingMode::WaitForTimeout:
|
|
val = static_cast<FunctionalAreaOperatingMode>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, Language &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<Language>(iVal))
|
|
{
|
|
case Language::NoChange:
|
|
case Language::German:
|
|
case Language::English:
|
|
case Language::French:
|
|
case Language::Arabic:
|
|
case Language::Spanish:
|
|
case Language::Russian:
|
|
val = static_cast<Language>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, ParticipantLicenseState &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<ParticipantLicenseState>(iVal))
|
|
{
|
|
case ParticipantLicenseState::Unknown:
|
|
case ParticipantLicenseState::Licensed:
|
|
case ParticipantLicenseState::Rejected:
|
|
case ParticipantLicenseState::Unlicense:
|
|
val = static_cast<ParticipantLicenseState>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, EquipmentConfigurationReport::MineHandgrenadeSensorMode &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<EquipmentConfigurationReport::MineHandgrenadeSensorMode>(iVal))
|
|
{
|
|
case EquipmentConfigurationReport::MineHandgrenadeSensorMode::PersonellMode:
|
|
case EquipmentConfigurationReport::MineHandgrenadeSensorMode::NormalVehicleMode:
|
|
case EquipmentConfigurationReport::MineHandgrenadeSensorMode::OcVehicleMode:
|
|
val = static_cast<EquipmentConfigurationReport::MineHandgrenadeSensorMode>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, EquipmentConfigurationReport::FirMode &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<EquipmentConfigurationReport::FirMode>(iVal))
|
|
{
|
|
case EquipmentConfigurationReport::FirMode::NoFir:
|
|
case EquipmentConfigurationReport::FirMode::Fir:
|
|
case EquipmentConfigurationReport::FirMode::FirSpzMarder:
|
|
val = static_cast<EquipmentConfigurationReport::FirMode>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, EquipmentConfigurationReport::MineLayerMode &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<EquipmentConfigurationReport::MineLayerMode>(iVal))
|
|
{
|
|
case EquipmentConfigurationReport::MineLayerMode::NoMineLayerDevice:
|
|
case EquipmentConfigurationReport::MineLayerMode::MinLayerTrailer:
|
|
case EquipmentConfigurationReport::MineLayerMode::MineLayerThrower:
|
|
val = static_cast<EquipmentConfigurationReport::MineLayerMode>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, EquipmentConfigurationReport::SpecialSensorStandardMode &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<EquipmentConfigurationReport::SpecialSensorStandardMode>(iVal))
|
|
{
|
|
case EquipmentConfigurationReport::SpecialSensorStandardMode::NoSpecialSensorStandard:
|
|
case EquipmentConfigurationReport::SpecialSensorStandardMode::ZABC:
|
|
case EquipmentConfigurationReport::SpecialSensorStandardMode::CSF:
|
|
case EquipmentConfigurationReport::SpecialSensorStandardMode::PzBr:
|
|
case EquipmentConfigurationReport::SpecialSensorStandardMode::MRF:
|
|
val = static_cast<EquipmentConfigurationReport::SpecialSensorStandardMode>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, EquipmentConfigurationReport::AgdusHwMode &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<EquipmentConfigurationReport::AgdusHwMode>(iVal))
|
|
{
|
|
case EquipmentConfigurationReport::AgdusHwMode::WithoutHelmetWithoutVest:
|
|
case EquipmentConfigurationReport::AgdusHwMode::WithHelmetWithoutVest:
|
|
case EquipmentConfigurationReport::AgdusHwMode::WithHelmetWithVest:
|
|
val = static_cast<EquipmentConfigurationReport::AgdusHwMode>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, EquipmentConfigurationReport::PositionUpdateInterval &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<EquipmentConfigurationReport::PositionUpdateInterval>(iVal))
|
|
{
|
|
case EquipmentConfigurationReport::PositionUpdateInterval::Vehicle:
|
|
case EquipmentConfigurationReport::PositionUpdateInterval::Personnell:
|
|
case EquipmentConfigurationReport::PositionUpdateInterval::Aircraft:
|
|
val = static_cast<EquipmentConfigurationReport::PositionUpdateInterval>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, CtaDataError::Reason &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<CtaDataError::Reason>(iVal))
|
|
{
|
|
case CtaDataError::Reason::WrongParameter:
|
|
case CtaDataError::Reason::TelegramOutdated:
|
|
case CtaDataError::Reason::InvalidByteCount:
|
|
case CtaDataError::Reason::InvalidData:
|
|
case CtaDataError::Reason::FragmentationError:
|
|
case CtaDataError::Reason::Unknown:
|
|
case CtaDataError::Reason::AdditionalDemandTimeout:
|
|
case CtaDataError::Reason::ErrorLoginEquipmentNumber:
|
|
case CtaDataError::Reason::ErrorLoginTetraId:
|
|
case CtaDataError::Reason::InfoLoginMasteringFlag:
|
|
case CtaDataError::Reason::ErrorSendingNamelist:
|
|
case CtaDataError::Reason::ErrorSendingToExerciseControl:
|
|
case CtaDataError::Reason::ErrorNotLoggedIn:
|
|
case CtaDataError::Reason::ErrorNotLicensed:
|
|
case CtaDataError::Reason::ErrorConfigSelfTest:
|
|
case CtaDataError::Reason::JsonDecodeFailure:
|
|
case CtaDataError::Reason::WrongCrc:
|
|
case CtaDataError::Reason::BroadcastCounterOverflow:
|
|
case CtaDataError::Reason::InvalidTime:
|
|
case CtaDataError::Reason::InvalidPosition:
|
|
case CtaDataError::Reason::InvalidTacticalState:
|
|
val = static_cast<CtaDataError::Reason>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, CreateCContamination::Volatiliy &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<CreateCContamination::Volatiliy>(iVal))
|
|
{
|
|
case CreateCContamination::Volatiliy::Floating:
|
|
case CreateCContamination::Volatiliy::Resident:
|
|
val = static_cast<CreateCContamination::Volatiliy>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, AreaEffectSimulationType &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<AreaEffectSimulationType>(iVal))
|
|
{
|
|
case AreaEffectSimulationType::Unknown:
|
|
case AreaEffectSimulationType::MineArea:
|
|
case AreaEffectSimulationType::ExplosionArea:
|
|
case AreaEffectSimulationType::ExplosionSingle:
|
|
case AreaEffectSimulationType::NContamination:
|
|
case AreaEffectSimulationType::CContamination:
|
|
case AreaEffectSimulationType::FunctionalArea:
|
|
case AreaEffectSimulationType::TechnicalArea:
|
|
case AreaEffectSimulationType::DusSingleMineSimulator:
|
|
case AreaEffectSimulationType::GasPipeDetonation:
|
|
case AreaEffectSimulationType::SpecialArea:
|
|
case AreaEffectSimulationType::BeStillWarning:
|
|
case AreaEffectSimulationType::DangerZoneExplosion:
|
|
case AreaEffectSimulationType::AirSupport:
|
|
|
|
val = static_cast<AreaEffectSimulationType>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, IedType &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<IedType>(iVal))
|
|
{
|
|
case IedType::SuicideIed:
|
|
case IedType::IedSmallPyro:
|
|
case IedType::IedBigPyro:
|
|
val = static_cast<IedType>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, IedPairingState &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<IedPairingState>(iVal))
|
|
{
|
|
case IedPairingState::NotPaired:
|
|
case IedPairingState::PairedToParticipant:
|
|
case IedPairingState::PairedToOps:
|
|
val = static_cast<IedPairingState>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, IedTacticalState &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<IedTacticalState>(iVal))
|
|
{
|
|
case IedTacticalState::NotActive:
|
|
case IedTacticalState::Active:
|
|
case IedTacticalState::Defused:
|
|
case IedTacticalState::TriggeredBySwitch:
|
|
case IedTacticalState::TriggeredByRemote:
|
|
case IedTacticalState::TriggeredByLightBarrier:
|
|
case IedTacticalState::TriggeredByTautWire:
|
|
case IedTacticalState::TriggeredByControlDevice:
|
|
case IedTacticalState::Unknown:
|
|
val = static_cast<IedTacticalState>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, IedError &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<IedError>(iVal))
|
|
{
|
|
case IedError::NoError:
|
|
case IedError::DeviceMissing:
|
|
val = static_cast<IedError>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, MinelayerThrowerData::ThrowingType &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<MinelayerThrowerData::ThrowingType>(iVal))
|
|
{
|
|
case MinelayerThrowerData::ThrowingType::Straight:
|
|
case MinelayerThrowerData::ThrowingType::Right:
|
|
case MinelayerThrowerData::ThrowingType::Left:
|
|
case MinelayerThrowerData::ThrowingType::LeftAndRight:
|
|
case MinelayerThrowerData::ThrowingType::SingleRight:
|
|
case MinelayerThrowerData::ThrowingType::SingleLeft:
|
|
case MinelayerThrowerData::ThrowingType::SingleLeftAndRight:
|
|
val = static_cast<MinelayerThrowerData::ThrowingType>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, OpaquePayloadDataBase::Type &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<OpaquePayloadDataBase::Type>(iVal))
|
|
{
|
|
case OpaquePayloadDataBase::Type::FireSmokeMarker:
|
|
case OpaquePayloadDataBase::Type::Geopairing:
|
|
case OpaquePayloadDataBase::Type::Target:
|
|
case OpaquePayloadDataBase::Type::OC:
|
|
val = static_cast<OpaquePayloadDataBase::Type>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, TechnicalArea::Type &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<TechnicalArea::Type>(iVal))
|
|
{
|
|
case TechnicalArea::Type::Reserved:
|
|
case TechnicalArea::Type::RemoveArea:
|
|
case TechnicalArea::Type::MoutArea:
|
|
case TechnicalArea::Type::RestingAreaPersonnel:
|
|
case TechnicalArea::Type::RestingAreaVehicle:
|
|
case TechnicalArea::Type::RestingAreaPersonnelAndVehicle:
|
|
val = static_cast<TechnicalArea::Type>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, ParticipantModeBase::OperationMode &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<ParticipantModeBase::OperationMode>(iVal))
|
|
{
|
|
case ParticipantModeBase::OperationMode::NoChange:
|
|
case ParticipantModeBase::OperationMode::Normal:
|
|
case ParticipantModeBase::OperationMode::BeStill:
|
|
val = static_cast<ParticipantModeBase::OperationMode>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, BiteReport::LoginType &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<BiteReport::LoginType>(iVal))
|
|
{
|
|
case BiteReport::LoginType::NoLogin:
|
|
case BiteReport::LoginType::NewLogin:
|
|
case BiteReport::LoginType::Relogin:
|
|
case BiteReport::LoginType::InvalidLogin:
|
|
val = static_cast<BiteReport::LoginType>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, ParticipantModeBase::WphMode &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<ParticipantModeBase::WphMode>(iVal))
|
|
{
|
|
case ParticipantModeBase::WphMode::NoChange:
|
|
case ParticipantModeBase::WphMode::Without:
|
|
case ParticipantModeBase::WphMode::With:
|
|
val = static_cast<ParticipantModeBase::WphMode>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, ParticipantModeBase::PersonellProtection &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<ParticipantModeBase::PersonellProtection>(iVal))
|
|
{
|
|
case ParticipantModeBase::PersonellProtection::NoChange:
|
|
case ParticipantModeBase::PersonellProtection::Without:
|
|
case ParticipantModeBase::PersonellProtection::Suit:
|
|
case ParticipantModeBase::PersonellProtection::SuitAndGloves:
|
|
val = static_cast<ParticipantModeBase::PersonellProtection>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, ParticipantModeBase::ProtectionLevel &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<ParticipantModeBase::ProtectionLevel>(iVal))
|
|
{
|
|
case ParticipantModeBase::ProtectionLevel::NoChange:
|
|
case ParticipantModeBase::ProtectionLevel::IdzBs:
|
|
case ParticipantModeBase::ProtectionLevel::IdzEs:
|
|
case ParticipantModeBase::ProtectionLevel::Ksk:
|
|
case ParticipantModeBase::ProtectionLevel::SoldierWithBodyArmor:
|
|
case ParticipantModeBase::ProtectionLevel::SoldierActor:
|
|
val = static_cast<ParticipantModeBase::ProtectionLevel>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, ParticipantModeBase::HandgrenadeSearchMode &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<ParticipantModeBase::HandgrenadeSearchMode>(iVal))
|
|
{
|
|
case ParticipantModeBase::HandgrenadeSearchMode::NoChange:
|
|
case ParticipantModeBase::HandgrenadeSearchMode::On:
|
|
case ParticipantModeBase::HandgrenadeSearchMode::Off:
|
|
val = static_cast<ParticipantModeBase::HandgrenadeSearchMode>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, ParticipantModeBase::InternationalMode &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<ParticipantModeBase::InternationalMode>(iVal))
|
|
{
|
|
case ParticipantModeBase::InternationalMode::NoChange:
|
|
case ParticipantModeBase::InternationalMode::On:
|
|
case ParticipantModeBase::InternationalMode::Off:
|
|
val = static_cast<ParticipantModeBase::InternationalMode>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, ParticipantModeBase::ABCProtectionMode &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<ParticipantModeBase::ABCProtectionMode>(iVal))
|
|
{
|
|
case ParticipantModeBase::ABCProtectionMode::NoChange:
|
|
case ParticipantModeBase::ABCProtectionMode::On:
|
|
case ParticipantModeBase::ABCProtectionMode::Off:
|
|
val = static_cast<ParticipantModeBase::ABCProtectionMode>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, ParticipantConfigurationBase::FaultPositionHandling &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<ParticipantConfigurationBase::FaultPositionHandling>(iVal))
|
|
{
|
|
case ParticipantConfigurationBase::FaultPositionHandling::NoChange:
|
|
case ParticipantConfigurationBase::FaultPositionHandling::NoPositions:
|
|
case ParticipantConfigurationBase::FaultPositionHandling::InvalidPositionValue:
|
|
case ParticipantConfigurationBase::FaultPositionHandling::EstimatedPosition:
|
|
val = static_cast<ParticipantConfigurationBase::FaultPositionHandling>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, ParticipantConfigurationBase::SwitchingPositionIntervall &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<ParticipantConfigurationBase::SwitchingPositionIntervall>(iVal))
|
|
{
|
|
case ParticipantConfigurationBase::SwitchingPositionIntervall::NoChange:
|
|
case ParticipantConfigurationBase::SwitchingPositionIntervall::On:
|
|
case ParticipantConfigurationBase::SwitchingPositionIntervall::Off:
|
|
val = static_cast<ParticipantConfigurationBase::SwitchingPositionIntervall>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, ParticipantConfigurationBase::OpticalCode &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<ParticipantConfigurationBase::OpticalCode>(iVal))
|
|
{
|
|
case ParticipantConfigurationBase::OpticalCode::NoChange:
|
|
case ParticipantConfigurationBase::OpticalCode::Osag10:
|
|
case ParticipantConfigurationBase::OpticalCode::Osag20Basic:
|
|
case ParticipantConfigurationBase::OpticalCode::SisoStandard:
|
|
val = static_cast<ParticipantConfigurationBase::OpticalCode>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, SanitationResult &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<SanitationResult>(iVal))
|
|
{
|
|
case SanitationResult::NoEffect:
|
|
case SanitationResult::Unhandled:
|
|
case SanitationResult::Insufficient:
|
|
case SanitationResult::Sufficient:
|
|
case SanitationResult::Optimal:
|
|
val = static_cast<SanitationResult>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, SanitationEvaluation &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<SanitationEvaluation>(iVal))
|
|
{
|
|
case SanitationEvaluation::NotApplicable:
|
|
case SanitationEvaluation::Okay:
|
|
case SanitationEvaluation::PartlyWrong:
|
|
case SanitationEvaluation::Wrong:
|
|
val = static_cast<SanitationEvaluation>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, Qualification &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<Qualification>(iVal))
|
|
{
|
|
case Qualification::NotDefined:
|
|
case Qualification::SANPers:
|
|
case Qualification::FAB:
|
|
case Qualification::FAA:
|
|
val = static_cast<Qualification>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, SanitationRepair::TreatmentResult &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<SanitationRepair::TreatmentResult>(iVal))
|
|
{
|
|
case SanitationRepair::TreatmentResult::None:
|
|
case SanitationRepair::TreatmentResult::Success:
|
|
case SanitationRepair::TreatmentResult::Failure:
|
|
case SanitationRepair::TreatmentResult::Stabilized:
|
|
val = static_cast<SanitationRepair::TreatmentResult>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, ExerciseStateData::ExerciseState &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<ExerciseStateData::ExerciseState>(iVal))
|
|
{
|
|
case ExerciseStateData::ExerciseState::Unknown:
|
|
case ExerciseStateData::ExerciseState::Created:
|
|
case ExerciseStateData::ExerciseState::Started:
|
|
case ExerciseStateData::ExerciseState::Paused:
|
|
case ExerciseStateData::ExerciseState::Stopped:
|
|
case ExerciseStateData::ExerciseState::Terminated:
|
|
val = static_cast<ExerciseStateData::ExerciseState>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, ServiceControlEnum &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<ServiceControlEnum>(iVal))
|
|
{
|
|
case ServiceControlEnum::PRESHUTDOWN:
|
|
case ServiceControlEnum::SHUTDOWN:
|
|
case ServiceControlEnum::STOP:
|
|
|
|
val = static_cast<ServiceControlEnum>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, PowerMethod &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<PowerMethod>(iVal))
|
|
{
|
|
case PowerMethod::Unknown:
|
|
case PowerMethod::PowerOn:
|
|
case PowerMethod::PowerOff:
|
|
|
|
val = static_cast<PowerMethod>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, UAVActionTask &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<UAVActionTask>(iVal))
|
|
{
|
|
case UAVActionTask::Undefined:
|
|
case UAVActionTask::Disarm:
|
|
case UAVActionTask::Arm:
|
|
case UAVActionTask::Takeoff:
|
|
case UAVActionTask::Connect:
|
|
case UAVActionTask::Loiter:
|
|
case UAVActionTask::Return:
|
|
case UAVActionTask::Observe:
|
|
val = static_cast<UAVActionTask>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, UAVRadioLinkConnectionStatusType &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<UAVRadioLinkConnectionStatusType>(iVal))
|
|
{
|
|
case UAVRadioLinkConnectionStatusType::Connected:
|
|
case UAVRadioLinkConnectionStatusType::Disconnected:
|
|
case UAVRadioLinkConnectionStatusType::Connecting:
|
|
case UAVRadioLinkConnectionStatusType::Error:
|
|
case UAVRadioLinkConnectionStatusType::Undefined:
|
|
case UAVRadioLinkConnectionStatusType::Diconnecting:
|
|
val = static_cast<UAVRadioLinkConnectionStatusType>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
template <>
|
|
bool get(const QJsonObject &obj, const QString &key, UAVState &val, bool bOptional)
|
|
{
|
|
int iVal = 0;
|
|
get(obj, key, iVal, bOptional);
|
|
switch (static_cast<UAVState>(iVal))
|
|
{
|
|
case UAVState::Auto:
|
|
case UAVState::Calibrating:
|
|
case UAVState::Init:
|
|
case UAVState::Maintenance:
|
|
case UAVState::Undefined:
|
|
case UAVState::Manual:
|
|
case UAVState::Normal:
|
|
case UAVState::Off:
|
|
case UAVState::On:
|
|
case UAVState::Shutdown:
|
|
case UAVState::Standby:
|
|
val = static_cast<UAVState>(iVal);
|
|
return true;
|
|
}
|
|
throw JsonException(obj, key);
|
|
}
|
|
|
|
|
|
|
|
Header Header::fromJson(const QJsonObject &obj)
|
|
{
|
|
Header ret;
|
|
get(obj, QStringLiteral("equipmentNumber"), ret.equipmentNumber);
|
|
get(obj, QStringLiteral("timeStamp"), ret.timeStamp);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject Header::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("equipmentNumber"), equipmentNumber},
|
|
{QStringLiteral("timeStamp"), timeStamp}
|
|
};
|
|
}
|
|
|
|
|
|
RelativePosition RelativePosition::fromJson(const QJsonObject &obj)
|
|
{
|
|
RelativePosition ret;
|
|
get(obj, QStringLiteral("offsetX"), ret.offsetX);
|
|
get(obj, QStringLiteral("offsetY"), ret.offsetY);
|
|
get(obj, QStringLiteral("offsetZ"), ret.offsetZ);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject RelativePosition::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("offsetX"), offsetX},
|
|
{QStringLiteral("offsetY"), offsetY},
|
|
{QStringLiteral("offsetZ"), offsetZ}
|
|
};
|
|
}
|
|
|
|
|
|
AbsolutePosition AbsolutePosition::fromJson(const QJsonObject &obj)
|
|
{
|
|
AbsolutePosition ret;
|
|
get(obj, QStringLiteral("lon"), ret.lon);
|
|
get(obj, QStringLiteral("lat"), ret.lat);
|
|
get(obj, QStringLiteral("z"), ret.z);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject AbsolutePosition::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("lon"), lon},
|
|
{QStringLiteral("lat"), lat},
|
|
{QStringLiteral("z"), z}
|
|
};
|
|
}
|
|
|
|
|
|
OpsPosition OpsPosition::fromJson(const QJsonObject &obj)
|
|
{
|
|
OpsPosition ret;
|
|
get(obj, QStringLiteral("opsId"), ret.opsId);
|
|
get(obj, QStringLiteral("moutObjectId"), ret.moutObjectId, true);
|
|
get(obj, QStringLiteral("moutRoomId"), ret.moutRoomId, true);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject OpsPosition::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("opsId"), opsId},
|
|
{QStringLiteral("moutObjectId"), moutObjectId},
|
|
{QStringLiteral("moutRoomId"), moutRoomId}
|
|
};
|
|
}
|
|
|
|
|
|
GpsQuality GpsQuality::fromJson(const QJsonObject &obj)
|
|
{
|
|
GpsQuality ret;
|
|
get(obj, QStringLiteral("moreThan4SatellitesAvailable"), ret.moreThan4SatellitesAvailable);
|
|
get(obj, QStringLiteral("dgpsModeAvailable"), ret.dgpsModeAvailable);
|
|
get(obj, QStringLiteral("pdopValue"), ret.pdopValue);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject GpsQuality::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("moreThan4SatellitesAvailable"), moreThan4SatellitesAvailable},
|
|
{QStringLiteral("dgpsModeAvailable"), dgpsModeAvailable},
|
|
{QStringLiteral("pdopValue"), pdopValue}
|
|
};
|
|
}
|
|
|
|
|
|
Gear Gear::fromJson(const QJsonObject &obj)
|
|
{
|
|
Gear ret;
|
|
get(obj, QStringLiteral("gearTasCode"), ret.gearTasCode);
|
|
get(obj, QStringLiteral("gearSerialNumber"), ret.gearSerialNumber);
|
|
get(obj, QStringLiteral("chargeCounting"), ret.chargeCounting);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject Gear::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("gearTasCode"), gearTasCode},
|
|
{QStringLiteral("gearSerialNumber"), gearSerialNumber},
|
|
{QStringLiteral("chargeCounting"), chargeCounting}
|
|
};
|
|
}
|
|
|
|
|
|
GearCharge GearCharge::fromJson(const QJsonObject &obj)
|
|
{
|
|
GearCharge ret;
|
|
get(obj, QStringLiteral("gearTasCode"), ret.gearTasCode);
|
|
get(obj, QStringLiteral("gearSerialNumber"), ret.gearSerialNumber);
|
|
get(obj, QStringLiteral("chargeTypeId"), ret.chargeTypeId);
|
|
get(obj, QStringLiteral("remain"), ret.remain);
|
|
get(obj, QStringLiteral("location"), ret.location);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject GearCharge::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("gearTasCode"), gearTasCode},
|
|
{QStringLiteral("gearSerialNumber"), gearSerialNumber},
|
|
{QStringLiteral("chargeTypeId"), chargeTypeId},
|
|
{QStringLiteral("remain"), remain},
|
|
{QStringLiteral("location"), location}
|
|
};
|
|
}
|
|
|
|
|
|
WlsPosition WlsPosition::fromJson(const QJsonObject &obj)
|
|
{
|
|
WlsPosition ret;
|
|
get(obj, QStringLiteral("x"), ret.x);
|
|
get(obj, QStringLiteral("y"), ret.y);
|
|
get(obj, QStringLiteral("z"), ret.z);
|
|
get(obj, QStringLiteral("wlsAreaId"), ret.wlsAreaId);
|
|
get(obj, QStringLiteral("wlsZone"), ret.wlsZone);
|
|
get(obj, QStringLiteral("wlsBuildingId"), ret.wlsBuildingId);
|
|
get(obj, QStringLiteral("wlsRoomNumber"), ret.wlsRoomNumber);
|
|
get(obj, QStringLiteral("playerOrientation"), ret.playerOrientation);
|
|
get(obj, QStringLiteral("weaponOrientation"), ret.weaponOrientation);
|
|
get(obj, QStringLiteral("isValid"), ret.isValid);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject WlsPosition::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("x"), x},
|
|
{QStringLiteral("y"), y},
|
|
{QStringLiteral("z"), z},
|
|
{QStringLiteral("wlsAreaId"), wlsAreaId},
|
|
{QStringLiteral("wlsZone"), wlsZone},
|
|
{QStringLiteral("wlsBuildingId"), wlsBuildingId},
|
|
{QStringLiteral("wlsRoomNumber"), wlsRoomNumber},
|
|
{QStringLiteral("playerOrientation"), playerOrientation},
|
|
{QStringLiteral("weaponOrientation"), weaponOrientation},
|
|
{QStringLiteral("isValid"), isValid}
|
|
};
|
|
}
|
|
|
|
|
|
WlsParticipantState WlsParticipantState::fromJson(const QJsonObject &obj)
|
|
{
|
|
WlsParticipantState ret;
|
|
get(obj, QStringLiteral("tagId"), ret.tagId);
|
|
get(obj, QStringLiteral("lastSeen"), ret.lastSeen);
|
|
get(obj, QStringLiteral("voltage"), ret.voltage);
|
|
get(obj, QStringLiteral("equipmentNumber"), ret.equipmentNumber);
|
|
get(obj, QStringLiteral("tacticalState"), ret.tacticalState);
|
|
get(obj, QStringLiteral("gpsOn"), ret.gpsOn);
|
|
get(obj, QStringLiteral("inBlockedArea"), ret.inBlockedArea);
|
|
get(obj, QStringLiteral("relativePosition"), ret.relativePosition);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject WlsParticipantState::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("tagId"), tagId},
|
|
{QStringLiteral("lastSeen"), lastSeen},
|
|
{QStringLiteral("voltage"), voltage},
|
|
{QStringLiteral("equipmentNumber"), equipmentNumber},
|
|
{QStringLiteral("tacticalState"), tacticalState},
|
|
{QStringLiteral("gpsOn"), gpsOn},
|
|
{QStringLiteral("inBlockedArea"), inBlockedArea},
|
|
{QStringLiteral("relativePosition"), relativePosition.toJson()}
|
|
};
|
|
}
|
|
|
|
|
|
BatteryState BatteryState::fromJson(const QJsonObject &obj)
|
|
{
|
|
BatteryState ret;
|
|
get(obj, QStringLiteral("batteryPort"), ret.m_batteryPort);
|
|
get(obj, QStringLiteral("battery"), ret.m_batteryPercent);
|
|
get(obj, QStringLiteral("voltage"), ret.m_voltage);
|
|
get(obj, QStringLiteral("temperature"), ret.m_temperature);
|
|
get(obj, QStringLiteral("frequency"), ret.m_frequency);
|
|
get(obj, QStringLiteral("generic"), ret.m_generic);
|
|
get(obj, QStringLiteral("current"), ret.m_current);
|
|
get(obj, QStringLiteral("switchOrValue"), ret.m_switchOrValue);
|
|
get(obj, QStringLiteral("serialNumber"), ret.m_serialNumber);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject BatteryState::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("batteryPort"), batteryPort()},
|
|
{QStringLiteral("battery"), batteryPercent()},
|
|
{QStringLiteral("voltage"), voltage()},
|
|
{QStringLiteral("temperature"), temperature()},
|
|
{QStringLiteral("frequency"), frequency()},
|
|
{QStringLiteral("generic"), generic()},
|
|
{QStringLiteral("current"), current()},
|
|
{QStringLiteral("switchOrValue"), switchOrValue()},
|
|
{QStringLiteral("serialNumber"), serialNumber()}
|
|
};
|
|
}
|
|
|
|
|
|
Acknowledge Acknowledge::fromJson(const QJsonObject &obj)
|
|
{
|
|
Acknowledge ret;
|
|
get(obj, QStringLiteral("timeStamp"), ret.timeStamp);
|
|
get(obj, QStringLiteral("ackCounter"), ret.ackCounter);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject Acknowledge::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("timeStamp"), timeStamp},
|
|
{QStringLiteral("ackCounter"), ackCounter}
|
|
};
|
|
}
|
|
|
|
|
|
Init Init::fromJson(const QJsonObject &obj)
|
|
{
|
|
Init ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("workstationId"), ret.workstationId);
|
|
get(obj, QStringLiteral("restockCharges"), ret.restockCharges);
|
|
get(obj, QStringLiteral("resetManipulation"), ret.resetManipulation);
|
|
get(obj, QStringLiteral("resetVulnerabilityState"), ret.resetVulnerabilityState);
|
|
get(obj, QStringLiteral("restockSanitationMaterial"), ret.restockSanitationMaterial);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject Init::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("workstationId"), workstationId},
|
|
{QStringLiteral("restockCharges"), restockCharges},
|
|
{QStringLiteral("resetManipulation"), resetManipulation},
|
|
{QStringLiteral("resetVulnerabilityState"), resetVulnerabilityState},
|
|
{QStringLiteral("restockSanitationMaterial"), restockSanitationMaterial}
|
|
};
|
|
}
|
|
|
|
|
|
ManipulationReport ManipulationReport::fromJson(const QJsonObject &obj)
|
|
{
|
|
ManipulationReport ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("isManipulation"), ret.isManipulation);
|
|
get(obj, QStringLiteral("equipmentFunctionId"), ret.equipmentFunctionId);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ManipulationReport::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("isManipulation"), isManipulation},
|
|
{QStringLiteral("equipmentFunctionId"), equipmentFunctionId}
|
|
};
|
|
}
|
|
|
|
|
|
DemandBite DemandBite::fromJson(const QJsonObject &obj)
|
|
{
|
|
DemandBite ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("withSelfTest"), ret.withSelfTest);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject DemandBite::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("withSelfTest"), withSelfTest}
|
|
};
|
|
}
|
|
|
|
|
|
EquipmentOperationalState EquipmentOperationalState::fromJson(const QJsonObject &obj)
|
|
{
|
|
EquipmentOperationalState ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("nbcProtectionActive"), ret.nbcProtectionActive);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject EquipmentOperationalState::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("nbcProtectionActive"), nbcProtectionActive}
|
|
};
|
|
}
|
|
|
|
|
|
void VulnerabilityModelBase::fromJson(const QJsonObject &obj, VulnerabilityModelBase &ret)
|
|
{
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("vulnerabilityModelMineIed"), ret.vulnerabilityModelMineIed);
|
|
get(obj, QStringLiteral("vulnerabilityModelAreaFire"), ret.vulnerabilityModelAreaFire);
|
|
get(obj, QStringLiteral("vulnerabilityModelOperatingResource"), ret.vulnerabilityModelOperatingResource);
|
|
get(obj, QStringLiteral("vulnerabilityModelAcWeaponry"), ret.vulnerabilityModelAcWeaponry);
|
|
}
|
|
|
|
QJsonObject VulnerabilityModelBase::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("vulnerabilityModelMineIed"), vulnerabilityModelMineIed},
|
|
{QStringLiteral("vulnerabilityModelAreaFire"), vulnerabilityModelAreaFire},
|
|
{QStringLiteral("vulnerabilityModelOperatingResource"), vulnerabilityModelOperatingResource},
|
|
{QStringLiteral("vulnerabilityModelAcWeaponry"), vulnerabilityModelAcWeaponry}
|
|
};
|
|
}
|
|
|
|
|
|
SetVulnerabilityModel SetVulnerabilityModel::fromJson(const QJsonObject &obj)
|
|
{
|
|
SetVulnerabilityModel ret;
|
|
VulnerabilityModelBase::fromJson(obj, ret);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject SetVulnerabilityModel::toJson() const
|
|
{
|
|
return VulnerabilityModelBase::toJson();
|
|
}
|
|
|
|
|
|
DemandEquipmentConfigurationReport DemandEquipmentConfigurationReport::fromJson(const QJsonObject &obj)
|
|
{
|
|
DemandEquipmentConfigurationReport ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject DemandEquipmentConfigurationReport::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()}};
|
|
}
|
|
|
|
|
|
EquipmentConfigurationReport EquipmentConfigurationReport::fromJson(const QJsonObject &obj)
|
|
{
|
|
EquipmentConfigurationReport ret;
|
|
VulnerabilityModelBase::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("equipmentNumber"), ret.equipmentNumber);
|
|
get(obj, QStringLiteral("canStartUpTime"), ret.canStartUpTime);
|
|
get(obj, QStringLiteral("equipmentType"), ret.equipmentType);
|
|
get(obj, QStringLiteral("loginWaittimeBitweenTrys"), ret.loginWaittimeBitweenTrys);
|
|
get(obj, QStringLiteral("loginMaxRetryCnt"), ret.loginMaxRetryCnt);
|
|
get(obj, QStringLiteral("loginMasteringFlag"), ret.loginMasteringFlag);
|
|
get(obj, QStringLiteral("canDeviceConfiguration"), ret.canDeviceConfiguration);
|
|
get(obj, QStringLiteral("displayDeviceVoiceOutput"), ret.displayDeviceVoiceOutput);
|
|
get(obj, QStringLiteral("displayDeviceLanguage"), ret.displayDeviceLanguage);
|
|
get(obj, QStringLiteral("pyrotechnics"), ret.pyrotechnics);
|
|
get(obj, QStringLiteral("mhgrsMode"), ret.mhgrsMode);
|
|
get(obj, QStringLiteral("mhgrsEnergySaving"), ret.mhgrsEnergySaving);
|
|
get(obj, QStringLiteral("specialSensorFir"), ret.specialSensorFir);
|
|
get(obj, QStringLiteral("specialSensorMinelayer"), ret.specialSensorMinelayer);
|
|
get(obj, QStringLiteral("specialSensorStandard"), ret.specialSensorStandard);
|
|
get(obj, QStringLiteral("agdusHwMode"), ret.agdusHwMode);
|
|
get(obj, QStringLiteral("positionUpdateInterval"), ret.positionUpdateInterval);
|
|
get(obj, QStringLiteral("displayTextMainGroup"), ret.displayTextMainGroup);
|
|
get(obj, QStringLiteral("displayTextSubGroup"), ret.displayTextSubGroup);
|
|
get(obj, QStringLiteral("vulnerabilityModelAgdus"), ret.vulnerabilityModelAgdus);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject EquipmentConfigurationReport::toJson() const
|
|
{
|
|
QJsonObject obj = VulnerabilityModelBase::toJson();
|
|
obj[QStringLiteral("header")] = header.toJson();
|
|
obj[QStringLiteral("equipmentNumber")] = equipmentNumber;
|
|
obj[QStringLiteral("canStartUpTime")] = canStartUpTime;
|
|
obj[QStringLiteral("equipmentType")] = equipmentType;
|
|
obj[QStringLiteral("loginWaittimeBitweenTrys")] = loginWaittimeBitweenTrys;
|
|
obj[QStringLiteral("loginMaxRetryCnt")] = loginMaxRetryCnt;
|
|
obj[QStringLiteral("loginMasteringFlag")] = loginMasteringFlag;
|
|
obj[QStringLiteral("canDeviceConfiguration")] = canDeviceConfiguration;
|
|
obj[QStringLiteral("displayDeviceVoiceOutput")] = displayDeviceVoiceOutput;
|
|
obj[QStringLiteral("displayDeviceLanguage")] = enumToJson(displayDeviceLanguage);
|
|
obj[QStringLiteral("pyrotechnics")] = pyrotechnics;
|
|
obj[QStringLiteral("mhgrsMode")] = enumToJson(mhgrsMode);
|
|
obj[QStringLiteral("mhgrsEnergySaving")] = mhgrsEnergySaving;
|
|
obj[QStringLiteral("specialSensorFir")] = enumToJson(specialSensorFir);
|
|
obj[QStringLiteral("specialSensorMinelayer")] = enumToJson(specialSensorMinelayer);
|
|
obj[QStringLiteral("specialSensorStandard")] = enumToJson(specialSensorStandard);
|
|
obj[QStringLiteral("agdusHwMode")] = enumToJson(agdusHwMode);
|
|
obj[QStringLiteral("positionUpdateInterval")] = enumToJson(positionUpdateInterval);
|
|
obj[QStringLiteral("displayTextMainGroup")] = displayTextMainGroup;
|
|
obj[QStringLiteral("displayTextSubGroup")] = displayTextSubGroup;
|
|
obj[QStringLiteral("vulnerabilityModelAgdus")] = vulnerabilityModelAgdus;
|
|
return obj;
|
|
}
|
|
|
|
|
|
CtaDataError CtaDataError::fromJson(const QJsonObject &obj)
|
|
{
|
|
CtaDataError ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("reason"), ret.reason);
|
|
get(obj, QStringLiteral("originTelegramId"), ret.originTelegramId);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject CtaDataError::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("reason"), enumToJson(reason)},
|
|
{QStringLiteral("originTelegramId"), originTelegramId}
|
|
};
|
|
}
|
|
|
|
|
|
void PositionReportBase::fromJson(const QJsonObject &obj, PositionReportBase &ret)
|
|
{
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
bool bAtLeastOneFound = false;
|
|
if (get(obj, QStringLiteral("relPosition"), ret.relPosition, true))
|
|
bAtLeastOneFound = true;
|
|
if (get(obj, QStringLiteral("geoPosition"), ret.geoPosition, true))
|
|
bAtLeastOneFound = true;
|
|
|
|
get(obj, QStringLiteral("opsPosition"), ret.opsPosition, bAtLeastOneFound);
|
|
get(obj, QStringLiteral("gpsQuality"), ret.gpsQuality, true);
|
|
}
|
|
|
|
QJsonObject PositionReportBase::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("relPosition"), relPosition.toJson()},
|
|
{QStringLiteral("geoPosition"), geoPosition.toJson()},
|
|
{QStringLiteral("opsPosition"), opsPosition.toJson()},
|
|
{QStringLiteral("gpsQuality"), gpsQuality.toJson()}
|
|
};
|
|
}
|
|
|
|
|
|
PositionReport PositionReport::fromJson(const QJsonObject &obj)
|
|
{
|
|
PositionReport ret;
|
|
PositionReportBase::fromJson(obj, ret);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject PositionReport::toJson() const
|
|
{
|
|
return PositionReportBase::toJson();
|
|
}
|
|
|
|
|
|
PositionReportWithMountedEquipments PositionReportWithMountedEquipments::fromJson(const QJsonObject &obj)
|
|
{
|
|
PositionReportWithMountedEquipments ret;
|
|
PositionReportBase::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("mountedEquipments"), ret.mountedEquipments);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject PositionReportWithMountedEquipments::toJson() const
|
|
{
|
|
QJsonObject obj = PositionReportBase::toJson();
|
|
obj[QStringLiteral("mountedEquipments")] = arrayToJson(mountedEquipments);
|
|
return obj;
|
|
}
|
|
|
|
|
|
void CreateAreaEffectSimulationBase::fromJson(const QJsonObject &obj, CreateAreaEffectSimulationBase &ret)
|
|
{
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("aesDdsId"), ret.aesDdsId);
|
|
get(obj, QStringLiteral("name"), ret.name);
|
|
get(obj, QStringLiteral("partyId"), ret.partyId);
|
|
get(obj, QStringLiteral("relEffectPosition"), ret.relEffectPosition);
|
|
}
|
|
|
|
QJsonObject CreateAreaEffectSimulationBase::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("aesDdsId"), aesDdsId},
|
|
{QStringLiteral("name"), QString::fromStdString(name)},
|
|
{QStringLiteral("partyId"), partyId},
|
|
{QStringLiteral("relEffectPosition"), relEffectPosition.toJson()}
|
|
};
|
|
}
|
|
|
|
|
|
void CreateCombatAreaEffectSimulationBase::fromJson(const QJsonObject &obj, CreateCombatAreaEffectSimulationBase &ret)
|
|
{
|
|
CreateAreaEffectSimulationBase::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("chargeTypeId"), ret.chargeTypeId);
|
|
get(obj, QStringLiteral("effectStart"), ret.effectStart);
|
|
get(obj, QStringLiteral("effectDuration"), ret.effectDuration);
|
|
}
|
|
|
|
QJsonObject CreateCombatAreaEffectSimulationBase::toJson() const
|
|
{
|
|
QJsonObject obj = CreateAreaEffectSimulationBase::toJson();
|
|
obj[QStringLiteral("chargeTypeId")] = chargeTypeId;
|
|
obj[QStringLiteral("effectStart")] = effectStart;
|
|
obj[QStringLiteral("effectDuration")] = effectDuration;
|
|
return obj;
|
|
}
|
|
|
|
|
|
OcCommand OcCommand::fromJson(const QJsonObject &obj)
|
|
{
|
|
OcCommand ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("action"), ret.action);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject OcCommand::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("action"), action}
|
|
};
|
|
}
|
|
|
|
|
|
CreateSingleExplosion CreateSingleExplosion::fromJson(const QJsonObject &obj)
|
|
{
|
|
CreateSingleExplosion ret;
|
|
CreateCombatAreaEffectSimulationBase::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("effectDiameter"), ret.effectDiameter);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject CreateSingleExplosion::toJson() const
|
|
{
|
|
QJsonObject obj = CreateCombatAreaEffectSimulationBase::toJson();
|
|
obj[QStringLiteral("effectDiameter")] = effectDiameter;
|
|
return obj;
|
|
}
|
|
|
|
|
|
CreateAreaExplosion CreateAreaExplosion::fromJson(const QJsonObject &obj)
|
|
{
|
|
CreateAreaExplosion ret;
|
|
CreateCombatAreaEffectSimulationBase::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("relCorner"), ret.relCorner);
|
|
get(obj, QStringLiteral("height"), ret.height);
|
|
get(obj, QStringLiteral("width"), ret.width);
|
|
get(obj, QStringLiteral("rotationAngle"), ret.rotationAngle);
|
|
get(obj, QStringLiteral("impactCount"), ret.impactCount);
|
|
get(obj, QStringLiteral("impactEdgeLength"), ret.impactEdgeLength);
|
|
get(obj, QStringLiteral("impactRadius"), ret.impactRadius);
|
|
get(obj, QStringLiteral("hazardDistance"), ret.hazardDistance);
|
|
|
|
get(obj, QStringLiteral("mhpLength"), ret.mhpLength);
|
|
get(obj, QStringLiteral("mhpWidth"), ret.mhpWidth);
|
|
get(obj, QStringLiteral("mhpRotation"), ret.mhpRotation);
|
|
get(obj, QStringLiteral("mhPoints"), ret.mhPoints);
|
|
|
|
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject CreateAreaExplosion::toJson() const
|
|
{
|
|
QJsonObject obj = CreateCombatAreaEffectSimulationBase::toJson();
|
|
obj[QStringLiteral("relCorner")] = relCorner.toJson();
|
|
obj[QStringLiteral("height")] = height;
|
|
obj[QStringLiteral("width")] = width;
|
|
obj[QStringLiteral("rotationAngle")] = rotationAngle;
|
|
obj[QStringLiteral("impactCount")] = impactCount;
|
|
obj[QStringLiteral("impactEdgeLength")] = impactEdgeLength;
|
|
obj[QStringLiteral("impactRadius")] = impactRadius;
|
|
|
|
obj[QStringLiteral("hazardDistance")] = hazardDistance;
|
|
|
|
obj[QStringLiteral("mhpLength")] = mhpLength;
|
|
obj[QStringLiteral("mhpWidth")] = mhpWidth;
|
|
obj[QStringLiteral("mhpRotation")] = mhpRotation;
|
|
obj[QStringLiteral("mhPoints")] = arrayToJson(mhPoints);
|
|
return obj;
|
|
}
|
|
|
|
|
|
PauseEffectSimulation PauseEffectSimulation::fromJson(const QJsonObject &obj)
|
|
{
|
|
PauseEffectSimulation ret;
|
|
get(obj, QStringLiteral("aesDdsId"), ret.aesDdsId);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject PauseEffectSimulation::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("aesDdsId"), aesDdsId}};
|
|
}
|
|
|
|
|
|
ResumeEffectSimulation ResumeEffectSimulation::fromJson(const QJsonObject &obj)
|
|
{
|
|
ResumeEffectSimulation ret;
|
|
get(obj, QStringLiteral("aesDdsId"), ret.aesDdsId);
|
|
get(obj, QStringLiteral("sequelNumber"), ret.sequelNumber);
|
|
get(obj, QStringLiteral("nextImpact"), ret.nextImpact);
|
|
get(obj, QStringLiteral("resumeTime"), ret.resumeTime);
|
|
get(obj, QStringLiteral("remainDuration"), ret.remainDuration);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ResumeEffectSimulation::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("aesDdsId"), aesDdsId},
|
|
{QStringLiteral("sequelNumber"), sequelNumber},
|
|
{QStringLiteral("nextImpact"), nextImpact},
|
|
{QStringLiteral("resumeTime"), resumeTime},
|
|
{QStringLiteral("remainDuration"), remainDuration}
|
|
};
|
|
}
|
|
|
|
|
|
MineAreaSegment MineAreaSegment::fromJson(const QJsonObject &obj)
|
|
{
|
|
MineAreaSegment ret;
|
|
get(obj, QStringLiteral("relStart"), ret.relStart);
|
|
get(obj, QStringLiteral("relEnd"), ret.relEnd);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject MineAreaSegment::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("relStart"), relStart.toJson()},
|
|
{QStringLiteral("relEnd"), relEnd.toJson()}
|
|
};
|
|
}
|
|
|
|
|
|
CreateMineArea CreateMineArea::fromJson(const QJsonObject &obj)
|
|
{
|
|
CreateMineArea ret;
|
|
CreateCombatAreaEffectSimulationBase::fromJson(obj, ret);
|
|
|
|
|
|
get(obj, QStringLiteral("layingDepth"), ret.layingDepth);
|
|
get(obj, QStringLiteral("layingDensity"), ret.layingDensity);
|
|
get(obj, QStringLiteral("segments"), ret.segments);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject CreateMineArea::toJson() const
|
|
{
|
|
QJsonObject obj = CreateCombatAreaEffectSimulationBase::toJson();
|
|
|
|
|
|
obj[QStringLiteral("layingDepth")] = layingDepth;
|
|
obj[QStringLiteral("layingDensity")] = layingDensity;
|
|
obj[QStringLiteral("segments")] = arrayToJson(segments);
|
|
return obj;
|
|
}
|
|
|
|
|
|
MineAreaSingleMineState MineAreaSingleMineState::fromJson(const QJsonObject &obj)
|
|
{
|
|
MineAreaSingleMineState ret;
|
|
get(obj, QStringLiteral("aesDdsId"), ret.aesDdsId);
|
|
get(obj, QStringLiteral("mineCount"), ret.mineCount);
|
|
get(obj, QStringLiteral("mineState"), ret.mineState);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject MineAreaSingleMineState::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("aesDdsId"), aesDdsId},
|
|
{QStringLiteral("mineCount"), mineCount},
|
|
{QStringLiteral("mineState"), arrayToJson(mineState)},
|
|
};
|
|
}
|
|
|
|
|
|
CreateNContamination CreateNContamination::fromJson(const QJsonObject &obj)
|
|
{
|
|
CreateNContamination ret;
|
|
CreateCombatAreaEffectSimulationBase::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("innerRadius"), ret.innerRadius);
|
|
get(obj, QStringLiteral("borderLengthInner"), ret.borderLengthInner);
|
|
get(obj, QStringLiteral("borderLengthOuter"), ret.borderLengthOuter);
|
|
get(obj, QStringLiteral("spanAngle"), ret.spanAngle);
|
|
get(obj, QStringLiteral("rotationAngle"), ret.rotationAngle);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject CreateNContamination::toJson() const
|
|
{
|
|
QJsonObject obj = CreateCombatAreaEffectSimulationBase::toJson();
|
|
obj[QStringLiteral("innerRadius")] = innerRadius;
|
|
obj[QStringLiteral("borderLengthInner")] = borderLengthInner;
|
|
obj[QStringLiteral("borderLengthOuter")] = borderLengthOuter;
|
|
obj[QStringLiteral("spanAngle")] = spanAngle;
|
|
obj[QStringLiteral("rotationAngle")] = rotationAngle;
|
|
return obj;
|
|
}
|
|
|
|
|
|
CreateCContamination CreateCContamination::fromJson(const QJsonObject &obj)
|
|
{
|
|
CreateCContamination ret;
|
|
CreateCombatAreaEffectSimulationBase::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("effectRadius"), ret.effectRadius);
|
|
get(obj, QStringLiteral("expansionFactor"), ret.expansionFactor);
|
|
get(obj, QStringLiteral("propagationDirection"), ret.propagationDirection);
|
|
get(obj, QStringLiteral("windSpeed"), ret.windSpeed);
|
|
get(obj, QStringLiteral("validityTimeWind"), ret.validityTimeWind);
|
|
get(obj, QStringLiteral("relPositionValidityTimeWind"), ret.relPositionValidityTimeWind);
|
|
get(obj, QStringLiteral("volatility"), ret.volatility);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject CreateCContamination::toJson() const
|
|
{
|
|
QJsonObject obj = CreateCombatAreaEffectSimulationBase::toJson();
|
|
obj[QStringLiteral("effectRadius")] = effectRadius;
|
|
obj[QStringLiteral("expansionFactor")] = expansionFactor;
|
|
obj[QStringLiteral("propagationDirection")] = propagationDirection;
|
|
obj[QStringLiteral("windSpeed")] = windSpeed;
|
|
obj[QStringLiteral("validityTimeWind")] = validityTimeWind;
|
|
obj[QStringLiteral("relPositionValidityTimeWind")] = relPositionValidityTimeWind.toJson();
|
|
obj[QStringLiteral("volatility")] = enumToJson(volatility);
|
|
return obj;
|
|
}
|
|
|
|
|
|
DeactivateEffectSimulation DeactivateEffectSimulation::fromJson(const QJsonObject &obj)
|
|
{
|
|
DeactivateEffectSimulation ret;
|
|
get(obj, QStringLiteral("aesType"), ret.aesType);
|
|
get(obj, QStringLiteral("aesDdsId"), ret.aesDdsId);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject DeactivateEffectSimulation::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("aesType"), enumToJson(aesType)},
|
|
{QStringLiteral("aesDdsId"), aesDdsId}
|
|
};
|
|
}
|
|
|
|
|
|
ModifyAreaEffectSimulationName ModifyAreaEffectSimulationName::fromJson(const QJsonObject &obj)
|
|
{
|
|
ModifyAreaEffectSimulationName ret;
|
|
get(obj, QStringLiteral("aesType"), ret.aesType);
|
|
get(obj, QStringLiteral("aesDdsId"), ret.aesDdsId);
|
|
get(obj, QStringLiteral("name"), ret.name);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ModifyAreaEffectSimulationName::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("aesType"), enumToJson(aesType)},
|
|
{QStringLiteral("aesDdsId"), aesDdsId},
|
|
{QStringLiteral("name"), QString::fromStdString(name)}
|
|
};
|
|
}
|
|
|
|
|
|
MineTriggered MineTriggered::fromJson(const QJsonObject &obj)
|
|
{
|
|
MineTriggered ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("mineAreaId"), ret.mineAreaId);
|
|
get(obj, QStringLiteral("mineIndex"), ret.mineIndex);
|
|
get(obj, QStringLiteral("chargeTypeId"), ret.chargeTypeId);
|
|
get(obj, QStringLiteral("relPosition"), ret.relPosition);
|
|
get(obj, QStringLiteral("relPositionValid"), ret.relPositionValid);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject MineTriggered::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("mineAreaId"), mineAreaId},
|
|
{QStringLiteral("mineIndex"), mineIndex},
|
|
{QStringLiteral("chargeTypeId"), chargeTypeId},
|
|
{QStringLiteral("relPosition"), relPosition.toJson()},
|
|
{QStringLiteral("relPositionValid"), relPositionValid}
|
|
};
|
|
}
|
|
|
|
|
|
DusMineReactivation DusMineReactivation::fromJson(const QJsonObject &obj)
|
|
{
|
|
DusMineReactivation ret;
|
|
get(obj, QStringLiteral("dusSerialNumbers"), ret.dusSerialNumbers);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject DusMineReactivation::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("dusSerialNumbers"), arrayToJson(dusSerialNumbers)}};
|
|
}
|
|
|
|
|
|
void IedBaseData::fromJson(const QJsonObject &obj, IedBaseData &ret)
|
|
{
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("iedId"), ret.iedId);
|
|
get(obj, QStringLiteral("tacticalState"), ret.tacticalState);
|
|
get(obj, QStringLiteral("statePyrotechnics"), ret.statePyrotechnics);
|
|
}
|
|
|
|
QJsonObject IedBaseData::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("iedId"), iedId},
|
|
{QStringLiteral("tacticalState"), enumToJson(tacticalState)},
|
|
{QStringLiteral("statePyrotechnics"), statePyrotechnics}
|
|
};
|
|
}
|
|
|
|
|
|
DefinitionIed DefinitionIed::fromJson(const QJsonObject &obj)
|
|
{
|
|
DefinitionIed ret;
|
|
IedBaseData::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("relPosition"), ret.relPosition);
|
|
get(obj, QStringLiteral("iedType"), ret.iedType);
|
|
get(obj, QStringLiteral("trigger"), ret.trigger);
|
|
get(obj, QStringLiteral("explosiveForce"), ret.explosiveForce);
|
|
get(obj, QStringLiteral("pairingState"), ret.pairingState);
|
|
get(obj, QStringLiteral("pairedId"), ret.pairedId);
|
|
get(obj, QStringLiteral("partyId"), ret.partyId);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject DefinitionIed::toJson() const
|
|
{
|
|
QJsonObject obj = IedBaseData::toJson();
|
|
obj[QStringLiteral("relPosition")] = relPosition.toJson();
|
|
obj[QStringLiteral("iedType")] = enumToJson(iedType);
|
|
obj[QStringLiteral("trigger")] = trigger;
|
|
obj[QStringLiteral("explosiveForce")] = explosiveForce;
|
|
obj[QStringLiteral("pairingState")] = enumToJson(pairingState);
|
|
obj[QStringLiteral("pairedId")] = pairedId;
|
|
obj[QStringLiteral("partyId")] = partyId;
|
|
return obj;
|
|
}
|
|
|
|
|
|
StateIed StateIed::fromJson(const QJsonObject &obj)
|
|
{
|
|
StateIed ret;
|
|
IedBaseData::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("batteryWarnings"), ret.batteryWarnings);
|
|
get(obj, QStringLiteral("errorStateElectronics"), ret.errorStateElectronics);
|
|
get(obj, QStringLiteral("errorStatePyrotechnics1"), ret.errorStatePyrotechnics1);
|
|
get(obj, QStringLiteral("errorStatePyrotechnics2"), ret.errorStatePyrotechnics2);
|
|
get(obj, QStringLiteral("errorStatePyrotechnics3"), ret.errorStatePyrotechnics3);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject StateIed::toJson() const
|
|
{
|
|
QJsonObject obj = IedBaseData::toJson();
|
|
obj[QStringLiteral("batteryWarnings")] = batteryWarnings;
|
|
obj[QStringLiteral("errorStateElectronics")] = enumToJson(errorStateElectronics);
|
|
obj[QStringLiteral("errorStatePyrotechnics1")] = enumToJson(errorStatePyrotechnics1);
|
|
obj[QStringLiteral("errorStatePyrotechnics2")] = enumToJson(errorStatePyrotechnics2);
|
|
obj[QStringLiteral("errorStatePyrotechnics3")] = enumToJson(errorStatePyrotechnics3);
|
|
return obj;
|
|
}
|
|
|
|
|
|
DusSingleMineState DusSingleMineState::fromJson(const QJsonObject &obj)
|
|
{
|
|
DusSingleMineState ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("mineId"), ret.mineId);
|
|
get(obj, QStringLiteral("effectStart"), ret.effectStart);
|
|
get(obj, QStringLiteral("relPosition"), ret.relPosition);
|
|
get(obj, QStringLiteral("chargeTypeId"), ret.chargeTypeId);
|
|
get(obj, QStringLiteral("state"), ret.state);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject DusSingleMineState::toJson() const
|
|
{
|
|
QJsonObject obj;
|
|
obj[QStringLiteral("header")] = header.toJson();
|
|
obj[QStringLiteral("mineId")] = mineId;
|
|
obj[QStringLiteral("effectStart")] = effectStart;
|
|
obj[QStringLiteral("relPosition")] = relPosition.toJson();
|
|
obj[QStringLiteral("chargeTypeId")] = chargeTypeId;
|
|
obj[QStringLiteral("state")] = state;
|
|
return obj;
|
|
}
|
|
|
|
|
|
CreateDusSingleMine CreateDusSingleMine::fromJson(const QJsonObject &obj)
|
|
{
|
|
CreateDusSingleMine ret;
|
|
CreateCombatAreaEffectSimulationBase::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("mineId"), ret.mineId);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject CreateDusSingleMine::toJson() const
|
|
{
|
|
QJsonObject obj = CreateCombatAreaEffectSimulationBase::toJson();
|
|
obj[QStringLiteral("mineId")] = mineId;
|
|
return obj;
|
|
}
|
|
|
|
|
|
void StateChangeBase::fromJson(const QJsonObject &obj, StateChangeBase &ret)
|
|
{
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
|
|
bool bAtLeastOneFound = false;
|
|
if (get(obj, QStringLiteral("relPosition"), ret.relPosition, true))
|
|
bAtLeastOneFound = true;
|
|
if (get(obj, QStringLiteral("geoPosition"), ret.geoPosition, true))
|
|
bAtLeastOneFound = true;
|
|
|
|
get(obj, QStringLiteral("opsPosition"), ret.opsPosition, bAtLeastOneFound);
|
|
|
|
get(obj, QStringLiteral("vulnerabilityState"), ret.vulnerabilityState);
|
|
get(obj, QStringLiteral("tasVulnerabilityKindId"), ret.tasVulnerabilityKindId);
|
|
get(obj, QStringLiteral("tasVitality"), ret.tasVitality, true);
|
|
get(obj, QStringLiteral("vulnerabilityBits"), ret.vulnerabilityBits);
|
|
|
|
get(obj, QStringLiteral("originatorId"), ret.originatorId);
|
|
}
|
|
|
|
QJsonObject StateChangeBase::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("relPosition"), relPosition.toJson()},
|
|
{QStringLiteral("geoPosition"), geoPosition.toJson()},
|
|
{QStringLiteral("opsPosition"), opsPosition.toJson()},
|
|
{QStringLiteral("vulnerabilityState"), enumToJson(vulnerabilityState)},
|
|
{QStringLiteral("tasVulnerabilityKindId"), tasVulnerabilityKindId},
|
|
{QStringLiteral("tasVitality"), tasVitality},
|
|
{QStringLiteral("vulnerabilityBits"), vulnerabilityBits},
|
|
{QStringLiteral("originatorId"), originatorId}
|
|
};
|
|
}
|
|
|
|
|
|
StateChangeDirect StateChangeDirect::fromJson(const QJsonObject &obj)
|
|
{
|
|
StateChangeDirect ret;
|
|
StateChangeBase::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("chargeTypeId"), ret.chargeTypeId);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject StateChangeDirect::toJson() const
|
|
{
|
|
QJsonObject obj = StateChangeBase::toJson();
|
|
obj[QStringLiteral("chargeTypeId")] = chargeTypeId;
|
|
return obj;
|
|
}
|
|
|
|
|
|
StateChangeIndirect StateChangeIndirect::fromJson(const QJsonObject &obj)
|
|
{
|
|
StateChangeIndirect ret;
|
|
StateChangeBase::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("isSecondaryEffect"), ret.isSecondaryEffect);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject StateChangeIndirect::toJson() const
|
|
{
|
|
QJsonObject obj = StateChangeBase::toJson();
|
|
obj[QStringLiteral("isSecondaryEffect")] = isSecondaryEffect;
|
|
return obj;
|
|
}
|
|
|
|
|
|
DemandVulnerabilityStateChange DemandVulnerabilityStateChange::fromJson(const QJsonObject &obj)
|
|
{
|
|
DemandVulnerabilityStateChange ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("workstationId"), ret.workstationId);
|
|
get(obj, QStringLiteral("reqestedState"), ret.reqestedState);
|
|
get(obj, QStringLiteral("vulnerabilityVitalityIndex"), ret.vulnerabilityVitalityIndex);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject DemandVulnerabilityStateChange::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("workstationId"), workstationId},
|
|
{QStringLiteral("reqestedState"), enumToJson(reqestedState)},
|
|
{QStringLiteral("vulnerabilityVitalityIndex"), vulnerabilityVitalityIndex}
|
|
};
|
|
}
|
|
|
|
|
|
OperatorAction OperatorAction::fromJson(const QJsonObject &obj)
|
|
{
|
|
OperatorAction ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("relPosition"), ret.relPosition);
|
|
get(obj, QStringLiteral("operatorId"), ret.operatorId);
|
|
get(obj, QStringLiteral("action"), ret.action);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject OperatorAction::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("relPosition"), relPosition.toJson()},
|
|
{QStringLiteral("operatorId"), operatorId},
|
|
{QStringLiteral("action"), action}
|
|
};
|
|
}
|
|
|
|
|
|
Reammunition Reammunition::fromJson(const QJsonObject &obj)
|
|
{
|
|
Reammunition ret;
|
|
get(obj, QStringLiteral("chargeTypeId"), ret.chargeTypeId);
|
|
get(obj, QStringLiteral("newStock"), ret.newStock);
|
|
get(obj, QStringLiteral("newDefaultStock"), ret.newDefaultStock);
|
|
get(obj, QStringLiteral("tracerRatio"), ret.tracerRatio);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject Reammunition::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("chargeTypeId"), chargeTypeId},
|
|
{QStringLiteral("newStock"), newStock},
|
|
{QStringLiteral("newDefaultStock"), newDefaultStock},
|
|
{QStringLiteral("tracerRatio"), tracerRatio}
|
|
};
|
|
}
|
|
|
|
|
|
SelectiveReammunition SelectiveReammunition::fromJson(const QJsonObject &obj)
|
|
{
|
|
SelectiveReammunition ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("gearId"), ret.gearId);
|
|
get(obj, QStringLiteral("reammunitions"), ret.reammunitions);
|
|
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject SelectiveReammunition::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("gearId"), gearId},
|
|
{QStringLiteral("reammunitions"), arrayToJson(reammunitions)}
|
|
};
|
|
}
|
|
|
|
|
|
StateChange StateChange::fromJson(const QJsonObject &obj)
|
|
{
|
|
StateChange ret;
|
|
StateChangeBase::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("originatorType"), ret.originatorType);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject StateChange::toJson() const
|
|
{
|
|
QJsonObject obj = StateChangeBase::toJson();
|
|
obj[QStringLiteral("originatorType")] = enumToJson(originatorType);
|
|
return obj;
|
|
}
|
|
|
|
|
|
CreateFunctionalArea CreateFunctionalArea::fromJson(const QJsonObject &obj)
|
|
{
|
|
CreateFunctionalArea ret;
|
|
CreateAreaEffectSimulationBase::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("relEffectPosition"), ret.relEffectPosition);
|
|
get(obj, QStringLiteral("width"), ret.width);
|
|
get(obj, QStringLiteral("height"), ret.height);
|
|
get(obj, QStringLiteral("deconTimeout"), ret.deconTimeout);
|
|
get(obj, QStringLiteral("maintenanceTimeout"), ret.maintenanceTimeout);
|
|
get(obj, QStringLiteral("medicalTimeout"), ret.medicalTimeout);
|
|
get(obj, QStringLiteral("deconMode"), ret.deconMode);
|
|
get(obj, QStringLiteral("maintenanceMode"), ret.maintenanceMode);
|
|
get(obj, QStringLiteral("medicalMode"), ret.medicalMode);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject CreateFunctionalArea::toJson() const
|
|
{
|
|
QJsonObject obj = CreateAreaEffectSimulationBase::toJson();
|
|
obj[QStringLiteral("relEffectPosition")] = relEffectPosition.toJson();
|
|
obj[QStringLiteral("width")] = width;
|
|
obj[QStringLiteral("height")] = height;
|
|
obj[QStringLiteral("deconTimeout")] = qint64(deconTimeout);
|
|
obj[QStringLiteral("maintenanceTimeout")] = qint64(maintenanceTimeout);
|
|
obj[QStringLiteral("medicalTimeout")] = qint64(medicalTimeout);
|
|
obj[QStringLiteral("deconMode")] = enumToJson(deconMode);
|
|
obj[QStringLiteral("maintenanceMode")] = enumToJson(maintenanceMode);
|
|
obj[QStringLiteral("medicalMode")] = enumToJson(medicalMode);
|
|
return obj;
|
|
}
|
|
|
|
|
|
FunctionalAreaEntry FunctionalAreaEntry::fromJson(const QJsonObject &obj)
|
|
{
|
|
FunctionalAreaEntry ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("relPosition"), ret.relPosition);
|
|
get(obj, QStringLiteral("aesDdsId"), ret.aesDdsId);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject FunctionalAreaEntry::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("relPosition"), relPosition.toJson()},
|
|
{QStringLiteral("aesDdsId"), aesDdsId}
|
|
};
|
|
}
|
|
|
|
|
|
RequestBroadcastTelegrams RequestBroadcastTelegrams::fromJson(const QJsonObject &obj)
|
|
{
|
|
RequestBroadcastTelegrams ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("resetCounter"), ret.resetCounter);
|
|
get(obj, QStringLiteral("broadcastIndex"), ret.broadcastIndex);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject RequestBroadcastTelegrams::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("resetCounter"), resetCounter},
|
|
{QStringLiteral("broadcastIndex"), broadcastIndex}
|
|
};
|
|
}
|
|
|
|
|
|
SpecialSensorData SpecialSensorData::fromJson(const QJsonObject &obj)
|
|
{
|
|
SpecialSensorData ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("relPosition"), ret.relPosition);
|
|
get(obj, QStringLiteral("operationalState"), ret.operationalState);
|
|
get(obj, QStringLiteral("airSensor"), ret.airSensor);
|
|
get(obj, QStringLiteral("tireSensor"), ret.tireSensor);
|
|
get(obj, QStringLiteral("pointSensor"), ret.pointSensor);
|
|
get(obj, QStringLiteral("solidMatterSampleExtractor"), ret.solidMatterSampleExtractor);
|
|
get(obj, QStringLiteral("type"), ret.type);
|
|
get(obj, QStringLiteral("nbcType"), ret.nbcType);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject SpecialSensorData::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("relPosition"), relPosition.toJson()},
|
|
{QStringLiteral("operationalState"), operationalState},
|
|
{QStringLiteral("airSensor"), airSensor},
|
|
{QStringLiteral("tireSensor"), tireSensor},
|
|
{QStringLiteral("pointSensor"), pointSensor},
|
|
{QStringLiteral("solidMatterSampleExtractor"), solidMatterSampleExtractor},
|
|
{QStringLiteral("type"), type},
|
|
{QStringLiteral("nbcType"), nbcType}
|
|
};
|
|
}
|
|
|
|
|
|
void MinelayerTrailerDataBase::fromJson(const QJsonObject &obj, MinelayerTrailerDataBase &ret)
|
|
{
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("relPosition"), ret.relPosition);
|
|
get(obj, QStringLiteral("barrierId"), ret.barrierId);
|
|
get(obj, QStringLiteral("layingDensity"), ret.layingDensity);
|
|
get(obj, QStringLiteral("effectStart"), ret.effectStart);
|
|
get(obj, QStringLiteral("effectDuration"), ret.effectDuration);
|
|
get(obj, QStringLiteral("indirectChargeTasCode"), ret.indirectChargeTasCode);
|
|
get(obj, QStringLiteral("mineCount"), ret.mineCount);
|
|
}
|
|
|
|
QJsonObject MinelayerTrailerDataBase::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("relPosition"), relPosition.toJson()},
|
|
{QStringLiteral("barrierId"), barrierId},
|
|
{QStringLiteral("layingDensity"), layingDensity},
|
|
{QStringLiteral("effectStart"), qint64(effectStart)},
|
|
{QStringLiteral("effectDuration"), effectDuration},
|
|
{QStringLiteral("indirectChargeTasCode"), indirectChargeTasCode},
|
|
{QStringLiteral("mineCount"), mineCount}
|
|
};
|
|
}
|
|
|
|
|
|
MinelayerTrailerData MinelayerTrailerData::fromJson(const QJsonObject &obj)
|
|
{
|
|
MinelayerTrailerData ret;
|
|
MinelayerTrailerDataBase::fromJson(obj, ret);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject MinelayerTrailerData::toJson() const
|
|
{
|
|
return MinelayerTrailerDataBase::toJson();
|
|
}
|
|
|
|
|
|
MinelayerThrowerData MinelayerThrowerData::fromJson(const QJsonObject &obj)
|
|
{
|
|
MinelayerThrowerData ret;
|
|
MinelayerTrailerDataBase::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("throwingType"), ret.throwingType);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject MinelayerThrowerData::toJson() const
|
|
{
|
|
QJsonObject obj = MinelayerTrailerDataBase::toJson();
|
|
obj[QStringLiteral("throwingType")] = enumToJson(throwingType);
|
|
return obj;
|
|
}
|
|
MinelayerTrailerPosition MinelayerTrailerPosition::fromJson(const QJsonObject &obj)
|
|
{
|
|
MinelayerTrailerPosition ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("relPosition"), ret.relPosition);
|
|
get(obj, QStringLiteral("indirectChargeTasCode"), ret.indirectChargeTasCode);
|
|
get(obj, QStringLiteral("dusSerialNo"), ret.dusSerialNo);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject MinelayerTrailerPosition::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("relPosition"), relPosition.toJson()},
|
|
{QStringLiteral("indirectChargeTasCode"), indirectChargeTasCode},
|
|
{QStringLiteral("dusSerialNo"), qint64(dusSerialNo)}
|
|
};
|
|
}
|
|
|
|
|
|
LanguageSelection LanguageSelection::fromJson(const QJsonObject &obj)
|
|
{
|
|
LanguageSelection ret;
|
|
get(obj, QStringLiteral("aesDdsId"), ret.header);
|
|
get(obj, QStringLiteral("languageSelection"), ret.languageSelection);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject LanguageSelection::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("languageSelection"), enumToJson(languageSelection)}
|
|
};
|
|
}
|
|
|
|
|
|
EquipmentMessage EquipmentMessage::fromJson(const QJsonObject &obj)
|
|
{
|
|
EquipmentMessage ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("message"), ret.message);
|
|
get(obj, QStringLiteral("msgId"), ret.msgId);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject EquipmentMessage::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("message"), QString::fromStdString(message)},
|
|
{QStringLiteral("msgId"), msgId}
|
|
};
|
|
}
|
|
|
|
|
|
EquipmentMessageOC EquipmentMessageOC::fromJson(const QJsonObject &obj)
|
|
{
|
|
EquipmentMessageOC ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("subject"), ret.subject);
|
|
get(obj, QStringLiteral("message"), ret.message);
|
|
get(obj, QStringLiteral("senderId"), ret.senderId);
|
|
get(obj, QStringLiteral("receiverId"), ret.receiverId);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject EquipmentMessageOC::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("subject"), QString::fromStdString(subject)},
|
|
{QStringLiteral("message"), QString::fromStdString(message)},
|
|
{QStringLiteral("senderId"), senderId},
|
|
{QStringLiteral("receiverId"), receiverId}
|
|
};
|
|
}
|
|
|
|
|
|
void OpaquePayloadDataBase::fromJson(const QJsonObject &obj, OpaquePayloadDataBase &ret)
|
|
{
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("payload"), ret.payload);
|
|
get(obj, QStringLiteral("payloadType"), ret.payloadType);
|
|
}
|
|
|
|
QJsonObject OpaquePayloadDataBase::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("payload"), arrayToJson(payload)},
|
|
{QStringLiteral("payloadType"), enumToJson(payloadType)}
|
|
};
|
|
}
|
|
|
|
|
|
OpaquePayloadDataOut OpaquePayloadDataOut::fromJson(const QJsonObject &obj)
|
|
{
|
|
OpaquePayloadDataOut ret;
|
|
OpaquePayloadDataBase::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject OpaquePayloadDataOut::toJson() const
|
|
{
|
|
QJsonObject obj = OpaquePayloadDataBase::toJson();
|
|
obj[QStringLiteral("header")] = header.toJson();
|
|
return obj;
|
|
}
|
|
|
|
|
|
OpaquePayloadDataIn OpaquePayloadDataIn::fromJson(const QJsonObject &obj)
|
|
{
|
|
OpaquePayloadDataIn ret;
|
|
OpaquePayloadDataBase::fromJson(obj, ret);
|
|
get(obj, QStringLiteral("relPosition"), ret.relPosition);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject OpaquePayloadDataIn::toJson() const
|
|
{
|
|
QJsonObject obj = OpaquePayloadDataBase::toJson();
|
|
obj[QStringLiteral("relPosition")] = relPosition.toJson();
|
|
return obj;
|
|
}
|
|
|
|
|
|
EquipmentEvent EquipmentEvent::fromJson(const QJsonObject &obj)
|
|
{
|
|
EquipmentEvent ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("relPosition"), ret.relPosition);
|
|
get(obj, QStringLiteral("equipmentFunctionId"), ret.equipmentFunctionId);
|
|
get(obj, QStringLiteral("subDeviceId"), ret.subDeviceId);
|
|
get(obj, QStringLiteral("uniqueId"), ret.uniqueId);
|
|
get(obj, QStringLiteral("code"), ret.code);
|
|
get(obj, QStringLiteral("payload"), ret.payload);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject EquipmentEvent::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("relPosition"), relPosition.toJson()},
|
|
{QStringLiteral("equipmentFunctionId"), equipmentFunctionId},
|
|
{QStringLiteral("subDeviceId"), subDeviceId},
|
|
{QStringLiteral("uniqueId"), uniqueId},
|
|
{QStringLiteral("code"), code},
|
|
{QStringLiteral("payload"), arrayToJson(payload)}
|
|
};
|
|
}
|
|
|
|
|
|
EquipmentGearAssignment EquipmentGearAssignment::fromJson(const QJsonObject &obj)
|
|
{
|
|
EquipmentGearAssignment ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("gears"), ret.gears, true);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject EquipmentGearAssignment::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("gears"), arrayToJson(gears)}
|
|
};
|
|
}
|
|
|
|
|
|
EquipmentGearChargeState EquipmentGearChargeState::fromJson(const QJsonObject &obj)
|
|
{
|
|
EquipmentGearChargeState ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("charges"), ret.charges);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject EquipmentGearChargeState::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("charges"), arrayToJson(charges)}
|
|
};
|
|
}
|
|
|
|
|
|
ExerciseEnvironmentData ExerciseEnvironmentData::fromJson(const QJsonObject &obj)
|
|
{
|
|
ExerciseEnvironmentData ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("exerciseId"), ret.exerciseId);
|
|
int tz;
|
|
get(obj, QStringLiteral("timeZone"), tz);
|
|
ret.timeZone = tz;
|
|
get(obj, QStringLiteral("utmZone"), ret.utmZone);
|
|
get(obj, QStringLiteral("utmBand"), ret.utmBand);
|
|
get(obj, QStringLiteral("grid"), ret.grid);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ExerciseEnvironmentData::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("exerciseId"), exerciseId},
|
|
{QStringLiteral("timeZone"), timeZone},
|
|
{QStringLiteral("utmZone"), utmZone},
|
|
{QStringLiteral("utmBand"), utmBand},
|
|
{QStringLiteral("grid"), QString::fromStdString(grid)}
|
|
};
|
|
}
|
|
|
|
|
|
BiteError BiteError::fromJson(const QJsonObject &obj)
|
|
{
|
|
BiteError ret;
|
|
get(obj, QStringLiteral("errorNumber"), ret.errorNumber);
|
|
get(obj, QStringLiteral("canDeviceNumber"), ret.canDeviceNumber);
|
|
get(obj, QStringLiteral("subdeviceNumber"), ret.subdeviceNumber);
|
|
get(obj, QStringLiteral("uniqueId"), ret.uniqueId);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject BiteError::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("errorNumber"), errorNumber},
|
|
{QStringLiteral("canDeviceNumber"), canDeviceNumber},
|
|
{QStringLiteral("subdeviceNumber"), subdeviceNumber},
|
|
{QStringLiteral("uniqueId"), uniqueId}
|
|
};
|
|
}
|
|
|
|
|
|
BiteReport BiteReport::fromJson(const QJsonObject &obj)
|
|
{
|
|
BiteReport ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("loginType"), ret.loginType);
|
|
get(obj, QStringLiteral("biteState"), ret.biteState);
|
|
get(obj, QStringLiteral("configState"), ret.configState);
|
|
get(obj, QStringLiteral("batteryState"), ret.batteryState);
|
|
get(obj, QStringLiteral("configError"), ret.configError);
|
|
get(obj, QStringLiteral("biteErrors"), ret.biteErrors, true);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject BiteReport::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("loginType"), enumToJson(loginType)},
|
|
{QStringLiteral("biteState"), biteState},
|
|
{QStringLiteral("configState"), configState},
|
|
{QStringLiteral("batteryState"), batteryState},
|
|
{QStringLiteral("configError"), configError},
|
|
{QStringLiteral("biteErrors"), arrayToJson(biteErrors)}
|
|
};
|
|
}
|
|
|
|
|
|
EquipmentGearEvent EquipmentGearEvent::fromJson(const QJsonObject &obj)
|
|
{
|
|
EquipmentGearEvent ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("charge"), ret.charge);
|
|
get(obj, QStringLiteral("chargeAmount"), ret.chargeAmount);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject EquipmentGearEvent::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("charge"), charge.toJson()},
|
|
{QStringLiteral("chargeAmount"), chargeAmount}
|
|
};
|
|
}
|
|
|
|
|
|
CesHitInformation CesHitInformation::fromJson(const QJsonObject &obj)
|
|
{
|
|
CesHitInformation ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("chargeTasCodeDirect"), ret.chargeTasCodeDirect);
|
|
get(obj, QStringLiteral("chargeTasCodeIndirect"), ret.chargeTasCodeIndirect);
|
|
get(obj, QStringLiteral("originatorEquipmentNumber"), ret.originatorEquipmentNumber);
|
|
get(obj, QStringLiteral("directionDegree"), ret.directionDegree);
|
|
get(obj, QStringLiteral("distance"), ret.distance);
|
|
get(obj, QStringLiteral("effectPercent"), ret.effectPercent);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject CesHitInformation::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("chargeTasCodeDirect"), chargeTasCodeDirect},
|
|
{QStringLiteral("chargeTasCodeIndirect"), chargeTasCodeIndirect},
|
|
{QStringLiteral("originatorEquipmentNumber"), originatorEquipmentNumber},
|
|
{QStringLiteral("directionDegree"), directionDegree},
|
|
{QStringLiteral("distance"), distance},
|
|
{QStringLiteral("effectPercent"), effectPercent}
|
|
};
|
|
}
|
|
|
|
|
|
ParticipantSwVersionsRequest ParticipantSwVersionsRequest::fromJson(const QJsonObject &obj)
|
|
{
|
|
ParticipantSwVersionsRequest ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("charge"), ret.equipmentFunctionId);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ParticipantSwVersionsRequest::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("chargeAmount"), equipmentFunctionId}
|
|
};
|
|
}
|
|
|
|
|
|
EquipmentSwVersion EquipmentSwVersion::fromJson(const QJsonObject &obj)
|
|
{
|
|
EquipmentSwVersion ret;
|
|
get(obj, QStringLiteral("equipmentFunctionId"), ret.equipmentFunctionId);
|
|
get(obj, QStringLiteral("subDeviceId"), ret.subDeviceId);
|
|
get(obj, QStringLiteral("uniqueId"), ret.uniqueId);
|
|
get(obj, QStringLiteral("swVersion"), ret.swVersion);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject EquipmentSwVersion::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("equipmentFunctionId"), equipmentFunctionId},
|
|
{QStringLiteral("subDeviceId"), subDeviceId},
|
|
{QStringLiteral("uniqueId"), uniqueId},
|
|
{QStringLiteral("swVersion"), swVersion}
|
|
};
|
|
}
|
|
|
|
|
|
ParticipantSwVersions ParticipantSwVersions::fromJson(const QJsonObject &obj)
|
|
{
|
|
ParticipantSwVersions ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("subDeviceId"), ret.equipments);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ParticipantSwVersions::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("subDeviceId"), arrayToJson(equipments)}
|
|
};
|
|
}
|
|
|
|
|
|
CesHitRequest CesHitRequest::fromJson(const QJsonObject &obj)
|
|
{
|
|
CesHitRequest ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("chargeTasCodeDirect"), ret.chargeTasCodeDirect);
|
|
get(obj, QStringLiteral("chargeTasCodeIndirect"), ret.chargeTasCodeIndirect);
|
|
get(obj, QStringLiteral("originatorEquipmentNumber"), ret.originatorEquipmentNumber);
|
|
get(obj, QStringLiteral("aesDdsId"), ret.aesDdsId);
|
|
get(obj, QStringLiteral("aesType"), ret.aesType);
|
|
get(obj, QStringLiteral("mineId"), ret.mineId);
|
|
get(obj, QStringLiteral("remainEffectPercent"), ret.remainEffectPercent);
|
|
get(obj, QStringLiteral("remainEffectTasCodeDirect"), ret.remainEffectTasCodeDirect);
|
|
get(obj, QStringLiteral("buildingId"), ret.buildingId);
|
|
get(obj, QStringLiteral("roomId"), ret.roomId);
|
|
get(obj, QStringLiteral("relPosition"), ret.relPosition);
|
|
get(obj, QStringLiteral("reserve1"), ret.reserve1);
|
|
get(obj, QStringLiteral("reserve2"), ret.reserve2);
|
|
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject CesHitRequest::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("chargeTasCodeDirect"), chargeTasCodeDirect},
|
|
{QStringLiteral("chargeTasCodeIndirect"), chargeTasCodeIndirect},
|
|
{QStringLiteral("originatorEquipmentNumber"), originatorEquipmentNumber},
|
|
{QStringLiteral("aesDdsId"), aesDdsId},
|
|
{QStringLiteral("aesType"), enumToJson(aesType)},
|
|
{QStringLiteral("mineId"), mineId},
|
|
{QStringLiteral("remainEffectPercent"), remainEffectPercent},
|
|
{QStringLiteral("remainEffectTasCodeDirect"), remainEffectTasCodeDirect},
|
|
{QStringLiteral("buildingId"), buildingId},
|
|
{QStringLiteral("roomId"), roomId},
|
|
{QStringLiteral("relPosition"), relPosition.toJson()},
|
|
{QStringLiteral("reserve1"), reserve1},
|
|
{QStringLiteral("reserve2"), reserve2}
|
|
};
|
|
}
|
|
|
|
|
|
TechnicalArea TechnicalArea::fromJson(const QJsonObject &obj)
|
|
{
|
|
TechnicalArea ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("aesDdsId"), ret.aesDdsId);
|
|
get(obj, QStringLiteral("taType"), ret.taType);
|
|
get(obj, QStringLiteral("name"), ret.name);
|
|
get(obj, QStringLiteral("relCorner"), ret.relCorner);
|
|
get(obj, QStringLiteral("width"), ret.width);
|
|
get(obj, QStringLiteral("height"), ret.height);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject TechnicalArea::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("aesDdsId"), aesDdsId},
|
|
{QStringLiteral("taType"), enumToJson(taType)},
|
|
{QStringLiteral("name"), QString::fromStdString(name)},
|
|
{QStringLiteral("relCorner"), relCorner.toJson()},
|
|
{QStringLiteral("width"), width},
|
|
{QStringLiteral("height"), height}
|
|
};
|
|
}
|
|
|
|
|
|
void ParticipantModeBase::fromJson(const QJsonObject &obj, ParticipantModeBase &ret)
|
|
{
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("language"), ret.language);
|
|
get(obj, QStringLiteral("operationMode"), ret.operationMode);
|
|
get(obj, QStringLiteral("reactivationDetoxication"), ret.reactivationDetoxication);
|
|
get(obj, QStringLiteral("reactivationMaintenance"), ret.reactivationMaintenance);
|
|
get(obj, QStringLiteral("reactivationMedic"), ret.reactivationMedic);
|
|
get(obj, QStringLiteral("modeVest"), ret.modeVest);
|
|
get(obj, QStringLiteral("modeHelmet"), ret.modeHelmet);
|
|
get(obj, QStringLiteral("personellProtectionMode"), ret.personellProtectionMode);
|
|
get(obj, QStringLiteral("protectionLevel"), ret.protectionLevel);
|
|
get(obj, QStringLiteral("handgrenadeSearchMode"), ret.handgrenadeSearchMode);
|
|
get(obj, QStringLiteral("internationalMode"), ret.internationalMode);
|
|
get(obj, QStringLiteral("abcProtectionMode"), ret.abcProtectionMode);
|
|
}
|
|
|
|
QJsonObject ParticipantModeBase::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("language"), enumToJson(language)},
|
|
{QStringLiteral("operationMode"), enumToJson(operationMode)},
|
|
{QStringLiteral("reactivationDetoxication"), reactivationDetoxication},
|
|
{QStringLiteral("reactivationMaintenance"), reactivationMaintenance},
|
|
{QStringLiteral("reactivationMedic"), reactivationMedic},
|
|
{QStringLiteral("modeVest"), enumToJson(modeVest)},
|
|
{QStringLiteral("modeHelmet"), enumToJson(modeHelmet)},
|
|
{QStringLiteral("personellProtectionMode"), enumToJson(personellProtectionMode)},
|
|
{QStringLiteral("protectionLevel"), enumToJson(protectionLevel)},
|
|
{QStringLiteral("handgrenadeSearchMode"), enumToJson(handgrenadeSearchMode)},
|
|
{QStringLiteral("internationalMode"), enumToJson(internationalMode)},
|
|
{QStringLiteral("abcProtectionMode"), enumToJson(abcProtectionMode)}
|
|
};
|
|
}
|
|
|
|
|
|
ParticipantMode ParticipantMode::fromJson(const QJsonObject &obj)
|
|
{
|
|
ParticipantMode ret;
|
|
ParticipantModeBase::fromJson(obj, ret);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ParticipantMode::toJson() const
|
|
{
|
|
return ParticipantModeBase::toJson();
|
|
}
|
|
|
|
|
|
ParticipantModeReport ParticipantModeReport::fromJson(const QJsonObject &obj)
|
|
{
|
|
ParticipantModeReport ret;
|
|
ParticipantModeBase::fromJson(obj, ret);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ParticipantModeReport::toJson() const
|
|
{
|
|
return ParticipantModeBase::toJson();
|
|
}
|
|
|
|
|
|
DemandParticipantMode DemandParticipantMode::fromJson(const QJsonObject &obj)
|
|
{
|
|
DemandParticipantMode ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject DemandParticipantMode::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()}};
|
|
}
|
|
|
|
|
|
void ParticipantConfigurationBase::fromJson(const QJsonObject &obj, ParticipantConfigurationBase &ret)
|
|
{
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("positionIntervallVehicle"), ret.positionIntervallVehicle);
|
|
get(obj, QStringLiteral("positionIntervallPersonell"), ret.positionIntervallPersonell);
|
|
get(obj, QStringLiteral("positionIntervallAircraft"), ret.positionIntervallAircraft);
|
|
get(obj, QStringLiteral("positionTransmissionIntervall"), ret.positionTransmissionIntervall);
|
|
get(obj, QStringLiteral("heightbarrier"), ret.heightbarrier);
|
|
get(obj, QStringLiteral("faultPositionHandling"), ret.faultPositionHandling);
|
|
get(obj, QStringLiteral("switchingPositionIntervall"), ret.switchingPositionIntervall);
|
|
get(obj, QStringLiteral("waittimeAdditionalBroadcastDemand"), ret.waittimeAdditionalBroadcastDemand);
|
|
get(obj, QStringLiteral("factorWaittimeIncreaseAtHighload"), ret.factorWaittimeIncreaseAtHighload);
|
|
get(obj, QStringLiteral("waittimeAutomaticVulnerabilityIncreaseLevel1"), ret.waittimeAutomaticVulnerabilityIncreaseLevel1);
|
|
get(obj, QStringLiteral("waittimeAutomaticVulnerabilityIncreaseLevel2"), ret.waittimeAutomaticVulnerabilityIncreaseLevel2);
|
|
get(obj, QStringLiteral("waittimeAutomaticVulnerabilityIncreaseLevel3"), ret.waittimeAutomaticVulnerabilityIncreaseLevel3);
|
|
get(obj, QStringLiteral("opticalCode"), ret.opticalCode);
|
|
get(obj, QStringLiteral("vulnerabilityModel"), ret.vulnerabilityModel);
|
|
get(obj, QStringLiteral("validTimeOps"), ret.validTimeOps);
|
|
}
|
|
|
|
QJsonObject ParticipantConfigurationBase::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("positionIntervallVehicle"), positionIntervallVehicle},
|
|
{QStringLiteral("positionIntervallPersonell"), positionIntervallPersonell},
|
|
{QStringLiteral("positionIntervallAircraft"), positionIntervallAircraft},
|
|
{QStringLiteral("positionTransmissionIntervall"), positionTransmissionIntervall},
|
|
{QStringLiteral("heightbarrier"), heightbarrier},
|
|
{QStringLiteral("faultPositionHandling"), enumToJson(faultPositionHandling)},
|
|
{QStringLiteral("switchingPositionIntervall"), enumToJson(switchingPositionIntervall)},
|
|
{QStringLiteral("waittimeAdditionalBroadcastDemand"), waittimeAdditionalBroadcastDemand},
|
|
{QStringLiteral("factorWaittimeIncreaseAtHighload"), factorWaittimeIncreaseAtHighload},
|
|
{QStringLiteral("waittimeAutomaticVulnerabilityIncreaseLevel1"), waittimeAutomaticVulnerabilityIncreaseLevel1},
|
|
{QStringLiteral("waittimeAutomaticVulnerabilityIncreaseLevel2"), waittimeAutomaticVulnerabilityIncreaseLevel2},
|
|
{QStringLiteral("waittimeAutomaticVulnerabilityIncreaseLevel3"), waittimeAutomaticVulnerabilityIncreaseLevel3},
|
|
{QStringLiteral("opticalCode"), enumToJson(opticalCode)},
|
|
{QStringLiteral("vulnerabilityModel"), vulnerabilityModel},
|
|
{QStringLiteral("validTimeOps"), validTimeOps}
|
|
};
|
|
}
|
|
|
|
|
|
ParticipantConfigurationReport ParticipantConfigurationReport::fromJson(const QJsonObject &obj)
|
|
{
|
|
ParticipantConfigurationReport ret;
|
|
ParticipantConfigurationBase::fromJson(obj, ret);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ParticipantConfigurationReport::toJson() const
|
|
{
|
|
return ParticipantConfigurationBase::toJson();
|
|
}
|
|
|
|
|
|
ParticipantConfiguration ParticipantConfiguration::fromJson(const QJsonObject &obj)
|
|
{
|
|
ParticipantConfiguration ret;
|
|
ParticipantConfigurationBase::fromJson(obj, ret);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ParticipantConfiguration::toJson() const
|
|
{
|
|
return ParticipantConfigurationBase::toJson();
|
|
}
|
|
|
|
|
|
DemandParticipantConfiguration DemandParticipantConfiguration::fromJson(const QJsonObject &obj)
|
|
{
|
|
DemandParticipantConfiguration ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject DemandParticipantConfiguration::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()}};
|
|
}
|
|
|
|
|
|
ExerciseStateData ExerciseStateData::fromJson(const QJsonObject &obj)
|
|
{
|
|
ExerciseStateData ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("exerciseState"), ret.exerciseState);
|
|
get(obj, QStringLiteral("exerciseId"), ret.exerciseId);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ExerciseStateData::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("exerciseState"), enumToJson(exerciseState)},
|
|
{QStringLiteral("exerciseId"), exerciseId}
|
|
};
|
|
}
|
|
|
|
|
|
EmergencyCall EmergencyCall::fromJson(const QJsonObject &obj)
|
|
{
|
|
EmergencyCall ret;
|
|
get(obj, QStringLiteral("issi"), ret.issi);
|
|
get(obj, QStringLiteral("absPosition"), ret.absPosition);
|
|
get(obj, QStringLiteral("timeStamp"), ret.timeStamp);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject EmergencyCall::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("issi"), issi},
|
|
{QStringLiteral("absPosition"), absPosition.toJson()},
|
|
{QStringLiteral("timeStamp"), timeStamp}
|
|
};
|
|
}
|
|
|
|
|
|
RequestBroadcastStatistics RequestBroadcastStatistics::fromJson(const QJsonObject &obj)
|
|
{
|
|
RequestBroadcastStatistics ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject RequestBroadcastStatistics::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("issi"), header.toJson()}};
|
|
}
|
|
|
|
|
|
BroadcastInformation BroadcastInformation::fromJson(const QJsonObject &obj)
|
|
{
|
|
BroadcastInformation ret;
|
|
get(obj, QStringLiteral("equipmentNumber"), ret.equipmentNumber);
|
|
get(obj, QStringLiteral("broadcastRequests"), ret.broadcastRequests);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject BroadcastInformation::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("equipmentNumber"), equipmentNumber},
|
|
{QStringLiteral("broadcastRequests"), broadcastRequests}
|
|
};
|
|
}
|
|
|
|
|
|
BroadcastStatistics BroadcastStatistics::fromJson(const QJsonObject &obj)
|
|
{
|
|
BroadcastStatistics ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("information"), ret.information);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject BroadcastStatistics::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("information"), arrayToJson(information)}
|
|
};
|
|
}
|
|
|
|
|
|
GroupIssiInformation GroupIssiInformation::fromJson(const QJsonObject &obj)
|
|
{
|
|
GroupIssiInformation ret;
|
|
get(obj, QStringLiteral("exerciseId"), ret.exerciseId);
|
|
get(obj, QStringLiteral("serverIssi"), ret.serverIssi);
|
|
get(obj, QStringLiteral("broadcastIssi1"), ret.broadcastIssi1);
|
|
get(obj, QStringLiteral("broadcastIssi2"), ret.broadcastIssi2);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject GroupIssiInformation::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("exerciseId"), exerciseId},
|
|
{QStringLiteral("serverIssi"), serverIssi},
|
|
{QStringLiteral("broadcastIssi1"), broadcastIssi1},
|
|
{QStringLiteral("broadcastIssi2"), broadcastIssi2}
|
|
};
|
|
}
|
|
|
|
|
|
ExerciseEquipmentAssignmentComplete ExerciseEquipmentAssignmentComplete::fromJson(const QJsonObject &obj)
|
|
{
|
|
ExerciseEquipmentAssignmentComplete ret;
|
|
QJsonArray arrExercise;
|
|
get(obj, QStringLiteral("exerciseEquipmentAssignments"), arrExercise);
|
|
for (const auto &ele : std::as_const(arrExercise))
|
|
{
|
|
const QJsonObject elem = ele.toObject();
|
|
int exerciseId;
|
|
QJsonArray equipmentNumbers;
|
|
get(elem, QStringLiteral("exerciseId"), exerciseId);
|
|
get(elem, QStringLiteral("equipmentNumbers"), equipmentNumbers);
|
|
auto &cont = ret.exerciseEquipmentAssignments[exerciseId];
|
|
for (const auto &eq : std::as_const(equipmentNumbers))
|
|
cont.insert(eq.toInt());
|
|
}
|
|
get(obj, QStringLiteral("groupIssiInformation"), ret.groupIssiInformation);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ExerciseEquipmentAssignmentComplete::toJson() const
|
|
{
|
|
QJsonArray arrExercise;
|
|
for (const auto &it : exerciseEquipmentAssignments)
|
|
{
|
|
QJsonArray equipmentNumbers;
|
|
for (const int equipmentNumber : it.second)
|
|
equipmentNumbers += equipmentNumber;
|
|
arrExercise += QJsonObject{{QStringLiteral("exerciseId"), it.first},
|
|
{QStringLiteral("equipmentNumbers"), equipmentNumbers}
|
|
};
|
|
}
|
|
|
|
return QJsonObject{{QStringLiteral("exerciseEquipmentAssignments"), arrExercise},
|
|
{QStringLiteral("groupIssiInformation"), arrayToJson(groupIssiInformation)}
|
|
};
|
|
}
|
|
|
|
|
|
ProxyConnectionState ProxyConnectionState::fromJson(const QJsonObject &obj)
|
|
{
|
|
ProxyConnectionState ret;
|
|
get(obj, QStringLiteral("connectedToSystem"), ret.connectedToSystem);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ProxyConnectionState::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("connectedToSystem"), connectedToSystem}};
|
|
}
|
|
|
|
|
|
ParticipantLicenseChange ParticipantLicenseChange::fromJson(const QJsonObject &obj)
|
|
{
|
|
ParticipantLicenseChange ret;
|
|
get(obj, QStringLiteral("equipmentNumber"), ret.equipmentNumber);
|
|
get(obj, QStringLiteral("licenseState"), ret.licenseState);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ParticipantLicenseChange::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("equipmentNumber"), equipmentNumber},
|
|
{QStringLiteral("licenseState"), enumToJson(licenseState)}
|
|
};
|
|
}
|
|
|
|
|
|
WlsParticipantsStateRequest WlsParticipantsStateRequest::fromJson(const QJsonObject &obj)
|
|
{
|
|
Q_UNUSED(obj);
|
|
return WlsParticipantsStateRequest();
|
|
}
|
|
|
|
QJsonObject WlsParticipantsStateRequest::toJson() const
|
|
{
|
|
return QJsonObject();
|
|
}
|
|
|
|
|
|
WlsParticipantsStateReport WlsParticipantsStateReport::fromJson(const QJsonObject &obj)
|
|
{
|
|
WlsParticipantsStateReport ret;
|
|
get(obj, QStringLiteral("participantStates"), ret.participantStates);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject WlsParticipantsStateReport::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("participantStates"), arrayToJson(participantStates)}};
|
|
}
|
|
|
|
|
|
WlsBinarySfmData WlsBinarySfmData::fromJson(const QJsonObject &obj)
|
|
{
|
|
WlsBinarySfmData ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("payload"), ret.payload);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject WlsBinarySfmData::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("payload"), arrayToJson(payload)}
|
|
};
|
|
}
|
|
|
|
|
|
WlsParticipantsConnectionState WlsParticipantsConnectionState::fromJson(const QJsonObject &obj)
|
|
{
|
|
WlsParticipantsConnectionState ret;
|
|
get(obj, QStringLiteral("equipmentNumber"), ret.equipmentNumber);
|
|
get(obj, QStringLiteral("dataCommunicationPossible"), ret.dataCommunicationPossible);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject WlsParticipantsConnectionState::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("equipmentNumber"), equipmentNumber},
|
|
{QStringLiteral("dataCommunicationPossible"), dataCommunicationPossible}
|
|
};
|
|
}
|
|
|
|
|
|
SanitationRepair SanitationRepair::fromJson(const QJsonObject &obj)
|
|
{
|
|
SanitationRepair ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("originatorType"), ret.originatorType);
|
|
get(obj, QStringLiteral("equipmentNumberOrigin"), ret.equipmentNumberOrigin);
|
|
get(obj, QStringLiteral("stateStart"), ret.stateStart);
|
|
get(obj, QStringLiteral("typeOfTreatment"), ret.typeOfTreatment);
|
|
get(obj, QStringLiteral("triage"), ret.triage);
|
|
get(obj, QStringLiteral("tyeOfDamage"), ret.tyeOfDamage);
|
|
get(obj, QStringLiteral("stateResult"), ret.stateResult);
|
|
get(obj, QStringLiteral("treatmentResult"), ret.treatmentResult);
|
|
get(obj, QStringLiteral("triagePriority"), ret.triagePriority);
|
|
get(obj, QStringLiteral("fullState"), ret.fullState);
|
|
get(obj, QStringLiteral("timeOfTreatment"), ret.timeOfTreatment);
|
|
get(obj, QStringLiteral("timeOfRecovery"), ret.timeOfRecovery);
|
|
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject SanitationRepair::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("originatorType"), enumToJson(originatorType)},
|
|
{QStringLiteral("equipmentNumberOrigin"), equipmentNumberOrigin},
|
|
{QStringLiteral("stateStart"), enumToJson(stateStart)},
|
|
{QStringLiteral("typeOfTreatment"), typeOfTreatment},
|
|
{QStringLiteral("triage"), triage},
|
|
{QStringLiteral("tyeOfDamage"), tyeOfDamage},
|
|
{QStringLiteral("stateResult"), enumToJson(stateResult)},
|
|
{QStringLiteral("treatmentResult"), enumToJson(treatmentResult)},
|
|
{QStringLiteral("triagePriority"), triagePriority},
|
|
{QStringLiteral("fullState"), fullState},
|
|
{QStringLiteral("timeOfTreatment"), timeOfTreatment},
|
|
{QStringLiteral("timeOfRecovery"), timeOfRecovery}
|
|
};
|
|
}
|
|
|
|
SanitaryMaterialStockReport SanitaryMaterialStockReport::fromJson(const QJsonObject &obj)
|
|
{
|
|
SanitaryMaterialStockReport ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("originatorEquipmentNumber"), ret.originatorEquipmentNumber);
|
|
get(obj, QStringLiteral("qualification"), ret.qualification);
|
|
get(obj, QStringLiteral("uniqueId"), ret.uniqueId);
|
|
get(obj, QStringLiteral("sanitaryMaterialCount"), ret.sanitaryMaterialCount);
|
|
get(obj, QStringLiteral("sanitaryMaterialStock"), ret.sanitaryMaterialStock);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject SanitaryMaterialStockReport::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("sanitaryMaterialCount"), sanitaryMaterialCount},
|
|
{QStringLiteral("uniqueId"), uniqueId},
|
|
{QStringLiteral("sanitaryMaterialStock"), arrayToJson(sanitaryMaterialStock)},
|
|
{QStringLiteral("qualification"), enumToJson(qualification)},
|
|
{QStringLiteral("originatorEquipmentNumber"), originatorEquipmentNumber}
|
|
};
|
|
}
|
|
|
|
ApacheLaserDesignation ApacheLaserDesignation::fromJson(const QJsonObject &obj)
|
|
{
|
|
ApacheLaserDesignation ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("gearId"), ret.gearId);
|
|
get(obj, QStringLiteral("code"), ret.code);
|
|
get(obj, QStringLiteral("outputPower"), ret.outputPower);
|
|
get(obj, QStringLiteral("spotLocation"), ret.spotLocation);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ApacheLaserDesignation::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("gearId"), gearId},
|
|
{QStringLiteral("code"), code},
|
|
{QStringLiteral("outputPower"), outputPower},
|
|
{QStringLiteral("spotLocation"), spotLocation.toJson()}
|
|
};
|
|
}
|
|
|
|
Sanitation Sanitation::fromJson(const QJsonObject &obj)
|
|
{
|
|
Sanitation ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("originatorEquipmentNumber"), ret.originatorEquipmentNumber);
|
|
get(obj, QStringLiteral("uniqeId"), ret.uniqeId);
|
|
get(obj, QStringLiteral("proceduresTaken"), ret.proceduresTaken);
|
|
get(obj, QStringLiteral("sanitationResult"), ret.sanitationResult);
|
|
get(obj, QStringLiteral("sanitationEvaluation"), ret.sanitationEvaluation);
|
|
get(obj, QStringLiteral("qualification"), ret.qualification);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject Sanitation::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("originatorEquipmentNumber"), originatorEquipmentNumber},
|
|
{QStringLiteral("uniqeId"), uniqeId},
|
|
{QStringLiteral("proceduresTaken"), proceduresTaken},
|
|
{QStringLiteral("sanitationResult"), enumToJson(sanitationResult)},
|
|
{QStringLiteral("sanitationEvaluation"), enumToJson(sanitationEvaluation)},
|
|
{QStringLiteral("qualification"), enumToJson(qualification)}
|
|
};
|
|
}
|
|
|
|
BatteryInfo BatteryInfo::fromJson(const QJsonObject &obj)
|
|
{
|
|
BatteryInfo ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("batteryStates"), ret.batteryStates);
|
|
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject BatteryInfo::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("batteryStates"), arrayToJson(batteryStates)}
|
|
};
|
|
}
|
|
|
|
BatteryAlarm BatteryAlarm::fromJson(const QJsonObject &obj)
|
|
{
|
|
BatteryAlarm ret;
|
|
get(obj, QStringLiteral("header"), ret.m_header);
|
|
get(obj, QStringLiteral("id"), ret.m_id);
|
|
get(obj, QStringLiteral("description"), ret.m_description);
|
|
get(obj, QStringLiteral("acknowledge"), ret.m_acknowledge);
|
|
get(obj, QStringLiteral("condition"), ret.m_condition);
|
|
get(obj, QStringLiteral("uniqueAlarmNumber"), ret.m_uniqueAlarmNumber);
|
|
get(obj, QStringLiteral("alarmTime"), ret.m_alarmTime);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject BatteryAlarm::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header().toJson()},
|
|
{QStringLiteral("id"), m_id},
|
|
{QStringLiteral("description"), description()},
|
|
{QStringLiteral("acknowledge"), acknowledge()},
|
|
{QStringLiteral("condition"), condition()},
|
|
{QStringLiteral("uniqueAlarmNumber"), uniqueAlarmNumber()},
|
|
{QStringLiteral("alarmTime"), alarmTime()}
|
|
};
|
|
}
|
|
|
|
ServiceControl ServiceControl::fromJson(const QJsonObject &obj)
|
|
{
|
|
ServiceControl ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("serviceControlState"), ret.serviceControlState);
|
|
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ServiceControl::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("serviceControlState"), enumToJson(serviceControlState)}
|
|
};
|
|
}
|
|
|
|
SetDevicePowerRequest SetDevicePowerRequest::fromJson(const QJsonObject &obj)
|
|
{
|
|
SetDevicePowerRequest ret;
|
|
get(obj, QStringLiteral("header"), ret.header);
|
|
get(obj, QStringLiteral("powerType"), ret.powerType);
|
|
get(obj, QStringLiteral("subdeviceId"), ret.subdeviceId);
|
|
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject SetDevicePowerRequest::toJson() const
|
|
{
|
|
return QJsonObject{{QStringLiteral("header"), header.toJson()},
|
|
{QStringLiteral("powerType"), enumToJson(powerType)},
|
|
{QStringLiteral("subdeviceId"), subdeviceId}
|
|
};
|
|
}
|
|
|
|
RestoreRadioReadiness RestoreRadioReadiness::fromJson(const QJsonObject &obj)
|
|
{
|
|
RestoreRadioReadiness ret;
|
|
|
|
get(obj, HEADER(), ret.header);
|
|
get(obj, READINESS_LOSS_POSITION(), ret.readinessLossPosition);
|
|
get(obj, READINESS_LOSS_TIME(), ret.readinessLossTime);
|
|
get(obj, READINESS_RESTORE_POSITION(), ret.readinessRestorePosition);
|
|
get(obj, READINESS_RESTORE_TIME(), ret.readinessRestoreTime);
|
|
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject RestoreRadioReadiness::toJson() const
|
|
{
|
|
return QJsonObject{{HEADER(), header.toJson()},
|
|
{READINESS_LOSS_POSITION(), readinessLossPosition.toJson()},
|
|
{READINESS_LOSS_TIME(), readinessLossTime},
|
|
{READINESS_RESTORE_POSITION(), readinessRestorePosition.toJson()},
|
|
{READINESS_RESTORE_TIME(), readinessRestoreTime}
|
|
};
|
|
}
|
|
|
|
|
|
UAVAction UAVAction::fromJson(const QJsonObject &obj)
|
|
{
|
|
UAVAction ret;
|
|
|
|
get(obj, TASK(), ret.task);
|
|
get(obj, POSITION(), ret.absPosition);
|
|
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject UAVAction::toJson() const
|
|
{
|
|
return QJsonObject{{TASK(), enumToJson(task)},
|
|
{POSITION(), absPosition.toJson()}};
|
|
}
|
|
|
|
|
|
UAVPerformMission UAVPerformMission::fromJson(const QJsonObject &obj)
|
|
{
|
|
UAVPerformMission ret;
|
|
|
|
get(obj, HEADER(), ret.header);
|
|
get(obj, ACTIONS(), ret.actions);
|
|
get(obj, MISSION_NAME(), ret.missionName);
|
|
get(obj, MISSION_ID(), ret.missionId);
|
|
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject UAVPerformMission::toJson() const
|
|
{
|
|
return QJsonObject{{HEADER(), header.toJson()},
|
|
{ACTIONS(), arrayToJson(actions)},
|
|
{MISSION_NAME(), missionName},
|
|
{MISSION_ID(), missionId}};
|
|
}
|
|
|
|
|
|
|
|
UAVStatus UAVStatus::fromJson(const QJsonObject &obj)
|
|
{
|
|
UAVStatus ret;
|
|
|
|
get(obj, HEADER(), ret.header);
|
|
get(obj, UAVSTATE(), ret.uavState);
|
|
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject UAVStatus::toJson() const
|
|
{
|
|
return QJsonObject{{HEADER(), header.toJson()},
|
|
{UAVSTATE(), enumToJson(uavState)}};
|
|
}
|
|
|
|
|
|
|
|
UAVRadioLinkConnectionStatus UAVRadioLinkConnectionStatus::fromJson(const QJsonObject &obj)
|
|
{
|
|
UAVRadioLinkConnectionStatus ret;
|
|
|
|
get(obj, HEADER(), ret.header);
|
|
get(obj, UAVCONNECTIONSTATE(), ret.uavConnectionState);
|
|
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject UAVRadioLinkConnectionStatus::toJson() const
|
|
{
|
|
return QJsonObject{{HEADER(), header.toJson()},
|
|
{UAVCONNECTIONSTATE(), enumToJson(uavConnectionState)}};
|
|
}
|
|
|
|
|
|
|
|
UAVMissionStatus UAVMissionStatus::fromJson(const QJsonObject &obj)
|
|
{
|
|
UAVMissionStatus ret;
|
|
|
|
get(obj, HEADER(), ret.header);
|
|
get(obj, CURRENT_ACTION(), ret.currentAction);
|
|
get(obj, CURRENT_MISSION_NAME(), ret.currentMissionName);
|
|
get(obj, MISSION_ENDED(), ret.missionEnded);
|
|
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject UAVMissionStatus::toJson() const
|
|
{
|
|
return QJsonObject{{HEADER(), header.toJson()},
|
|
{CURRENT_ACTION(), enumToJson(currentAction)},
|
|
{CURRENT_MISSION_NAME(), currentMissionName},
|
|
{MISSION_ENDED(), missionEnded}};
|
|
}
|
|
|
|
|
|
UAVChangeState UAVChangeState::fromJson(const QJsonObject &obj)
|
|
{
|
|
UAVChangeState ret;
|
|
|
|
get(obj, HEADER(), ret.header);
|
|
get(obj, REQUESTED_STATE(), ret.requestedState);
|
|
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject UAVChangeState::toJson() const
|
|
{
|
|
return QJsonObject{{HEADER(), header.toJson()},
|
|
{REQUESTED_STATE(), enumToJson(requestedState)}};
|
|
}
|
|
|
|
ExFireReadiness ExFireReadiness::fromJson(const QJsonObject &obj)
|
|
{
|
|
ExFireReadiness ret;
|
|
|
|
get(obj, HEADER(), ret.header);
|
|
get(obj, PARTY_ID(), ret.partyId);
|
|
get(obj, REFERENCE(), ret.reference);
|
|
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ExFireReadiness::toJson() const
|
|
{
|
|
return QJsonObject{{HEADER(), header.toJson()},
|
|
{PARTY_ID(), partyId},
|
|
{REFERENCE(), reference}};
|
|
}
|
|
|
|
ExFiredReport ExFiredReport::fromJson(const QJsonObject &obj)
|
|
{
|
|
ExFiredReport ret;
|
|
|
|
get(obj, HEADER(), ret.header);
|
|
get(obj, PARTY_ID(), ret.partyId);
|
|
get(obj, REFERENCE(), ret.reference);
|
|
get(obj, UNIT_IDENTIFIER(), ret.unitIdentifier);
|
|
get(obj, IDENTIFIER(), ret.identifier);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ExFiredReport::toJson() const
|
|
{
|
|
return QJsonObject{{HEADER(), header.toJson()},
|
|
{PARTY_ID(), partyId},
|
|
{REFERENCE(), reference},
|
|
{UNIT_IDENTIFIER(), unitIdentifier},
|
|
{IDENTIFIER(), identifier}};
|
|
}
|
|
|
|
ExConfirmationReport ExConfirmationReport::fromJson(const QJsonObject &obj)
|
|
{
|
|
ExConfirmationReport ret;
|
|
|
|
get(obj, HEADER(), ret.header);
|
|
get(obj, PARTY_ID(), ret.partyId);
|
|
get(obj, REFERENCE(), ret.reference);
|
|
get(obj, UNIT_IDENTIFIER(), ret.unitIdentifier);
|
|
get(obj, IDENTIFIER(), ret.identifier);
|
|
return ret;
|
|
}
|
|
|
|
QJsonObject ExConfirmationReport::toJson() const
|
|
{
|
|
return QJsonObject{{HEADER(), header.toJson()},
|
|
{PARTY_ID(), partyId},
|
|
{REFERENCE(), reference},
|
|
{UNIT_IDENTIFIER(), unitIdentifier},
|
|
{IDENTIFIER(), identifier}};
|
|
}
|
|
|
|
} // namespace TetraIcd
|
|
} // namespace TrainingAreaBase
|