← Documentation
ADS-IDAC Engine 5.0.0
InteractiveVariable.cpp
Go to the documentation of this file.
1// InteractiveVariable.cpp: implementation of the InteractiveVariable class.
2//
4
6#include <boost/serialization/export.hpp>
7#include <boost/archive/binary_oarchive.hpp>
8#include <boost/archive/binary_iarchive.hpp>
9BOOST_CLASS_EXPORT_IMPLEMENT(InteractiveVariable)
10using namespace std;
11
13// Construction/Destruction
15//only need_to_interact is TRUE the input_value will be used to update the system state
17{
18 input_value = -999.0;
19 display_value = -999.0;
20 need_to_interact = false;
23}
24
26{
27
28}
30 input_value = x;
31 need_to_interact = true;
32}
39 int obj_id;
41 obj_id = r5pars_.interact_obj[sequence_in_the_array];
43 finteract_(obj_id, input_value);
44 this->need_to_interact = false;
45 }
46}
49}
51 input_value = x;
52 need_to_interact = true;
53}
57 int i_need_to_interact;
59 i_need_to_interact = 1;
60 }
61 else{
62 i_need_to_interact = 0;
63 }
64 fout << input_value << ' ' << display_value << ' ' << i_need_to_interact << ' ' << sequence_in_the_array << '\n';
65 this->saveTHElementToFile(fout);
66}
68 int i_need_to_interact;
69 fin >> input_value >> display_value >> i_need_to_interact >> sequence_in_the_array;
70 if(i_need_to_interact == 1){
71 need_to_interact = true;
72 }
73 else{
74 need_to_interact = false;
75 }
77}
79 this->copyTHElement(_iv);
80 input_value = _iv.getInputValue(); // update intrva value
81 display_value = _iv.getDisplayValue();//display current intrva value
82 need_to_interact = _iv.getNeedToInteract();//flag for determining whether th einteractive action should be taken place
84}
void finteract_(int, double)
void setInteractiveAction(double)
void setDisplayValue(double val)
void readInfoFromFile(std::ifstream &)
void setInputValue(double val)
void copyInteractiveVariable(InteractiveVariable &)
void retrieveInteractiveVariableFromFile(std::ifstream &)
void setNeedToInteract(bool flag)
void setSequenceInTheArray(int seq)
void saveInteractiveVariableToFile(std::ofstream &)
void setTypeOfCard(Relap5ComponentType newTypeOfCard)
Definition: THElement.cpp:35
void saveTHElementToFile(std::ofstream &)
Definition: THElement.cpp:36
void copyTHElement(THElement &)
Definition: THElement.cpp:42
void readInfoFromFile(std::ifstream &)
Definition: THElement.cpp:31
void retrieveTHElementFromFile(std::ifstream &)
Definition: THElement.cpp:39
struct @0 r5pars_