mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
feat(alarm state): refactor to separe alarm state from radar state. Kown issue: alarm state is not correctly mantained
This commit is contained in:
@@ -406,17 +406,17 @@ void Scheduler::handleRequest(string key, json::value value, string username, js
|
||||
log(username + " set unit " + unit->getUnitName() + "(" + unit->getName() + ") ROE to " + to_string(ROE), true);
|
||||
}
|
||||
}
|
||||
else if (key.compare("commandAlarmState") == 0)
|
||||
else if (key.compare("setAlarmState") == 0)
|
||||
{
|
||||
unsigned int ID = value[L"ID"].as_integer();
|
||||
unitsManager->acquireControl(ID);
|
||||
Unit* unit = unitsManager->getGroupLeader(ID);
|
||||
if (unit != nullptr) {
|
||||
unsigned char alarmState = value[L"alarmState"].as_integer();
|
||||
unit->commandAlarmState(alarmState);
|
||||
unit->setAlarmState(alarmState);
|
||||
log(username + " set unit " + unit->getUnitName() + "(" + unit->getName() + ") alarm state to " + to_string(alarmState), true);
|
||||
} else {
|
||||
log("Error while setting commandAlarmState. Unit does not exist.");
|
||||
log("Error while setting setAlarmState. Unit does not exist.");
|
||||
}
|
||||
}
|
||||
/************************/
|
||||
|
||||
Reference in New Issue
Block a user