V 10 1 LANG:1 8 (NoName) PANEL,-1 -1 937 671 N {224,223,227} 2 "$1" "$2" " main() { // ------ Decode the name of node ------ string sDomain = $1; string sNode = $2; /* hmpBase_GetCoords(sNode, iModule, iSector, iExtra, iType); if(iType != LDT_LVSEG && iType != LDT_LVROSEG) { DebugN(\"hmpHVChannel: Bad referenced Alias for PWS Module !! ABORT [\"+sNode+\"]\"); return; } sLogName = hmpBase_buildLogicalName(iType,iModule,iSector,iExtra); string sSign = (iType == LDT_LVSEG && iExtra == LDC_ISNEGATIVE) ? \"-\" : \"+\"; */ // ----------------------------------------------------- // Status summary -------------------------------------- _setColor2All(colOFF); dpConnect(\"ChangeLedColor0\", sNode+\".Status\"+\".On\"+\":_original.._value\"); dpConnect(\"ChangeLedColor1\", sNode+\".Status\"+\".RampUp\"+\":_original.._value\"); dpConnect(\"ChangeLedColor2\", sNode+\".Status\"+\".RampDown\"+\":_original.._value\"); dpConnect(\"ChangeLedColor3\", sNode+\".Status\"+\".FailureMaxSenseVoltage\"+\":_original.._value\"); dpConnect(\"ChangeLedColor4\", sNode+\".Status\"+\".FailureMaxTerminalVoltage\"+\":_original.._value\"); dpConnect(\"ChangeLedColor5\", sNode+\".Status\"+\".FailureMaxCurrent\"+\":_original.._value\"); dpConnect(\"ChangeLedColor6\", sNode+\".Status\"+\".FailureMaxTemperature\"+\":_original.._value\"); dpConnect(\"ChangeLedColor7\", sNode+\".Status\"+\".FailureMaxPower\"+\":_original.._value\"); dpConnect(\"ChangeLedColor8\", sNode+\".Status\"+\".FailureTimeout\"+\":_original.._value\"); // ----------------------------------------------------- string sSign = \"+\"; // <-----Don't forget to remove!!! int xpos,ypos,wpos,hpos; getValue(\"fr1\",\"position\",xpos,ypos); getValue(\"fr1\",\"size\",wpos,hpos); xpos = xpos;// -1030; ypos = ypos -(hpos); removeSymbol(myModuleName(),myPanelName(),\"vLVCh\"); addSymbol(myModuleName(),myPanelName(),\"objects/trd_General/trd_indicatorBIG.pnl\", \"vLVCh\",makeDynString(\"$sDpName:\"+sNode,\"$sDpeName:\"+sNode+\".MeasurementSenseVoltage\", \"$Decimal:3\",\"$Digit:6\",\"$sLabel:VMON\",\"$sPanel:none\",\"$sSign:\"+sSign,\"$sTitle:\"), xpos+15,ypos+40,0,1,1); removeSymbol(myModuleName(),myPanelName(),\"iLVCh\"); addSymbol(myModuleName(),myPanelName(),\"objects/trd_General/trd_indicatorBIG.pnl\", \"iLVCh\",makeDynString(\"$sDpName:\"+sNode,\"$sDpeName:\"+sNode+\".MeasurementCurrent\", \"$Decimal:3\",\"$Digit:6\",\"$sLabel:IMON\",\"$sPanel:none\",\"$sSign:\",\"$sTitle:\"), xpos+15,ypos+80,0,1,1); removeSymbol(myModuleName(),myPanelName(),\"tLVCh\"); addSymbol(myModuleName(),myPanelName(),\"objects/trd_General/trd_indicator.pnl\", \"iLVCon\",makeDynString(\"$sDpName:\"+sNode,\"$sDpeName:\"+sNode+\".MeasurementTemperature\", \"$Decimal:1\",\"$Digit:6\",\"$sLabel:TMON\",\"$sPanel:none\",\"$sSign:\"+sSign,\"$sTitle:\"), xpos+15,ypos+140,0,1,1); // ------------------------- // Set the Chart // Adapt all the scales float fImax; dpGet(sNode+\".Settings.Current:_original.._value\",fImax); fImax = fImax * 1.20; Trend1.curveAutoscale(\"Imon\")=FALSE; Trend1.curveMax(\"Imon\", fImax ); Trend1.curveMin(\"Imon\", 0 ); // then put the names & Units Trend1.curveLegendName(\"Vmon\", \"LV voltage monitoring\"); Trend1.curveLegendName(\"Imon\", \"LV current monitoring\"); Trend1.curveLegendUnit(\"Vmon\", \"V\"); Trend1.curveLegendUnit(\"Imon\", \"A\"); // Trend1.curveLineType(\"Vmon\", \"Linear\"); // Then Connect the Dps Trend1.connectDirectly(\"Vmon\", sNode+\".MeasurementSenseVoltage:_original.._value\"); Trend1.connectDirectly(\"Imon\", sNode+\".MeasurementCurrent:_original.._value\"); // ------------------------- /* // ------------------------- getValue(\"lnStatusW\",\"position\",xpos,ypos); getValue(\"fr1\",\"size\",wpos,hpos); xpos = xpos;// -1030; ypos = ypos; removeSymbol(myModuleName(),myPanelName(),\"StatusWord\"); addSymbol(myModuleName(),myPanelName(),\"objects/trd_General/trd_ledBar.pnl\", \"StatusWord\",makeDynString(\"$sDpE:\"+sNode+\".Status\", \"$colOFF:{53,0,0}\",\"$colON:{253,0,0}\", \"$Tips:Channel On,Ramp Up,Ramp Down,Over Current,Over Voltage,Under Voltage,External Trip,Over HV Max,External Disabled,Internal Trip,Calibration Error,Unplugged,Under Current,Over Voltage Protection,Power Fail,Temperature Error\"), xpos+2,ypos+19,0,1,1); dpConnect(\"RdBackVSetValue\",sNode+\".ReadbackSettings.Voltage:_original.._value\",sNode+\".ReadbackSettings.Voltage:_original.._invalid\"); dpConnect(\"RdBackISetValue\",sNode+\".ReadbackSettings.Current:_original.._value\",sNode+\".ReadbackSettings.Current:_original.._invalid\"); */ // ------------------------- fwCU_connectState(\"ChState\",sDomain+\"::\"+sNode); /* // -------- Access control ------------------------------------------- // Set the CB Function that Hook the change of Logged User dyn_string exceptionInfo; fwAccessControl_setupPanel(\"hmpLVChannel_LoggedUserAC\",exceptionInfo); if (dynlen(exceptionInfo)) { hmpLVChannel_LoggedUserAC(\"\",\"\"); // global \"reject\" } // ---------------------------------------------------------------------- // ---------------- Set the title into the main window ------------------ if(iType == LDT_LVROSEG) dcsUiBase_setMainTitle(\"HMPID - RICH \"+iModule+\" READ OUT \"+ ( (iExtra == LDC_ISLEFT) ? \"LEFT\" :\"RIGHT\" )+\" LV CHANNEL\" ); else dcsUiBase_setMainTitle(\"HMPID - RICH \"+iModule+\" SECTOR \"+iSector+\" FFE \"+( (iExtra == LDC_ISNEGATIVE)?\"NEGATIVE\":\"POSITIVE\")+\" LV CHANNEL\" ); // ---------------------------------------------------------------------- } /// ---- Dp connected function RdBackVSetValue(string dp,float fNewValue,string dp2,bool invalid) { setMultiValue(\"txtActualV\",\"text\",fNewValue,\"txtActualV\",\"foreCol\",(invalid) ? \"?invalid\":\"_3DText\"); } RdBackISetValue(string dp,float fNewValue,string dp2,bool invalid) { setMultiValue(\"txtActualI\",\"text\",fNewValue,\"txtActualI\",\"foreCol\",(invalid) ? \"?invalid\":\"_3DText\"); } */ } ChState(string node, string state) { string color; fwCU_getStateColor(node, state, color); setMultiValue(\"txtChStatus\",\"text\",state,\"txtChStatus\",\"backCol\",color); } ChangeLedColor0(string dp, int iNewValue) { if (iNewValue == 1) setValue(\"RECTANGLE0\",\"backCol\",colON); else setValue(\"RECTANGLE0\",\"backCol\",colOFF); } ChangeLedColor1(string dp, int iNewValue) { if (iNewValue == 1) setValue(\"RECTANGLE1\",\"backCol\",colON); else setValue(\"RECTANGLE1\",\"backCol\",colOFF); } ChangeLedColor2(string dp, int iNewValue) { if (iNewValue == 1) setValue(\"RECTANGLE2\",\"backCol\",colON); else setValue(\"RECTANGLE2\",\"backCol\",colOFF); } ChangeLedColor3(string dp, int iNewValue) { if (iNewValue == 1) setValue(\"RECTANGLE3\",\"backCol\",colON); else setValue(\"RECTANGLE3\",\"backCol\",colOFF); } ChangeLedColor4(string dp, int iNewValue) { if (iNewValue == 1) setValue(\"RECTANGLE4\",\"backCol\",colON); else setValue(\"RECTANGLE4\",\"backCol\",colOFF); } ChangeLedColor5(string dp, int iNewValue) { if (iNewValue == 1) setValue(\"RECTANGLE5\",\"backCol\",colON); else setValue(\"RECTANGLE5\",\"backCol\",colOFF); } ChangeLedColor6(string dp, int iNewValue) { if (iNewValue == 1) setValue(\"RECTANGLE6\",\"backCol\",colON); else setValue(\"RECTANGLE6\",\"backCol\",colOFF); } ChangeLedColor7(string dp, int iNewValue) { if (iNewValue == 1) setValue(\"RECTANGLE7\",\"backCol\",colON); else setValue(\"RECTANGLE7\",\"backCol\",colOFF); } ChangeLedColor8(string dp, int iNewValue) { if (iNewValue == 1) setValue(\"RECTANGLE8\",\"backCol\",colON); else setValue(\"RECTANGLE8\",\"backCol\",colOFF); } " 0 "main() { // -------------- Event Terminate --------------------- // // Here REMOVE all objects inserted with an // addSymbol() function // // int removeSymbol (string moduleName, string panelName, string refName); removeSymbol(myModuleName(),myPanelName(),\"vLVCh\"); removeSymbol(myModuleName(),myPanelName(),\"iLVCh\"); // removeSymbol(myModuleName(),myPanelName(),\"StatusWord\"); removeSymbol(myModuleName(),myPanelName(),\"tLVCh\"); // } //" 0 E E E 1 0 0 0 0 0 ""0 1 E "string colOFF =\"_3DFace\"; string colON = \"Yellow\"; int Nums = 9; _setColor2All(string col) { int i; for(i=0;i