Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
RsaTypes.h
Go to the documentation of this file.
1#pragma once
2#include <misc/gen/Value.h>
3#include <rsa/iface/global.h>
4
5namespace sf
6{
7
11constexpr const char* US_METHOD_PEAK = "Peak";
12
16constexpr const char* US_METHOD_COPY = "Copy";
17
22{
26 typedef unsigned long long IdType;
27
32
36 typedef void (*NotifyProc)(void* data, IdType id);
37
42 {
43 ParamState() = default;
44
45 ParamState(const ParamState& ps) = default;
46
47 ParamState(std::string name, Value val)
48 : name(std::move(name))
49 , value(std::move(val))
50 {}
51
52 bool operator==(const ParamState& ps) const
53 {
54 return name == ps.name;
55 }
56
60 std::string name;
65 };
66
71
76 {
78 pfReadonly = 1 << 0,
80 pfEffectsParameter = 1 << 1,
82 pfEffectsResult = 1 << 2,
84 pfEffectsData = 1 << 3,
86 pfChannelSingle = 1 << 4,
88 pfGate = 1 << 5,
90 pfMethod = 1 << 6,
92 pfExport = 1 << 7,
94 pfSystem = 1 << 8,
96 pfWriteable = 1 << 9,
98 pfAlias = 1 << 10,
100 pfArchive = 1 << 11,
102 pfWriteAtOff = 1 << 12,
103 };
104
109 {
110 rfGate = 1 << 0,// Result is generated by a gate.
111 rfIndex = 1 << 1,// Result contains synced i/o input.
112 rfAsync = 1 << 2,// Result data is not sync synchronous.
113 rfAsyncIndex = 1 << 3,// Result keeps track of sync counter values at the time async data was generated.
114 rfHugeData = 1 << 4,// Result that generates a huge amount of data.
115 rfStored = 1 << 5,// Generates data to be stored.
116 };
117
122 {
124 {
125 Init();
126 }
127
129 {
130 Copy(pi);
131 }
132
134 {
135 Copy(pi);
136 return *this;
137 }
138
139 void Init()
140 {
141 Id = 0;
142 Flags = 0;
143 Gate = 0;
144 Index = 0;
145 Channel = 0;
146 Name.clear();
147 Unit.clear();
148 Description.clear();
149 Round.setType(Value::vitUndefined);
150 Default.set(Round);
151 Minimum.set(Round);
152 Maximum.set(Round);
153 States.clear();
154 }
155
157 {
158 Id = pi.Id;
159 Name = pi.Name;
160 Description = pi.Description;
161 Gate = pi.Gate;
162 Channel = pi.Channel;
163 Flags = pi.Flags;
164 Index = pi.Index;
165 Round = pi.Round;
166 Default = pi.Default;
167 Maximum = pi.Maximum;
168 Minimum = pi.Minimum;
169 States = pi.States;
170 return *this;
171 }
172
176 IdType Id{0};
181 unsigned Gate{0};
185 unsigned Index{0};
190 unsigned Channel{0};
194 std::string Name;
198 std::string Unit;
202 std::string Description;
226 int Flags{0};
227 };
228
233 {
234 ResultInfo() = default;
235
236 void reset()
237 {
238 Id = 0;
239 Flags = 0;
240 Gate = 0;
241 Index = 0;
242 Channel = 0;
243 Name.clear();
244 Description.clear();
245 Bits = 0;
246 WordSize = 0;
247 ArraySize = 0;
248 Offset = 0;
249 }
250
252 {
253 Copy(pi);
254 }
255
257 {
258 Copy(pi);
259 return *this;
260 }
261
263 {
264 Id = pi.Id;
265 Flags = pi.Flags;
266 Name = pi.Name;
267 Gate = pi.Gate;
268 Index = pi.Index;
269 Channel = pi.Channel;
270 WordSize = pi.WordSize;
271 ArraySize = pi.ArraySize;
272 Bits = pi.Bits;
273 Offset = pi.Offset;
274 return *this;
275 }
276
280 IdType Id{0};
284 int Flags{0};
289 unsigned Gate{0};
293 unsigned Index{0};
298 unsigned Channel{0};
302 std::string Name;
306 std::string Description;
310 unsigned Bits{0};
314 unsigned WordSize{0};
318 unsigned ArraySize{0};
322 int Offset{0};
323 };
324
329 {
333 BufferInfo() = default;
334
338 void Clear()
339 {
340 Buffer = nullptr;
341 Size = 0;
342 BlockBufSize = 0;
343 Remain = 0;
344 Counter = 0;
345 }
346
350 void* Buffer{nullptr};
354 size_t Size{0};
358 size_t BlockBufSize{0};
362 size_t Remain{0};
366 size_t Counter{0};
367 };
368
373 {
377 atEddyCurrent
378 };
379
384 enum EDefaultParam : uint64_t
385 {
387 apNone = 0x0000,
388 /*
389 * Interface parameters from here.
390 * 0x0000 is used for the interface implementation parameter.
391 * 0x0001 is used for the RunMode parameter.
392 */
394 apChannels = 0x0002,
396 apError = 0x0003,
397 // Restart is imminent when an error occurs less than zero.
398 // Acquisition cannot continue when errors occur larger than zero.
400 apErrorMessage = 0x0004,
402 apAmplitudeUnit = 0x0005,
404 apUserFirst = 0x000F,
405 /*
406 * Channel parameters from here.
407 */
409 apChannel_Mask = 0x4000,
411 apChannel_RepRate = 0x4001,
413 apChannel_SyncMode = 0x4002,
415 apChannel_Gates = 0x4003,
417 apChannel_Inputs = 0x4004,
419 apChannel_TimeUnits = 0x4005,
421 apChannel_CopyDelay = 0x4006,
423 apChannel_CopyRange = 0x4007,
425 apChannel_SampleRate = 0x4008,
427 apChannel_CopyEnable = 0x4009,
432 apChannel_PopManual = 0x400A,
437 apChannel_BiDirMode = 0x400B,
439 apChannel_UserFirst = 0x401F,
440 /*
441 * Gate parameters from here.
442 */
444 apGate_Mask = 0x8000,
446 apGate_Name = 0x8001,
448 apGate_Delay = 0x8002,
450 apGate_Range = 0x8003,
452 apGate_SlaveTo = 0x8004,
454 apGate_Enable = 0x8005,
456 apGate_Method = 0x8006,
458 apGate_Threshold = 0x8007,
460 apGate_Amplitude = 0x8008,
462 apGate_TimeOfFlight = 0x8009,
464 apGate_UserFirst = 0x801F,
465 };
466
471 enum EDefaultResult : uint64_t
472 {
474 arNone = 0x0000,
476 arUserFirst = 0x0001,
477 /*
478 * Channel results from here.
479 */
481 arChannel_Mask = 0x4000,
483 arChannel_PopIndex = 0x4001,
485 arChannel_CopyData = 0x4002,
487 arChannel_CopyIndex = 0x4003,
489 arChannel_UserFirst = 0x401F,
490 /*
491 * Gate results from here.
492 */
494 arGate_Amplitude = 0x8001,
495 arGate_TimeOfFlight = 0x8002,
496 arGate_Copy = 0x8003,
498 arGate_Mask = 0x8000,
500 arGate_UserFirst = 0x801F
501 };
502
507 {
509 pmDisabled = 0,
513 pmTrigger
514 };
515};
516
517}// namespace sf
Counted vector having additional methods and operators for ease of usage. This template class extends...
Definition TVector.h:20
Value container class able to performing arithmetic functions.
Definition Value.h:19
Definition Application.h:10
constexpr const char * US_METHOD_PEAK
Names used for method identification.
Definition RsaTypes.h:11
constexpr const char * US_METHOD_COPY
Method for generating sample copy results in array's of Amplitude values.
Definition RsaTypes.h:16
#define _RSA_CLASS
Definition rsa/iface/global.h:35
Definition RsaTypes.h:329
BufferInfo()=default
Initializing constructor.
void Clear()
Definition RsaTypes.h:338
Structure to hold parameter information.
Definition RsaTypes.h:122
ParamInfo(const ParamInfo &pi)
Definition RsaTypes.h:128
std::string Name
Definition RsaTypes.h:194
Value Minimum
Definition RsaTypes.h:214
ParamInfo & operator=(const ParamInfo &pi)
Definition RsaTypes.h:133
ParamInfo & Copy(const ParamInfo &pi)
Definition RsaTypes.h:156
int Flags
Definition RsaTypes.h:226
Value Maximum
Definition RsaTypes.h:218
Value Default
Definition RsaTypes.h:210
IdType Id
Definition RsaTypes.h:176
std::string Description
Definition RsaTypes.h:202
unsigned Index
Definition RsaTypes.h:185
std::string Unit
Definition RsaTypes.h:198
Value Round
Definition RsaTypes.h:206
void Init()
Definition RsaTypes.h:139
unsigned Channel
Definition RsaTypes.h:190
unsigned Gate
Definition RsaTypes.h:181
ParamInfo()
Definition RsaTypes.h:123
ParamStates States
Definition RsaTypes.h:222
Structure to hold a single state consisting of a name and value.
Definition RsaTypes.h:42
Value value
Holds the value of the state.
Definition RsaTypes.h:64
ParamState(std::string name, Value val)
Definition RsaTypes.h:47
ParamState(const ParamState &ps)=default
std::string name
Holds the name of the state.
Definition RsaTypes.h:60
bool operator==(const ParamState &ps) const
Definition RsaTypes.h:52
Definition RsaTypes.h:233
unsigned Channel
Holds the channel number of this parameter. When channel is UINT_MAX the param is not a gate related ...
Definition RsaTypes.h:298
std::string Name
Name of the parameter.
Definition RsaTypes.h:302
void reset()
Definition RsaTypes.h:236
unsigned Index
Param index in the hierarchy of the gate or non gate params.
Definition RsaTypes.h:293
IdType Id
Holds a unique id for the current situation.
Definition RsaTypes.h:280
int Flags
Flags.
Definition RsaTypes.h:284
std::string Description
Usage off the parameter of the parameter.
Definition RsaTypes.h:306
ResultInfo(const ResultInfo &pi)
Definition RsaTypes.h:251
int Offset
Level offset of the generated data.
Definition RsaTypes.h:322
ResultInfo & operator=(const ResultInfo &pi)
Definition RsaTypes.h:256
ResultInfo & Copy(const ResultInfo &pi)
Definition RsaTypes.h:262
unsigned Bits
Amount of Bits used to store the actual value.
Definition RsaTypes.h:310
unsigned WordSize
Amount of bytes 1, 2 or 4 (later 8) used for storing a single value.
Definition RsaTypes.h:314
unsigned Gate
Holds the gate number this gate belongs to. When gate is UINT_MAX the param is not a gate related par...
Definition RsaTypes.h:289
unsigned ArraySize
Amount of values in an array for an arrayed value.
Definition RsaTypes.h:318
Type holding all types for the RsaInterface in a single namespaced structure.
Definition RsaTypes.h:22
EDefaultResult
Definition RsaTypes.h:472
TVector< ParamState > ParamStates
Vector to specify states.
Definition RsaTypes.h:70
TVector< IdType > IdList
Type for gathering parameter ID's.
Definition RsaTypes.h:31
EDefaultParam
Definition RsaTypes.h:385
EResultFlag
Result flags for defining result behaviour.
Definition RsaTypes.h:109
unsigned long long IdType
Type for gathering parameter ID's.
Definition RsaTypes.h:26
EAcquisitionType
Definition RsaTypes.h:373
@ atUltrasonic
Definition RsaTypes.h:375
EPopManual
Enumerate for the pop manual function.
Definition RsaTypes.h:507
@ pmReady
Definition RsaTypes.h:511
EParamFlag
Parameter flags for defining parameter behaviour.
Definition RsaTypes.h:76