OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
OpalVMonitor.cpp
Go to the documentation of this file.
1 // ------------------------------------------------------------------------
2 // $RCSfile: OpalVMonitor.cpp,v $
3 // ------------------------------------------------------------------------
4 // $Revision: 1.1.1.1 $
5 // ------------------------------------------------------------------------
6 // Copyright: see Copyright.readme
7 // ------------------------------------------------------------------------
8 //
9 // Class: OpalVMonitor
10 // The class of OPAL monitors for the vertical plane.
11 //
12 // ------------------------------------------------------------------------
13 //
14 // $Date: 2000/03/27 09:33:40 $
15 // $Author: Andreas Adelmann $
16 //
17 // ------------------------------------------------------------------------
18 
19 #include "Elements/OpalVMonitor.h"
20 #include "Attributes/Attributes.h"
22 
23 
24 // Class OpalVMonitor
25 // ------------------------------------------------------------------------
26 
28  OpalElement(COMMON, "VMONITOR",
29  "The \"VMONITOR\" element defines a monitor "
30  "for the vertical plane.") {
31  setElement((new YMonitorRep("VMONITOR"))->makeAlignWrapper());
32 }
33 
34 
35 OpalVMonitor::OpalVMonitor(const std::string &name, OpalVMonitor *parent):
36  OpalElement(name, parent) {
37  setElement((new YMonitorRep(name))->makeAlignWrapper());
38 }
39 
40 
42 {}
43 
44 
45 OpalVMonitor *OpalVMonitor::clone(const std::string &name) {
46  return new OpalVMonitor(name, this);
47 }
48 
49 
52 
53  YMonitorRep *mon =
54  dynamic_cast<YMonitorRep *>(getElement()->removeWrappers());
55  double length = Attributes::getReal(itsAttr[LENGTH]);
56  mon->setElementLength(length);
57 
58  // Transmit "unknown" attributes.
60 }
OpalVMonitor()
Exemplar constructor.
virtual ~OpalVMonitor()
virtual OpalVMonitor * clone(const std::string &name)
Make clone.
virtual ElementBase * removeWrappers()
Return the design element.
virtual void setElementLength(double length)
Set design length.
Definition: ElementBase.h:515
std::vector< Attribute > itsAttr
The object attributes (see Attribute.hh).
Definition: Object.h:214
virtual void update()
Update the embedded CLASSIC monitor.
Base class for all beam line elements.
Definition: OpalElement.h:41
The VMONITOR element.
Definition: OpalVMonitor.h:28
void setElement(ElementBase *)
Assign new CLASSIC element.
Definition: Element.h:133
virtual void update()
Update the embedded CLASSIC element.
virtual void updateUnknown(ElementBase *)
Transmit the ``unknown&#39;&#39; (not known to OPAL) attributes to CLASSIC.
ElementBase * getElement() const
Return the embedded CLASSIC element.
Definition: Element.h:128
Representation for a orbit position monitor.
Definition: YMonitorRep.h:31
const std::string name
double getReal(const Attribute &attr)
Return real value.
Definition: Attributes.cpp:217