DCSModulesAPI  1.0.0
DCS sub project containing all the control modules as libraries.
internal.h
Go to the documentation of this file.
1 #pragma once
3 #include "../../config/exports.h"
4 
17 #define INTERNAL_SAMP_SIZE 1000
18 
19 namespace DCS
20 {
21  namespace DAQ
22  {
27  typedef void* TaskHandle;
28 
42  DCS::i32 VoltageEvent(TaskHandle taskHandle, DCS::i32 everyNsamplesEventType, DCS::u32 nSamples, void *callbackData);
43 
53  //DCS_REGISTER_EVENT
54  //DCS::i32 CounterEvent(DCS::u64 totalCount, DCS::u64 diffCount);
55 
60  typedef DCS::i32 (*NIDataCallback)(TaskHandle taskHandle, DCS::i32 everyNsamplesEventType, DCS::u32 nSamples, void *callbackData);
61 
66  typedef DCS::i32 (*NIErrorCallback)(TaskHandle taskHandle, DCS::i32 status, void *callbackData);
67 
73  {
74  ChannelType type;
75  ChannelRef ref;
76  };
77 
83  {
84  TaskHandle ni_opaque_handler;
85 
86  DCS::i32 clock_edge;
87  DCS::f64 clock_rate;
88 
89  DCS::i32 sample_mode;
90  DCS::u64 num_samples;
91 
92  NIDataCallback acq_callback;
93  NIErrorCallback err_callback = nullptr;
94 
95  DCS::u8* taskData = nullptr;
96 
97  DCS::Utils::String name;
98 
99  std::map<const char*, InternalChannel> vchannels;
100  };
101 
107  {
108  f64 ptr[INTERNAL_SAMP_SIZE];
109 
110  Timer::Timestamp timestamp;
111 
112  f64 measured_angle;
113  f64 predicted_angle;
114  };
115 
120  DCS_INTERNAL_TEST void CreateTask(InternalTask* t, const char* name);
121 
126  DCS_INTERNAL_TEST void SetupTask(InternalTask* t, const char* clk_source, DCS::f64 clk, DCS::u64 num_samp, NIDataCallback func);
127 
132  DCS_INTERNAL_TEST void AddTaskChannel(InternalTask* t, const char* channel_name, ChannelType type, ChannelRef ref, ChannelLimits lims, const char* virtual_channel_name = nullptr);
133 
138  DCS_INTERNAL_TEST void StartTask(InternalTask* t);
139 
144  DCS_INTERNAL_TEST void StopTask(InternalTask* t);
145 
150  DCS_INTERNAL_TEST void ClearTask(InternalTask* t);
151 
157  }
158 }
Exposes DAQ functionalities of the API to the end user.
double f64
Equivalent to double.
Definition: DCS_ModuleUtils.h:61
unsigned long u32
Equivalent to uint_32t.
Definition: DCS_ModuleUtils.h:54
signed long i32
Equivalent to int_32t.
Definition: DCS_ModuleUtils.h:53
A wrapper class used to export a simple string to the client side.
Definition: DCS_ModuleUtils.h:73
Definition: internal.h:82
ChannelType
Classifies a channel type of the DAQ.
Definition: DCS_ModuleAcquisition.h:30
Definition: internal.h:72
Represents a timestamp divided fieldwise.
Definition: DCS_ModuleUtils.h:295
ChannelRef
Classifies a channel reference connector for the DAQ.
Definition: DCS_ModuleAcquisition.h:40
Definition: registry.h:70
Definition: internal.h:106
#define DCS_INTERNAL_TEST
Defines the export interface acessible via the dll-interface applicable for internal functions only...
Definition: exports.h:137
Channel measurement numeric limits.
Definition: DCS_ModuleAcquisition.h:56
unsigned long long u64
Equivalent to uint_64t.
Definition: DCS_ModuleUtils.h:52
unsigned char u8
Equivalent to uint_8t.
Definition: DCS_ModuleUtils.h:58
#define DCS_REGISTER_EVENT
Append this definition before function declarations (or anywhere in the code) to register a tcp conne...
Definition: exports.h:95