From a6d532af75ac94791aa8ddc97735b406acaa7e58 Mon Sep 17 00:00:00 2001
From: Rolf Bork <rolf.bork@ligo.org>
Date: Mon, 4 Aug 2014 16:21:24 +0000
Subject: [PATCH] Synced with Branch-2.9 for SDF updates.

git-svn-id: https://redoubt.ligo-wa.caltech.edu/svn/advLigoRTS/trunk@3779 6dcd42c9-f523-4c6d-aada-af552506706e
---
 src/epics/seq/main.c               |   8 +-
 src/epics/util/SDF_RESTORE.adl     | 606 +++++++++++++----------------
 src/epics/util/fmseq.pl            |   8 +-
 src/epics/util/lib/medmGenGdsTp.pm |   2 +-
 4 files changed, 279 insertions(+), 345 deletions(-)

diff --git a/src/epics/seq/main.c b/src/epics/seq/main.c
index 9aad67ebe..70b9887c4 100644
--- a/src/epics/seq/main.c
+++ b/src/epics/seq/main.c
@@ -1119,11 +1119,11 @@ sleep(2);
 	char edbloadedFile[256]; sprintf(edbloadedFile, "%s_%s", pref, "SDF_LOADED_EDB");	// Name of file presently loaded
 	status = dbNameToAddr(edbloadedFile,&edbloadedaddr);		// Get Address
 
-	char speStat[256]; sprintf(speStat, "%s_%s", pref, "SDF_SP_ERR_CNT");		// Setpoint diff counter
+	char speStat[256]; sprintf(speStat, "%s_%s", pref, "SDF_DIFF_CNT");		// Setpoint diff counter
 	status = dbNameToAddr(speStat,&sperroraddr);			// Get Address
 	status = dbPutField(&sperroraddr,DBR_LONG,&sperror,1);		// Init to zero.
 
-	char spaStat[256]; sprintf(spaStat, "%s_%s", pref, "SDF_ALARM_COUNT");		// Number of alarm settings in a BURT file.
+	char spaStat[256]; sprintf(spaStat, "%s_%s", pref, "SDF_ALARM_CNT");		// Number of alarm settings in a BURT file.
 	status = dbNameToAddr(spaStat,&alrmchcountaddr);		// Get Address
 	status = dbPutField(&alrmchcountaddr,DBR_LONG,&alarmCnt,1);	// Init to zero.
 
@@ -1133,7 +1133,7 @@ sleep(2);
 	char fsc[256]; sprintf(fsc, "%s_%s", pref, "SDF_FILE_SET_CNT");			// Number of settings inBURT file
 	status = dbNameToAddr(fsc,&filesetcntaddr);
 
-	char mcc[256]; sprintf(mcc, "%s_%s", pref, "SDF_MON_CNT");			// Number of settings NOT being monitored.
+	char mcc[256]; sprintf(mcc, "%s_%s", pref, "SDF_UNMON_CNT");			// Number of settings NOT being monitored.
 	status = dbNameToAddr(mcc,&monchancntaddr);
 
 	char tsrname[256]; sprintf(tsrname, "%s_%s", pref, "SDF_SORT");			// SDF Table sorting request
@@ -1142,7 +1142,7 @@ sleep(2);
 	char cnfname[256]; sprintf(cnfname, "%s_%s", pref, "SDF_DROP_CNT");		// Number of channels not found.
 	status = dbNameToAddr(cnfname,&chnotfoundaddr);
 
-	char cniname[256]; sprintf(cniname, "%s_%s", pref, "SDF_UNSET_CNT");		// Number of channels not initialized.
+	char cniname[256]; sprintf(cniname, "%s_%s", pref, "SDF_UNINIT_CNT");		// Number of channels not initialized.
 	status = dbNameToAddr(cniname,&chnotinitaddr);
 
 	char stename[256]; sprintf(stename, "%s_%s", pref, "SDF_TABLE_ENTRIES");	// Number of entries in an SDF reporting table.
diff --git a/src/epics/util/SDF_RESTORE.adl b/src/epics/util/SDF_RESTORE.adl
index 51c1de0ff..df72a27f5 100644
--- a/src/epics/util/SDF_RESTORE.adl
+++ b/src/epics/util/SDF_RESTORE.adl
@@ -431,382 +431,316 @@ text {
 	label="LOAD EDB ONLY"
 	release_msg="4"
 }
+"text update" {
+	object {
+		x=424
+		y=83
+		width=50
+		height=16
+	}
+	monitor {
+		chan="SITE_NAME:FEC-DCU_NODE_ID_SDF_ALARM_CNT"
+		clr=0
+		bclr=14
+	}
+	align="horiz. centered"
+	limits {
+	}
+}
+text {
+	object {
+		x=424
+		y=52
+		width=50
+		height=16
+	}
+	"basic attribute" {
+		clr=14
+	}
+	textix="ALARM"
+	align="horiz. centered"
+}
+text {
+	object {
+		x=424
+		y=68
+		width=50
+		height=16
+	}
+	"basic attribute" {
+		clr=14
+	}
+	textix="SETS"
+	align="horiz. centered"
+}
+"text update" {
+	object {
+		x=358
+		y=83
+		width=50
+		height=16
+	}
+	monitor {
+		chan="SITE_NAME:FEC-DCU_NODE_ID_SDF_DROP_CNT"
+		clr=0
+		bclr=14
+	}
+	align="horiz. centered"
+	limits {
+	}
+}
+text {
+	object {
+		x=358
+		y=52
+		width=50
+		height=16
+	}
+	"basic attribute" {
+		clr=14
+	}
+	textix="NOT"
+	align="horiz. centered"
+}
+text {
+	object {
+		x=358
+		y=68
+		width=50
+		height=16
+	}
+	"basic attribute" {
+		clr=14
+	}
+	textix="FOUND"
+	align="horiz. centered"
+}
+"text update" {
+	object {
+		x=292
+		y=83
+		width=50
+		height=16
+	}
+	monitor {
+		chan="SITE_NAME:FEC-DCU_NODE_ID_SDF_UNINIT_CNT"
+		clr=0
+		bclr=14
+	}
+	align="horiz. centered"
+	limits {
+	}
+}
+text {
+	object {
+		x=292
+		y=52
+		width=50
+		height=16
+	}
+	"basic attribute" {
+		clr=14
+	}
+	textix="NOT"
+	align="horiz. centered"
+}
+text {
+	object {
+		x=292
+		y=68
+		width=50
+		height=16
+	}
+	"basic attribute" {
+		clr=14
+	}
+	textix="INIT"
+	align="horiz. centered"
+}
+text {
+	object {
+		x=94
+		y=68
+		width=50
+		height=16
+	}
+	"basic attribute" {
+		clr=14
+	}
+	textix="DIFFS"
+	align="horiz. centered"
+}
+"text update" {
+	object {
+		x=94
+		y=83
+		width=50
+		height=16
+	}
+	monitor {
+		chan="SITE_NAME:FEC-DCU_NODE_ID_SDF_DIFF_CNT"
+		clr=0
+		bclr=14
+	}
+	align="horiz. centered"
+	limits {
+	}
+}
+text {
+	object {
+		x=94
+		y=52
+		width=50
+		height=16
+	}
+	"basic attribute" {
+		clr=14
+	}
+	textix="TOTAL"
+	align="horiz. centered"
+}
 composite {
 	object {
 		x=28
 		y=52
-		width=446
-		height=68
+		width=50
+		height=47
 	}
 	"composite name"=""
 	children {
-		composite {
+		"text update" {
 			object {
-				x=424
-				y=52
+				x=28
+				y=83
 				width=50
-				height=47
-			}
-			"composite name"=""
-			children {
-				"text update" {
-					object {
-						x=424
-						y=83
-						width=50
-						height=16
-					}
-					monitor {
-						chan="SITE_NAME:FEC-DCU_NODE_ID_SDF_ALARM_COUNT"
-						clr=0
-						bclr=14
-					}
-					align="horiz. centered"
-					limits {
-					}
-				}
-				text {
-					object {
-						x=424
-						y=52
-						width=50
-						height=16
-					}
-					"basic attribute" {
-						clr=14
-					}
-					textix="ALARM"
-					align="horiz. centered"
-				}
-				text {
-					object {
-						x=424
-						y=68
-						width=50
-						height=16
-					}
-					"basic attribute" {
-						clr=14
-					}
-					textix="SETS"
-					align="horiz. centered"
-				}
+				height=16
 			}
-		}
-		composite {
-			object {
-				x=358
-				y=52
-				width=50
-				height=47
+			monitor {
+				chan="SITE_NAME:FEC-DCU_NODE_ID_SDF_FULL_CNT"
+				clr=0
+				bclr=14
 			}
-			"composite name"=""
-			children {
-				"text update" {
-					object {
-						x=358
-						y=83
-						width=50
-						height=16
-					}
-					monitor {
-						chan="SITE_NAME:FEC-DCU_NODE_ID_SDF_DROP_CNT"
-						clr=0
-						bclr=14
-					}
-					align="horiz. centered"
-					limits {
-					}
-				}
-				text {
-					object {
-						x=358
-						y=52
-						width=50
-						height=16
-					}
-					"basic attribute" {
-						clr=14
-					}
-					textix="NOT"
-					align="horiz. centered"
-				}
-				text {
-					object {
-						x=358
-						y=68
-						width=50
-						height=16
-					}
-					"basic attribute" {
-						clr=14
-					}
-					textix="FOUND"
-					align="horiz. centered"
-				}
+			align="horiz. centered"
+			limits {
 			}
 		}
-		composite {
+		text {
 			object {
-				x=292
+				x=28
 				y=52
 				width=50
-				height=47
+				height=16
 			}
-			"composite name"=""
-			children {
-				"text update" {
-					object {
-						x=292
-						y=83
-						width=50
-						height=16
-					}
-					monitor {
-						chan="SITE_NAME:FEC-DCU_NODE_ID_SDF_UNSET_CNT"
-						clr=0
-						bclr=14
-					}
-					align="horiz. centered"
-					limits {
-					}
-				}
-				text {
-					object {
-						x=292
-						y=52
-						width=50
-						height=16
-					}
-					"basic attribute" {
-						clr=14
-					}
-					textix="NOT"
-					align="horiz. centered"
-				}
-				text {
-					object {
-						x=292
-						y=68
-						width=50
-						height=16
-					}
-					"basic attribute" {
-						clr=14
-					}
-					textix="INIT"
-					align="horiz. centered"
-				}
+			"basic attribute" {
+				clr=14
 			}
+			textix="TOTAL"
+			align="horiz. centered"
 		}
-		composite {
+		text {
 			object {
-				x=94
-				y=52
+				x=28
+				y=68
 				width=50
-				height=47
+				height=16
 			}
-			"composite name"=""
-			children {
-				text {
-					object {
-						x=94
-						y=68
-						width=50
-						height=16
-					}
-					"basic attribute" {
-						clr=14
-					}
-					textix="DIFFS"
-					align="horiz. centered"
-				}
-				"text update" {
-					object {
-						x=94
-						y=83
-						width=50
-						height=16
-					}
-					monitor {
-						chan="SITE_NAME:FEC-DCU_NODE_ID_SDF_SP_ERR_CNT"
-						clr=0
-						bclr=14
-					}
-					align="horiz. centered"
-					limits {
-					}
-				}
-				text {
-					object {
-						x=94
-						y=52
-						width=50
-						height=16
-					}
-					"basic attribute" {
-						clr=14
-					}
-					textix="TOTAL"
-					align="horiz. centered"
-				}
+			"basic attribute" {
+				clr=14
 			}
+			textix="SET PTS"
+			align="horiz. centered"
 		}
-		composite {
+	}
+}
+text {
+	object {
+		x=160
+		y=68
+		width=50
+		height=16
+	}
+	"basic attribute" {
+		clr=14
+	}
+	textix="MONITORED"
+	align="horiz. centered"
+}
+"text update" {
+	object {
+		x=160
+		y=83
+		width=50
+		height=16
+	}
+	monitor {
+		chan="SITE_NAME:FEC-DCU_NODE_ID_SDF_UNMON_CNT"
+		clr=0
+		bclr=14
+	}
+	align="horiz. centered"
+	limits {
+	}
+}
+text {
+	object {
+		x=160
+		y=52
+		width=50
+		height=16
+	}
+	"basic attribute" {
+		clr=14
+	}
+	textix="NOT"
+	align="horiz. centered"
+}
+composite {
+	object {
+		x=226
+		y=52
+		width=50
+		height=68
+	}
+	"composite name"=""
+	children {
+		"choice button" {
 			object {
-				x=28
-				y=52
+				x=226
+				y=82
 				width=50
-				height=47
+				height=38
 			}
-			"composite name"=""
-			children {
-				"text update" {
-					object {
-						x=28
-						y=83
-						width=50
-						height=16
-					}
-					monitor {
-						chan="SITE_NAME:FEC-DCU_NODE_ID_SDF_FULL_CNT"
-						clr=0
-						bclr=14
-					}
-					align="horiz. centered"
-					limits {
-					}
-				}
-				text {
-					object {
-						x=28
-						y=52
-						width=50
-						height=16
-					}
-					"basic attribute" {
-						clr=14
-					}
-					textix="TOTAL"
-					align="horiz. centered"
-				}
-				text {
-					object {
-						x=28
-						y=68
-						width=50
-						height=16
-					}
-					"basic attribute" {
-						clr=14
-					}
-					textix="SET PTS"
-					align="horiz. centered"
-				}
+			control {
+				chan="SITE_NAME:FEC-DCU_NODE_ID_SDF_MON_ALL"
+				clr=0
+				bclr=29
 			}
 		}
-		composite {
+		text {
 			object {
-				x=160
+				x=226
 				y=52
 				width=50
-				height=47
+				height=16
 			}
-			"composite name"=""
-			children {
-				text {
-					object {
-						x=160
-						y=68
-						width=50
-						height=16
-					}
-					"basic attribute" {
-						clr=14
-					}
-					textix="MONITORED"
-					align="horiz. centered"
-				}
-				"text update" {
-					object {
-						x=160
-						y=83
-						width=50
-						height=16
-					}
-					monitor {
-						chan="SITE_NAME:FEC-DCU_NODE_ID_SDF_MON_CNT"
-						clr=0
-						bclr=14
-					}
-					align="horiz. centered"
-					limits {
-					}
-				}
-				text {
-					object {
-						x=160
-						y=52
-						width=50
-						height=16
-					}
-					"basic attribute" {
-						clr=14
-					}
-					textix="NOT"
-					align="horiz. centered"
-				}
+			"basic attribute" {
+				clr=14
 			}
+			textix="MONITOR"
+			align="horiz. centered"
 		}
-		composite {
+		text {
 			object {
 				x=226
-				y=52
+				y=68
 				width=50
-				height=68
+				height=16
 			}
-			"composite name"=""
-			children {
-				"choice button" {
-					object {
-						x=226
-						y=82
-						width=50
-						height=38
-					}
-					control {
-						chan="SITE_NAME:FEC-DCU_NODE_ID_SDF_MON_ALL"
-						clr=0
-						bclr=29
-					}
-				}
-				text {
-					object {
-						x=226
-						y=52
-						width=50
-						height=16
-					}
-					"basic attribute" {
-						clr=14
-					}
-					textix="MONITOR"
-					align="horiz. centered"
-				}
-				text {
-					object {
-						x=226
-						y=68
-						width=50
-						height=16
-					}
-					"basic attribute" {
-						clr=14
-					}
-					textix="SELECT"
-					align="horiz. centered"
-				}
+			"basic attribute" {
+				clr=14
 			}
+			textix="SELECT"
+			align="horiz. centered"
 		}
 	}
 }
diff --git a/src/epics/util/fmseq.pl b/src/epics/util/fmseq.pl
index 9b4882570..a51436ca1 100755
--- a/src/epics/util/fmseq.pl
+++ b/src/epics/util/fmseq.pl
@@ -868,8 +868,8 @@ print "grecord(ao,\"%IFO%:FEC-${dcuId}_SDF_SAVE_CMD\")\n";
 print "grecord(ao,\"%IFO%:FEC-${dcuId}_SDF_RELOAD_STATUS\")\n";
 print "grecord(ao,\"%IFO%:FEC-${dcuId}_SDF_FULL_CNT\")\n";
 print "grecord(ao,\"%IFO%:FEC-${dcuId}_SDF_FILE_SET_CNT\")\n";
-print "grecord(ao,\"%IFO%:FEC-${dcuId}_SDF_MON_CNT\")\n";
-print "grecord(ao,\"%IFO%:FEC-${dcuId}_SDF_ALARM_COUNT\")\n";
+print "grecord(ao,\"%IFO%:FEC-${dcuId}_SDF_UNMON_CNT\")\n";
+print "grecord(ao,\"%IFO%:FEC-${dcuId}_SDF_ALARM_CNT\")\n";
 print "grecord(stringout,\"%IFO%:FEC-${dcuId}_SDF_NAME\")\n";
 print "grecord(stringout,\"%IFO%:FEC-${dcuId}_SDF_SAVE_AS_NAME\")\n";
 print "grecord(stringout,\"%IFO%:FEC-${dcuId}_SDF_RELOAD_TIME\")\n";
@@ -883,13 +883,13 @@ print "		field(ONAM,\"ALL\")\n}\n";
 
 print "grecord(ao,\"%IFO%:FEC-${dcuId}_SDF_ALH_CRC\")\n";
 print "{\n	field(SCAN,\".5 second\")\n}\n";
-print "grecord(ao,\"%IFO%:FEC-${dcuId}_SDF_SP_ERR_CNT\")\n";
+print "grecord(ao,\"%IFO%:FEC-${dcuId}_SDF_DIFF_CNT\")\n";
 print "{\n	field(SCAN,\".5 second\")\n}\n";
 print "grecord(ao,\"%IFO%:FEC-${dcuId}_SDF_RB_ERR_CNT\")\n";
 print "{\n	field(SCAN,\".5 second\")\n}\n";
 print "grecord(ao,\"%IFO%:FEC-${dcuId}_SDF_DROP_CNT\")\n";
 print "{\n	field(SCAN,\".5 second\")\n}\n";
-print "grecord(ao,\"%IFO%:FEC-${dcuId}_SDF_UNSET_CNT\")\n";
+print "grecord(ao,\"%IFO%:FEC-${dcuId}_SDF_UNINIT_CNT\")\n";
 print "{\n	field(SCAN,\".5 second\")\n}\n";
 print "grecord(ao,\"%IFO%:FEC-${dcuId}_SDF_TABLE_ENTRIES\")\n";
 print "{\n	field(SCAN,\".5 second\")\n}\n";
diff --git a/src/epics/util/lib/medmGenGdsTp.pm b/src/epics/util/lib/medmGenGdsTp.pm
index d6751b0fc..a30a93e4a 100644
--- a/src/epics/util/lib/medmGenGdsTp.pm
+++ b/src/epics/util/lib/medmGenGdsTp.pm
@@ -124,7 +124,7 @@ sub createGdsMedm
 	$medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"DIFFS",$ecolors{black});
 	# Add Guardian setpoint error  Counter Monitor
 	$xpos = 725; $ypos = 108; $width = 35; $height = 15;
-        $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_SDF_SP_ERR_CNT",$ecolors{white},$ecolors{black},"alarm");
+        $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_SDF_DIFF_CNT",$ecolors{white},$ecolors{black},"alarm");
 	# BURT Partial File Loaded
 	$xpos = 562; $ypos = 128; $width = 200; $height = 15;
         $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_SDF_LOADED",$ecolors{white},$ecolors{blue},"static");
-- 
GitLab