From 3bb045e05ec34d581c46f8ab1c7956ffff4b8797 Mon Sep 17 00:00:00 2001 From: Rolf Bork <rolf.bork@ligo.org> Date: Wed, 18 Nov 2015 21:54:37 +0000 Subject: [PATCH] Continued work on Coeff file bug #894 and #896: - Added creation of a diff file (Foton vs Loaded coeffs). - Added 'Diff' button on GDS_TP screen to present xterm with list of diffs. git-svn-id: https://redoubt.ligo-wa.caltech.edu/svn/advLigoRTS/trunk@4077 6dcd42c9-f523-4c6d-aada-af552506706e --- config/Makefile.linux | 3 ++- src/epics/seq/main.c | 20 +++++++++++++++----- src/epics/util/lib/medmGenGdsTp.pm | 7 +++++-- src/epics/util/skeleton.st | 7 ++++++- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/config/Makefile.linux b/config/Makefile.linux index e0e6b512a..7f7627924 100644 --- a/config/Makefile.linux +++ b/config/Makefile.linux @@ -138,7 +138,8 @@ install: $(DB) echo "dbLoadRecords \"db/$${ifo}/`basename $$i`\"" >> target/$(TARGET)/$(TARGET)$$ifo.cmd; \ echo "epicsEnvSet DAQ_FILE /opt/rtcds/$(SITE)/${ifo}/chans/daq/$$ucmodel.ini" >> target/$(TARGET)/$(TARGET)$$ifo.cmd; \ echo "epicsEnvSet DAQ_DIR /opt/rtcds/$(SITE)/${ifo}/chans/daq/" >> target/$(TARGET)/$(TARGET)$$ifo.cmd; \ - echo "epicsEnvSet PHOTON_FILE /opt/rtcds/$(SITE)/${ifo}/chans/$$ucmodel.txt" >> target/$(TARGET)/$(TARGET)$$ifo.cmd; \ + echo "epicsEnvSet FOTON_FILE /opt/rtcds/$(SITE)/${ifo}/chans/$$ucmodel.txt" >> target/$(TARGET)/$(TARGET)$$ifo.cmd; \ + echo "epicsEnvSet FOTON_DIFF_FILE /opt/rtcds/$(SITE)/${ifo}/chans/tmp/$$ucmodel.diff" >> target/$(TARGET)/$(TARGET)$$ifo.cmd; \ echo "epicsEnvSet COEFF_FILE /opt/rtcds/$(SITE)/${ifo}/chans/tmp/$$ucmodel.txt" >> target/$(TARGET)/$(TARGET)$$ifo.cmd; \ echo "epicsEnvSet LOG_DIR /opt/rtcds/$(SITE)/${ifo}/log/$$model" >> target/$(TARGET)/$(TARGET)$$ifo.cmd; \ echo "epicsEnvSet SDF_DIR /opt/rtcds/$(SITE)/${ifo}/target/$$model/$(TARGET)/burt/" >> target/$(TARGET)/$(TARGET)$$ifo.cmd; \ diff --git a/src/epics/seq/main.c b/src/epics/seq/main.c index c06c80027..9b0491382 100644 --- a/src/epics/seq/main.c +++ b/src/epics/seq/main.c @@ -2604,7 +2604,9 @@ int main(int argc,char *argv[]) int fivesectimer = 0; long daqFileCrc = 0; long coeffFileCrc = 0; - long photonFileCrc = 0; + long fotonFileCrc = 0; + long prevFotonFileCrc = 0; + long prevCoeffFileCrc = 0; long sdfFileCrc = 0; char modfilemsg[] = "Modified File Detected "; struct stat st = {0}; @@ -2644,8 +2646,10 @@ int main(int argc,char *argv[]) char *targetdir = getenv("TARGET_DIR"); char *daqFile = getenv("DAQ_FILE"); char *coeffFile = getenv("COEFF_FILE"); - char *photonFile = getenv("PHOTON_FILE"); + char *fotonFile = getenv("FOTON_FILE"); + char *fotonDiffFile = getenv("FOTON_DIFF_FILE"); char *logdir = getenv("LOG_DIR"); + char myDiffCmd[256]; if(stat(logdir, &st) == -1) mkdir(logdir,0777); // strcat(sdf,"_safe"); @@ -2848,7 +2852,9 @@ sleep(5); // Initialize DAQ and COEFF file CRC checksums for later compares. daqFileCrc = checkFileCrc(daqFile); coeffFileCrc = checkFileCrc(coeffFile); - photonFileCrc = checkFileCrc(photonFile); + fotonFileCrc = checkFileCrc(fotonFile); + prevFotonFileCrc = fotonFileCrc; + prevCoeffFileCrc = coeffFileCrc; reportSetErrors(pref, 0,setErrTable,0); sleep(1); // Need to wait before first restore to allow sequencers time to do their initialization. @@ -3219,12 +3225,16 @@ sleep(5); logFileEntry("Detected Change to DAQ Config file."); } coeffFileCrc = checkFileCrc(coeffFile); - photonFileCrc = checkFileCrc(photonFile); - if(photonFileCrc != coeffFileCrc) { + fotonFileCrc = checkFileCrc(fotonFile); + if(fotonFileCrc != coeffFileCrc) { status = dbPutField(&coeffmsgaddr,DBR_STRING,modfilemsg,1); } else { status = dbPutField(&coeffmsgaddr,DBR_STRING,"",1); } + if(fotonFileCrc != prevFotonFileCrc || prevCoeffFileCrc != coeffFileCrc) { + sprintf(myDiffCmd,"%s %s %s %s %s","diff",fotonFile,coeffFile," > ",fotonDiffFile); + status = system(myDiffCmd); + } status = checkFileCrc(sdffileloaded); if(status == -1) { sdfFileCrc = status; diff --git a/src/epics/util/lib/medmGenGdsTp.pm b/src/epics/util/lib/medmGenGdsTp.pm index eb019128f..2e1575631 100644 --- a/src/epics/util/lib/medmGenGdsTp.pm +++ b/src/epics/util/lib/medmGenGdsTp.pm @@ -273,9 +273,12 @@ sub createGdsMedm # Add Coeff load time Monitor $xpos = 562; $ypos = 210; $width = 200; $height = 18; $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_MSG",$ecolors{white},$ecolors{blue},"static"); - # Add Coeff load time Monitor - $xpos = 562; $ypos = 230; $width = 200; $height = 18; + # Add Coeff Msg2 Monitor + $xpos = 562; $ypos = 230; $width = 160; $height = 18; $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_MSG2",$ecolors{white},$ecolors{blue},"static"); + $xpos = 722; $ypos = 230; $width = 40; $height = 18; + $arg = "/opt/rtcds/"; + $medmdata .= ("CDS::medmGen::medmGenShellCmd") -> ($xpos,$ypos,$width,$height,$ecolors{black},$ecolors{yellow},1,"Diff","Coeff Diff","xterm -e view",$scriptTarget); # ************* Create DAQ Status Info Block ***************************************************************** diff --git a/src/epics/util/skeleton.st b/src/epics/util/skeleton.st index a06d9cef8..f634b1f62 100644 --- a/src/epics/util/skeleton.st +++ b/src/epics/util/skeleton.st @@ -253,10 +253,11 @@ assign tcsEnable to "{ifo}:TCS-SERVO_EN"; %% static char ifo[160]; %% static char daqsys[160]; -%% char fName[3][256]; /* MA */ +%% char fName[4][256]; /* MA */ %% char fType[3][10] = {"IIR", "FIR", "IIR & FIR"}; /* MA */ %% char fNameDAQ[256]; /* ma */ %% char cpCmd[256]; /* ma */ +%% char diffCmd[256]; /* ma */ %% char cfdir[256]; %% char cfmodel[256] = ""; @@ -370,6 +371,7 @@ state init %% strcat(fName[2], "tmp/"); /* MA */ %% strcat_upper(fName[2], fmc.system); /* MA */ %% strcat_upper(fName[0], fmc.system); /* MA */ +%% strcpy(fName[3],fName[2]); %% strcat_upper(cfmodel, fmc.system); /* MA */ %% if (strlen(fmc.subSys[0].name) > 0) { /* MA */ %% strcat(fName[0], "_"); /* MA */ @@ -380,14 +382,17 @@ state init %% strcat(fName[0], "txt"); /* MA */ %% strcat(fName[2], ".txt"); /* MA */ %% strcat(fName[1], "fir"); /* MA */ +%% strcat(fName[3], ".diff"); /* MA */ %% sprintf(cpCmd,"%s %s %s","cp",fName[0],fName[2]); %% printf("copy file with command = %s\n",cpCmd); +%% sprintf(diffCmd,"%s %s %s %s %s","diff",fName[0],fName[2]," > ",fName[3]); %DECL3% %% int status = system(cpCmd); %% printf("copy file with status = %d\n",status); +%% status = system(diffCmd); %% fmc.pVmeCoeff = (VME_COEF *)pVmeCoeff; /* Initialize pointer for fmReadCoeffFile() */ #if MAX_MODULES > 0 %% for(ii=0;ii<MAX_MODULES;ii++) -- GitLab