Free Electron
moaAS.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __moa_moaAS_h__
8 #define __moa_moaAS_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /// @brief
16 class AsComposer
17  : public AsNamed, public Initialize<AsComposer>
18 {
19  public:
20  AsConstruct(AsComposer);
21  void initialize(void)
22  {
23  add(frequency, FE_USE("composer:frequency"));
24  }
25  Accessor<t_moa_real> frequency;
26 };
27 
28 /// @brief
29 class AsMultiSweep
30  : public AsComposer, public Initialize<AsMultiSweep>
31 {
32  public:
33  AsConstruct(AsMultiSweep);
34  void initialize(void)
35  {
36  add(step, FE_USE("composer:step"));
37  add(outer, FE_USE("composer:outer"));
38  add(inner, FE_USE("composer:inner"));
39  add(linger, FE_USE("composer:linger"));
40  add(runup, FE_USE("composer:runup"));
41  }
42 
43  Accessor<String> step;
44  Accessor< Array<String> > outer;
45  Accessor< Array<String> > inner;
46  Accessor<t_moa_real> linger;
47  Accessor<t_moa_real> runup;
48 };
49 
50 class AsSimulatorLoop
51  : public AsComposer, public Initialize<AsSimulatorLoop>
52 {
53  public:
54  AsConstruct(AsSimulatorLoop);
55  void initialize(void)
56  {
57  add(linger, FE_USE("composer:linger"));
58  add(duration, FE_USE("loop:duration"));
59  }
60 
61  Accessor<t_moa_real> linger;
62  Accessor<t_moa_real> duration;
63 };
64 
65 
66 class AsEvaluateAction
67  : public AccessorSet, public Initialize<AsEvaluateAction>
68 {
69  public:
70  AsConstruct(AsEvaluateAction);
71  void initialize(void)
72  {
73  add(time, FE_USE("time:time"));
74  add(action, FE_USE("event:action"));
75  }
76  Accessor<t_moa_real> time;
77  Accessor<String> action;
78 };
79 
80 /// @brief
81 class AsFrequencyResponse
82  : public AsComposer, public Initialize<AsFrequencyResponse>
83 {
84  public:
85  AsConstruct(AsFrequencyResponse);
86  void initialize(void)
87  {
88  add(step, FE_USE("composer:step"));
89  add(home, FE_USE("composer:home"));
90  add(outer, FE_USE("composer:outer"));
91  add(inner, FE_USE("composer:inner"));
92  add(samples, FE_USE("composer:samples"));
93  }
94 
95  Accessor<String> step;
96  Accessor<String> home;
97  Accessor< Array<String> > outer;
98  Accessor< Array<String> > inner;
99  Accessor<int> samples;
100 };
101 
102 
103 /// @brief Clock
104 class AsTime
105  : public AsNamed, public Initialize<AsTime>
106 {
107  public:
108  AsConstruct(AsTime);
109  void initialize(void)
110  {
111  add(time, FE_USE("time:time"));
112  add(dt, FE_USE("time:dt"));
113  }
114  Record simClock(sp<RecordGroup> &a_rg)
115  {
116  bind(a_rg->scope());
117  Record r_time = recordFind<AsTime>(a_rg, FE_SIM_CLOCK);
118  if(!r_time.isValid())
119  {
120  sp<Layout> l_time = a_rg->scope()->declare(FE_L_TIME);
121  populate(l_time);
122  r_time = a_rg->scope()->createRecord(l_time);
123  a_rg->add(r_time);
124  name(r_time) = FE_SIM_CLOCK;
125  time(r_time) = 0.0;
126  dt(r_time) = 1.0;
127  }
128  return r_time;
129  }
130 
133 };
134 
135 
136 /// @brief
137 class AsOverlay
138  : public AsNamed, public Initialize<AsOverlay>
139 {
140  public:
141  AsConstruct(AsOverlay);
142  void initialize(void)
143  {
144  add(label, FE_USE("label"));
145  add(dataset, FE_USE("dataset:group"));
146  }
147 
148  Accessor<String> label;
149  Accessor< sp<RecordGroup> > dataset;
150 };
151 
152 
153 
154 /// @brief Time/Simulation Tick Signal
155 class AsTick
156  : public AccessorSet, public Initialize<AsTick>
157 {
158  public:
159  AsConstruct(AsTick);
160  void initialize(void)
161  {
162  add(id, FE_USE("note:id"));
163  }
164  Accessor<int> id;
165 };
166 
167 
168 /// @brief Splat Configuration
169 class AsSplat
170  : public AccessorSet, public Initialize<AsSplat>
171 {
172  public:
173  AsConstruct(AsSplat);
174  void initialize(void)
175  {
176  add(x_range, FE_USE("splat:x_range"));
177  add(y_range, FE_USE("splat:y_range"));
178  add(expression, FE_USE("splat:expression"));
179  add(name, FE_USE("name"));
180  add(splat, FE_USE("splat:splat"));
181  add(color, FE_USE("splat:color"));
182  }
183  AccessorR<t_moa_v2> x_range;
184  AccessorR<t_moa_v2> y_range;
185  AccessorR<String> expression;
186  AccessorR<String> name;
187  AccessorR<String> splat;
188  AccessorR<t_moa_v3> color;
189 };
190 
191 class AsSplatLine
192  : public AsSplat, public Initialize<AsSplatLine>
193 {
194  public:
195  AsConstruct(AsSplatLine);
196  void initialize(void)
197  {
198  add(is, FE_USE("splatline:is"));
199  }
200  Accessor<void> is;
201 };
202 
203 class AsNyquistLine
204  : public AsSplat, public Initialize<AsNyquistLine>
205 {
206  public:
207  AsConstruct(AsNyquistLine);
208  void initialize(void)
209  {
210  add(scale, FE_USE("nyquist:scale"));
211  }
212  Accessor<t_moa_real> scale;
213 };
214 
215 /// Something with a location in simulation
217  : public AccessorSet, public Initialize<AsLocator>
218 {
219  public:
220  AsConstruct(AsLocator);
221  void initialize(void)
222  {
223  add(transform, FE_USE("spc:transform"));
224  //add(transform_inv, FE_USE("spc:transform_inv"));
225  //add(velocity, FE_USE("spc:velocity"));
226  //add(angular_velocity, FE_USE("spc:angular_velocity"));
227  //add(force, FE_USE("sim:force"));
228  //add(moment, FE_USE("sim:moment"));
229  }
230  Accessor<t_moa_xform> transform;
231  //Accessor<t_moa_xform> transform_inv;
232  //Accessor<t_moa_v3> velocity;
233  //Accessor<t_moa_v3> angular_velocity;
234  //Accessor<t_moa_v3> force;
235  //Accessor<t_moa_v3> moment;
236 };
237 
238 
239 
240 #if 0
241 
242 ///
243 class AsPointsLocator
244  : public AsLocator, public Initialize<AsPointsLocator>
245 {
246  public:
247  AsConstruct(AsPointsLocator);
248  void initialize(void)
249  {
250  add(p0, FE_USE("spc:p0"));
251  add(p1, FE_USE("spc:p1"));
252  add(p1, FE_USE("spc:p1"));
253  }
254 };
255 
256 ///
257 class AsLocatorMount
258  : public AccessorSet, public Initialize<AsLocatorMount>
259 {
260  public:
261  AsConstruct(AsLocatorMount);
262  void initialize(void)
263  {
264  add(tire, FE_USE("spc:tire"));
265  add(locator, FE_USE("spc:locator"));
266  }
267 };
268 #endif
269 
270 } /* namespace ext */
271 } /* namespace fe */
272 
273 #endif /* __moa_moaAS_h__ */
Set of accessors.
Definition: AccessorSet.h:18
kernel
Definition: namespace.dox:3
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
Clock.
Definition: moaAS.h:104
Named Records.
Definition: datatoolAS.h:134
Something with a location in simulation.
Definition: moaAS.h:216
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Splat Configuration.
Definition: moaAS.h:169
Time/Simulation Tick Signal.
Definition: moaAS.h:155