feat(alarm state): alarm state command is now working in DCS

This commit is contained in:
MarcoJayUsai
2025-03-21 16:21:35 +01:00
parent 2a00bab149
commit f1fcabe7f7
11 changed files with 119 additions and 45 deletions

View File

@@ -18,6 +18,7 @@ namespace SetCommandType {
FORMATION = 5,
RTB_ON_BINGO = 6,
SILENCE = 7,
ALARM_STATE = 9,
RTB_ON_OUT_OF_AMMO = 10,
ECM_USING = 13,
PROHIBIT_AA = 14,
@@ -45,6 +46,14 @@ namespace ROE {
};
}
namespace ALARM_STATE {
enum ALARM_STATEs {
AUTO = 0,
GREEN = 1,
RED = 2,
};
}
namespace ReactionToThreat {
enum ReactionsToThreat {
NO_REACTION = 0,

View File

@@ -7,7 +7,7 @@ namespace DataIndex {
startOfData = 0,
category,
alive,
radarState,
alarmState,
human,
controlled,
coalition,

View File

@@ -96,6 +96,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 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);
@@ -112,12 +113,12 @@ public:
virtual void setRacetrackLength(double newValue) { updateValue(racetrackLength, newValue, DataIndex::racetrackLength); }
virtual void setRacetrackAnchor(Coords newValue) { updateValue(racetrackAnchor, newValue, DataIndex::racetrackAnchor); }
virtual void setRacetrackBearing(double newValue) { updateValue(racetrackBearing, newValue, DataIndex::racetrackBearing); }
virtual void setRadarState(string newValue) { updateValue(radarState, newValue, DataIndex::radarState); }
virtual void setAlarmState(string newValue) { updateValue(alarmState, newValue, DataIndex::alarmState); }
/********** Getters **********/
virtual string getCategory() { return category; };
virtual bool getAlive() { return alive; }
virtual string getRadarState() { return radarState; }
virtual string getAlarmState() { return alarmState; }
virtual bool getHuman() { return human; }
virtual bool getControlled() { return controlled; }
virtual unsigned char getCoalition() { return coalition; }
@@ -180,7 +181,7 @@ protected:
string callsign = "";
string groupName = "";
unsigned char state = State::NONE;
string radarState = "";
string alarmState = "";
string task = "";
bool hasTask = false;
Coords position = Coords(NULL);