38 std::string(
"The \"POLYNOMIAL_TIME_DEPENDENCE\" element defines ")
39 + std::string(
"polynomial coefficients for time dependent RF phase, ")
40 + std::string(
"frequency, amplitude, etc, given by ")
41 + std::string(
"f(t) = P0+P1*t+P2*t^2+P3*t^3 where t is the time in ns");
45 :
OpalElement(static_cast<int>(
SIZE),
"POLYNOMIAL_TIME_DEPENDENCE", doc_string.c_str()) {
54 "COEFFICIENTS",
"Polynomial coefficients as an array with arbitrary length.");
79 "Use P0..P3 or COEFFICIENTS to specify the coefficients, not both.");
82 if (polynomial_coefficients.empty()) {
89 getOpalName(), std::make_shared<PolynomialTimeDependence>(polynomial_coefficients));
double getReal(const Attribute &attr)
Return real value.
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
Attribute makeRealArray(const std::string &name, const std::string &help)
Create real array attribute.
std::vector< double > getRealArray(const Attribute &attr)
Get array value.
const std::string & getOpalName() const
Return object name.
std::vector< Attribute > itsAttr
The object attributes.
static void setTimeDependence(std::string name, std::shared_ptr< AbstractTimeDependence > time_dep)
Add a value to the lookup table.
virtual void print(std::ostream &) const
Print the object.
void registerOwnership() const
OpalPolynomialTimeDependence provides UI wrapper for the PolynomialTimeDependence.
OpalPolynomialTimeDependence()
Define mapping from enum variables to string UI parameter names.
static const std::string doc_string
void update()
Receive parameters from the parser and hand them off to the PolynomialTimeDependence.
virtual ~OpalPolynomialTimeDependence()
No memory allocated so does nothing.
virtual OpalPolynomialTimeDependence * clone(const std::string &name)
Inherited copy constructor.
virtual void print(std::ostream &) const
Calls print on the OpalElement.
The base class for all OPAL exceptions.