20 #include <epicsStdio.h>
36 void copy(
const char* nname,
const TEccParams_t& nparams)
40 params.pParams =
new TEccParam_t[nparams.len];
42 memcpy(
params.pParams, nparams.pParams, nparams.len *
sizeof(TEccParam_t));
46 os <<
"Technique " <<
name << std::endl;
47 for (
int i = 0; i<
params.len; ++i)
49 os <<
"Param name " <<
params.pParams[i].ParamStr << std::endl;
50 os <<
"Param type " <<
params.pParams[i].ParamType << std::endl;
51 os <<
"Param val " <<
params.pParams[i].ParamVal << std::endl;
52 os <<
"Param index " <<
params.pParams[i].ParamIndex << std::endl;
73 #define NCHANNELS 1 // 1 to `16
77 for(
int i=0; i<16; ++i)
79 my_channels[i].
info.Channel = i;
80 my_channels[i].
info.State = KBIO_STATE_STOP;
81 my_channels[i].
info.NbOfTechniques = 0;
85 #define CHECK_CONNECTION_ID(__ID) \
86 if (__ID != my_connection_id) \
90 #define CHECK_CHANNEL(__CH) \
91 if (__CH >= NCHANNELS) \
97 #define DEBUG_PRINT(__arg)
103 strncpy(pVersion, version, *psize);
104 pVersion[*psize-1] =
'\0';
105 *psize = strlen(version);
132 pInfos->DeviceCode = KBIO_DEV_SP200;
134 pInfos->NumberOfSlots = 1;
199 memcpy(pInfos, &(my_channels[ch].info),
sizeof(TChannelInfos_t));
216 if (DisplayParams ==
true)
228 if (TechIndx >= my_channels[channel].techniques.size())
237 BIOLOGIC_API(
int) BL_StartChannelStub (
int ID, uint8 channel)
244 time(&(my_channels[channel].start));
248 BIOLOGIC_API(
int) BL_StopChannelStub (
int ID, uint8 channel)
264 pValues->Eoverflow = 3;
265 pValues->TimeBase = 1e-6;
266 pValues->MemFilled = 0;
282 BIOLOGIC_API(
int) BL_GetDataStub(
int ID, uint8 channel, TDataBuffer_t*
pBuf, TDataInfos_t* pInfos, TCurrentValues_t*
pValues )
293 if (pos == std::string::npos)
297 if (my_channels[channel].techniques[i].name.substr(pos+1) ==
"ocv4.ecc")
301 pInfos->TechniqueID = KBIO_TECHID_OCV;
302 pInfos->ProcessIndex = 0;
305 t = (time(NULL) - pInfos->StartTime) / pValues->TimeBase;
306 pBuf->data[0] = (t >> 32);
307 pBuf->data[1] = (t & 0xffffffff);
310 if (my_channels[channel].techniques[i].name.substr(pos+1) ==
"peis4.ecc")
312 pInfos->TechniqueID = KBIO_TECHID_PEIS;
315 if (time(NULL) % 2 == 0)
317 pInfos->ProcessIndex = 0;
320 t = (time(NULL) - pInfos->StartTime) / pValues->TimeBase;
321 pBuf->data[0] = (t >> 32);
322 pBuf->data[1] = (t & 0xffffffff);
328 pInfos->ProcessIndex = 1;
350 memset(TExpInfos, 0,
sizeof(TExperimentInfos_t));
uint8 const char TEccParams_t bool FirstTechnique
void copy(const char *nname, const TEccParams_t &nparams)
#define CHECK_CHANNEL(__CH)
uint8 int uint8 bool bool ForceReload
uint8 int TDeviceInfos_t * pInfos
memcpy(pInfos,&(my_channels[ch].info), sizeof(TChannelInfos_t))
std::vector< MyTechnique > techniques
uint8 int uint8 bool bool const char const char * XlxFile
uint8 const char TEccParams_t bool bool LastTechnique
#define DEBUG_PRINT(__arg)
MyTechnique(const MyTechnique &t)
void print(std::ostream &os)
uint8 TExperimentInfos_t TExpInfos
static MyChannel my_channels[16]
static int my_connection_id
uint8 const char TEccParams_t bool bool bool DisplayParams
uint8 int uint8 bool ShowGauge
uint8 TDataBuffer_t * pBuf
static const char * version
uint8 TCurrentValues_t * pValues
strncpy(pVersion, version,*psize)
static unsigned castFloatToInt(float f)
void print(std::ostream &os)
uint8 const char TEccParams_t Params
uint8 int TEccParams_t const char * EccFileName
uint8 int uint8 bool bool const char * BinFile
BIOLOGIC_API(int) BL_GetLibVersionStub(char *pVersion
Provide an interface to EC lab functions, converting error codes into C++ exceptions.
MyTechnique(const char *nname, const TEccParams_t &nparams)
#define CHECK_CONNECTION_ID(__ID)
memset(TExpInfos, 0, sizeof(TExperimentInfos_t))
uint8 const char * pFName
BL_GetCurrentValuesStub(ID, channel, pValues)
static void init_channels()