Commit 0ba5920b authored by frey_m's avatar frey_m
Browse files

OpalElement: upper case string attribute

parent 648a4183
......@@ -401,7 +401,6 @@ double RFCavity::getPhi0() const {
}
void RFCavity::setComponentType(std::string name) {
name = Util::toUpper(name);
if(name == "STANDING") {
type_m = SW;
} else if(name == "SINGLEGAP") {
......
......@@ -84,7 +84,7 @@ OpalCyclotron::OpalCyclotron():
itsAttr[RFPHI] = Attributes::makeRealArray
("RFPHI", "Initial phase(s) of the electric field map(s) [deg]");
itsAttr[TYPE] = Attributes::makeString
itsAttr[TYPE] = Attributes::makeUpperCaseString
("TYPE", "Used to identify special cyclotron types");
itsAttr[MINZ] = Attributes::makeReal
......
......@@ -47,7 +47,7 @@ std::map < std::string, OwnPtr<AttCell> > OpalElement::attributeRegistry;
OpalElement::OpalElement(int size, const char *name, const char *help):
Element(size, name, help), itsSize(size) {
itsAttr[TYPE] = Attributes::makeString
itsAttr[TYPE] = Attributes::makeUpperCaseString
("TYPE", "The element design type (the project name)");
itsAttr[LENGTH] = Attributes::makeReal
("L", "The element length in m");
......
......@@ -65,7 +65,7 @@ void OpalMonitor::update() {
mon->setElementLength(length);
mon->setOutputFN(Attributes::getString(itsAttr[OUTFN]));
if (Util::toUpper(Attributes::getString(itsAttr[TYPE])) == "TEMPORAL") {
if (Attributes::getString(itsAttr[TYPE]) == "TEMPORAL") {
mon->setType(Monitor::TEMPORAL);
} else {
mon->setType(Monitor::SPATIAL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment