ACQ400_XRM (xrmIoc)
Loading...
Searching...
No Matches
acq400_Proxy.h
Go to the documentation of this file.
1/** @file acq400_Proxy.h
2 * @brief local proxy for UUT parameters, perhaps in a more accessible form
3 - #1 SMPL: to be clawed back from SMPL so we don't HAVE to have SOE instantiated and running.
4 - #2 CAL: $IOC_HOST:0:AI:CAL:ESLO/EOFF : view UUT calibration as a single vector of channels.
5 *
6 * Created on: 12 May 2026
7 * Author: pgm
8 */
9
10#ifndef XRMIOCAPP_SRC_ACQ400_PROXY_H_
11#define XRMIOCAPP_SRC_ACQ400_PROXY_H_
12
13#include "acq400_asyn_common.h"
14#include "xrm_structs.h"
15#include "SamplePrams.h"
16
17#define FIRST_SITE 1
18#define LAST_SITE 6
19
20#define MAX_SITES 6
21#define MAX_ADDR (MAX_SITES+1) // site 0 and selection of 1..6
22
23
24/* @@todo later .. */
25#define PS_SMPL_AGG_SITES "SMPL_AGG_SITES"
26#define PS_SMPL_SITE_SSB "SMPL_SITE_SSB" /* addr per site */
27#define PS_SMPL_NSAM "SMPL_NSAM"
28#define PS_SMPL_SITE_IS_ADC "SMPL_SITE_IS_ADC" /* addr per site */
29#define PS_SMPL_SS_U32 "SMPL_SS_U32"
30#define PS_SMPL_AI_COUNT "SMPL_AI_COUNT"
31#define PS_SMPL_DI_COUNT "SMPL_DI_COUNT"
32#define PS_SMPL_SP_COUNT "SMPL_SP_COUNT"
33
34#define PS_SMPL_DI_INDEX "SMPL_DI_INDEX"
35#define PS_SMPL_SP_INDEX "SMPL_SP_INDEX"
36
37#define PS_AI_CAL_ESLO "AI_CAL_ESLO" /* addr: 0:summary, 1..6 : mirror UUT */
38#define PS_AI_CAL_EOFF "AI_CAL_EOFF" /* addr: 0:summary, 1..6 : mirror UUT */
39
40class acq400_Proxy: public acq400_asynPortDriver {
41
42 SamplePrams samplePrams;
43
44 size_t ai_site_lengths[MAX_SITES+1];
45 epicsFloat32** eslo_src; // eslo_src[1..6][NCHAN+1] copy data from ACQ400IOC
46 epicsFloat32** eoff_src; // eoff_src[1..6][NCHAN+1] copy data from ACQ400IOC
47
48 epicsFloat32* eslo_dst; // eslo_dst[AGG_NCHAN+1] copy data from ACQ400IOC
49 epicsFloat32* eoff_dst; // eoff_dst[AGG_NCHAN+1] copy data from ACQ400IOC
50
51 static int verbose;
52
53 void get_sample_dimensions();
54 void get_cal();
55
56 virtual void task();
57
58 static void task_runner(void *drvPvt);
59
60 int P_SMPL_AGG_SITES; // asynParamOctet
61 int P_SMPL_SITE_SSB;
62 int P_SMPL_NSAM;
63 int P_SMPL_SITE_IS_ADC;
64 int P_SMPL_SS_U32;
65 int P_SMPL_AI_COUNT;
66 int P_SMPL_DI_COUNT;
67 int P_SMPL_SP_COUNT;
68 int P_SMPL_DI_INDEX;
69 int P_SMPL_SP_INDEX;
70
71 int P_AI_CAL_ESLO;
72 int P_AI_CAL_EOFF;
73
74 acq400_Proxy(const char *portName);
75
76 static acq400_Proxy* _instance;
77public:
78 static void create_instance(const char *portName);
79 static const SamplePrams *getSamplePrams() {
80 assert(_instance != 0);
81 return &_instance->samplePrams;
82 }
83 static acq400_Proxy& instance() {
84 assert(_instance != 0);
85 return *_instance;
86 }
87 virtual ~acq400_Proxy() {}
88
89 virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
90
91 virtual asynStatus writeFloat32Array(asynUser *pasynUser, epicsFloat32 *value,
92 size_t nElements);
93
94 const epicsFloat32* getEslo(int site) const;
95 const epicsFloat32* getEoff(int site) const;
96};
97#endif /* XRMIOCAPP_SRC_ACQ400_PROXY_H_ */
defines SamplePrams, sample geometry definition struct.
acq400_asynPortDriver(const char *portName, int maxAddr, int interfaceMask, int interruptMask, int asynFlags, int autoConnect, int priority, int stackSize)
Definition acq400_asynPortDriver.cpp:16
Definition SamplePrams.h:11
Declarations for key XRM structures for internal and wire (external) use.