feat(alarm state): refactor to separe alarm state from radar state. Kown issue: alarm state is not correctly mantained

This commit is contained in:
MarcoJayUsai
2025-03-24 18:42:04 +01:00
parent f7e9fc5cbc
commit 1622d663bb
15 changed files with 174 additions and 253 deletions

View File

@@ -48,9 +48,9 @@ namespace ROE {
namespace ALARM_STATE {
enum ALARM_STATEs {
AUTO = 0,
AUTO = 2,
GREEN = 1,
RED = 2,
RED = 0,
};
}

View File

@@ -8,6 +8,7 @@ namespace DataIndex {
category,
alive,
alarmState,
radarState,
human,
controlled,
coalition,

View File

@@ -98,7 +98,7 @@ public:
virtual void setTargetID(unsigned int newValue) { updateValue(targetID, newValue, DataIndex::targetID); }
virtual void setTargetPosition(Coords newValue) { updateValue(targetPosition, newValue, DataIndex::targetPosition); }
virtual void setROE(unsigned char newValue, bool force = false);
virtual void commandAlarmState(unsigned char newValue, bool force = false);
virtual void setAlarmState(unsigned char newValue, bool force = false);
virtual void setReactionToThreat(unsigned char newValue, bool force = false);
virtual void setEmissionsCountermeasures(unsigned char newValue, bool force = false);
virtual void setTACAN(DataTypes::TACAN newValue, bool force = false);
@@ -126,12 +126,12 @@ public:
virtual void setTargetingRange(double newValue) { updateValue(targetingRange, newValue, DataIndex::targetingRange); }
virtual void setAimMethodRange(double newValue) { updateValue(aimMethodRange, newValue, DataIndex::aimMethodRange); }
virtual void setAcquisitionRange(double newValue) { updateValue(acquisitionRange, newValue, DataIndex::acquisitionRange); }
virtual void setAlarmState(string newValue) { updateValue(alarmState, newValue, DataIndex::alarmState); }
virtual void setRadarState(bool newValue) { updateValue(radarState, newValue, DataIndex::radarState); }
/********** Getters **********/
virtual string getCategory() { return category; };
virtual bool getAlive() { return alive; }
virtual string getAlarmState() { return alarmState; }
virtual unsigned char getAlarmState() { return alarmState; }
virtual bool getHuman() { return human; }
virtual bool getControlled() { return controlled; }
virtual unsigned char getCoalition() { return coalition; }
@@ -190,6 +190,7 @@ public:
virtual double getTargetingRange() { return targetingRange; }
virtual double getAimMethodRange() { return aimMethodRange; }
virtual double getAcquisitionRange() { return acquisitionRange; }
virtual bool getRadarState() { return radarState; }
protected:
unsigned int ID;
@@ -205,7 +206,8 @@ protected:
string callsign = "";
string groupName = "";
unsigned char state = State::NONE;
string alarmState = "";
unsigned char alarmState = ALARM_STATE::AUTO;
bool radarState = false;
string task = "";
bool hasTask = false;
Coords position = Coords(NULL);