OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
BeamlineFieldElement.cpp
Go to the documentation of this file.
2
3extern Inform* gmsg;
4
6 std::shared_ptr<Component> element, const double& start, const double& end)
7 : element_m(element), start_m(start), end_m(end), is_on_m(false) {}
8
10
11void BeamlineFieldElement::setOn(const double& kineticEnergy) {
12 if (!is_on_m) {
13 element_m->goOnline(kineticEnergy);
14 *gmsg << "* " << element_m->getName() << " gone live" << endl;
15 is_on_m = true;
16 }
17}
18
20 if (is_on_m) {
21 element_m->goOffline();
22 *gmsg << "* " << element_m->getName() << " gone off" << endl;
23 is_on_m = false;
24 }
25}
Inform * gmsg
Definition changes.cpp:7
Inform * gmsg
Definition changes.cpp:7
void setOn(const double &kinematicEnergy)
std::shared_ptr< Component > element_m
BeamlineFieldElement(std::shared_ptr< Component >, const double &, const double &)