24 "The \"SINUSOIDAL_TIME_DEPENDENCE\" element defines "
25 "sinusoidal coefficients for a time dependence, "
26 "frequency, amplitude, phase offset, DC offset, given by "
27 "f(t) = sigma_over_i(a[i] / 2 * sin(2 * pi * f[i] * t + p[i]) + o[i])";
30 :
OpalElement(static_cast<int>(
SIZE),
"SINUSOIDAL_TIME_DEPENDENCE", doc_string.c_str()) {
33 "Sine wave frequencies, length determines the number of size waves included.");
35 "AMPLITUDES",
"Peak-to-peak amplitude for each size wave. If undefined, defaults to 1.0.");
37 "PHASE_OFFSETS",
"Phase offset for each sine wave. If undefined, defaults to 0.0.");
39 "DC_OFFSETS",
"DC offset for each sine wave. If undefined, defaults to 0.0.");
58 getOpalName(), std::make_shared<SinusoidalTimeDependence>(
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
The UI wrapper for SinusoidalTimeDependence.
static const std::string doc_string
OpalSinusoidalTimeDependence * clone(const std::string &name) override
Inherited copy constructor.
OpalSinusoidalTimeDependence()
Define mapping from enum variables to string UI parameter names.
void update() override
Receive parameters from the parser and hand them off to the OpalSinusoidalTimeDependence.
void print(std::ostream &) const override
Calls print on the OpalElement.