V 10 1 LANG:1 8 (NoName) PANEL,284 171 280 92 N {204,204,204} 0 "main() { // Insert the Led Bar int x,y,i; getValue(\"Border1\",\"position\",x,y); int refreshTime = 2; dyn_float dfVoltDp,dfCurrDp,dfConnDp; float fPowerSupplied = 0; float fPowerConsumed = 0; while(!flagCalculation) { delay(1); } addSymbol(myModuleName(),myPanelName(),\"objects/hmpGeneral/hmpLedBarIndicator.pnl\", \"WattLedBar\",makeDynString(\"$dpElem:\"+sDpWattElem,\"$Maxval:\"+sMaxWatt,\"$warn:75\",\"$err:90\"), x+10,y-10,0,1.1,1); while(flagCalculation) { dpGet(dsVoltDp,dfVoltDp); dpGet(dsCurrDp,dfCurrDp); dpGet(dsConnDp,dfConnDp); fPowerSupplied = 0; fPowerConsumed = 0; for(i=1;i<=dynlen(dsVoltDp);i++) { fPowerSupplied += ( dfConnDp[i] * dfCurrDp[i] ); fPowerConsumed += ( dfVoltDp[i] * dfCurrDp[i] ); } txtPowerConsumed.text = fPowerConsumed; txtPowerSupplied.text = fPowerSupplied; dpSet(sDpWattElem,fPowerSupplied); delay(refreshTime); } }" 0 "main() { removeSymbol(myModuleName(),myPanelName(),\"WattLedBar\"); }" 0 E E E 1 0 0 0 10 10 "" 0 1 E"#uses \"hmpBaselibrary.ctl\" global dyn_string dsVoltDp; global dyn_string dsCurrDp; global dyn_string dsConnDp; global string sDpWattElem; global string sMaxWatt; global bool flagCalculation = false; ConnectElements(string sObject) { dyn_string dpNam,dsAli; string root,sAp; // estract the coords int iModule, iSector, extra, iType; hmpBase_GetCoords(sObject, iModule, iSector, extra, iType); // Build the Name string root; DebugN(\"---\",sObject,HVSYS+\":\"+WATTMETERDPNAME,dpExists(HVSYS+\":\"+WATTMETERDPNAME)); // Create the Wattmeter Dp if(!dpExists(HVSYS+\":\"+WATTMETERDPNAME)) { dpCreate(WATTMETERDPNAME,WATTMETERDPTYPENAME,getSystemId(HVSYS+\":\")); delay(4); if(!dpExists(HVSYS+\":\"+WATTMETERDPNAME)) { __hmpBase_CreateWattmeterDpt(); delay(2); dpCreate(WATTMETERDPNAME,WATTMETERDPTYPENAME,getSystemId(HVSYS+\":\")); delay(2); if(!dpExists(HVSYS+\":\"+WATTMETERDPNAME)) return; } } if(iType == LDT_DETECTOR) { root = hmpBase_buildLogicalName(LDT_DETECTOR,0,0,0); sDpWattElem = HVSYS+\":\"+WATTMETERDPNAME+\".hmpid\"; sMaxWatt = MAXDETECTORWATTS; } else { root = hmpBase_buildLogicalName(LDT_POWERSYSTEM,iModule,0,0); sDpWattElem = HVSYS+\":\"+WATTMETERDPNAME+\".rich\"+iModule; sMaxWatt = MAXMODULEWATTS; } // catch all entities int num = dpGetAllAliases(dpNam,dsAli,root+\"/*\",\"*:*.**\"); if(num<1) { DebugTN(\"HMPID Wattmeter: Bad referenced Logic View Alias !! ABORT\"); return; } // Now for each init the controls int j; for(j=1;j<=num;j++) { if(dpTypeName(dpNam[j]) == \"FwCaenChannel\") { // Verify if it's an LV Channel dpGet(dpNam[j]+\"model:_original.._value\",sAp); if(strpos(sAp,\"CAEN Easy Channel\") >= 0) { dynAppend(dsVoltDp,dpNam[j]+\"actual.vMon:_original.._value\"); dynAppend(dsCurrDp,dpNam[j]+\"actual.iMon:_original.._value\"); dynAppend(dsConnDp,dpNam[j]+\"actual.vCon:_original.._value\"); } } } flagCalculation = true; }" 0 2 "CBRef""1" "EClose""main() { removeSymbol(myModuleName(),myPanelName(),\"WattLedBar\"); }" 0 "" DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 LAYER, 0 1 LANG:1 6 Layer1 6 27 "Border1" "" 1 0 80 E E E 1 E 1 E N "_WindowText" E N "hmpUserFrameBack" E E E E 23 0 0 0 0 0 EE E 4 1 LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 0 1 E U 1 E 0 0 270 80 2 5 "txtPowerConsumed" "" 1 20 30 E E E 1 E 1 E N "hmpInstrumentFore" E N "hmpInstrumentBack" E E E E 2 0 0 0 0 0 EE E 0 1 LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 0 1 E U 1 E 22 32 88 48 0 2 0 "7.1f" 9 0 0 66 0 0 22 32 1 1 LANG:1 107 -microsoft windows-Arial-normal-r-normal-*-*-140-100-100-*-*-iso8859-1|-16,0,0,0,400,0,0,0,0,3,2,1,34,Arial 0 "" 1 LANG:1 4 2.25 2 7 "txtPowerSupplied" "" 1 150 30 E E E 1 E 1 E N "hmpInstrumentFore" E N "hmpInstrumentBack" E E E E 4 0 0 0 0 0 EE E 0 1 LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 0 1 E U 1 E 152 32 218 48 0 2 0 "7.1f" 9 0 0 66 0 0 152 32 1 1 LANG:1 107 -microsoft windows-Arial-normal-r-normal-*-*-140-100-100-*-*-iso8859-1|-16,0,0,0,400,0,0,0,0,3,2,1,34,Arial 0 "" 1 LANG:1 4 2.25 2 8 "Text3" "" 1 90 30 E E E 1 E 1 E N "hmpInstrumentUnitFore" E N "hmpInstrumentUnitBack" E E E E 5 0 0 0 0 0 EE E 0 1 LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 0 1 E U 1 E 92 32 108 48 0 2 0 "s" 0 0 0 65 0 0 92 32 1 1 LANG:1 107 -microsoft windows-Arial-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-11,0,0,0,400,0,0,0,0,3,2,1,34,Arial 0 "" 1 LANG:1 1 W 4 10 "Line1" "" 1 20 50 E E E 1 E 1 E N {255,255,255} E N {255,255,255} E E E E 7 0 0 0 0 0 EE E 0 1 LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 0 1 E 111 50 20 50 4 13 "Line4" "" 1 110 30 E E E 1 E 1 E N {255,255,255} E N {255,255,255} E E E E 10 0 0 0 0 0 EE E 0 1 LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 0 1 E 110 50 110 30 2 15 "Text1" "" 1 9 5 E E E 1 E 1 E N {255,255,255} E N {102,102,102} E E E E 12 0 0 0 0 0 EE E 0 1 LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 0 1 E U 1 E 11 7 118 22 1 2 0 "s" 0 0 0 65 0 0 11 7 1 1 LANG:1 107 -microsoft windows-Arial-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,3,2,1,34,Arial 0 "" 1 LANG:1 16 Power Dissipated 2 16 "Text2" "" 1 140 5 E E E 1 E 1 E N {255,255,255} E N {102,102,102} E E E E 13 0 0 0 0 0 EE E 0 1 LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 0 1 E U 1 E 142 7 251 23 1 2 0 "s" 0 0 0 65 0 0 142 7 1 1 LANG:1 107 -microsoft windows-Arial-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,3,2,1,34,Arial 0 "" 1 LANG:1 14 Power Supplied 4 19 "Line7" "" 1 21 30 E E E 1 E 1 E N {102,102,102} E N {255,255,255} E E E E 16 0 0 0 0 0 EE E 0 1 LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 0 1 E 111 30 21 30 4 20 "Line8" "" 1 20 30 E E E 1 E 1 E N {51,51,51} E N {255,255,255} E E E E 17 0 0 0 0 0 EE E 0 1 LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 0 1 E 20 51 20 30 2 21 "Text5" "" 1 220 30 E E E 1 E 1 E N "hmpInstrumentUnitFore" E N "hmpInstrumentUnitBack" E E E E 18 0 0 0 0 0 EE E 0 1 LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 0 1 E U 1 E 222 32 238 48 0 2 0 "s" 0 0 0 65 0 0 222 32 1 1 LANG:1 107 -microsoft windows-Arial-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-11,0,0,0,400,0,0,0,0,3,2,1,34,Arial 0 "" 1 LANG:1 1 W 4 22 "Line9" "" 1 150 50 E E E 1 E 1 E N {255,255,255} E N {255,255,255} E E E E 19 0 0 0 0 0 EE E 0 1 LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 0 1 E 241 50 150 50 4 23 "Line10" "" 1 240 30 E E E 1 E 1 E N {255,255,255} E N {255,255,255} E E E E 20 0 0 0 0 0 EE E 0 1 LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 0 1 E 240 50 240 30 4 24 "Line11" "" 1 151 30 E E E 1 E 1 E N {102,102,102} E N {255,255,255} E E E E 21 0 0 0 0 0 EE E 0 1 LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 0 1 E 241 30 151 30 4 25 "Line12" "" 1 150 30 E E E 1 E 1 E N {51,51,51} E N {255,255,255} E E E E 22 0 0 0 0 0 EE E 0 1 LANG:1 0 1 "dashclr"N "_Transparent" E E 0 1 1 0 1 E 150 51 150 30 14 26 "txtSectorName" "" 1 40 80 E E E 1 E 0 E N "_WindowText" E N "_Window" E E E E 23 0 0 0 0 0 "main() { ConnectElements( this.text ); }" 0 E E 0 1 LANG:1 0 0 1 LANG:1 107 -microsoft windows-Arial-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-11,0,0,0,400,0,0,0,0,3,2,1,34,Arial 0 "" 38 78 232 103 3 "s" 0 0 0 0 0 0 E E E 0 LAYER, 1 1 LANG:1 6 Layer2 0 LAYER, 2 1 LANG:1 6 Layer3 0 LAYER, 3 1 LANG:1 6 Layer4 0 LAYER, 4 1 LANG:1 6 Layer5 0 LAYER, 5 1 LANG:1 6 Layer6 0 LAYER, 6 1 LANG:1 6 Layer7 0 LAYER, 7 1 LANG:1 6 Layer8 0 0