6#include "../Branch/BranchRecord.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>
26typedef map<string, SystemControl *>
cp_type;
31 string control_type, control_name, control_unit;
35 fin >> control_type >> n_control;
36 for(i = 0; i < n_control; i++){
37 auto cv_ptr = make_unique<ControlValue>();
38 cv_ptr->readInfoFromFile(fin);
42 fin >> control_type >> n_control;
43 for(i = 0; i < n_control; i++){
44 auto cs_ptr = make_unique<ControlState>();
45 cs_ptr->readInfoFromFile(fin);
65 (*cs_itr)->initiateControlValue();
66 (*cs_itr)->getDisplayedControlState();
69 (*cv_itr)->initiateControlValue();
70 (*cv_itr)->getDisplayedControlValue();
77 fout <<
'\t' << (*cs_itr)->getDisplayName();
80 fout <<
'\t' << (*cv_itr)->getDisplayName();
86 fout <<
'\t' <<
"Cntrl Value";
89 fout <<
'\t' <<
"Cntrl Value";
97 fout <<
'\t' << (*cs_itr)->getDisplayedControlStateString();
100 fout <<
'\t' << (*cv_itr)->getDisplayedControlValue();
108 map<string, SystemControl *>::iterator map_itr;
112 ofstream fout(
"err messages.txt", ios::app);
113 cout <<
"ControlPanelControl::getControlFromMap " << _ctrl_name
114 <<
" can not be found." << endl;
115 fout <<
r5pars_.timesno <<
" ControlPanelControl::getControlFromMap " << _ctrl_name
116 <<
" can not be found.\n";
124 return map_itr->second;
128 map<string, SystemControl *>::iterator m_itr;
135 ofstream fout(
"err messages.txt", ios::app);
136 cout <<
"ControlPanelControl::executeValueControl control name: " << _ctrl_name <<
" can not be found." << endl;
137 fout <<
r5pars_.timesno <<
" ControlPanelControl::executeValueControl control name: " << _ctrl_name <<
" can not be found.\n";
153 map<string, SystemControl *>::iterator m_itr;
159 ofstream fout(
"err messages.txt", ios::app);
160 cout <<
"ControlPanelControl::executeStateControl control name: " << _ctrl_name <<
" can not be found." << endl;
161 fout <<
r5pars_.timesno <<
" ControlPanelControl::executeStateControl control name: " << _ctrl_name <<
" can not be found.\n";
172 ofstream fout(
"err messages.txt", ios::app);
173 cout <<
"ControlPanelControl::executeValueControl control name: " << _ctrl_name <<
" is a value control not state control" << endl;
174 fout <<
r5pars_.timesno <<
" ControlPanelControl::executeValueControl control name: " << _ctrl_name <<
" is a value control not state control.\n";
183 auto ptr = make_unique<ControlState>();
184 ptr->copyControlState(*src);
185 this->
control_map.insert(cp_type::value_type(ptr->getDisplayName(), ptr.get()));
189 auto ptr = make_unique<ControlValue>();
190 ptr->copyControlValue(*src);
191 this->
control_map.insert(cp_type::value_type(ptr->getDisplayName(), ptr.get()));
203 fout <<
"ControlPanelControl\n" << num <<
'\n';
204 for(i = 0; i < num; i++){
209 for(i = 0; i < num; i++){
216 string control_type, control_name, control_unit, str;
220 fin >> str >> n_control;
221 for(i = 0; i < n_control; i++){
222 auto cv_ptr = make_unique<ControlValue>();
223 cv_ptr->retrieveControlValueFromFile(fin);
228 for(i = 0; i < n_control; i++){
229 auto cs_ptr = make_unique<ControlState>();
230 cs_ptr->retrieveControlStateFromFile(fin);
map< string, SystemControl * > cp_type
SimulationContext g_sim
Global simulation context: the single instance, defined in SimulationContext.cpp.
void setTempTypeOfConsequence(Consequence)
Stores the consequence of the end state the running sequence will get.
void setTempESMessage(std::string)
Stores the description of the end state the running sequence will get if it is terminated (set by mod...
void outputParametersUnitsToFile(std::ofstream &)
void clearControlPanelControl()
void saveControlPanelControlToFile(std::ofstream &)
void initiateAllControls()
std::vector< std::unique_ptr< ControlValue > > control_value_array
std::map< std::string, SystemControl * > control_map
SystemControl * getControlFromMap(std::string)
void outputParametersValuesToFile(std::ofstream &)
virtual ~ControlPanelControl()
void outputParametersLabelsToFile(std::ofstream &)
std::vector< std::unique_ptr< ControlState > > control_state_array
int getTotalNumberOfControls()
int readInfoFromFile(std::ifstream &)
void executeValueControl(std::string, double)
void executeStateControl(std::string, int)
void copyControlPanelControl(ControlPanelControl &)
void retrieveControlPanelControlFromFile(std::ifstream &)
void performValueControl(SystemModule &, double)
void performDisplayedControlState(SystemModule &, int)
void performControl(SystemModule &, double)
SystemModule Plant
Maps RELAP5 card numbers to C++ objects.
BranchRecord Branch_center
Dynamic event tree state.