Skip to content
Snippets Groups Projects
Commit 4c11e8ec authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Merge branch 'master' into 'master'

Added VPSU error codes

See merge request !215
parents 60a698f1 8018986a
No related branches found
No related tags found
1 merge request!215Added VPSU error codes
Pipeline #41688 failed
......@@ -6,6 +6,10 @@
<FACEPLATE_TPG>Faceplate/vac_tpg-$(vacDEV)-brief.bob</FACEPLATE_TPG>
<vacDEV>vgc</vacDEV>
<vacPREFIX>$(SEC)-$(SUBSEC):$(DIS)-$(DEV)-$(IDX)</vacPREFIX>
<vacRELAY1_DESC>$(RELAY1_DESC)</vacRELAY1_DESC>
<vacRELAY2_DESC>$(RELAY2_DESC)</vacRELAY2_DESC>
<vacRELAY3_DESC>$(RELAY3_DESC)</vacRELAY3_DESC>
<vacRELAY4_DESC>$(RELAY4_DESC)</vacRELAY4_DESC>
<vacSYMBOLS>$(ROOT=$(ESS_OPIS=/ess-opis)/NON-APPROVED)/COMMON/DEVICES/vacuum/symbols</vacSYMBOLS>
</macros>
<width>133</width>
......
......@@ -6,6 +6,8 @@
<FACEPLATE_TPG>Faceplate/vac_tpg-$(vacDEV)-brief.bob</FACEPLATE_TPG>
<vacDEV>vgd</vacDEV>
<vacPREFIX>$(SEC)-$(SUBSEC):$(DIS)-$(DEV)-$(IDX)</vacPREFIX>
<vacRELAY1_DESC>$(RELAY1_DESC)</vacRELAY1_DESC>
<vacRELAY2_DESC>$(RELAY2_DESC)</vacRELAY2_DESC>
<vacSYMBOLS>$(ROOT=$(ESS_OPIS=/ess-opis)/NON-APPROVED)/COMMON/DEVICES/vacuum/symbols</vacSYMBOLS>
</macros>
<width>133</width>
......
......@@ -6,6 +6,8 @@
<FACEPLATE_TPG>Faceplate/vac_tpg-$(vacDEV)-brief.bob</FACEPLATE_TPG>
<vacDEV>vgp</vacDEV>
<vacPREFIX>$(SEC)-$(SUBSEC):$(DIS)-$(DEV)-$(IDX)</vacPREFIX>
<vacRELAY1_DESC>$(RELAY1_DESC)</vacRELAY1_DESC>
<vacRELAY2_DESC>$(RELAY2_DESC)</vacRELAY2_DESC>
<vacSYMBOLS>$(ROOT=$(ESS_OPIS=/ess-opis)/NON-APPROVED)/COMMON/DEVICES/vacuum/symbols</vacSYMBOLS>
</macros>
<width>133</width>
......
......@@ -19,6 +19,13 @@ if PVUtil.getLong(pvs[0]):
90 : "Turbo-Pumps Not Available",
89 : "Max Auto-Restart",
88 : "Back-Up Primary Pumping System Error",
85 : "VPSU-00020 24VDC Power Supply Overload",
84 : "VPSU-00020 24VDC Power Supply Tripped",
83 : "VPSU-00020 400VAC 3-Phases Power Supply Tripped",
82 : "VPSU-00010 24VDC Power Supply Overload",
81 : "VPSU-00010 24VDC Power Supply Tripped",
80 : "VPSU-00010 400VAC 3-Phases Power Supply Tripped",
15 : "Mode Selection Error - Vacuum Sector Vented",
14 : "Mode Selection Error - Vacuum Sector Under Vacuum",
13 : "Primary Pumping System: Rescue Primary System is Off",
......
PVUtil = org.csstudio.display.builder.runtime.script.PVUtil;
ScriptUtil = org.csstudio.display.builder.runtime.script.ScriptUtil;
var pvAccelerating = 0;
var pvAtNominalSpeed = 0;
var pvStopped = 0;
var pvError = 0;
var pvStatus = pvs[0];
var sum = 0;
var isValid = 0;
var status = "N/A";
var debug = widget.getEffectiveMacros().getValue("DEBUG");
if (debug) {
debug = debug[0];
switch (debug) {
case '1':
case 'Y':
case 'y':
case 'T':
case 't':
debug = true;
break;
default:
debug = false;
}
}
else
debug = false;
if (debug)
Logger = org.csstudio.display.builder.runtime.script.ScriptUtil.getLogger();
else {
Logger = new Object();
Logger.info = function() {}
Logger.warning = function() {}
Logger.severe = function(text) { org.csstudio.display.builder.runtime.script.ScriptUtil.getLogger().severe(text);}
}
function log_pv(pv) {
Logger.info(pv + ": " + PVUtil.getString(pv));
}
try {
pvAccelerating = 1 * PVUtil.getInt(pvs[1]);
pvAtNominalSpeed = 2 * PVUtil.getInt(pvs[2]);
pvStopped = 4 * PVUtil.getInt(pvs[3]);
pvError = 8 * PVUtil.getInt(pvs[4]);
sum = pvAccelerating | pvAtNominalSpeed | pvStopped | pvError;
isValid = (sum & (sum - 1)) == 0 ? 1 : 0;
log_pv(pvs[1]);
log_pv(pvs[2]);
log_pv(pvs[3]);
log_pv(pvs[4]);
if (pvError) {
Logger.info(pvStatus + ": ERROR");
status = "ERROR";
} else if (isValid == 0) {
Logger.severe(pvStatus + ": Invalid combination");
} else if (pvStopped) {
Logger.info(pvStatus + ": STOPPED");
status = "STOPPED";
} else if (pvAtNominalSpeed) {
Logger.info(pvStatus + ": NOMINAL-SPEED");
status = "At NOMINAL-SPEED";
} else if (pvAccelerating) {
Logger.info(pvStatus + ": ACCELERATING");
status = "ACCELERATING";
} else
Logger.severe(pvStatus + ": Unknown combination:" + sum);
} catch (err) {
Logger.severe("NO CONNECTION: " + err);
}
pvStatus.write(status);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment