Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+1387
File diff suppressed because it is too large.
Load diff
+452
@@ -0,0 +1,452 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Class Sidc2525Delta
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
// Own
|
||||
#include "advanced_symbology_export.h"
|
||||
#include "../SymbologyImpl/advanced_symbology_logging.h" // ToDo
|
||||
|
||||
|
||||
// Qt
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
namespace AdvancedSymbology
|
||||
{
|
||||
|
||||
//
|
||||
// Version : digit 1,2
|
||||
//
|
||||
|
||||
|
||||
|
||||
//
|
||||
// StandardIdentity : digit 3,4
|
||||
//
|
||||
|
||||
enum class ShapeType
|
||||
{
|
||||
UNDEFINED,
|
||||
CIRCLE,
|
||||
CLOVER,
|
||||
CURVE,
|
||||
DIAMOND,
|
||||
RECTANGLE,
|
||||
SQUARE
|
||||
};
|
||||
QLatin1String ADVANCED_SYMBOLOGY_EXPORT toString(ShapeType value);
|
||||
|
||||
// StandardIdentity, 1st digit
|
||||
enum class Context
|
||||
{
|
||||
Reality, ///< 0
|
||||
Exercise, ///< 1
|
||||
Simulation ///< 2
|
||||
};
|
||||
QLatin1String ADVANCED_SYMBOLOGY_EXPORT toString(Context value);
|
||||
QVector<Context> ADVANCED_SYMBOLOGY_EXPORT contexts();
|
||||
|
||||
// StandardIdentity, 2nd digit
|
||||
enum class Identity
|
||||
{
|
||||
Pending, ///< 0
|
||||
Unknown, ///< 1
|
||||
|
||||
AssumedFriend, ///< 2
|
||||
Friend, ///< 3
|
||||
|
||||
Neutral, ///< 4
|
||||
|
||||
SuspectJoker, ///< 5
|
||||
HostileFaker ///< 6
|
||||
};
|
||||
QLatin1String ADVANCED_SYMBOLOGY_EXPORT toString(Identity value);
|
||||
QVector<Identity> ADVANCED_SYMBOLOGY_EXPORT identities();
|
||||
|
||||
|
||||
struct ADVANCED_SYMBOLOGY_EXPORT StandardIdentity
|
||||
{
|
||||
Context context = Context::Reality; ///< 1st digit
|
||||
Identity identity = Identity::Unknown; ///< 2nd digit
|
||||
void init();
|
||||
ShapeType getShape() const; // BattleDimension missing!!!!!!!
|
||||
};
|
||||
//
|
||||
// : StandardIdentity
|
||||
//
|
||||
|
||||
|
||||
//
|
||||
// Symbol Set : digit 5,6
|
||||
//
|
||||
enum class SymbolSet
|
||||
{
|
||||
Unknown, ///< 0
|
||||
Air,
|
||||
AirMissle,
|
||||
Space = 5,
|
||||
SpaceMissle,
|
||||
LandUnit = 10,
|
||||
LandCivilian_UnitOrganisation,
|
||||
LandEquipment = 15,
|
||||
LandInstallation = 20,
|
||||
ControlMeasure = 25,
|
||||
SeaSurface = 30,
|
||||
SeaSubSurface = 35,
|
||||
MineWarfare,
|
||||
Activities = 40,
|
||||
Atmospheric = 45,
|
||||
Oceanographic,
|
||||
MeteorologicalSpace = 50,
|
||||
SignalsIntelligence_Space,
|
||||
SignalsIntelligence_Air,
|
||||
SignalsIntelligence_Land,
|
||||
SignalsIntelligence_Surface,
|
||||
SignalsIntelligence_Subsurface,
|
||||
Cyberspace = 60
|
||||
};
|
||||
QLatin1String ADVANCED_SYMBOLOGY_EXPORT toString(SymbolSet value);
|
||||
QVector<SymbolSet> ADVANCED_SYMBOLOGY_EXPORT symbolSets();
|
||||
|
||||
template<typename T> SymbolSet castToSymbolSet(T value)
|
||||
{
|
||||
SymbolSet symbolSet = static_cast<SymbolSet>(value);
|
||||
if (!symbolSets().contains(symbolSet)) symbolSet = SymbolSet::Unknown;
|
||||
return symbolSet;
|
||||
} // template<typename T> SymbolSet castToSymbolSet(T value)
|
||||
|
||||
|
||||
//
|
||||
// Status : digit 7
|
||||
//
|
||||
enum class Status
|
||||
{
|
||||
Present = 0, ///< exeption, no Unknown
|
||||
Planned_Anticipated_Suspect = 1,
|
||||
Present_FullCapable = 2,
|
||||
Present_Damaged = 3,
|
||||
Present_Destroyed = 4,
|
||||
Present_FullToCapacity = 5
|
||||
};
|
||||
QLatin1String ADVANCED_SYMBOLOGY_EXPORT toString(Status value);
|
||||
QVector<Status> ADVANCED_SYMBOLOGY_EXPORT statuss();
|
||||
|
||||
|
||||
|
||||
//
|
||||
// HQ TF Dummy : digit 8
|
||||
//
|
||||
enum class HQTFDummy
|
||||
{
|
||||
Unknown, ///< 0
|
||||
FeintDummy, ///< 1
|
||||
Headquarters, ///< 2
|
||||
FeintDummy_Headquarters, ///< 3
|
||||
TaskForce, ///< 4
|
||||
FeintDummy_TaskForce, ///< 5
|
||||
TaskForce_Headquarters, ///< 6
|
||||
FeintDummy_TaskForce_Headquarters, ///< 7
|
||||
};
|
||||
QLatin1String ADVANCED_SYMBOLOGY_EXPORT toString(HQTFDummy value);
|
||||
QVector<HQTFDummy> ADVANCED_SYMBOLOGY_EXPORT hQTFDummy();
|
||||
|
||||
|
||||
//
|
||||
// Amplifier : digit 9,10
|
||||
//
|
||||
|
||||
// Amplifier-Group : 1st digit
|
||||
enum class AmplifierGroup
|
||||
{
|
||||
Unknown,
|
||||
|
||||
Echelon_BrigadeAndBelow,
|
||||
Echelon_DivisionAndAbove,
|
||||
|
||||
Mobility_OnLand,
|
||||
Mobility_OnSnow,
|
||||
Mobility_OnWater,
|
||||
|
||||
Naval_TowedArry,
|
||||
};
|
||||
QLatin1String ADVANCED_SYMBOLOGY_EXPORT toString(AmplifierGroup value);
|
||||
QVector<AmplifierGroup> ADVANCED_SYMBOLOGY_EXPORT amplifierGroups();
|
||||
|
||||
// Depending on AmplifierGroup :
|
||||
// Amplifier-Echelon/Mobility/Naval - 2nd digit
|
||||
|
||||
enum class EchelonBrigadeAndBelow
|
||||
{
|
||||
Unknown = 0,
|
||||
TeamCrew,
|
||||
Squad,
|
||||
Section,
|
||||
PlatoonDetachment,
|
||||
BattalionSquadron,
|
||||
CompanyBatteryTroop,
|
||||
RegimentGroup,
|
||||
Brigade
|
||||
};
|
||||
QLatin1String ADVANCED_SYMBOLOGY_EXPORT toString(EchelonBrigadeAndBelow value);
|
||||
QVector<EchelonBrigadeAndBelow> ADVANCED_SYMBOLOGY_EXPORT echelonBrigadeAndBelows();
|
||||
|
||||
// OR
|
||||
|
||||
enum class EchelonDivisionAndAbove
|
||||
{
|
||||
Unknown = 0,
|
||||
Division,
|
||||
CorpsMEF,
|
||||
Army,
|
||||
Army_GroupFront,
|
||||
RegionTheater,
|
||||
Command
|
||||
};
|
||||
QLatin1String ADVANCED_SYMBOLOGY_EXPORT toString(EchelonDivisionAndAbove value);
|
||||
QVector<EchelonDivisionAndAbove> ADVANCED_SYMBOLOGY_EXPORT echelonDivisionAndAboves();
|
||||
|
||||
|
||||
// OR
|
||||
|
||||
enum class MobilityOnLand
|
||||
{
|
||||
Unknown = 0,
|
||||
WheeledLimitedCrossCountry,
|
||||
WheeledCrossCountry,
|
||||
Tracked,
|
||||
WheeledAndTrackedCombination,
|
||||
Towed,
|
||||
Rail,
|
||||
PackAnimal
|
||||
};
|
||||
QLatin1String ADVANCED_SYMBOLOGY_EXPORT toString(MobilityOnLand value);
|
||||
QVector<MobilityOnLand> ADVANCED_SYMBOLOGY_EXPORT mobilityOnLands();
|
||||
|
||||
// OR
|
||||
|
||||
enum class MobilityOnSnow
|
||||
{
|
||||
Unknown = 0,
|
||||
OverSnow,
|
||||
Sled
|
||||
};
|
||||
QLatin1String ADVANCED_SYMBOLOGY_EXPORT toString(MobilityOnSnow value);
|
||||
QVector<MobilityOnSnow> ADVANCED_SYMBOLOGY_EXPORT mobilityOnSnows();
|
||||
|
||||
|
||||
// OR
|
||||
|
||||
enum class MobilityOnWater
|
||||
{
|
||||
Unknown = 0,
|
||||
Barge,
|
||||
Amphibious
|
||||
};
|
||||
QLatin1String ADVANCED_SYMBOLOGY_EXPORT toString(MobilityOnWater value);
|
||||
QVector<MobilityOnWater> ADVANCED_SYMBOLOGY_EXPORT mobilityOnWaters();
|
||||
|
||||
// OR
|
||||
|
||||
enum class NavalTowedArray
|
||||
{
|
||||
Unknown = 0,
|
||||
ShortTowedArray,
|
||||
LongTowedArray
|
||||
};
|
||||
QLatin1String ADVANCED_SYMBOLOGY_EXPORT toString(NavalTowedArray value);
|
||||
QVector<NavalTowedArray> ADVANCED_SYMBOLOGY_EXPORT navalTowedArrays();
|
||||
|
||||
//
|
||||
// : Amplifier
|
||||
//
|
||||
|
||||
|
||||
/**
|
||||
* @brief The Sidc2525Delta class
|
||||
*
|
||||
* Support functions:
|
||||
* Digit Name enum toString Contnr set/getXY Converter
|
||||
* XYs() toChar/fromChar
|
||||
* // SET A
|
||||
* 1,2 Version + + + + irrelevant
|
||||
* 3,4 StdIdentity + + + + +
|
||||
* 5,6 SymbolSet + + + + -
|
||||
* 7 Status + + + + -
|
||||
* 8 HqTfDummy + + + + + (to be cont.)
|
||||
* 9 AmplifierGrp + + + + (to be cont.)
|
||||
* 10 Amplifier... + + + - -
|
||||
* // SET B
|
||||
* ...
|
||||
*
|
||||
* -> toSidc will evaluate: StdIdentity, hqTfFd(execpt Amplifier)
|
||||
*/
|
||||
class ADVANCED_SYMBOLOGY_EXPORT Sidc2525Delta final
|
||||
{
|
||||
public:
|
||||
|
||||
Sidc2525Delta(qint32 partA = _specialPartA, qint32 partB = _invalidPartB);
|
||||
|
||||
void setSidc(const QString &sidcMIL2525D)
|
||||
{
|
||||
initFromMil2525D(sidcMIL2525D);
|
||||
}
|
||||
|
||||
bool initFromMil2525D(const QString &sidcMIL2525D);
|
||||
bool initFromMil2525DBaseSymbolCode(const QString &sidcMIL2525D_baseSymbolCode);
|
||||
|
||||
void setLegacySidc(const QString &legacySidcMIL2525);
|
||||
|
||||
~Sidc2525Delta() = default;
|
||||
|
||||
|
||||
bool analyzeLegacySidc();
|
||||
|
||||
static StandardIdentity legacyToStandardIdentity(const QChar &ch);
|
||||
|
||||
bool legacySymbolModifier(const QChar &c1, const QChar &c2);
|
||||
bool legacySymbolModifier(const QString &str);
|
||||
|
||||
QString toSidc() const;
|
||||
|
||||
|
||||
// !!! Attention: digit count starts with 1, not with 0!!!
|
||||
|
||||
//
|
||||
// Set A, digit 1,2
|
||||
//
|
||||
// Version
|
||||
|
||||
|
||||
//
|
||||
// Set A, digit 3,4
|
||||
//
|
||||
// StandardIdentity
|
||||
StandardIdentity standardIdentity() const; // 1st and 2nd
|
||||
void setStandardIdentity(const StandardIdentity &standardIdentity);
|
||||
|
||||
//
|
||||
// Set A, digit 5,6
|
||||
//
|
||||
// SymbolSet
|
||||
SymbolSet symbolSet() const;
|
||||
void setSymbolSet(const SymbolSet &symbolSet);
|
||||
// QChar symbolSetString() const;
|
||||
|
||||
//
|
||||
// Set A, digit 7
|
||||
//
|
||||
// Status
|
||||
Status status() const;
|
||||
void setStatus(const Status &status);
|
||||
// QChar statusString() const;
|
||||
|
||||
//
|
||||
// Set A, digit 8
|
||||
//
|
||||
// HQTFDummy
|
||||
HQTFDummy hqTfFd() const;
|
||||
uint hqTfFd_UInt() const;
|
||||
void setHqTfFd(const HQTFDummy &hqTfFd);
|
||||
|
||||
bool headquarters() const;
|
||||
bool taskForce() const;
|
||||
bool feintDummy() const;
|
||||
|
||||
|
||||
// bool installation() const
|
||||
// {
|
||||
// return m_installation;
|
||||
// }
|
||||
// void setInstallation(bool installation)
|
||||
// {
|
||||
// m_installation = installation;
|
||||
// }
|
||||
|
||||
|
||||
//
|
||||
// Set A, digit 9, 10
|
||||
//
|
||||
AmplifierGroup amplifierGroup() const; // digit 9
|
||||
void setAmplifierGroup(const AmplifierGroup &lifierGroup);
|
||||
|
||||
unsigned int amplifier2ndDigit() const;
|
||||
void setAmplifier2ndDigit(unsigned int amplifierSecondDigit);
|
||||
|
||||
// quint32 amplifier_UInt(QString *str = nullptr) const; // digit 9,10
|
||||
// QString amplifier_String() const; // digit 9,10
|
||||
|
||||
unsigned int sectorModifier1Digit();
|
||||
unsigned int sectorModifier2Digit();
|
||||
|
||||
void setSectorModifier1Digit( unsigned int );
|
||||
void setSectorModifier2Digit( unsigned int );
|
||||
|
||||
private:
|
||||
void init();
|
||||
void initAmplifier();
|
||||
|
||||
QString m_first10;
|
||||
QString m_second10;
|
||||
|
||||
|
||||
//
|
||||
// SET A :
|
||||
//
|
||||
|
||||
|
||||
// HQTFFD
|
||||
// bool m_installation; ///< Installation
|
||||
|
||||
|
||||
|
||||
// Amplifier (Echelon/Mobility/TowedArray)
|
||||
AmplifierGroup m_amplifierGroup;
|
||||
EchelonBrigadeAndBelow m_e_BrigadeAndBelow;
|
||||
EchelonDivisionAndAbove m_e_DivisionAndAbove;
|
||||
MobilityOnLand m_e_MobilityOnLand;
|
||||
MobilityOnSnow m_e_MobilityOnSnow;
|
||||
MobilityOnWater m_e_MobilityOnWater;
|
||||
NavalTowedArray m_e_NavalTowedArray;
|
||||
|
||||
|
||||
//
|
||||
// : SET A
|
||||
//
|
||||
|
||||
|
||||
//
|
||||
// SET B :
|
||||
//
|
||||
//
|
||||
// : SET B
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
QString m_legacySidc; //to be removed ///< Based on MIL2525C
|
||||
|
||||
|
||||
static qint32 _smallest;
|
||||
static qint32 _specialPartA;
|
||||
static qint32 _invalidPartB;
|
||||
static qint32 _retiredPartB;
|
||||
|
||||
|
||||
LOGGER_T m_logger; ///< Interface of the Logging-Facility
|
||||
};
|
||||
|
||||
|
||||
ADVANCED_SYMBOLOGY_EXPORT std::ostream &operator<< (std::ostream &stream, const AdvancedSymbology::ShapeType &value);
|
||||
ADVANCED_SYMBOLOGY_EXPORT std::ostream &operator<< (std::ostream &stream, const AdvancedSymbology::Identity &value);
|
||||
ADVANCED_SYMBOLOGY_EXPORT std::ostream &operator<< (std::ostream &stream, const AdvancedSymbology::SymbolSet &value);
|
||||
ADVANCED_SYMBOLOGY_EXPORT std::ostream &operator<< (std::ostream &stream, const AdvancedSymbology::Status &value);
|
||||
|
||||
|
||||
} // namespace AdvancedSymbology
|
||||
Reference in new issue
Block a user