47 "The \"SELECT\" sub-command selects the positions to be affected "
48 "by subsequent error sub-commands.") {
50 "LINE",
"Name of the lattice to be affected by selections",
"UNNAMED_USE");
54 "RANGE",
"Range to be considered for selection (default: full range)");
58 "TYPE",
"The type name of elements to be selected (default: all types)");
60 "PATTERN",
"Regular expression for matching names (default: all names)");
77 select(*line->fetchLine());
78 }
else if (
Table* table =
dynamic_cast<Table*
>(obj)) {
82 "Select::execute()",
"You cannot do a \"SELECT\" on \"" + name
83 +
"\", it is neither a line nor a table.");
86 throw OpalException(
"Select::execute()",
"Object \"" + name +
"\" not found.");
96 *
gmsg << level2 <<
"\nAll elements selected.\n" << endl;
103 *
gmsg << level2 <<
"\nAll elements de-selected.\n" << endl;
114 *
gmsg << level2 <<
"No elements";
115 }
else if (count == 1) {
116 *
gmsg << level2 <<
"\n1 element";
118 *
gmsg << level2 <<
'\n' << count <<
" elements";
120 *
gmsg << level2 <<
" selected.\n" << endl;
The base class for all OPAL actions.
The base class for all OPAL beam lines and sequences.
An abstract sequence of beam line components.
void execute() override
Apply the algorithm to the top-level beamline.
Set/reset all selection flags in a beam line built from FlaggedElmPtr.
The base class for all OPAL objects.
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
std::vector< Attribute > itsAttr
The object attributes.
static OpalData * getInstance()
virtual void execute()
Execute the command.
void select(const Beamline &)
virtual Select * clone(const std::string &name)
Make clone.
Select()
Exemplar constructor.
int getCount() const
Return the count of selected elements.
virtual void execute()
Execute the selection.
The base class for all OPAL tables.
Attribute makeBool(const std::string &name, const std::string &help)
Make logical attribute.
Attribute makeRange(const std::string &name, const std::string &help)
Create a range attribute.
bool getBool(const Attribute &attr)
Return logical value.
std::string getString(const Attribute &attr)
Get string value.
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
RangeRep getRange(const Attribute &attr)
Get range value.