/** * Class for reading oc data * $Id: handler_oc_situation_data.h 57655 2022-07-20 11:38:28Z karwat $ * $HeadURL: svn://192.168.133.21/TDS/branches/product/features/3dws_devel/Lts/Services/OcSituationClient/handler_oc_situation_data.h $ * $Author: karwat $ * Created by Hannes Fritsche, SLTE, 30-08-2023 */ #pragma once #include #include "AreaEffectSimulation/aes_dtc.h" #include "OcSituationServer/oc_situation.h" #include "logger.h" namespace OcSituationClient { class CentralAesByteReader { public: struct RemoveMessage { qint32 aesItemId; AreaEffectSimulation::AesType aesType; RemoveMessage(qint32 aesItemId, AreaEffectSimulation::AesType aesType) : aesItemId(aesItemId) , aesType(aesType) {} RemoveMessage() : RemoveMessage(-1, AreaEffectSimulation::AesType::inner_enum::AtUnknown) {} }; explicit CentralAesByteReader(const QByteArray &data); bool getRemoveMessage(size_t &pos, RemoveMessage &removeMessage) const; bool getNContamination(size_t &pos, AreaEffectSimulation::NContaminationModifyRequest &nContamination) const; bool getBCContamination(size_t &pos, AreaEffectSimulation::BCContaminationModifyRequest &bCContamination) const; bool getExplosionArea(size_t &pos, AreaEffectSimulation::ExplosionAreaModifyRequest &explosionArea) const; bool getExplosionSingle(size_t &pos, AreaEffectSimulation::ExplosionSingleModifyRequest &explosionSingle) const; bool getMineArea(size_t &pos, AreaEffectSimulation::MineAreaModifyRequest &mineArea) const; bool getFunctionalArea(size_t &pos, AreaEffectSimulation::FunctionalAreaModifyRequest &functionalArea) const; bool getBoobyTrap(size_t &pos, AreaEffectSimulation::BoobyTrapModifyRequest &boobyTrap) const; bool getOffRouteMine(size_t &pos, AreaEffectSimulation::OffRouteMineModifyRequest &offRouteMine) const; bool getExplosionCluster(size_t &pos, AreaEffectSimulation::ExplosionClusterOcModifyRequest &explosionCluster) const; bool getAesType(size_t &pos, AreaEffectSimulation::AesType &aesType) const; bool getCentralAesChangeType(size_t &pos, OcSituation::CentralAesChangeType &changeType) const; private: bool getAesItemId(size_t &pos, int32_t &aesItemId) const; bool getAesMaLayingProcedureType(size_t &pos, AreaEffectSimulation::AesMaLayingProcedureType &aesMaLayingProcedureType) const; bool getAltitude(size_t &pos, int32_t &altitude) const; bool getArea(size_t &pos, AreaEffectSimulation::Area &area) const; bool getBorderLengthInner(size_t &pos, double &borderLengthInner) const; bool getBorderLengthOuter(size_t &pos, double &borderLengthOuter) const; bool getCannonCount(size_t &pos, int32_t &cannonCount) const; bool getCannonRounds(size_t &pos, int32_t &cannonRounds) const; bool getChargeTypeId(size_t &pos, int32_t &chargeType) const; bool getCentralAngle(size_t &pos, double ¢ralAngle) const; template bool getDdsEnumVal(size_t &pos, T &ddsEnumVal) const; bool getDeconMode(size_t &pos, AreaEffectSimulation::AesOperatingMode &deconMode) const; bool getDeconTime(size_t &pos, int32_t &deconTime) const; bool getDensity(size_t &pos, double &density) const; bool getDetonationValue(size_t &pos, double &detonationValue) const; bool getEffectDuration(size_t &pos, int32_t &effectDuration) const; bool getEffectStart(size_t &pos, rti::core::int64 &effectStart) const; bool getExplosionGeometry(size_t &pos, AreaEffectSimulation::AesExplosionGeometry &explosionGeometry) const; bool getFireRequestTime(size_t &pos, rti::core::int64 &fireRequestTime) const; bool getFunctionalAreaTypeId(size_t &pos, int32_t &functionalAreaTypeId) const; bool getIgniterType(size_t &pos, int32_t igniterTypeId) const; bool getImpactCount(size_t &pos, int32_t &impactCount) const; bool getImpactPosition(size_t &pos, Core::GeoPosition2D &position) const; bool getImpactRadius(size_t &pos, double &impactRadius) const; bool getIsCenterLine(size_t &pos, bool &isCenterLine) const; bool getIsLayedHidden(size_t &pos, bool &isLayedHidden) const; bool getMaintMode(size_t &pos, AreaEffectSimulation::AesOperatingMode &maintMode) const; bool getMaintTime(size_t &pos, int32_t &maintTime) const; bool getMedicMode(size_t &pos, AreaEffectSimulation::AesOperatingMode &medicMode) const; bool getMedicTime(size_t &pos, int32_t &medicTime) const; bool getMhpCount(size_t &pos, int32_t &mhpCount) const; bool getMhpRotation(size_t &pos, double &mhpRotation) const; bool getName(size_t &pos, std::string &name) const; template bool getOptionalNumber(size_t &pos, rti::core::optional &optionalNumber, bool(CentralAesByteReader::*method)(size_t &pos, T &number) const) const; bool getPartyId(size_t &pos, int32_t &partyId) const; bool getPointSymbol(size_t &pos, std::string &pointSymbol) const; bool getPosition2D(size_t &pos, Core::GeoPosition2D &position) const; bool getPropagationDirection(size_t &pos, double &propagationDirection) const; bool getPurpose(size_t &pos, std::string &purpose) const; bool getRotationAngle(size_t &pos, double &rotationAngle) const; bool getSegments(size_t &pos, std::vector &segments) const; bool getSpanAngle(size_t &pos, double &spanAngle) const; bool getString(size_t &pos, std::string &str) const; bool getTriggerRadius(size_t &pos, double &triggerRadius) const; bool getWidth(size_t &pos, double &width) const; bool getWindSpeed(size_t &pos, double &windSpeed) const; private: const QByteArray m_data; LOGGER_T &m_logger; }; } // namespace OcSituationClient