← Documentation
ADS-IDAC Engine 5.0.0
ControlPanel.h
Go to the documentation of this file.
1#pragma once
2
10
11#include <iostream>
12#include "../Global/SharedConfig.h"
13#include <boost/serialization/split_member.hpp>
14#include <typeinfo>
15#include <boost/serialization/string.hpp>
16#include <boost/archive/text_iarchive.hpp>
17#include <boost/archive/text_oarchive.hpp>
18#include <string>
19#include <fstream>
20#include "ControlPanelAlarm.h"
21#include "ControlPanelDisplay.h"
22#include "ControlPanelControl.h"
23#include <boost/serialization/export.hpp>
24
25
27public:
29 virtual ~ControlPanel();
30 void readInfoFromFile();
32 double getCurrentTime();
33 void setCurrentTime();
35 void updateDisplay();
36 void checkForNewAlarms();
41 void executeValueControl(std::string, double);
42 void executeStateControl(std::string, int);
44 void oneThroughProcess();
47 void clearControlPanel();
48 void clearForRestart();
49 void saveControlPanelToFile(std::ofstream &);
50 void retrieveControlPanelFromFile(std::ifstream &);
51
55// SPDS safety_par_display_system;
56
57private:
61
62 // State overlay: the archive carries live values and per-element state;
63 // layout and definitions are re-seeded from the shared panel master at load.
65 BOOST_SERIALIZATION_SPLIT_MEMBER()
66 template<class Archive>
67 void save(Archive &ar, const unsigned int) const {
68 ar & current_time;
71 ar & alarms;
72 ar & indicators;
73 ar & controls;
74 }
75 template<class Archive>
76 void load(Archive &ar, const unsigned int) {
77 if (const ControlPanel* master = adsidac::shared_control_panel();
78 master != nullptr && master != this)
79 seedFromMaster(*master);
80 ar & current_time;
83 ar & alarms;
84 ar & indicators;
85 ar & controls;
86 }
87public:
88 void seedFromMaster(const ControlPanel& master);
89};
90
91
92BOOST_CLASS_EXPORT_KEY(ControlPanel)
void setCurrentTime()
void seedFromMaster(const ControlPanel &master)
double total_weight_of_activated_alarm
Definition: ControlPanel.h:60
int total_number_of_activated_alarm
Definition: ControlPanel.h:59
void save(Archive &ar, const unsigned int) const
Definition: ControlPanel.h:67
void checkForNewAlarms()
void load(Archive &ar, const unsigned int)
Definition: ControlPanel.h:76
void retrieveControlPanelFromFile(std::ifstream &)
int getTotalNumberOfActivatedAlarm()
void copyControlPanel(ControlPanel &)
void executeStateControl(std::string, int)
void executeRequestToPlant()
ControlPanelDisplay indicators
Definition: ControlPanel.h:53
ControlPanelControl controls
Definition: ControlPanel.h:54
void copyControlPanelForRestart(ControlPanel &)
void updateTotalNumberOfActivatedAlarm(int)
void clearForRestart()
void readInfoFromFile()
void saveControlPanelToFile(std::ofstream &)
void updateDisplayAndAlarm()
virtual ~ControlPanel()
void oneThroughProcess()
double getTotalWeightOfActivatedAlarm()
void updateTotalWeightOfActivatedAlarm(double)
double current_time
Definition: ControlPanel.h:58
void executeValueControl(std::string, double)
friend class boost::serialization::access
Definition: ControlPanel.h:64
void clearControlPanel()
void initiationForSimulation()
void updateDisplay()
ControlPanelAlarm alarms
Definition: ControlPanel.h:52
double getCurrentTime()
const ControlPanel * shared_control_panel()