From 4ccba7d69e7f230d21136e0ed6b228134f9a5bc1 Mon Sep 17 00:00:00 2001 From: "ezekiel.dohmen" <ezekiel.dohmen@ligo.org> Date: Thu, 22 Feb 2024 16:13:58 -0800 Subject: [PATCH] Adding define for system name, and using it for duotone struct member access --- src/epics/util/feCodeGen.pl | 6 ++++-- src/fe/controllerIop.c | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/epics/util/feCodeGen.pl b/src/epics/util/feCodeGen.pl index 1b52710f3..2b5dc4397 100755 --- a/src/epics/util/feCodeGen.pl +++ b/src/epics/util/feCodeGen.pl @@ -387,6 +387,8 @@ if($timemasterdepwarning == 1) { $systemName = substr($systemName, 2, 3); $plantName = $systemName; # Default plant name is the model name +print OUTH "\#define SYSDEF $systemName\n\n"; + #// - Perform some specific part checks/processing. #// - Check parts which require GROUND input in fact have ground connections. \n @@ -1261,8 +1263,8 @@ $inCnt = 0; my $subs = substr($skeleton,5); -print OUTH "#define MAX_FIR \t $firCnt\n"; -print OUTH "#define MAX_FIR_POLY \t $firCnt\n\n"; +print OUTH "#define MAX_FIR $firCnt\n"; +print OUTH "#define MAX_FIR_POLY $firCnt\n\n"; print EPICS "\nEPICS CDS_EPICS dspSpace coeffSpace epicsSpace\n\n"; print EPICS "\n\n"; diff --git a/src/fe/controllerIop.c b/src/fe/controllerIop.c index fbe802dcb..110a6141a 100644 --- a/src/fe/controllerIop.c +++ b/src/fe/controllerIop.c @@ -659,12 +659,12 @@ fe_start_controller( void ) double max_dt_diag_val = MAX_DT_DIAG_VAL + duotone_offset_usec; // set accepted duotone range in EPICS - pLocalEpics->iop.dtTimeFloat_high = max_dt_diag_val; - pLocalEpics->iop.dtTimeFloat_low = min_dt_diag_val; + pLocalEpics->SYSDEF.dtTimeFloat_high = max_dt_diag_val; + pLocalEpics->SYSDEF.dtTimeFloat_low = min_dt_diag_val; // add a bit more leeway and 4 extra cycles to dac limits - pLocalEpics->iop.dacDtTimeFloat_high = max_dt_diag_val + 2+(int)(4*(1e6/IOP_IO_RATE) + 0.5); - pLocalEpics->iop.dacDtTimeFloat_low = min_dt_diag_val - 2+(int)(4*(1e6/IOP_IO_RATE) + 0.5); + pLocalEpics->SYSDEF.dacDtTimeFloat_high = max_dt_diag_val + 2+(int)(4*(1e6/IOP_IO_RATE) + 0.5); + pLocalEpics->SYSDEF.dacDtTimeFloat_low = min_dt_diag_val - 2+(int)(4*(1e6/IOP_IO_RATE) + 0.5); /// calculate the best index to use for duotone values to get closest to the @@ -1118,7 +1118,7 @@ fe_start_controller( void ) duotoneTime = duotime( dt_data_count, dt_adc_data_offset, dt_diag.meanAdc, dt_diag.adc ); - pLocalEpics->iop.dtTimeFloat = (double)duotoneTime; + pLocalEpics->SYSDEF.dtTimeFloat = (double)duotoneTime; pLocalEpics->epicsOutput.dtTime = (int)duotoneTime; if ( ( ( duotoneTime < min_dt_diag_val ) || @@ -1138,7 +1138,7 @@ fe_start_controller( void ) pLocalEpics->epicsOutput.dacDtTime = (int)duotoneTimeDac; - pLocalEpics->iop.dacDtTimeFloat = duotoneTimeDac; + pLocalEpics->SYSDEF.dacDtTimeFloat = duotoneTimeDac; } -- GitLab