Commit f53816a6 authored by kraus's avatar kraus

order elements before switching them off

parent 93541f92
......@@ -160,7 +160,11 @@ void OpalBeamline::switchElementsOff(const double &min, ElementBase::ElementType
}
void OpalBeamline::switchElementsOff() {
for(FieldList::iterator flit = elements_m.begin(); flit != elements_m.end(); ++ flit)
elements_m.sort([](const ClassicField& a, const ClassicField& b) {
return a.getElement()->getName() < b.getElement()->getName();
});
for (FieldList::iterator flit = elements_m.begin(); flit != elements_m.end(); ++ flit)
(*flit).setOff();
}
......
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