From 154b84ca697468123a8f16e95b65b1bbb26627f4 Mon Sep 17 00:00:00 2001 From: keenanlang Date: Fri, 22 Nov 2024 11:45:41 -0600 Subject: [PATCH 1/6] Make system configuration more clear --- iocs/LambdaIOC/iocBoot/iocLambda/ADLambda.iocsh | 17 +---------------- iocs/LambdaIOC/iocBoot/iocLambda/st.cmd | 2 +- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/iocs/LambdaIOC/iocBoot/iocLambda/ADLambda.iocsh b/iocs/LambdaIOC/iocBoot/iocLambda/ADLambda.iocsh index b25468b..ae17287 100644 --- a/iocs/LambdaIOC/iocBoot/iocLambda/ADLambda.iocsh +++ b/iocs/LambdaIOC/iocBoot/iocLambda/ADLambda.iocsh @@ -2,7 +2,7 @@ epicsEnvSet("EPICS_DB_INCLUDE_PATH", "$(ADCORE)/db") #LambdaConfig("Port Name", "Path to config", # of modules, # of threads to assign per module) -LambdaConfig("$(PORT)", "system.yml", 3) +LambdaConfig("$(PORT)", "/etc/opt/xsp/system.yml", $(NUM_MODULES=1)) dbLoadRecords("$(ADLAMBDA)/db/ADLambda.template","P=$(PREFIX),R=cam1:,PORT=$(PORT),ADDR=0,TIMEOUT=1") dbLoadRecords("$(ADLAMBDA)/db/LambdaModule.template", "P=$(PREFIX),R=cam1:,PORT=$(PORT),ADDR=0,TIMEOUT=1") @@ -15,20 +15,5 @@ dbLoadRecords("$(ADCORE)/db/NDPluginBase.template","P=$(PREFIX),R=image1:,PORT=I # The stitched image is 1558 x 1813 = 2,824,654 dbLoadRecords("$(ADCORE)/db/NDStdArrays.template", "P=$(PREFIX),R=image1:,PORT=Image1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),TYPE=Int16,FTVL=SHORT,NELEMENTS=2824654") -# Create a standard arrays plugin, set it to get data from Driver. -NDStdArraysConfigure("ImageA", 3, 0, "$(PORT)", 0) -dbLoadRecords("$(ADCORE)/db/NDPluginBase.template","P=$(PREFIX),R=imageA:,PORT=ImageA,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),NDARRAY_ADDR=0") -dbLoadRecords("$(ADCORE)/db/NDStdArrays.template", "P=$(PREFIX),R=imageA:,PORT=ImageA,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),TYPE=Int16,FTVL=SHORT,NELEMENTS=802896") - -# Create a standard arrays plugin, set it to get data from Driver. -NDStdArraysConfigure("ImageB", 3, 0, "$(PORT)", 1) -dbLoadRecords("$(ADCORE)/db/NDPluginBase.template","P=$(PREFIX),R=imageB:,PORT=ImageB,ADDR=1,TIMEOUT=1,NDARRAY_PORT=$(PORT),NDARRAY_ADDR=1") -dbLoadRecords("$(ADCORE)/db/NDStdArrays.template", "P=$(PREFIX),R=imageB:,PORT=ImageB,ADDR=1,TIMEOUT=1,NDARRAY_PORT=$(PORT),TYPE=Int16,FTVL=SHORT,NELEMENTS=802896") - -# Create a standard arrays plugin, set it to get data from Driver. -NDStdArraysConfigure("ImageC", 3, 0, "$(PORT)", 2) -dbLoadRecords("$(ADCORE)/db/NDPluginBase.template","P=$(PREFIX),R=imageC:,PORT=ImageC,ADDR=2,TIMEOUT=1,NDARRAY_PORT=$(PORT),NDARRAY_ADDR=2") -dbLoadRecords("$(ADCORE)/db/NDStdArrays.template", "P=$(PREFIX),R=imageC:,PORT=ImageC,ADDR=2,TIMEOUT=1,NDARRAY_PORT=$(PORT),TYPE=Int16,FTVL=SHORT,NELEMENTS=802896") - # Load all other plugins using commonPlugins.cmd iocshLoad("$(ADCORE)/iocBoot/commonPlugins.cmd", "QSIZE=30, XSIZE=2048, YSIZE=2048, NCHANS=2048, CBUFFS=1000") diff --git a/iocs/LambdaIOC/iocBoot/iocLambda/st.cmd b/iocs/LambdaIOC/iocBoot/iocLambda/st.cmd index 41e73cf..409ec63 100755 --- a/iocs/LambdaIOC/iocBoot/iocLambda/st.cmd +++ b/iocs/LambdaIOC/iocBoot/iocLambda/st.cmd @@ -6,7 +6,7 @@ dbLoadDatabase("$(TOP)/dbd/LambdaApp.dbd") LambdaApp_registerRecordDeviceDriver(pdbbase) -iocshLoad("ADLambda.iocsh", "PREFIX=LAMBDA1:, PORT=LAMBDA1") +iocshLoad("ADLambda.iocsh", "PREFIX=LAMBDA1:, PORT=LAMBDA1, NUM_MODULES=3") set_requestfile_path("$(ADLAMBDA)/LambdaApp/Db") From 2929a190b92bac544a066350d3a8211f95f4bb14 Mon Sep 17 00:00:00 2001 From: keenanlang Date: Fri, 22 Nov 2024 11:51:38 -0600 Subject: [PATCH 2/6] use installed req file --- LambdaApp/Db/Makefile | 2 ++ iocs/LambdaIOC/iocBoot/iocLambda/ADLambda_settings.req | 2 -- iocs/LambdaIOC/iocBoot/iocLambda/st.cmd | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) delete mode 100755 iocs/LambdaIOC/iocBoot/iocLambda/ADLambda_settings.req diff --git a/LambdaApp/Db/Makefile b/LambdaApp/Db/Makefile index d2d4926..3976bbc 100644 --- a/LambdaApp/Db/Makefile +++ b/LambdaApp/Db/Makefile @@ -13,6 +13,8 @@ include $(TOP)/configure/CONFIG DB += ADLambda.template DB += LambdaModule.template +DB += ADLambda_settings.req + #------------------------------------------- # If .db template is not named *.template add # _TEMPLATE = diff --git a/iocs/LambdaIOC/iocBoot/iocLambda/ADLambda_settings.req b/iocs/LambdaIOC/iocBoot/iocLambda/ADLambda_settings.req deleted file mode 100755 index 446df02..0000000 --- a/iocs/LambdaIOC/iocBoot/iocLambda/ADLambda_settings.req +++ /dev/null @@ -1,2 +0,0 @@ -$(P)$(R)EnergyThreshold -$(P)$(R)OperatingMode diff --git a/iocs/LambdaIOC/iocBoot/iocLambda/st.cmd b/iocs/LambdaIOC/iocBoot/iocLambda/st.cmd index 409ec63..129f2b1 100755 --- a/iocs/LambdaIOC/iocBoot/iocLambda/st.cmd +++ b/iocs/LambdaIOC/iocBoot/iocLambda/st.cmd @@ -8,7 +8,7 @@ LambdaApp_registerRecordDeviceDriver(pdbbase) iocshLoad("ADLambda.iocsh", "PREFIX=LAMBDA1:, PORT=LAMBDA1, NUM_MODULES=3") -set_requestfile_path("$(ADLAMBDA)/LambdaApp/Db") +set_requestfile_path("$(ADLAMBDA)/db") ########## iocInit() From 6a59fee607f785ea0119789900fd27f7b901b034 Mon Sep 17 00:00:00 2001 From: keenanlang Date: Fri, 22 Nov 2024 12:00:27 -0600 Subject: [PATCH 3/6] remove sector 8 specific pieces --- LambdaApp/op/ui/LambdaBase.ui | 49 +++-------------------------------- 1 file changed, 3 insertions(+), 46 deletions(-) diff --git a/LambdaApp/op/ui/LambdaBase.ui b/LambdaApp/op/ui/LambdaBase.ui index c4bb181..22f6600 100644 --- a/LambdaApp/op/ui/LambdaBase.ui +++ b/LambdaApp/op/ui/LambdaBase.ui @@ -136,48 +136,6 @@ QPushButton::menu-indicator {image: url(none.png); width: 0} LambdaReadout.adl - - - - 605 - 10 - 100 - 22 - - - - - IOC - - - - 223 - 223 - 223 - - - - - 53 - 132 - 0 - - - - 1 - - - 8idLambda.ui - - - - - - caRowColMenu::Menu - - - false - - @@ -650,13 +608,13 @@ QPushButton::menu-indicator {image: url(none.png); width: 0} - netCDF file #1;TIFF file #1;JPEG file #1;NeXus file #1;Magick file #1;HDF5 file #1;Null file #1;PipeWriterPlugin;Sparse Plugin 0;Sparse Plugin 1;Sparse Plugin 2;Sparse Plugin 3;IMM File + netCDF file #1;TIFF file #1;JPEG file #1;NeXus file #1;Magick file #1;HDF5 file #1;Null file #1 - NDFileNetCDF.adl;NDFileTIFF.adl;NDFileJPEG.adl;NDFileNexus.adl;NDFileMagick.adl;NDFileHDF5.adl;NDFileNull.adl;NDPluginPipeWriter.adl;NDSparse.adl;NDSparse.adl;NDSparse.adl;NDSparse.adl;NDFileIMM.adl + NDFileNetCDF.adl;NDFileTIFF.adl;NDFileJPEG.adl;NDFileNexus.adl;NDFileMagick.adl;NDFileHDF5.adl;NDFileNull.adl - P=$(P), R=netCDF1:, EXT=nc;P=$(P), R=TIFF1:, EXT=tif;P=$(P), R=JPEG1:, EXT=jpg;P=$(P), R=Nexus1:, EXT=h5;P=$(P), R=Magick1:, EXT=tif;P=$(P), R=HDF1:, EXT=h5;P=$(P), R=Null1:, EXT=null;P=$(P), R=PW1:;P=$(P), R=Sparse0:;P=$(P), R=Sparse1:;P=$(P), R=Sparse2:;P=$(P), R=Sparse3:;P=$(P), R=IMM1:, EXT=imm + P=$(P), R=netCDF1:, EXT=nc;P=$(P), R=TIFF1:, EXT=tif;P=$(P), R=JPEG1:, EXT=jpg;P=$(P), R=Nexus1:, EXT=h5;P=$(P), R=Magick1:, EXT=tif;P=$(P), R=HDF1:, EXT=h5;P=$(P), R=Null1:, EXT=null caRowColMenu::Menu @@ -1257,7 +1215,6 @@ QPushButton::menu-indicator {image: url(none.png); width: 0} caInclude_0 caInclude_1 caInclude_2 - carelateddisplay_2 cagraphics caLabel_6 calabel From d209ef4cc2f65b72502b3557b884fc11cd02c40d Mon Sep 17 00:00:00 2001 From: keenanlang Date: Fri, 22 Nov 2024 12:05:20 -0600 Subject: [PATCH 4/6] fixes #6 --- LambdaApp/src/ADLambda.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LambdaApp/src/ADLambda.cpp b/LambdaApp/src/ADLambda.cpp index aa26bb2..dbed987 100644 --- a/LambdaApp/src/ADLambda.cpp +++ b/LambdaApp/src/ADLambda.cpp @@ -120,8 +120,8 @@ configFileName(configPath) createParam( LAMBDA_EnergyThresholdString, asynParamFloat64, &LAMBDA_EnergyThreshold); createParam( LAMBDA_DualThresholdString, asynParamFloat64, &LAMBDA_DualThreshold); - setDoubleParam(LAMBDA_EnergyThreshold, 0.0); - setDoubleParam(LAMBDA_DualThreshold, 0.0); + setDoubleParam(LAMBDA_EnergyThreshold, 40.0); + setDoubleParam(LAMBDA_DualThreshold, 40.0); /* ************** From 2c998162eca28780f4775a32e4ae1df986016589 Mon Sep 17 00:00:00 2001 From: keenanlang Date: Fri, 22 Nov 2024 12:08:24 -0600 Subject: [PATCH 5/6] fixes #5 --- LambdaApp/op/ui/LambdaReadout.ui | 33 ++------------------------------ 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/LambdaApp/op/ui/LambdaReadout.ui b/LambdaApp/op/ui/LambdaReadout.ui index 4a746e1..3f06e76 100644 --- a/LambdaApp/op/ui/LambdaReadout.ui +++ b/LambdaApp/op/ui/LambdaReadout.ui @@ -338,7 +338,7 @@ QPushButton::menu-indicator {image: url(none.png); width: 0} - 29 + 30 105 180 20 @@ -572,7 +572,7 @@ QPushButton::menu-indicator {image: url(none.png); width: 0} - 10 + 105 -1 90 20 @@ -656,32 +656,8 @@ QPushButton::menu-indicator {image: url(none.png); width: 0} caLineEdit::string - - - - 120 - 0 - 80 - 20 - - - - $(P)$(R)DataType - - - caMenu::Static - - - - 115 - 223 - 255 - - - caLineEdit_7 caLabel_8 - camenu @@ -970,11 +946,6 @@ QPushButton::menu-indicator {image: url(none.png); width: 0} - - caMenu - QComboBox -
caMenu
-
caRelatedDisplay QWidget From c898666a756ddeb2ba791e3b0751b8ee0700c915 Mon Sep 17 00:00:00 2001 From: keenanlang Date: Fri, 22 Nov 2024 12:21:11 -0600 Subject: [PATCH 6/6] use new timestamp function --- LambdaApp/src/ADLambda.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/LambdaApp/src/ADLambda.cpp b/LambdaApp/src/ADLambda.cpp index dbed987..bc6412e 100644 --- a/LambdaApp/src/ADLambda.cpp +++ b/LambdaApp/src/ADLambda.cpp @@ -730,9 +730,7 @@ void ADLambda::acquireThread(int index) NDArray* output; - this->lock(); - epicsTimeStamp currentTime = epicsTime::getCurrent(); - + this->lock(); // If there's not an NDArray stored for this frame_no, create one if (this->hasDecoder) { @@ -740,8 +738,7 @@ void ADLambda::acquireThread(int index) output->uniqueId = frame_no; output->getInfo(&info); - output->timeStamp = currentTime.secPastEpoch + currentTime.nsec / ONE_BILLION; - updateTimeStamp(&(output->epicsTS)); + updateTimeStamps(output); memset((char*) output->pData, 0, imagedims_output[0] * imagedims_output[1] * info.bytesPerElement); @@ -752,8 +749,8 @@ void ADLambda::acquireThread(int index) NDArray* new_frame = pNDArrayPool->alloc(2, imagedims_output, (NDDataType_t) datatype, 0, NULL); new_frame->uniqueId = 0; new_frame->getInfo(&info); - new_frame->timeStamp = currentTime.secPastEpoch + currentTime.nsec / ONE_BILLION; - updateTimeStamp(&(new_frame->epicsTS)); + + updateTimeStamps(new_frame); memset((char*) new_frame->pData, 0, imagedims_output[0] * imagedims_output[1] * info.bytesPerElement);