1388 lines
40 KiB
C++
Executable File
1388 lines
40 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Class Sidc2525Delta
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
// Own
|
|
#include "sidc2525_delta.h"
|
|
|
|
|
|
// ESRI
|
|
|
|
|
|
// Qt
|
|
#include <QMap>
|
|
#include <QPair>
|
|
#include <QDebug>
|
|
|
|
#include <sstream>
|
|
|
|
|
|
// 1234567890
|
|
qint32 AdvancedSymbology::Sidc2525Delta::_smallest = 1000000000;
|
|
qint32 AdvancedSymbology::Sidc2525Delta::_specialPartA = 1001980000;
|
|
qint32 AdvancedSymbology::Sidc2525Delta::_invalidPartB = 1000000000;
|
|
qint32 AdvancedSymbology::Sidc2525Delta::_retiredPartB = 1100000000;
|
|
|
|
|
|
|
|
QMap<int, QChar> s_standardIdentityCont;
|
|
QMap<int, QPair<QChar, QChar>> s_symbolModifierCont;
|
|
|
|
|
|
|
|
namespace AdvancedSymbology
|
|
{
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// StandardIdentityConverter
|
|
//-----------------------------------------------------------------------------
|
|
class StandardIdentityConverter
|
|
{
|
|
private:
|
|
static void init()
|
|
{
|
|
if (!s_standardIdentityCont.isEmpty())
|
|
{
|
|
return; // already filled
|
|
}
|
|
|
|
int key = 0;
|
|
|
|
key = (10 * (int)Context::Reality) + (int)Identity::Friend;
|
|
s_standardIdentityCont[key] = QLatin1Char('F');
|
|
key = (10 * (int)Context::Reality) + (int)Identity::HostileFaker;
|
|
s_standardIdentityCont[key] = QLatin1Char('H');
|
|
key = (10 * (int)Context::Reality) + (int)Identity::Unknown;
|
|
s_standardIdentityCont[key] = QLatin1Char('U');
|
|
key = (10 * (int)Context::Reality) + (int)Identity::Neutral;
|
|
s_standardIdentityCont[key] = QLatin1Char('N');
|
|
|
|
key = (10 * (int)Context::Reality) + (int)Identity::Pending;
|
|
s_standardIdentityCont[key] = QLatin1Char('P');
|
|
key = (10 * (int)Context::Reality) + (int)Identity::AssumedFriend;
|
|
s_standardIdentityCont[key] = QLatin1Char('A');
|
|
key = (10 * (int)Context::Reality) + (int)Identity::SuspectJoker;
|
|
s_standardIdentityCont[key] = QLatin1Char('S');
|
|
|
|
key = (10 * (int)Context::Exercise) + (int)Identity::Pending;
|
|
s_standardIdentityCont[key] = QLatin1Char('G');
|
|
key = (10 * (int)Context::Exercise) + (int)Identity::Unknown;
|
|
s_standardIdentityCont[key] = QLatin1Char('W');
|
|
key = (10 * (int)Context::Exercise) + (int)Identity::AssumedFriend;
|
|
s_standardIdentityCont[key] = QLatin1Char('M');
|
|
key = (10 * (int)Context::Exercise) + (int)Identity::Friend;
|
|
s_standardIdentityCont[key] = QLatin1Char('D');
|
|
key = (10 * (int)Context::Exercise) + (int)Identity::Neutral;
|
|
s_standardIdentityCont[key] = QLatin1Char('L');
|
|
key = (10 * (int)Context::Exercise) + (int)Identity::SuspectJoker;
|
|
s_standardIdentityCont[key] = QLatin1Char('J');
|
|
key = (10 * (int)Context::Exercise) + (int)Identity::HostileFaker;
|
|
s_standardIdentityCont[key] = QLatin1Char('K');
|
|
}
|
|
|
|
public:
|
|
static QChar toString(const StandardIdentity &standardIdentity)
|
|
{
|
|
init();
|
|
|
|
int key = (10 * (int)standardIdentity.context) + (int)standardIdentity.identity;
|
|
|
|
auto it = s_standardIdentityCont.constFind(key);
|
|
if (it != s_standardIdentityCont.constEnd())
|
|
return *it;
|
|
return QChar();
|
|
}
|
|
|
|
static StandardIdentity fromString(const QChar &ch)
|
|
{
|
|
init();
|
|
|
|
// define default:
|
|
StandardIdentity ident;
|
|
ident.context = Context::Reality;
|
|
|
|
int key = s_standardIdentityCont.key(ch, -1);
|
|
|
|
if (key >= 0)
|
|
{
|
|
int digitLeft = key / 10;
|
|
ident.context = static_cast<Context>(digitLeft);
|
|
|
|
int digitRight = key % 10;
|
|
ident.identity = static_cast<Identity>(digitRight);
|
|
}
|
|
else
|
|
{
|
|
LOGGER_T m_logger = getLogger("Sidc2525Delta");
|
|
ERROR_LOG(m_logger) << LOGFUNCTION
|
|
<< " not found, ch='" << QString(ch) << "'";
|
|
}
|
|
return ident;
|
|
}
|
|
|
|
}; // class StandardIdentityConverter
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// HQTFDummyConverter
|
|
//-----------------------------------------------------------------------------
|
|
class HQTFDummyConverter
|
|
{
|
|
static void init()
|
|
{
|
|
if (!::s_symbolModifierCont.isEmpty())
|
|
{
|
|
return; // already filled
|
|
}
|
|
|
|
::s_symbolModifierCont.clear();
|
|
int key = 0;
|
|
|
|
key = (1000 * (int)HQTFDummy::Unknown) + 10 * (int)AmplifierGroup::Unknown + (int)EchelonBrigadeAndBelow::Unknown;
|
|
::s_symbolModifierCont[key] = QPair<QChar, QChar> (QLatin1Char('-'), QLatin1Char('-'));
|
|
|
|
key = (1000 * (int)HQTFDummy::FeintDummy) + 10 * (int)AmplifierGroup::Unknown + (int)EchelonBrigadeAndBelow::Unknown;
|
|
::s_symbolModifierCont[key] = QPair<QChar, QChar> (QLatin1Char('F'), QLatin1Char('-'));
|
|
|
|
key = (1000 * (int)HQTFDummy::Headquarters) + 10 * (int)AmplifierGroup::Unknown + (int)EchelonBrigadeAndBelow::Unknown;
|
|
::s_symbolModifierCont[key] = QPair<QChar, QChar> (QLatin1Char('A'), QLatin1Char('-'));
|
|
|
|
key = (1000 * (int)HQTFDummy::FeintDummy_Headquarters) + 10 * (int)AmplifierGroup::Unknown + (int)EchelonBrigadeAndBelow::Unknown;
|
|
::s_symbolModifierCont[key] = QPair<QChar, QChar> (QLatin1Char('C'), QLatin1Char('-'));
|
|
|
|
|
|
key = (1000 * (int)HQTFDummy::TaskForce) + 10 * (int)AmplifierGroup::Unknown + (int)EchelonBrigadeAndBelow::Unknown;
|
|
::s_symbolModifierCont[key] = QPair<QChar, QChar> (QLatin1Char('E'), QLatin1Char('-'));
|
|
|
|
key = (1000 * (int)HQTFDummy::FeintDummy_TaskForce) + 10 * (int)AmplifierGroup::Unknown + (int)EchelonBrigadeAndBelow::Unknown;
|
|
::s_symbolModifierCont[key] = QPair<QChar, QChar> (QLatin1Char('G'), QLatin1Char('-'));
|
|
|
|
key = (1000 * (int)HQTFDummy::TaskForce_Headquarters) + 10 * (int)AmplifierGroup::Unknown + (int)EchelonBrigadeAndBelow::Unknown;
|
|
::s_symbolModifierCont[key] = QPair<QChar, QChar> (QLatin1Char('B'), QLatin1Char('-'));
|
|
|
|
key = (1000 * (int)HQTFDummy::FeintDummy_TaskForce_Headquarters) + 10 * (int)AmplifierGroup::Unknown + (int)EchelonBrigadeAndBelow::Unknown;
|
|
::s_symbolModifierCont[key] = QPair<QChar, QChar> (QLatin1Char('D'), QLatin1Char('-'));
|
|
|
|
// to be cont
|
|
|
|
|
|
}
|
|
|
|
public:
|
|
|
|
static uint toInt(const HQTFDummy &hqTfDummy)
|
|
{
|
|
return static_cast<uint>(hqTfDummy);
|
|
}
|
|
|
|
static void toBool(const HQTFDummy &hqTfDummy,
|
|
bool &headquarters,
|
|
bool &taskForce,
|
|
bool &feintDummy)
|
|
{
|
|
uint asInt = toInt(hqTfDummy);
|
|
headquarters = asInt & 2; // mask
|
|
taskForce = asInt & 4; // mask
|
|
feintDummy = asInt & 1; // mask
|
|
}
|
|
|
|
static uint toHqTfDummyAsInt(bool headquarters,
|
|
bool taskForce,
|
|
bool feintDummy)
|
|
{
|
|
uint hdtffd = 0;
|
|
|
|
if (headquarters) hdtffd += 2;
|
|
if (taskForce) hdtffd += 4;
|
|
if (feintDummy) ++hdtffd;
|
|
|
|
return hdtffd;
|
|
}
|
|
|
|
static HQTFDummy toHqTfDummy(bool headquarters,
|
|
bool taskForce,
|
|
bool feintDummy)
|
|
{
|
|
return static_cast<HQTFDummy>(toHqTfDummyAsInt(headquarters,
|
|
taskForce,
|
|
feintDummy));
|
|
}
|
|
|
|
static QPair<QChar, QChar> toChars(const HQTFDummy &hqTfDummy)
|
|
{
|
|
init();
|
|
|
|
int key = (1000 * (int)hqTfDummy) + 10 * (int)AmplifierGroup::Unknown + (int)EchelonBrigadeAndBelow::Unknown;
|
|
|
|
auto it = ::s_symbolModifierCont.constFind(key);
|
|
if (it != ::s_symbolModifierCont.constEnd())
|
|
return *it;
|
|
return QPair<QChar, QChar>(QChar(), QChar());
|
|
}
|
|
|
|
static QString toString(const HQTFDummy &hqTfDummy)
|
|
{
|
|
QPair<QChar, QChar> pair = toChars(hqTfDummy);
|
|
return QString(pair.first) + QString(pair.second);
|
|
}
|
|
|
|
// static QPair<QChar, QChar> fromString(const QPair<QChar, Char> &char)
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// Sidc2525Delta
|
|
//-----------------------------------------------------------------------------
|
|
//Sidc2525Delta::Sidc2525Delta()
|
|
// : m_logger(getLogger("Sidc2525Delta"))
|
|
//{
|
|
// TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
|
// init();
|
|
// TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
|
//}
|
|
|
|
Sidc2525Delta::Sidc2525Delta(qint32 partA, qint32 partB)
|
|
: m_logger(getLogger("Sidc2525Delta"))
|
|
{
|
|
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
|
init();
|
|
|
|
if (partA >= _smallest && partB >= _smallest)
|
|
{
|
|
m_first10 = QString(QLatin1String("%1")).arg(partA);
|
|
m_second10 = QString(QLatin1String("%1")).arg(partB);
|
|
}
|
|
else
|
|
{
|
|
m_first10 = QString(QLatin1String("%1")).arg(_specialPartA);
|
|
m_second10 = QString(QLatin1String("%1")).arg(_invalidPartB);
|
|
}
|
|
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
|
}
|
|
|
|
void Sidc2525Delta::setLegacySidc(const QString &legacySidcMIL2525)
|
|
{
|
|
return;
|
|
init();
|
|
m_legacySidc = legacySidcMIL2525;
|
|
}
|
|
|
|
void Sidc2525Delta::init()
|
|
{
|
|
m_first10 = QString(QLatin1String("%1")).arg(_specialPartA);
|
|
m_second10 = QString(QLatin1String("%1")).arg(_invalidPartB);
|
|
|
|
initAmplifier();
|
|
|
|
m_legacySidc.clear();
|
|
}
|
|
|
|
void Sidc2525Delta::initAmplifier()
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Unknown;
|
|
|
|
m_e_BrigadeAndBelow = EchelonBrigadeAndBelow::Unknown;
|
|
m_e_DivisionAndAbove = EchelonDivisionAndAbove::Unknown;
|
|
|
|
m_e_MobilityOnLand = MobilityOnLand::Unknown;
|
|
m_e_MobilityOnSnow = MobilityOnSnow::Unknown;
|
|
m_e_MobilityOnWater = MobilityOnWater::Unknown;
|
|
|
|
m_e_NavalTowedArray = NavalTowedArray::Unknown;
|
|
}
|
|
|
|
|
|
|
|
|
|
StandardIdentity Sidc2525Delta::standardIdentity() const
|
|
{
|
|
StandardIdentity si;
|
|
si.context = static_cast<Context>(QStringRef(&m_first10, 2, 1).toString().toInt());
|
|
si.identity = static_cast<Identity>(QStringRef(&m_first10, 3, 1).toString().toInt());
|
|
return si;
|
|
}
|
|
|
|
void Sidc2525Delta::setStandardIdentity(const StandardIdentity &standardIdentity)
|
|
{
|
|
m_first10.replace(2, 1, QString(QLatin1String("%1")).arg((int)standardIdentity.context));
|
|
m_first10.replace(3, 1, QString(QLatin1String("%1")).arg((int)standardIdentity.identity));
|
|
}
|
|
|
|
|
|
SymbolSet Sidc2525Delta::symbolSet() const
|
|
{
|
|
SymbolSet sset = static_cast<SymbolSet>(QStringRef(&m_first10, 4, 2).toString().toInt());
|
|
return sset;
|
|
}
|
|
void Sidc2525Delta::setSymbolSet(const SymbolSet &symbolSet)
|
|
{
|
|
m_first10.replace(4, 2, QString(QLatin1String("%1")).arg((int)symbolSet));
|
|
}
|
|
|
|
|
|
Status Sidc2525Delta::status() const
|
|
{
|
|
Status status = static_cast<Status>(QStringRef(&m_first10, 6, 1).toString().toInt());
|
|
return status;
|
|
}
|
|
|
|
void Sidc2525Delta::setStatus(const Status &status)
|
|
{
|
|
m_first10.replace(6, 1, QString(QLatin1String("%1")).arg((int)status));
|
|
}
|
|
|
|
|
|
HQTFDummy Sidc2525Delta::hqTfFd() const
|
|
{
|
|
HQTFDummy hdtffd = static_cast<HQTFDummy>(QStringRef(&m_first10, 7, 1).toString().toInt());
|
|
return hdtffd;
|
|
}
|
|
|
|
uint Sidc2525Delta::hqTfFd_UInt() const
|
|
{
|
|
return static_cast<int>(hqTfFd());
|
|
}
|
|
|
|
void Sidc2525Delta::setHqTfFd(const HQTFDummy &hqTfFd)
|
|
{
|
|
m_first10.replace(7, 1, QString(QLatin1String("%1")).arg((int)hqTfFd));
|
|
}
|
|
|
|
bool Sidc2525Delta::headquarters() const
|
|
{
|
|
bool headquarters;
|
|
bool taskForce;
|
|
bool feintDummy;
|
|
HQTFDummyConverter::toBool(hqTfFd(), headquarters, taskForce, feintDummy);
|
|
return headquarters;
|
|
}
|
|
|
|
bool Sidc2525Delta::taskForce() const
|
|
{
|
|
bool headquarters;
|
|
bool taskForce;
|
|
bool feintDummy;
|
|
HQTFDummyConverter::toBool(hqTfFd(), headquarters, taskForce, feintDummy);
|
|
return taskForce;
|
|
}
|
|
|
|
bool Sidc2525Delta::feintDummy() const
|
|
{
|
|
bool headquarters;
|
|
bool taskForce;
|
|
bool feintDummy;
|
|
HQTFDummyConverter::toBool(hqTfFd(), headquarters, taskForce, feintDummy);
|
|
return feintDummy;
|
|
}
|
|
|
|
|
|
AmplifierGroup Sidc2525Delta::amplifierGroup() const
|
|
{
|
|
AmplifierGroup amplifierGroup = static_cast<AmplifierGroup>(QStringRef(&m_first10, 8, 1).toString().toInt());
|
|
return amplifierGroup;
|
|
}
|
|
void Sidc2525Delta::setAmplifierGroup(const AmplifierGroup &lifierGroup)
|
|
{
|
|
m_first10.replace(8, 1, QString(QLatin1String("%1")).arg((int)amplifierGroup));
|
|
}
|
|
|
|
unsigned int Sidc2525Delta::amplifier2ndDigit() const
|
|
{
|
|
qCritical() << m_first10;
|
|
return QStringRef( &m_first10,9,1 ).toString().toUInt();
|
|
} // unsigned int Sidc2525Delta::amplifier2ndDigit() const
|
|
|
|
|
|
void Sidc2525Delta::setAmplifier2ndDigit(unsigned int amplifierSecondDigit)
|
|
{
|
|
if (amplifierSecondDigit > 9) return; // ToDo error message
|
|
m_first10.replace(9, 1, QString(QLatin1String("%1")).arg(amplifierSecondDigit));
|
|
}
|
|
|
|
unsigned int Sidc2525Delta::sectorModifier1Digit()
|
|
{
|
|
return QStringRef( &m_second10,6,2 ).toString().toUInt();
|
|
} // unsigned int Sidc2525Delta::sectorModifier1Digit()
|
|
|
|
|
|
unsigned int Sidc2525Delta::sectorModifier2Digit()
|
|
{
|
|
return QStringRef( &m_second10,8,2 ).toString().toUInt();
|
|
} // unsigned int Sidc2525Delta::sectorModifier2Digit()
|
|
|
|
|
|
void Sidc2525Delta::setSectorModifier1Digit( unsigned int digit )
|
|
{
|
|
if (digit > 99) return; // ToDo error message
|
|
m_second10.replace( 6,2,QString(QLatin1String("%1")).arg(digit,2,10,QLatin1Char('0')) );
|
|
} // void Sidc2525Delta::setSectorModifier1Digit( unsigned int )
|
|
|
|
|
|
void Sidc2525Delta::setSectorModifier2Digit( unsigned int digit )
|
|
{
|
|
if (digit > 99) return; // ToDo error message
|
|
m_second10.replace( 8,2,QString(QLatin1String("%1")).arg(digit,2,10,QLatin1Char('0')) );
|
|
} // void Sidc2525Delta::setSectorModifier2Digit( unsigned int digit )
|
|
|
|
|
|
|
|
bool Sidc2525Delta::analyzeLegacySidc()
|
|
{
|
|
// Position 1 : (CodingSchema) 'S' = Warfighting
|
|
|
|
return false;
|
|
|
|
// // Position 2 : (Identity)
|
|
// m_standardIdentity = legacyToStandardIdentity(m_legacySidc[1]);
|
|
// TRACE_LOG(m_logger) << LOGFUNCTION << " START"
|
|
// << " m_standardIdentity.identity='" << (int)m_standardIdentity.identity << "'";
|
|
|
|
|
|
// // Position 11,12 : (SymbolModifier / size/mobility)
|
|
// QString symbolModifier = m_legacySidc[10] % m_legacySidc[11];
|
|
// legacySymbolModifier(symbolModifier);
|
|
|
|
return true;
|
|
}
|
|
|
|
StandardIdentity Sidc2525Delta::legacyToStandardIdentity(const QChar &ch)
|
|
{
|
|
return StandardIdentityConverter::fromString(ch);
|
|
}
|
|
|
|
bool Sidc2525Delta::legacySymbolModifier(const QString &str)
|
|
{
|
|
if (str.count() < 2)
|
|
return false;
|
|
|
|
return false;
|
|
// return legacySymbolModifier(str[0], str[1]);
|
|
}
|
|
|
|
QString Sidc2525Delta::toSidc() const
|
|
{
|
|
|
|
return m_first10 + m_second10;
|
|
|
|
|
|
// // StandardIdentity
|
|
// QChar siChar = standardIdentityString();
|
|
|
|
// if (siChar.isNull())
|
|
// return QString();
|
|
|
|
// sidc = sidc.replace(1, 1, siChar);
|
|
|
|
|
|
// // HqTfDummy / Amplifier/Descriptor
|
|
// const HQTFDummy &hqTfDummy = this->hqTfFd();
|
|
// QString str = AdvancedSymbology::HQTFDummyConverter::toString(hqTfDummy /*, put in Amplifier/Descriptor here*/);
|
|
|
|
// if (str.size() == 2)
|
|
// sidc = sidc.replace(10, 2, str);
|
|
}
|
|
|
|
/*
|
|
bool Sidc2525Delta::legacySymbolModifier(const QChar &c1, const QChar &c2)
|
|
{
|
|
TRACE_LOG(m_logger) << LOGFUNCTION << " START"
|
|
<< " c1='" << c1 << "'"
|
|
<< " c2='" << c2 << "'";
|
|
|
|
bool m_headquarters =
|
|
((c1 == QLatin1Char('A')) ||
|
|
(c1 == QLatin1Char('B')) ||
|
|
(c1 == QLatin1Char('C')) ||
|
|
(c1 == QLatin1Char('D'))
|
|
);
|
|
|
|
bool m_taskForce =
|
|
((c1 == QLatin1Char('B')) ||
|
|
(c1 == QLatin1Char('D')) ||
|
|
(c1 == QLatin1Char('E')) ||
|
|
(c1 == QLatin1Char('G'))
|
|
);
|
|
|
|
bool m_feintDummy = // See also special handling some lines later.
|
|
((c1 == QLatin1Char('C')) ||
|
|
(c1 == QLatin1Char('D')) ||
|
|
(c1 == QLatin1Char('F')) ||
|
|
(c1 == QLatin1Char('G'))
|
|
);
|
|
|
|
|
|
//--------------------------------------
|
|
//--------------------------------------
|
|
//--------------------------------------
|
|
|
|
initAmplifier();
|
|
|
|
bool doFurther = true;
|
|
|
|
// special handling of
|
|
// - 'H-' -> Installation
|
|
// - 'HB' -> Feint/Dummy Installation
|
|
if (c1 == QLatin1Char('H'))
|
|
{
|
|
m_installation = true;
|
|
if (c1 == QLatin1Char('B'))
|
|
{
|
|
m_feintDummy = true;
|
|
doFurther = false;
|
|
}
|
|
else if (c1 == QLatin1Char('-'))
|
|
doFurther = false;
|
|
}
|
|
|
|
|
|
if (doFurther)
|
|
{
|
|
// EchelonBrigadeAndBelow
|
|
|
|
if (c2 == QLatin1Char('A'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Echelon_BrigadeAndBelow;
|
|
m_e_BrigadeAndBelow = EchelonBrigadeAndBelow::TeamCrew;
|
|
}
|
|
else if (c2 == QLatin1Char('B'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Echelon_BrigadeAndBelow;
|
|
m_e_BrigadeAndBelow = EchelonBrigadeAndBelow::Squad;
|
|
}
|
|
else if (c2 == QLatin1Char('C'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Echelon_BrigadeAndBelow;
|
|
m_e_BrigadeAndBelow = EchelonBrigadeAndBelow::Section;
|
|
}
|
|
else if (c2 == QLatin1Char('D'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Echelon_BrigadeAndBelow;
|
|
m_e_BrigadeAndBelow = EchelonBrigadeAndBelow::PlatoonDetachment;
|
|
}
|
|
else if (c2 == QLatin1Char('E'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Echelon_BrigadeAndBelow;
|
|
m_e_BrigadeAndBelow = EchelonBrigadeAndBelow::CompanyBatteryTroop;
|
|
}
|
|
else if (c2 == QLatin1Char('F'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Echelon_BrigadeAndBelow;
|
|
m_e_BrigadeAndBelow = EchelonBrigadeAndBelow::BattalionSquadron;
|
|
}
|
|
else if (c2 == QLatin1Char('G'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Echelon_BrigadeAndBelow;
|
|
m_e_BrigadeAndBelow = EchelonBrigadeAndBelow::RegimentGroup;
|
|
}
|
|
else if (c2 == QLatin1Char('H'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Echelon_BrigadeAndBelow;
|
|
m_e_BrigadeAndBelow = EchelonBrigadeAndBelow::Brigade;
|
|
|
|
// EchelonDivisionAndAbove
|
|
|
|
}
|
|
else if (c2 == QLatin1Char('I'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Echelon_DivisionAndAbove;
|
|
m_e_DivisionAndAbove = EchelonDivisionAndAbove::Division;
|
|
}
|
|
else if (c2 == QLatin1Char('J'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Echelon_DivisionAndAbove;
|
|
m_e_DivisionAndAbove = EchelonDivisionAndAbove::CorpsMEF;
|
|
}
|
|
else if (c2 == QLatin1Char('K'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Echelon_DivisionAndAbove;
|
|
m_e_DivisionAndAbove = EchelonDivisionAndAbove::Army;
|
|
}
|
|
else if (c2 == QLatin1Char('L'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Echelon_DivisionAndAbove;
|
|
m_e_DivisionAndAbove = EchelonDivisionAndAbove::Army_GroupFront;
|
|
}
|
|
else if (c2 == QLatin1Char('M'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Echelon_DivisionAndAbove;
|
|
m_e_DivisionAndAbove = EchelonDivisionAndAbove::RegionTheater;
|
|
}
|
|
else if (c2 == QLatin1Char('N'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Echelon_DivisionAndAbove;
|
|
m_e_DivisionAndAbove = EchelonDivisionAndAbove::Command;
|
|
}
|
|
|
|
// MobilityOnLand
|
|
|
|
if (c1 == QLatin1Char('M'))
|
|
{
|
|
if (c2 == QLatin1Char('O'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Mobility_OnLand;
|
|
m_e_MobilityOnLand = MobilityOnLand::WheeledLimitedCrossCountry;
|
|
}
|
|
else if (c2 == QLatin1Char('P'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Mobility_OnLand;
|
|
m_e_MobilityOnLand = MobilityOnLand::WheeledCrossCountry;
|
|
}
|
|
else if (c2 == QLatin1Char('Q'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Mobility_OnLand;
|
|
m_e_MobilityOnLand = MobilityOnLand::Tracked;
|
|
}
|
|
else if (c2 == QLatin1Char('R'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Mobility_OnLand;
|
|
m_e_MobilityOnLand = MobilityOnLand::WheeledAndTrackedCombination;
|
|
}
|
|
else if (c2 == QLatin1Char('S'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Mobility_OnLand;
|
|
m_e_MobilityOnLand = MobilityOnLand::Towed;
|
|
}
|
|
else if (c2 == QLatin1Char('T'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Mobility_OnLand;
|
|
m_e_MobilityOnLand = MobilityOnLand::Rail;
|
|
|
|
// Snow
|
|
}
|
|
else if (c2 == QLatin1Char('U'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Mobility_OnSnow;
|
|
m_e_MobilityOnSnow = MobilityOnSnow::OverSnow;
|
|
}
|
|
else if (c2 == QLatin1Char('V'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Mobility_OnSnow;
|
|
m_e_MobilityOnSnow = MobilityOnSnow::Sled;
|
|
}
|
|
else if (c2 == QLatin1Char('W'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Mobility_OnLand; // <------ exception
|
|
m_e_MobilityOnLand = MobilityOnLand::PackAnimal; // <------ exception
|
|
|
|
// Water
|
|
}
|
|
else if (c2 == QLatin1Char('X'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Mobility_OnWater;
|
|
m_e_MobilityOnWater = MobilityOnWater::Barge;
|
|
}
|
|
else if (c2 == QLatin1Char('Y'))
|
|
{
|
|
m_amplifierGroup = AmplifierGroup::Mobility_OnWater;
|
|
m_e_MobilityOnWater = MobilityOnWater::Amphibious;
|
|
}
|
|
|
|
}
|
|
|
|
} // if (doFurther)
|
|
|
|
TRACE_LOG(m_logger) << LOGFUNCTION << " END"
|
|
<< " c1='" << c1 << "'"
|
|
<< " c2='" << c2 << "'"
|
|
<< " m_amplifierGroup='" << (int)m_amplifierGroup << "'";
|
|
|
|
return true;
|
|
}
|
|
|
|
quint32 Sidc2525Delta::amplifier_UInt(QString *str) const
|
|
{
|
|
quint32 first = static_cast<quint32>(m_amplifierGroup);
|
|
|
|
quint32 second = 0;
|
|
|
|
switch (m_amplifierGroup)
|
|
{
|
|
case AmplifierGroup::Unknown:
|
|
// second = 0;
|
|
break;
|
|
case AmplifierGroup::Echelon_BrigadeAndBelow:
|
|
second = static_cast<quint32>(m_e_BrigadeAndBelow);
|
|
break;
|
|
case AmplifierGroup::Echelon_DivisionAndAbove:
|
|
second = static_cast<quint32>(m_e_DivisionAndAbove);
|
|
break;
|
|
case AmplifierGroup::Mobility_OnLand:
|
|
second = static_cast<quint32>(m_e_MobilityOnLand);
|
|
break;
|
|
case AmplifierGroup::Mobility_OnWater:
|
|
second = static_cast<quint32>(m_e_MobilityOnSnow);
|
|
break;
|
|
case AmplifierGroup::Mobility_OnSnow:
|
|
second = static_cast<quint32>(m_e_MobilityOnWater);
|
|
break;
|
|
case AmplifierGroup::Naval_TowedArry:
|
|
second = static_cast<quint32>(m_e_NavalTowedArray);
|
|
break;
|
|
}
|
|
|
|
if (str)
|
|
*str = QString::number(first) + QString::number(second);
|
|
|
|
quint32 amplifierUInt = (first * 10) + second;
|
|
TRACE_LOG(m_logger) << LOGFUNCTION
|
|
<< " first='" << first << "'"
|
|
<< " second='" << second << "'"
|
|
<< " amplifierUInt='" << amplifierUInt << "'";
|
|
return amplifierUInt;
|
|
}
|
|
|
|
QString Sidc2525Delta::amplifier_String() const
|
|
{
|
|
QString str;
|
|
amplifier_UInt(&str);
|
|
return str;
|
|
}
|
|
|
|
*/
|
|
|
|
bool Sidc2525Delta::initFromMil2525D(const QString &sidcMIL2525D)
|
|
{
|
|
|
|
// check size
|
|
if (sidcMIL2525D.size() != 20)
|
|
{
|
|
ERROR_LOG(m_logger) << LOGFUNCTION
|
|
<< " sidcMIL2525D='" << sidcMIL2525D << "'"
|
|
<< ", size failed";
|
|
return false;
|
|
}
|
|
|
|
// check version
|
|
if (QStringRef(&sidcMIL2525D, 0, 2).toString().compare(QLatin1String("10")) != 0)
|
|
{
|
|
ERROR_LOG(m_logger) << LOGFUNCTION
|
|
<< " sidcMIL2525D='" << sidcMIL2525D << "'"
|
|
<< ", wrong version";
|
|
return false;
|
|
}
|
|
|
|
init();
|
|
|
|
m_first10 = QStringRef(&sidcMIL2525D, 0, 10).toString();
|
|
m_second10 = QStringRef(&sidcMIL2525D, 10, 10).toString();
|
|
|
|
INFO_LOG(m_logger) << LOGFUNCTION
|
|
<< " m_first10='" << m_first10 << "'"
|
|
<< " m_second10='" << m_second10 << "'";
|
|
|
|
return true;
|
|
}
|
|
|
|
bool Sidc2525Delta::initFromMil2525DBaseSymbolCode(const QString &sidcMIL2525D_baseSymbolCode)
|
|
{
|
|
// check size
|
|
if (sidcMIL2525D_baseSymbolCode.size() != 8)
|
|
{
|
|
ERROR_LOG(m_logger) << LOGFUNCTION
|
|
<< " sidcMIL2525D_baseSymbolCode='" << sidcMIL2525D_baseSymbolCode << "'"
|
|
<< ", size failed";
|
|
return false;
|
|
}
|
|
|
|
init();
|
|
|
|
|
|
// set SymbolSet:
|
|
SymbolSet sSet = static_cast<SymbolSet>(QStringRef(&sidcMIL2525D_baseSymbolCode, 0, 2).toInt());
|
|
this->setSymbolSet(sSet);
|
|
|
|
|
|
// set Entity:
|
|
const QString &entityChars = QStringRef(&sidcMIL2525D_baseSymbolCode, 2, 6).toString();
|
|
|
|
// merge into second10:
|
|
m_second10.replace(0, 6, entityChars);
|
|
|
|
return true;
|
|
}
|
|
|
|
|
|
QLatin1String toString(ShapeType value)
|
|
{
|
|
switch (value)
|
|
{
|
|
case ShapeType::UNDEFINED:
|
|
return QLatin1String("UNDEFINED");
|
|
case ShapeType::CIRCLE:
|
|
return QLatin1String("CIRCLE");
|
|
case ShapeType::CLOVER:
|
|
return QLatin1String("CLOVER");
|
|
case ShapeType::CURVE:
|
|
return QLatin1String("CURVE");
|
|
case ShapeType::DIAMOND:
|
|
return QLatin1String("DIAMOND");
|
|
case ShapeType::RECTANGLE:
|
|
return QLatin1String("RECTANGLE");
|
|
case ShapeType::SQUARE:
|
|
return QLatin1String("SQUARE");
|
|
}
|
|
return QLatin1String("ERROR-ShapeType");
|
|
}
|
|
|
|
|
|
QLatin1String toString(Context value)
|
|
{
|
|
switch (value)
|
|
{
|
|
case Context::Reality:
|
|
return QLatin1String("Reality");
|
|
case Context::Exercise:
|
|
return QLatin1String("Exercise");
|
|
case Context::Simulation:
|
|
return QLatin1String("Simulation");
|
|
}
|
|
return QLatin1String("ERROR-Context");
|
|
}
|
|
|
|
QLatin1String toString(Identity value)
|
|
{
|
|
switch (value)
|
|
{
|
|
case Identity::Pending:
|
|
return QLatin1String("Pending");
|
|
case Identity::Unknown:
|
|
return QLatin1String("Unknown");
|
|
|
|
case Identity::AssumedFriend:
|
|
return QLatin1String("AssumedFriend");
|
|
case Identity::Friend:
|
|
return QLatin1String("Friend");
|
|
|
|
case Identity::Neutral:
|
|
return QLatin1String("Neutral");
|
|
|
|
case Identity::SuspectJoker:
|
|
return QLatin1String("SuspectJoker");
|
|
case Identity::HostileFaker:
|
|
return QLatin1String("HostileFaker");
|
|
} // switch
|
|
return QLatin1String("ERROR-Identity");
|
|
}
|
|
|
|
|
|
|
|
ShapeType StandardIdentity::getShape() const
|
|
{
|
|
switch (identity)
|
|
{
|
|
case Identity::Unknown:
|
|
case Identity::Pending:
|
|
return ShapeType::CLOVER;
|
|
|
|
case Identity::Friend:
|
|
case Identity::AssumedFriend:
|
|
return ShapeType::RECTANGLE;
|
|
|
|
case Identity::Neutral:
|
|
return ShapeType::SQUARE;
|
|
|
|
case Identity::HostileFaker:
|
|
case Identity::SuspectJoker:
|
|
return ShapeType::DIAMOND;
|
|
} // switch
|
|
|
|
return ShapeType::UNDEFINED;
|
|
}
|
|
|
|
QVector<Context> contexts()
|
|
{
|
|
return { Context::Exercise, Context::Reality, Context::Simulation };
|
|
}
|
|
|
|
|
|
QVector<Identity> identities()
|
|
{
|
|
return {Identity::Pending,
|
|
Identity::Unknown,
|
|
Identity::AssumedFriend,
|
|
Identity::Friend,
|
|
Identity::Neutral,
|
|
Identity::SuspectJoker,
|
|
Identity::HostileFaker};
|
|
}
|
|
|
|
|
|
QLatin1String toString(HQTFDummy value)
|
|
{
|
|
switch (value)
|
|
{
|
|
case HQTFDummy::Unknown:
|
|
return QLatin1String("Unknown");
|
|
case HQTFDummy::FeintDummy:
|
|
return QLatin1String("FeintDummy");
|
|
case HQTFDummy::Headquarters:
|
|
return QLatin1String("Headquarters");
|
|
case HQTFDummy::FeintDummy_Headquarters:
|
|
return QLatin1String("FeintDummy_Headquarters");
|
|
case HQTFDummy::TaskForce:
|
|
return QLatin1String("TaskForce");
|
|
case HQTFDummy::FeintDummy_TaskForce:
|
|
return QLatin1String("FeintDummy_TaskForce");
|
|
case HQTFDummy::TaskForce_Headquarters:
|
|
return QLatin1String("TaskForce_Headquarters");
|
|
case HQTFDummy::FeintDummy_TaskForce_Headquarters:
|
|
return QLatin1String("FeintDummy_TaskForce_Headquarters");
|
|
} // switch
|
|
return QLatin1String("ERROR-HQTFDummy");
|
|
}
|
|
|
|
QVector<HQTFDummy> hQTFDummy()
|
|
{
|
|
return {HQTFDummy::Unknown,
|
|
HQTFDummy::FeintDummy,
|
|
HQTFDummy::Headquarters,
|
|
HQTFDummy::FeintDummy_Headquarters,
|
|
HQTFDummy::TaskForce,
|
|
HQTFDummy::FeintDummy_TaskForce,
|
|
HQTFDummy::TaskForce_Headquarters,
|
|
HQTFDummy::FeintDummy_TaskForce_Headquarters
|
|
};
|
|
}
|
|
|
|
|
|
QLatin1String toString(AmplifierGroup value)
|
|
{
|
|
switch (value)
|
|
{
|
|
case AmplifierGroup::Unknown:
|
|
return QLatin1String("Unknown");
|
|
case AmplifierGroup::Echelon_BrigadeAndBelow:
|
|
return QLatin1String("Echelon_BrigadeAndBelow");
|
|
case AmplifierGroup::Echelon_DivisionAndAbove:
|
|
return QLatin1String("Echelon_DivisionAndAbove");
|
|
case AmplifierGroup::Mobility_OnLand:
|
|
return QLatin1String("Mobility_OnLand");
|
|
case AmplifierGroup::Mobility_OnSnow:
|
|
return QLatin1String("Mobility_OnSnow");
|
|
case AmplifierGroup::Mobility_OnWater:
|
|
return QLatin1String("Mobility_OnWater");
|
|
case AmplifierGroup::Naval_TowedArry:
|
|
return QLatin1String("Naval_TowedArry");
|
|
} // switch
|
|
return QLatin1String("ERROR-AmplifierGroup");
|
|
}
|
|
|
|
QVector<AmplifierGroup> amplifierGroups()
|
|
{
|
|
return { AmplifierGroup::Unknown,
|
|
|
|
AmplifierGroup::Echelon_BrigadeAndBelow,
|
|
AmplifierGroup::Echelon_DivisionAndAbove,
|
|
|
|
AmplifierGroup::Mobility_OnLand,
|
|
AmplifierGroup::Mobility_OnSnow,
|
|
AmplifierGroup::Mobility_OnWater,
|
|
|
|
AmplifierGroup::Naval_TowedArry
|
|
};
|
|
}
|
|
|
|
|
|
QLatin1String toString(EchelonBrigadeAndBelow value)
|
|
{
|
|
switch (value)
|
|
{
|
|
case EchelonBrigadeAndBelow::Unknown:
|
|
return QLatin1String("Unknown");
|
|
case EchelonBrigadeAndBelow::TeamCrew:
|
|
return QLatin1String("TeamCrew");
|
|
case EchelonBrigadeAndBelow::Squad:
|
|
return QLatin1String("Squad");
|
|
|
|
case EchelonBrigadeAndBelow::Section:
|
|
return QLatin1String("Section");
|
|
case EchelonBrigadeAndBelow::PlatoonDetachment:
|
|
return QLatin1String("PlatoonDetachment");
|
|
case EchelonBrigadeAndBelow::BattalionSquadron:
|
|
return QLatin1String("BattalionSquadron");
|
|
|
|
case EchelonBrigadeAndBelow::CompanyBatteryTroop:
|
|
return QLatin1String("CompanyBatteryTroop");
|
|
case EchelonBrigadeAndBelow::RegimentGroup:
|
|
return QLatin1String("RegimentGroup");
|
|
case EchelonBrigadeAndBelow::Brigade:
|
|
return QLatin1String("Brigade");
|
|
} // switch
|
|
return QLatin1String("ERROR-EchelonBrigadeAndBelow");
|
|
}
|
|
|
|
QVector<EchelonBrigadeAndBelow> echelonBrigadeAndBelows()
|
|
{
|
|
return { EchelonBrigadeAndBelow::Unknown,
|
|
EchelonBrigadeAndBelow::TeamCrew,
|
|
EchelonBrigadeAndBelow::Squad,
|
|
EchelonBrigadeAndBelow::Section,
|
|
EchelonBrigadeAndBelow::PlatoonDetachment,
|
|
EchelonBrigadeAndBelow::BattalionSquadron,
|
|
EchelonBrigadeAndBelow::CompanyBatteryTroop,
|
|
EchelonBrigadeAndBelow::RegimentGroup,
|
|
EchelonBrigadeAndBelow::Brigade
|
|
};
|
|
}
|
|
|
|
|
|
QLatin1String toString(EchelonDivisionAndAbove value)
|
|
{
|
|
switch (value)
|
|
{
|
|
case EchelonDivisionAndAbove::Unknown:
|
|
return QLatin1String("Unknown");
|
|
case EchelonDivisionAndAbove::Division:
|
|
return QLatin1String("Division");
|
|
case EchelonDivisionAndAbove::CorpsMEF:
|
|
return QLatin1String("CorpsMEF");
|
|
case EchelonDivisionAndAbove::Army:
|
|
return QLatin1String("Army");
|
|
case EchelonDivisionAndAbove::Army_GroupFront:
|
|
return QLatin1String("Army_GroupFront");
|
|
case EchelonDivisionAndAbove::RegionTheater:
|
|
return QLatin1String("RegionTheater");
|
|
case EchelonDivisionAndAbove::Command:
|
|
return QLatin1String("Command");
|
|
} // switch
|
|
return QLatin1String("ERROR-EchelonDivisionAndAbove");
|
|
}
|
|
|
|
QVector<EchelonDivisionAndAbove> echelonDivisionAndAboves()
|
|
{
|
|
return {EchelonDivisionAndAbove::Unknown,
|
|
EchelonDivisionAndAbove::Division,
|
|
EchelonDivisionAndAbove::CorpsMEF,
|
|
EchelonDivisionAndAbove::Army,
|
|
EchelonDivisionAndAbove::Army_GroupFront,
|
|
EchelonDivisionAndAbove::RegionTheater,
|
|
EchelonDivisionAndAbove::Command,
|
|
};
|
|
}
|
|
|
|
|
|
QLatin1String toString(MobilityOnLand value)
|
|
{
|
|
switch (value)
|
|
{
|
|
case MobilityOnLand::Unknown:
|
|
return QLatin1String("Unknown");
|
|
case MobilityOnLand::WheeledLimitedCrossCountry:
|
|
return QLatin1String("WheeledLimitedCrossCountry");
|
|
case MobilityOnLand::WheeledCrossCountry:
|
|
return QLatin1String("WheeledCrossCountry");
|
|
case MobilityOnLand::Tracked:
|
|
return QLatin1String("Tracked");
|
|
case MobilityOnLand::WheeledAndTrackedCombination:
|
|
return QLatin1String("WheeledAndTrackedCombination");
|
|
case MobilityOnLand::Towed:
|
|
return QLatin1String("Towed");
|
|
case MobilityOnLand::Rail:
|
|
return QLatin1String("Rail");
|
|
case MobilityOnLand::PackAnimal:
|
|
return QLatin1String("PackAnimal");
|
|
} // switch
|
|
return QLatin1String("ERROR-MobilityOnLand");
|
|
}
|
|
|
|
QVector<MobilityOnLand> mobilityOnLands()
|
|
{
|
|
return { MobilityOnLand::Unknown,
|
|
MobilityOnLand::WheeledLimitedCrossCountry,
|
|
MobilityOnLand::WheeledCrossCountry,
|
|
MobilityOnLand::Tracked,
|
|
MobilityOnLand::WheeledAndTrackedCombination,
|
|
MobilityOnLand::Towed,
|
|
MobilityOnLand::Rail,
|
|
MobilityOnLand::PackAnimal
|
|
};
|
|
}
|
|
|
|
|
|
QLatin1String toString(MobilityOnSnow value)
|
|
{
|
|
switch (value)
|
|
{
|
|
case MobilityOnSnow::Unknown:
|
|
return QLatin1String("Unknown");
|
|
case MobilityOnSnow::OverSnow:
|
|
return QLatin1String("OverSnow");
|
|
case MobilityOnSnow::Sled:
|
|
return QLatin1String("Sled");
|
|
} // switch
|
|
return QLatin1String("ERROR-MobilityOnSnow");
|
|
}
|
|
|
|
QVector<MobilityOnSnow> mobilityOnSnows()
|
|
{
|
|
return { MobilityOnSnow::Unknown,
|
|
MobilityOnSnow::OverSnow,
|
|
MobilityOnSnow::Sled
|
|
};
|
|
}
|
|
|
|
QLatin1String toString(MobilityOnWater value)
|
|
{
|
|
switch (value)
|
|
{
|
|
case MobilityOnWater::Unknown:
|
|
return QLatin1String("Unknown");
|
|
case MobilityOnWater::Barge:
|
|
return QLatin1String("Barge");
|
|
case MobilityOnWater::Amphibious:
|
|
return QLatin1String("Amphibious");
|
|
} // switch
|
|
return QLatin1String("ERROR-MobilityOnWater");
|
|
}
|
|
|
|
QVector<MobilityOnWater> mobilityOnWaters()
|
|
{
|
|
return { MobilityOnWater::Unknown,
|
|
MobilityOnWater::Barge,
|
|
MobilityOnWater::Amphibious
|
|
};
|
|
}
|
|
|
|
|
|
QLatin1String toString(NavalTowedArray value)
|
|
{
|
|
switch (value)
|
|
{
|
|
case NavalTowedArray::Unknown:
|
|
return QLatin1String("Unknown");
|
|
case NavalTowedArray::ShortTowedArray:
|
|
return QLatin1String("ShortTowedArray");
|
|
case NavalTowedArray::LongTowedArray:
|
|
return QLatin1String("LongTowedArray");
|
|
} // switch
|
|
return QLatin1String("ERROR-NavalTowedArray");
|
|
}
|
|
|
|
QVector<NavalTowedArray> navalTowedArrays()
|
|
{
|
|
return {NavalTowedArray::Unknown,
|
|
NavalTowedArray::ShortTowedArray,
|
|
NavalTowedArray::LongTowedArray
|
|
};
|
|
}
|
|
|
|
QLatin1String toString(SymbolSet value)
|
|
{
|
|
switch (value)
|
|
{
|
|
case SymbolSet::Unknown:
|
|
return QLatin1String("Unknown");
|
|
case SymbolSet::Air:
|
|
return QLatin1String("Air");
|
|
case SymbolSet::AirMissle:
|
|
return QLatin1String("AirMissle");
|
|
case SymbolSet::Space:
|
|
return QLatin1String("Space");
|
|
case SymbolSet::SpaceMissle:
|
|
return QLatin1String("SpaceMissle");
|
|
case SymbolSet::LandUnit:
|
|
return QLatin1String("LandUnit");
|
|
case SymbolSet::LandCivilian_UnitOrganisation:
|
|
return QLatin1String("LandCivilian_UnitOrganisation");
|
|
case SymbolSet::LandEquipment:
|
|
return QLatin1String("LandEquipment");
|
|
case SymbolSet::LandInstallation:
|
|
return QLatin1String("LandInstallation");
|
|
case SymbolSet::ControlMeasure:
|
|
return QLatin1String("ControlMeasure");
|
|
case SymbolSet::SeaSurface:
|
|
return QLatin1String("SeaSurface");
|
|
case SymbolSet::SeaSubSurface:
|
|
return QLatin1String("SeaSubSurface");
|
|
case SymbolSet::MineWarfare:
|
|
return QLatin1String("MineWarfare");
|
|
case SymbolSet::Activities:
|
|
return QLatin1String("Activities");
|
|
case SymbolSet::Atmospheric:
|
|
return QLatin1String("Atmospheric");
|
|
case SymbolSet::Oceanographic:
|
|
return QLatin1String("Oceanographic");
|
|
case SymbolSet::MeteorologicalSpace:
|
|
return QLatin1String("MeteorologicalSpace");
|
|
case SymbolSet::SignalsIntelligence_Space:
|
|
return QLatin1String("SignalsIntelligence_Space");
|
|
case SymbolSet::SignalsIntelligence_Air:
|
|
return QLatin1String("SignalsIntelligence_Air");
|
|
case SymbolSet::SignalsIntelligence_Land:
|
|
return QLatin1String("SignalsIntelligence_Land");
|
|
case SymbolSet::SignalsIntelligence_Surface:
|
|
return QLatin1String("SignalsIntelligence_Surface");
|
|
case SymbolSet::SignalsIntelligence_Subsurface:
|
|
return QLatin1String("SignalsIntelligence_Subsurface");
|
|
case SymbolSet::Cyberspace:
|
|
return QLatin1String("Cyberspace");
|
|
} // switch
|
|
return QLatin1String("ERROR-SymbolSet");
|
|
}
|
|
|
|
QVector<SymbolSet> symbolSets()
|
|
{
|
|
return {SymbolSet::Unknown ,
|
|
SymbolSet::Air,
|
|
SymbolSet::AirMissle,
|
|
SymbolSet::Space,
|
|
SymbolSet::SpaceMissle,
|
|
SymbolSet::LandUnit,
|
|
SymbolSet::LandCivilian_UnitOrganisation,
|
|
SymbolSet::LandEquipment,
|
|
SymbolSet::LandInstallation,
|
|
SymbolSet::ControlMeasure,
|
|
SymbolSet::SeaSurface,
|
|
SymbolSet::SeaSubSurface,
|
|
SymbolSet::MineWarfare,
|
|
SymbolSet::Activities,
|
|
SymbolSet::Atmospheric,
|
|
SymbolSet::Oceanographic,
|
|
SymbolSet::MeteorologicalSpace,
|
|
SymbolSet::SignalsIntelligence_Space,
|
|
SymbolSet::SignalsIntelligence_Air,
|
|
SymbolSet::SignalsIntelligence_Land,
|
|
SymbolSet::SignalsIntelligence_Surface,
|
|
SymbolSet::SignalsIntelligence_Subsurface,
|
|
SymbolSet::Cyberspace
|
|
};
|
|
}
|
|
|
|
QLatin1String toString(Status value)
|
|
{
|
|
switch (value)
|
|
{
|
|
// case Status::Unknown:
|
|
// return QLatin1String("Unknown");
|
|
case Status::Present:
|
|
return QLatin1String("Present");
|
|
case Status::Planned_Anticipated_Suspect:
|
|
return QLatin1String("Planned_Anticipated_Suspect");
|
|
case Status::Present_FullCapable:
|
|
return QLatin1String("Present_FullCapable");
|
|
case Status::Present_Damaged:
|
|
return QLatin1String("Present_Damaged");
|
|
case Status::Present_Destroyed:
|
|
return QLatin1String("Present_Destroyed");
|
|
case Status::Present_FullToCapacity:
|
|
return QLatin1String("Present_FullToCapacity");
|
|
} // switch
|
|
return QLatin1String("ERROR-Status");
|
|
}
|
|
|
|
QVector<Status> statuss()
|
|
{
|
|
return
|
|
{
|
|
// Status::Unknown,
|
|
Status::Present,
|
|
Status::Planned_Anticipated_Suspect,
|
|
Status::Present_FullCapable,
|
|
Status::Present_Damaged,
|
|
Status::Present_Destroyed,
|
|
Status::Present_FullToCapacity
|
|
};
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
private void _BuildSIDC()
|
|
{
|
|
// Builds a current (2525D) SIDC from the JMSML Library elements currently associated
|
|
// with this symbol.
|
|
|
|
if (_version != null && _context != null &&
|
|
_standardIdentity != null && _symbolSet != null && _status != null &&
|
|
_hqTFDummy != null && _amplifierGroup != null && _amplifier != null)
|
|
{
|
|
_sidc.PartAUInt = (uint)_version.VersionCode.DigitOne * 1000000000 +
|
|
(uint)_version.VersionCode.DigitTwo * 100000000 +
|
|
(uint)_context.ContextCode * 10000000 +
|
|
(uint)_standardIdentity.StandardIdentityCode * 1000000 +
|
|
(uint)_symbolSet.SymbolSetCode.DigitOne * 100000 +
|
|
(uint)_symbolSet.SymbolSetCode.DigitTwo * 10000 +
|
|
(uint)_status.StatusCode * 1000 +
|
|
(uint)_hqTFDummy.HQTFDummyCode * 100 +
|
|
(uint)_amplifierGroup.AmplifierGroupCode * 10 +
|
|
(uint)_amplifier.AmplifierCode;
|
|
}
|
|
|
|
if (_entity != null)
|
|
{
|
|
_sidc.PartBUInt = (uint)_entity.EntityCode.DigitOne * 1000000000 +
|
|
(uint)_entity.EntityCode.DigitTwo * 100000000;
|
|
}
|
|
|
|
if (_entityType != null)
|
|
{
|
|
_sidc.PartBUInt = _sidc.PartBUInt + (uint)_entityType.EntityTypeCode.DigitOne * 10000000 +
|
|
(uint)_entityType.EntityTypeCode.DigitTwo * 1000000;
|
|
}
|
|
|
|
if (_entitySubType != null)
|
|
{
|
|
_sidc.PartBUInt = _sidc.PartBUInt + (uint)_entitySubType.EntitySubTypeCode.DigitOne * 100000 +
|
|
(uint)_entitySubType.EntitySubTypeCode.DigitTwo * 10000;
|
|
}
|
|
|
|
if (_modifierOne != null)
|
|
{
|
|
_sidc.PartBUInt = _sidc.PartBUInt + (uint)_modifierOne.ModifierCode.DigitOne * 1000 +
|
|
(uint)_modifierOne.ModifierCode.DigitTwo * 100;
|
|
}
|
|
|
|
if (_modifierTwo != null)
|
|
{
|
|
_sidc.PartBUInt = _sidc.PartBUInt + (uint)_modifierTwo.ModifierCode.DigitOne * 10 +
|
|
(uint)_modifierTwo.ModifierCode.DigitTwo;
|
|
}
|
|
}
|
|
|
|
*/
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
std::ostream &operator<< (std::ostream &stream, const AdvancedSymbology::ShapeType &value)
|
|
{
|
|
stream << "ShapeType(" << AdvancedSymbology::toString(value)
|
|
<< ")";
|
|
return stream;
|
|
}
|
|
|
|
std::ostream &operator<< (std::ostream &stream, const AdvancedSymbology::Identity &value)
|
|
{
|
|
stream << "Identity(" << AdvancedSymbology::toString(value)
|
|
<< ")";
|
|
return stream;
|
|
}
|
|
|
|
std::ostream &operator<< (std::ostream &stream, const AdvancedSymbology::SymbolSet &value)
|
|
{
|
|
stream << "SymbolSet(" << AdvancedSymbology::toString(value)
|
|
<< ")";
|
|
return stream;
|
|
}
|
|
|
|
ADVANCED_SYMBOLOGY_EXPORT std::ostream &operator<< (std::ostream &stream, const AdvancedSymbology::Status &value)
|
|
{
|
|
stream << "Status(" << AdvancedSymbology::toString(value)
|
|
<< ")";
|
|
return stream;
|
|
}
|
|
|
|
} // namespace AdvancedSymbology
|