← Documentation
ADS-IDAC Engine 5.0.0
BranchSystemAlarmState.cpp
Go to the documentation of this file.
1// BranchSystemAlarmState.cpp: implementation of the BranchSystemAlarmState class.
2//
4
6#include "../Global/ConvertToString.h"
7#include <boost/serialization/export.hpp>
8#include "../Global/SimulationContext.h"
9#include <boost/archive/binary_oarchive.hpp>
10#include <boost/archive/binary_iarchive.hpp>
11BOOST_CLASS_EXPORT_IMPLEMENT(BranchSystemAlarmState)
12using namespace std;
13
14
16// Construction/Destruction
18
20{
21
22}
23
25{
26
27}
32}
34 string str;
35 str = "Alarm: Sender: ";
36 str += g_sim.Translator.getString(this->getSender());
37 str += "; Receiver: ";
39 str += "; Alarm: ";
40 str += this->getAlarmName();
41 str += "; Observed State: ";
43 return str;
44}
46 fout << ' ' << this->getSender() << ' ' << sim::Action::SendInfo << ' ' << sim::None << ' ' << this->getAlarmName() << " 1.0 "
47 << this->getTimeOfCommunication() << ' ' << this->getRemainingTime() << " 0.0 0 "
48 << '"' << "Intended_Receiver:" << g_sim.Translator.getString(this->getIntendedReceiver()) << '"' << '\n';
49}
51 this->saveSystemAlarmToFile(fout);
52 this->saveCommunicationToFile(fout);
54}
59}
SimulationContext g_sim
Global simulation context: the single instance, defined in SimulationContext.cpp.
std::string getAlarmName()
int getDisplayedAlarmState()
void saveBranchSystemAlarmStateToFile(std::ofstream &)
void retrieveBranchSystemAlarmStateFromFile(std::ifstream &)
void copyBranchSystemAlarmState(BranchSystemAlarmState &)
void saveInfoToFile(std::ostream &)
double getTimeOfCommunication()
void saveCommunicationToFile(std::ofstream &)
int getIntendedReceiver()
void retrieveCommunicationFromFile(std::ifstream &)
void copyCommunication(Communication &)
std::string getString(int) const
void saveSystemAlarmToFile(std::ofstream &)
Definition: SystemAlarm.cpp:33
void copySystemAlarm(SystemAlarm &)
Definition: SystemAlarm.cpp:29
void retrieveSystemAlarmFromFile(std::ifstream &)
Definition: SystemAlarm.cpp:37
void saveTimerAndProbabilityToFile(std::ofstream &)
void copyTimerAndProbability(TimerAndProbability &)
void retrieveTimerAndProbabilityFromFile(std::ifstream &)
double getRemainingTime()
Definition: Timer.cpp:31
constexpr int SendInfo
Definition: SimConstants.h:204
constexpr int None
Definition: SimConstants.h:75
ConvertToString Translator
Parameter name/value conversion.