diff --git a/.gitattributes b/.gitattributes index f5a2f16382505e70f0314999a249f55790f8774e..7e382fb52fdd016b6e7c2e856d40df4a3331bc19 100644 --- a/.gitattributes +++ b/.gitattributes @@ -885,6 +885,7 @@ MAC/Navigator2/scripts/emptyDatabase.ctl -text MAC/Navigator2/scripts/gcf_cwd.ctl -text MAC/Navigator2/scripts/libs/FRENKM.ctl -text MAC/Navigator2/scripts/libs/GCFAlarm.ctl -text +MAC/Navigator2/scripts/libs/GCFCWD.ctl -text MAC/Navigator2/scripts/libs/GCFCommon.ctl -text MAC/Navigator2/scripts/libs/GCFLogging.ctl -text MAC/Navigator2/scripts/libs/MainCU_Processes.ctl -text @@ -898,6 +899,7 @@ MAC/Navigator2/scripts/libs/navPanel.ctl -text MAC/Navigator2/scripts/libs/navTabCtrl.ctl -text MAC/Navigator2/scripts/libs/navigator.ctl -text MAC/Navigator2/scripts/monitorStateChanges.ctl -text +MAC/Navigator2/scripts/monitorStateReset.ctl -text MAC/Navigator2/scripts/readAntennaConfigs.ctl -text MAC/Test/APL/PVSSproject/colorDB/Lofar[!!-~]colors -text svneol=native#application/octet-stream MAC/Test/APL/PVSSproject/colorDB/colorDB_de -text svneol=native#application/octet-stream diff --git a/MAC/Navigator2/panels/Hardware/Station_Cabinet_detailed.pnl b/MAC/Navigator2/panels/Hardware/Station_Cabinet_detailed.pnl index 7d351e8685b8bfdfe376f031da3c2564392aef99..af026bf84998ecfdbef9f2b067b7152291f9cce8 100644 --- a/MAC/Navigator2/panels/Hardware/Station_Cabinet_detailed.pnl +++ b/MAC/Navigator2/panels/Hardware/Station_Cabinet_detailed.pnl @@ -32,6 +32,9 @@ PANEL,-1 -1 732 746 N "_3DFace" 0 setValue(\"aCabinetTXT\", \"text\", \"Cabinet: \" + cNr); + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for childUpdates showChildState(baseDP); // connect for selfUpdates @@ -342,8 +345,7 @@ LANG:1 6 Layer8 "$aSide""back" 3 86 "selfState" "objects\\lofar_self_state.pnl" 284 264 T 851 1 0 1 116 -219 -1 -"$object""Cabinet" +0 3 89 "PANEL_REF90" "objects\\Hardware\\Station_Subrack_small.pnl" 48 330 T 855 1 0 1 354 -8 2 diff --git a/MAC/Navigator2/panels/Hardware/Station_RCU.pnl b/MAC/Navigator2/panels/Hardware/Station_RCU.pnl index da299842e51895aac5828e53f644f78ccf36e9af..bd6bfb01038ed6173c660e0af75bbda7844796c9 100644 --- a/MAC/Navigator2/panels/Hardware/Station_RCU.pnl +++ b/MAC/Navigator2/panels/Hardware/Station_RCU.pnl @@ -32,6 +32,9 @@ PANEL,-1 -1 870 803 N "_3DFace" 0 // no hardware selection, so no trigger mechanism needed in this panel. + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for selfUpdates showSelfState(baseDP); @@ -991,8 +994,7 @@ LANG:1 6 Layer8 0 3 43 "selfState" "objects\\lofar_self_state.pnl" 25 171 T 196 1 0 1 54.5 489.5 -1 -"$object""RCU" +0 3 44 "" "objects\\Hardware\\RCU_ADC_Component.pnl" 273 516 T 200 1 0 1 27 -16 0 diff --git a/MAC/Navigator2/panels/Test/Event_Viewer.pnl b/MAC/Navigator2/panels/Test/Event_Viewer.pnl index de5f54a046f667933f9bbde153a722a322bac418..cd032ac1ed7000eeaf301edfb3182f519de28ca3 100644 --- a/MAC/Navigator2/panels/Test/Event_Viewer.pnl +++ b/MAC/Navigator2/panels/Test/Event_Viewer.pnl @@ -470,87 +470,87 @@ LANG:1 0 1 "dashclr"N "_Transparent" E E 0 3 1 2 1 E 204 539 227 538 -1 365 0 "" 0 +1 452 0 "" 0 0 -1 366 1 "" 0 +1 453 1 "" 0 0 -1 367 2 "" 0 +1 454 2 "" 0 0 -1 368 4 "" 0 +1 455 4 "" 0 0 -1 369 5 "" 0 +1 456 5 "" 0 0 -1 370 6 "" 0 +1 457 6 "" 0 0 -1 371 7 "" 0 +1 458 7 "" 0 0 -1 372 7 "" 1 +1 459 7 "" 1 0 -1 373 7 "" 2 +1 460 7 "" 2 0 -1 374 7 "" 3 +1 461 7 "" 3 0 -1 375 7 "" 4 +1 462 7 "" 4 0 -1 376 9 "" 0 +1 463 9 "" 0 0 -1 377 9 "" 1 +1 464 9 "" 1 0 -1 378 9 "" 2 +1 465 9 "" 2 0 -1 379 9 "" 3 +1 466 9 "" 3 0 -1 380 9 "" 4 +1 467 9 "" 4 0 -1 381 12 "" 0 +1 468 12 "" 0 0 -1 382 12 "" 1 +1 469 12 "" 1 0 -1 383 12 "" 2 +1 470 12 "" 2 0 -1 384 12 "" 3 +1 471 12 "" 3 0 -1 385 12 "" 4 +1 472 12 "" 4 0 -1 386 14 "" 0 +1 473 14 "" 0 0 -1 387 14 "" 1 +1 474 14 "" 1 0 -1 388 14 "" 2 +1 475 14 "" 2 0 -1 389 14 "" 3 +1 476 14 "" 3 0 -1 390 14 "" 4 +1 477 14 "" 4 0 -1 391 17 "" 0 +1 478 17 "" 0 0 -1 392 17 "" 1 +1 479 17 "" 1 0 -1 393 17 "" 2 +1 480 17 "" 2 0 -1 394 17 "" 3 +1 481 17 "" 3 0 -1 395 17 "" 4 +1 482 17 "" 4 0 -1 396 18 "" 0 +1 483 18 "" 0 0 -1 397 18 "" 1 +1 484 18 "" 1 0 -1 398 18 "" 2 +1 485 18 "" 2 0 -1 399 18 "" 3 +1 486 18 "" 3 0 -1 400 18 "" 4 +1 487 18 "" 4 0 -1 401 19 "" 0 +1 488 19 "" 0 0 -1 402 19 "" 1 +1 489 19 "" 1 0 -1 403 19 "" 2 +1 490 19 "" 2 0 -1 404 19 "" 3 +1 491 19 "" 3 0 -1 405 19 "" 4 +1 492 19 "" 4 0 4 87 "LINE21" @@ -608,7 +608,7 @@ LANG:1 0 1 "dashclr"N "_Transparent" E E 0 3 1 2 1 E 62 333 81 333 -1 406 20 "" 0 +1 493 20 "" 0 0 14 134 "txt_datapoint" @@ -1124,7 +1124,7 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-*-80-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg +LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg 0 "" 951 48 1055 72 @@ -1153,7 +1153,7 @@ LANG:1 0 0 1 -LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-*-80-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg +LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg 0 "" 951 70 1055 94 @@ -1173,6 +1173,32 @@ LANG:1 17 Show searchArrays } }" 0 E E E +13 451 +"PUSH_BUTTON15" +"" +1 950 600 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E + E E +164 0 0 0 0 0 +E E E +0 +1 +LANG:1 0 + +0 +1 +LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" + 948 598 1098 624 + +T +1 +LANG:1 18 show g_connections +"main() +{ + LOG_DEBUG(\"Event_Viewer.pnl showMapping for g_connections\"); + showMapping(g_connections,\"g_connections\"); +}" 0 + E E E 0 LAYER, 1 1 diff --git a/MAC/Navigator2/panels/Test/test.pnl b/MAC/Navigator2/panels/Test/test.pnl index 78ef4eca0ed1f11de9590abf700abf377b0a4b6c..b685583453833d2553bdaf26673b45432595785c 100644 --- a/MAC/Navigator2/panels/Test/test.pnl +++ b/MAC/Navigator2/panels/Test/test.pnl @@ -1,6 +1,7 @@ V 10 -1 +2 LANG:1 0 +LANG:6 0 PANEL,-1 -1 500 396 N "_3DFace" 0 E E E E E 1 -1 -1 0 50 30 ""0 1 @@ -12,18 +13,72 @@ DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 LAYER, 0 1 LANG:1 0 -1 1 6 "" 0 +1 10 6 "" 0 +0 +1 11 6 "3" 0 +0 +1 12 6 "3" 2 +0 +1 13 6 "" 5 +0 +1 14 7 "" 0 0 -1 2 6 "3" 0 +1 15 7 "3" 0 0 -1 3 6 "" 5 +1 16 7 "3" 2 0 -1 4 7 "" 0 +1 17 7 "" 5 0 -1 5 7 "3" 0 +13 9 +"PUSH_BUTTON1" +"" +1 370 350 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E + E E +7 0 0 0 0 0 +E E E 0 -1 6 7 "" 5 +1 +LANG:1 0 + 0 +1 +LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg +0 "" + 368 348 492 374 + +T +1 +LANG:1 12 PUSH_BUTTON1 +"// SimpleCtrlScriptStart {invalid} +main() +{ + EP_setDP(); +} + +EP_setDP() +{ +dyn_errClass err; + + string query = \"SELECT '_online.._value' FROM 'LOFAR*.**.status.childState' REMOTE 'CS010:'\"; + dyn_dyn_anytype tab; + dpQuery(query,tab); + DebugN(\"Found: \"+tab); + for(int z=2;z<=dynlen(tab);z++){ + dpSetWait(tab[z][1]+\":_original.._value\", 0); + err = getLastError(); + if (dynlen(err) > 0) + errorDialog(err); + } +} + +// SimpleCtrlScript {EP_setDP} +// DP1 {CS010:LOFAR_PIC_Cabinet0_Subrack0_RSPBoard0_RCU0.status.leaf} +// Config1 {:_original.._value} +// Type1 {bool} +// Value1 {1} +// SimpleCtrlScriptEnd {EP_setDP} +" 0 + E E E 0 LAYER, 1 1 diff --git a/MAC/Navigator2/panels/objects/Hardware/RCU_TBB.pnl b/MAC/Navigator2/panels/objects/Hardware/RCU_TBB.pnl index 40f93f4b6a050966a6328451c7c2c3a0ab88d9c7..0fa10c5f949168cfdf8dd6d41cc1d3b048aa0ef5 100644 --- a/MAC/Navigator2/panels/objects/Hardware/RCU_TBB.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/RCU_TBB.pnl @@ -49,6 +49,9 @@ PANEL,-1 -1 255 122 N "_3DFace" 1 setValue(\"txt_bufSize\" , \"text\", \"\"); } + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for selfUpdates showSelfState(baseDP); } @@ -391,6 +394,5 @@ LANG:1 6 Layer8 0 3 0 "selfState" "objects\\lofar_self_state.pnl" 17 39 T 21 1 0 1 -4 -1 -1 -"$object""RCU" +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Hardware/RSPBoard.pnl b/MAC/Navigator2/panels/objects/Hardware/RSPBoard.pnl index 1e584198d3489452fac2096e06c6a8851c2ea578..0ed3735ee4a147d1e34b6008af9de13470b458a3 100644 --- a/MAC/Navigator2/panels/objects/Hardware/RSPBoard.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/RSPBoard.pnl @@ -31,6 +31,9 @@ PANEL,-1 -1 451 213 N "_3DFace" 0 baseDP + \".voltage12:_online.._invalid\"); } + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for childUpdates showChildState(baseDP); // connect for selfUpdates @@ -386,8 +389,7 @@ LANG:1 6 Layer8 0 3 0 "selfState" "objects\\lofar_self_state.pnl" 42 91 T 28 1 0 1 -26 56 -1 -"$object""RSPBoard" +0 3 11 "" "objects\\Hardware\\RSPBoard_Ethernet.pnl" 320 208 T 38 1 0 1 -154 -20 0 diff --git a/MAC/Navigator2/panels/objects/Hardware/RSPBoard_AP.pnl b/MAC/Navigator2/panels/objects/Hardware/RSPBoard_AP.pnl index bf73ec5805b0cd2c69e9f5068f64d60a6f71b026..34b883eddbbca07842b7a8a3dcf2e65d3bb2e663 100644 --- a/MAC/Navigator2/panels/objects/Hardware/RSPBoard_AP.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/RSPBoard_AP.pnl @@ -36,6 +36,9 @@ PANEL,-1 -1 184 193 N "_3DFace" 1 baseDP + \".SYNC.errorCount:_online.._value\"); } + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for selfUpdates showSelfState(baseDP); } @@ -313,7 +316,6 @@ LAYER, 7 LANG:1 6 Layer8 0 3 0 "selfState" -"objects\\lofar_self_state.pnl" 25 171 T 17 1 0 1 -2 -10 -1 -"$object""AP" +"objects\\lofar_self_state.pnl" 25 171 T 17 1 0 1 -2 -15 +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Hardware/RSPBoard_BP.pnl b/MAC/Navigator2/panels/objects/Hardware/RSPBoard_BP.pnl index 197f62c4ba86a68b12d63e5390601da44f2c7bd9..7c3e538f720ae87c8ddd41029c149b3fb1676dc6 100644 --- a/MAC/Navigator2/panels/objects/Hardware/RSPBoard_BP.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/RSPBoard_BP.pnl @@ -17,6 +17,9 @@ PANEL,-1 -1 328 89 N "_3DFace" 0 setValue(\"txt_temperature\", \"text\", \"xxxx\"); setValue(\"txt_temperature\", \"visible\", FALSE); } + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for selfUpdates showSelfState(baseDP); } @@ -175,7 +178,6 @@ LAYER, 7 LANG:1 6 Layer8 0 3 0 "selfState" -"objects\\lofar_self_state.pnl" 12 32 T 7 1 0 1 11 10 -1 -"$object""BP" +"objects\\lofar_self_state.pnl" 12 32 T 7 1 0 1 11 7 +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Hardware/RSPBoard_Ethernet.pnl b/MAC/Navigator2/panels/objects/Hardware/RSPBoard_Ethernet.pnl index 8fe2e1d59d27f29cd8bf9e6b3991744c920a3b2c..876306612e5db9a9259898b2c2e4b0257303ce7b 100644 --- a/MAC/Navigator2/panels/objects/Hardware/RSPBoard_Ethernet.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/RSPBoard_Ethernet.pnl @@ -27,6 +27,9 @@ PANEL,-1 -1 560 213 N "_3DFace" 0 baseDP + \".lastError:_online.._value\"); } + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for selfUpdates showSelfState(baseDP); } @@ -211,6 +214,5 @@ LANG:1 6 Layer8 0 3 0 "selfState" "objects\\lofar_self_state.pnl" 42 91 T 11 1 0 1 -26 31 -1 -"$object""RSPBoard_Ethernet" +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Hardware/RSPBoard_RCU.pnl b/MAC/Navigator2/panels/objects/Hardware/RSPBoard_RCU.pnl index 07f3fffa4b104b5c5c75e303e7e3176ad3150fe6..14193ad7b0974fd11f10c14ef07efaf41b1ada2b 100644 --- a/MAC/Navigator2/panels/objects/Hardware/RSPBoard_RCU.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/RSPBoard_RCU.pnl @@ -14,6 +14,9 @@ PANEL,-1 -1 429 479 N "_3DFace" 1 setValue(\"text_RCUNr\", \"text\", \"RCU\" + rcuNr ); baseDP+=\"_RCU\"+ rcuNr; + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for selfUpdates showSelfState(baseDP); } @@ -207,7 +210,6 @@ LAYER, 7 LANG:1 6 Layer8 0 3 1 "selfState" -"objects\\lofar_self_state.pnl" 25 171 T 12 1 0 0.933333333333333 -11 -106.6 -1 -"$object""RCU" +"objects\\lofar_self_state.pnl" 25 171 T 12 1 0 0.933333333333333 -11 -111.5999999999999 +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Hardware/Station_Cabinet_small.pnl b/MAC/Navigator2/panels/objects/Hardware/Station_Cabinet_small.pnl index cf7ced378f4b2e812186de7554ea8d496f69a471..290d7ac83523f0ff26599160f9d1b67e072c9ea5 100644 --- a/MAC/Navigator2/panels/objects/Hardware/Station_Cabinet_small.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/Station_Cabinet_small.pnl @@ -12,6 +12,9 @@ PANEL,-1 -1 248 432 N "_3DFace" 1 setValue(\"aCabinetTXT\", \"text\", \"Cabinet: \" + cNr); + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for childUpdates showChildState(baseDP); // connect for selfUpdates @@ -199,6 +202,5 @@ LANG:1 6 Layer8 0 3 86 "selfState" "objects\\lofar_self_state.pnl" 284 264 T 851 1.13333333333333 0 1 -302.866666666667 -245 -1 -"$object""Cabinet" +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Hardware/Station_Cabinet_top.pnl b/MAC/Navigator2/panels/objects/Hardware/Station_Cabinet_top.pnl index 157bf7f6cc5e7b0a765eb6b07cd281a1e09a06fe..38cd84bde04bd3d1f9efe9e82039597dbf46bde3 100644 --- a/MAC/Navigator2/panels/objects/Hardware/Station_Cabinet_top.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/Station_Cabinet_top.pnl @@ -10,6 +10,9 @@ PANEL,-1 -1 159 69 N "_3DFace" 0 string station=sysName; strreplace(station,\":\",\"\"); setValue(\"cabinet_txt\", \"text\", station); + + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); // connect for childUpdates showChildState(baseDP); @@ -209,6 +212,5 @@ LANG:1 6 Layer8 0 3 86 "selfState" "objects\\lofar_self_state.pnl" 284 264 T 851 1.13333333333333 0 1 -302.866666666667 -245 -1 -"$object""LofarStation-Cabinet" +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Hardware/Station_Clock.pnl b/MAC/Navigator2/panels/objects/Hardware/Station_Clock.pnl index cfa37819ea7a1df67c922df15084df63c406ee36..7f111d674ba97063d4fdcfcda798cdaaf13a1ccf 100644 --- a/MAC/Navigator2/panels/objects/Hardware/Station_Clock.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/Station_Clock.pnl @@ -15,6 +15,10 @@ PANEL,-1 -1 242 65 N "_3DFace" 0 setValue(\"stationClockTxt\", \"text\", \"xxx\"); } + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + + // connect for childUpdates showChildState(baseDP); // connect for selfUpdates @@ -148,7 +152,6 @@ LAYER, 7 LANG:1 6 Layer8 0 3 0 "selfState" -"objects\\lofar_self_state.pnl" 42 91 T 5 1 0 1 -30 -59 -1 -"$object""StationClock" +"objects\\lofar_self_state.pnl" 42 91 T 5 1 0 1 -30 -63 +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Hardware/Station_Subrack_small.pnl b/MAC/Navigator2/panels/objects/Hardware/Station_Subrack_small.pnl index 932cdde71522c5770b6546af7442d0144dc0e94d..415214074821d63e815fc6c2614e29c9eff222f8 100644 --- a/MAC/Navigator2/panels/objects/Hardware/Station_Subrack_small.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/Station_Subrack_small.pnl @@ -21,6 +21,9 @@ PANEL,-1 -1 185 272 N "_3DFace" 2 setValue(\"Subrack_Txt\",\"text\",\"Subrack: \"+sNr); + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for childUpdates showChildState(baseDP); // connect for selfUpdates @@ -465,6 +468,5 @@ LANG:1 6 Layer8 0 3 1 "selfState" "objects\\lofar_self_state.pnl" 363 291 T 87 1 0 1 -333 -270 -1 -"$object""Subrack" +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Hardware/Station_small.pnl b/MAC/Navigator2/panels/objects/Hardware/Station_small.pnl index d1267da08ff71b305f6e67b50b283f3f29aff1a7..c041e57b4118a4eda9d95c2b38b4d057b1e55407 100644 --- a/MAC/Navigator2/panels/objects/Hardware/Station_small.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/Station_small.pnl @@ -1,19 +1,21 @@ V 10 1 LANG:1 0 -PANEL,-1 -1 201 69 N "_3DFace" 1 +PANEL,-1 -1 369 69 N "_3DFace" 1 "$Station" "main() { baseDP = $Station+\":LOFAR\"; + stationDP = baseDP+\"_PIC\"; - setValue(\"\",\"toolTipText\",$Station); + + setValue(\"selfState.light\",\"toolTipText\",$Station+ \" state\"); // connect for childUpdates - showChildState(baseDP); + showChildState(stationDP); // connect for selfUpdates - showSelfState(baseDP); + showSelfState(stationDP); }" 0 E "main(int x, int y) { @@ -32,6 +34,7 @@ PANEL,-1 -1 201 69 N "_3DFace" 1 E "#uses \"navPanel.ctl\" string baseDP = \"\"; +string stationDP = \"\"; bool bDoubleClicked = false; // routine for single mouse click @@ -62,7 +65,7 @@ void dblClick() { // routine for right mouse click void rClick() { - navPanel_setEvent($Station,\"EventRightClick\"); + navPanel_statePopup(stationDP); }" 0 2 "CBRef" "1" @@ -120,7 +123,7 @@ void StationCallback(string dp1, bool aTrig) { 7 0 "selfState.light" "" -1 299 316 E E E 1 E 1 E N "Lofar_operational" E N "Lofar_operational" E E +1 299 316 E E E 1 E 1 E N "_3DText" E N "_dpdoesnotexist" E E "main() { rClick(); @@ -138,11 +141,7 @@ LANG:1 4 test 1 "dashclr"N "_Transparent" -"main() -{ - setValue(\"selfState.light\",\"toolTipText\",baseDP+\" state\"); -}" 0 - "main() +E "main() { click(); }" 0 @@ -168,15 +167,11 @@ LANG:1 4 test 1 "dashclr"N "_Transparent" -"main() -{ - setValue(\"childStateBorder\",\"toolTipText\",baseDP+\" childstate\"); -}" 0 - "main() +E "main() { click(); }" 0 - 0 3 1 2 1 E 1.0826177569242 0 1.00433361619441 -53.8744476585278 -50.2600169716646 1 E 59 60 6 6 + 0 3 1 2 1 E 1.0826177569242 0 1.00433361619441 -53.87444765852779 -50.26001697166461 1 E 59 60 6 6 0 LAYER, 1 1 diff --git a/MAC/Navigator2/panels/objects/Hardware/Subrack_ClockBoard.pnl b/MAC/Navigator2/panels/objects/Hardware/Subrack_ClockBoard.pnl index 9240dd9bd702b5679d11aebedae3966779264023..67519cf43373e4c4a54ca4d280880610ee0e9d8d 100644 --- a/MAC/Navigator2/panels/objects/Hardware/Subrack_ClockBoard.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/Subrack_ClockBoard.pnl @@ -7,6 +7,9 @@ PANEL,-1 -1 735 210 N "_3DFace" 0 baseDP = g_currentDatapoint+\".clockBoard\"; + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for selfUpdates showSelfState(baseDP); @@ -504,6 +507,5 @@ LANG:1 6 Layer8 0 3 0 "selfState" "objects\\lofar_self_state.pnl" 66 132 T 31 1 0 1 576 -55 -1 -"$object""ClockBoard" +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Hardware/Subrack_Numbers.pnl b/MAC/Navigator2/panels/objects/Hardware/Subrack_Numbers.pnl index 0bcd79a0982cabc651f4655cda4aa574985eee96..3bd008a1e2998109504a17411aa126bd0b1a7be5 100644 --- a/MAC/Navigator2/panels/objects/Hardware/Subrack_Numbers.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/Subrack_Numbers.pnl @@ -30,6 +30,9 @@ PANEL,-1 -1 257 137 N "_3DFace" 0 setValue(\"Subrack_Txt\",\"text\",\"Subrack: \"+sNr); + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for childUpdates showChildState(baseDP); // connect for selfUpdates @@ -158,6 +161,5 @@ LANG:1 6 Layer8 0 3 0 "selfState" "objects\\lofar_self_state.pnl" 173 17 T 1 1 0 1 0 -1 -1 -"$object""Subrack" +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Hardware/Subrack_RCU_small.pnl b/MAC/Navigator2/panels/objects/Hardware/Subrack_RCU_small.pnl index dacbb3654e56a93503ab43caa129c9a5f6965279..6796a6d0748ff207c2259de9916526f5863e2476 100644 --- a/MAC/Navigator2/panels/objects/Hardware/Subrack_RCU_small.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/Subrack_RCU_small.pnl @@ -24,6 +24,7 @@ PANEL,-1 -1 120 400 N "_3DFace" 1 baseDP+=\"_RSPBoard\"+rNr+\"_RCU\"+rcuNr; + // check if the required datapoint for this view are enabled and accessible if (dpExists(baseDP+\".status.state\")) { dpConnect(\"updateRCU\",baseDP + \".status.state\", diff --git a/MAC/Navigator2/panels/objects/Hardware/Subrack_RSPBoard.pnl b/MAC/Navigator2/panels/objects/Hardware/Subrack_RSPBoard.pnl index b0afb718832aa8008bcb59d9e8ff68a36f040449..a5e2d6c63ba0aeeee6073f5d04489e9a4a733d6d 100644 --- a/MAC/Navigator2/panels/objects/Hardware/Subrack_RSPBoard.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/Subrack_RSPBoard.pnl @@ -51,7 +51,10 @@ PANEL,-1 -1 120 444 N "_3DFace" 1 aDP + \".voltage12:_online.._invalid\"); } - // connect for childUpdates + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",aDP); + + // connect for childUpdates showChildState(aDP); // connect for selfUpdates showSelfState(aDP); @@ -648,6 +651,5 @@ LANG:1 6 Layer8 0 3 0 "selfState" "objects\\lofar_self_state.pnl" 72 493 T 40 1 0 1 -63 -89 -1 -"$object""RSPBoard" +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Hardware/Subrack_SPUBoard.pnl b/MAC/Navigator2/panels/objects/Hardware/Subrack_SPUBoard.pnl index 6f9b9247b70b65ff98f6c2406dfc3a35ff4b73c2..8a0c57f47438b1243f2574063b3881f1475f8925 100644 --- a/MAC/Navigator2/panels/objects/Hardware/Subrack_SPUBoard.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/Subrack_SPUBoard.pnl @@ -6,6 +6,9 @@ PANEL,-1 -1 745 269 N "_3DFace" 0 { baseDP=g_currentDatapoint+\".SPU\"; + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for selfUpdates showSelfState(baseDP); @@ -410,6 +413,5 @@ LANG:1 6 Layer8 0 3 0 "selfState" "objects\\lofar_self_state.pnl" 620 81 T 24 1 0 1 22 -4 -1 -"$object""SPUBoard" +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Hardware/Subrack_TBBoard.pnl b/MAC/Navigator2/panels/objects/Hardware/Subrack_TBBoard.pnl index cb7e57f4e48577a10168f31cf6899b6d618e2540..ffeed197d89a6f98392f0c578792371a0e81b962 100644 --- a/MAC/Navigator2/panels/objects/Hardware/Subrack_TBBoard.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/Subrack_TBBoard.pnl @@ -52,6 +52,9 @@ PANEL,-1 -1 120 455 N "_3DFace" 1 } + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for selfUpdates showSelfState(baseDP); } @@ -642,6 +645,5 @@ LANG:1 6 Layer8 0 3 0 "selfState" "objects\\lofar_self_state.pnl" 51 421 T 3 1 0 1 -42 -17 -1 -"$object""TBB" +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Hardware/TBB_AP.pnl b/MAC/Navigator2/panels/objects/Hardware/TBB_AP.pnl index 644d2eb34b674bb1e971e6c4add12898741c4871..13db8bd0afc119ca1bcf61bfbd373067ba93313a 100644 --- a/MAC/Navigator2/panels/objects/Hardware/TBB_AP.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/TBB_AP.pnl @@ -39,6 +39,9 @@ PANEL,-1 -1 155 117 N "_3DFace" 2 strreplace(rspDP,tbb,aS); + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for selfUpdates showSelfState(rspDP+\".AP\"+APNr); @@ -164,6 +167,5 @@ LANG:1 6 Layer8 0 3 1 "selfState" "objects\\lofar_self_state.pnl" 29 30 T 8 1 0 1 -6 -7 -1 -"$object""AP" +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Hardware/TBB_RSP.pnl b/MAC/Navigator2/panels/objects/Hardware/TBB_RSP.pnl index 1458f7eb75a17fd02714d9f12909190a85821c2b..1699f213306207a099ddc568facaad73df967deb 100644 --- a/MAC/Navigator2/panels/objects/Hardware/TBB_RSP.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/TBB_RSP.pnl @@ -35,6 +35,9 @@ PANEL,-1 -1 122 700 N "_3DFace" 1 LOG_DEBUG(\"TBB_RSP.pnl:initialize|Composed datapoint \" + g_currentDatapoint + \": \" + baseDP); + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for childUpdates showChildState(baseDP); // connect for selfUpdates @@ -232,6 +235,5 @@ LANG:1 6 Layer8 0 3 4 "selfState" "objects\\lofar_self_state.pnl" 24 587 T 7 1 0 1 -9 -572 -1 -"$object""RSPBoard" +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/Hardware/TBBoard.pnl b/MAC/Navigator2/panels/objects/Hardware/TBBoard.pnl index 117e6146a0ba038f67b138b49ca08940f2530c7f..ae00b46b07f7c0534b1e713ad76fe2e462ba3f81 100644 --- a/MAC/Navigator2/panels/objects/Hardware/TBBoard.pnl +++ b/MAC/Navigator2/panels/objects/Hardware/TBBoard.pnl @@ -20,6 +20,9 @@ PANEL,-1 -1 191 716 N "_3DFace" 0 setValue(\"txt_version\", \"text\", \"ver: x.!\"); } + // pass baseDP to selfstate Object to work with + setValue(\"selfState.light\",\"toolTipText\",baseDP); + // connect for selfUpdates showSelfState(baseDP); }" 0 @@ -254,6 +257,5 @@ LANG:1 6 Layer8 0 3 5 "selfState" "objects\\lofar_self_state.pnl" 45 590 T 7 1 0 1 -30 -575 -1 -"$object""TBBoard" +0 0 \ No newline at end of file diff --git a/MAC/Navigator2/panels/objects/lofar_self_state.pnl b/MAC/Navigator2/panels/objects/lofar_self_state.pnl index fbf85e165c51ad0fc35b78a0468a85cd813d84ab..b253d721e7721c05f24590c9ae32dc4e18360201 100644 --- a/MAC/Navigator2/panels/objects/lofar_self_state.pnl +++ b/MAC/Navigator2/panels/objects/lofar_self_state.pnl @@ -1,15 +1,11 @@ V 10 1 LANG:1 16 Lofar Self State -PANEL,-1 -1 170 141 N "_3DFace" 1 -"$object" +PANEL,-1 -1 170 141 N "_3DFace" 0 "main() -{ - setValue(\"light\",\"toolTipText\",$object+\" state\"); - baseDP=g_currentDatapoint; - - - +{ + getValue(\"light\",\"toolTipText\",baseDP); + LOG_DEBUG(\"lofar_self_state.pnl:main|toolTipText: \"+baseDP); }" 0 E E "main() { @@ -18,81 +14,14 @@ PANEL,-1 -1 170 141 N "_3DFace" 1 E 1 0 0 0 10 10 ""0 1 E "#uses \"navPanel.ctl\" - - -dyn_string popup; string baseDP=\"\"; -// NCFObjectState vars -string DPName=\"\"; -int state; -string message=\"Operator Overrule\"; -bool force=true; void rClick() { - // define the popupMenu - - int idx=1; - dynInsertAt(popup,\"CASCADE_BUTTON,Set State, 1\",idx++); - dynInsertAt(popup,\"CASCADE_BUTTON,Set Recursive State, 1\",idx++); - dynInsertAt(popup,\"Set State\",idx++); - for (int i = 1; i <= mappinglen(stateName); i++) { - string aS=\"PUSH_BUTTON,\"+mappingGetValue(stateName,i)+\",1\"+mappingGetKey(stateName,i)+\",1\"; - dynInsertAt(popup,aS,idx++); - } - dynInsertAt(popup,\"Set Recursive State\",idx++); - for (int i = 1; i <= mappinglen(stateName); i++) { - string aS=\"PUSH_BUTTON,\"+mappingGetValue(stateName,i)+\",2\"+mappingGetKey(stateName,i)+\",1\"; - dynInsertAt(popup,aS,idx++); - } - - popupMenu(popup,state); - - bool recursive = false; - if (state == 10 ) { - state = 0; - } else if (state == 20) { - state = 0; - recursive = true; - } else if (state < 200) { - state -= 100; - } else { - state -= 200; - recursive = true; - } - - bool ack=navFunct_acknowledgePanel(\"This will (re)set the state of \"+baseDP+\" to \"+getStateName(state)+\". Are you sure?\"); - if (!ack) { - LOG_DEBUG(\"lofar_self_state.pnl:rClick|State change by operator cancelled\"); - } - string database = dpSubStr(baseDP,DPSUB_SYS); - string bareDP = dpSubStr(baseDP,DPSUB_DP); - if (state) { - if (!recursive) { - LOG_DEBUG(\"lofar_self_state.pnl:rClick|Operator sets \"+baseDP+\".status.state to \"+getStateName(state)); - DPName=baseDP+\".status.state\"; - dpSet(database+\"__navObjectState.DPName\",DPName, - database+\"__navObjectState.stateNr\",state, - database+\"__navObjectState.message\",message, - database+\"__navObjectState.force\",force); - } else { - // If baseDP is on a station, only that station is needed in the query. - // if it is on the Main DB, all stations need to be examined. - string query=\"\"; - if (database == MainDBName) { - query= \"SELECT '_original.._value' FROM '\"+bareDP+\"*.status.state' REMOTE 'ALL' WHERE '_original.._value' != \"+state; - } else { - query= \"SELECT '_original.._value' FROM '\"+bareDP+\"*.status.state' REMOTE '\"+database+\"'WHERE '_original.._value' != \"+state; - } - dyn_dyn_anytype tab; - - dpQuery(query,tab); - - DebugN(\"lofar_self_state.pnl:rClick|Found: \"+tab+\" will all be set\"); - } - } + getValue(\"light\",\"toolTipText\",baseDP); + navPanel_statePopup(baseDP); }" 0 2 "CBRef" "1" @@ -105,18 +34,17 @@ LANG:1 6 Layer1 7 1 "light" "" -1 17.0333 17.0333 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E +1 17.5 17.5 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E "main() { -// rClick(); - DebugN(\"objectbaseDP:\"+itsObject); + rClick(); }" 0 E 2 0 0 0 0 0 E E E 0 1 -LANG:1 10 self state +LANG:1 0 1 "dashclr"N "_Transparent" diff --git a/MAC/Navigator2/scripts/libs/GCFCWD.ctl b/MAC/Navigator2/scripts/libs/GCFCWD.ctl new file mode 100644 index 0000000000000000000000000000000000000000..cf6ecd4d6075eaaf109e4516f63d2db5df5971da --- /dev/null +++ b/MAC/Navigator2/scripts/libs/GCFCWD.ctl @@ -0,0 +1,100 @@ +//# GCFWatchDog +//# +//# Copyright (C) 2002-2004 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id:$ + +//# +//# Connection watchdog +//# + +// Functions: +// Main - starts the watchdog and connects to the distmanager DP +// distSystemChanged - Eventhandle when a system goes on or offline +// fillWatchDog - helper function to fill the lists into the watchdog point + + +#uses "GCFCommon.ctl" + +const string CWD_DP = "__gcf_cwd"; +global mapping g_connections; + + +//////////////////////////////////////////////////////////////////////////////// +// +// Function main +// +// Starts the ConnectionWatchDog that monitor the (dis)connecting of systems. +// in __gcf_cwd, 5 dynamic lists are maintained that keep track of each system +// that is on or off line. The systemID is kept, a boolean that indicates if +// a system is on or offline, and the last time up and last time down is kept +// to be able to do time based restoration later. +// +//////////////////////////////////////////////////////////////////////////////// +GCFCWD_Init() { + LOG_DEBUG("GCFCWD.ctl:main|Starting GCF connection watch-dog"); + + // init the mapping + g_connections[ "SYSTEM" ] = makeDynInt(); + g_connections[ "NAME" ] = makeDynString(); + g_connections[ "UP" ] = makeDynBool(); + g_connections[ "DOWNTIME" ] = makeDynTime(); + g_connections[ "UPTIME" ] = makeDynTime(); + + // retrieve old settings + + dpConnect("GCFCWD_connectWD", TRUE, CWD_DP+".systemID", + CWD_DP+".name", + CWD_DP+".online", + CWD_DP+".lastUptime", + CWD_DP+".lastDowntime"); + + + LOG_DEBUG("GCFCWD.ctl:GCFCWD_Init|Watch-dog started"); +} + +//////////////////////////////////////////////////////////////////////////////// +// +// EventHandler GCFCWD_connectWD +// +//////////////////////////////////////////////////////////////////////////////// +void GCFCWD_connectWD(string dp1, dyn_int systemID, + string dp2, dyn_string name, + string dp3, dyn_bool up, + string dp4, dyn_time upTime, + string dp5, dyn_time downTime) { + LOG_DEBUG("GCFCWD.ctl:GCFCWD_connectWD|watchdog triggered systemchange"); + + int iPos; + // check all current systems and update mapping + for (int i = 1; i <= dynlen(systemID); i++) { + iPos=dynContains ( g_connections[ "SYSTEM" ],systemID[i]); + + // if the system was not yet available just add + if (iPos < 1) { + dynAppend( g_connections[ "SYSTEM" ],systemID[i]); + iPos=dynlen(g_connections[ "SYSTEM" ]); + } + // now store the values + g_connections[ "NAME" ][iPos] = name[iPos]; + g_connections[ "UP" ][iPos] = up[iPos]; + g_connections[ "UPTIME" ][iPos] = upTime[iPos]; + g_connections[ "DOWNTIME" ][iPos] = downTime[iPos]; + } +} diff --git a/MAC/Navigator2/scripts/libs/GCFCommon.ctl b/MAC/Navigator2/scripts/libs/GCFCommon.ctl index 66425610ab7baf56de3b5eda0b1902041dcbeaab..be4c22e7b7d2c36324699d1527f66b340b4e37f5 100644 --- a/MAC/Navigator2/scripts/libs/GCFCommon.ctl +++ b/MAC/Navigator2/scripts/libs/GCFCommon.ctl @@ -232,3 +232,4 @@ updateSelfState(string dp1, int state, string dp2, bool invalid) { } setValue("selfState.light", "backCol", SymbolCol); } + diff --git a/MAC/Navigator2/scripts/libs/navFunct.ctl b/MAC/Navigator2/scripts/libs/navFunct.ctl index 5550ccff68de0ff00ce96cf7da30f3a8f6af7bea..96d266c7d66fb29750ea90976fe4da2588018166 100644 --- a/MAC/Navigator2/scripts/libs/navFunct.ctl +++ b/MAC/Navigator2/scripts/libs/navFunct.ctl @@ -43,6 +43,7 @@ // navFunct_bareDBName : Returns a DatabaseName without the : (if any) // navFunct_findFirstOne : Returns the number of a given array that is true for a certain range // navFunct_acknowledgePanel : Returns acknowledge on a given action +// navFunct_getPathLessOne : Returns path less last leaf/node #uses "GCFLogging.ctl" #uses "GCFCommon.ctl" @@ -558,3 +559,51 @@ bool navFunct_acknowledgePanel(string text) { if (dreturns == "true") retVal=true; return retVal; } + +/////////////////////////////////////////////////////////////////////////// +//Function navFunct_getPathLessOne +// +// Returns the given path string less the last item. Paths can contain +// _ and . seperated items Like in: +// LOFAR_PIC_Cabinet0_Subrack0_RSPBoard0.AP0 (In fact the . seperated members +// are nested elements, but we need to tread them as a Path member since they +// can contain states and or childStates +// +// +/////////////////////////////////////////////////////////////////////////// +string navFunct_getPathLessOne(string path) { + + string returnVal=""; + dyn_string aS; + + // look if there is a . in the pathname, + // if so strip the last one plus point and return the result + // and we are done + + aS = strsplit(path,'.'); + if (dynlen(aS) > 1) { + returnVal = aS[1]; + for (int i=2; i< dynlen(aS);i++) { + returnVal += "."+aS[i]; + } + return returnVal; + } + + // if no . found then look if there is a _ in the pathname, + // if so strip the last one plus _ and return the result + // and we are done + + aS = strsplit(path,'_'); + if (dynlen(aS) > 1) { + returnVal = aS[1]; + for (int i=2; i< dynlen(aS);i++) { + returnVal += "_"+aS[i]; + } + return returnVal; + } + + // otherwise return empty string + + return returnVal; +} + diff --git a/MAC/Navigator2/scripts/libs/navPanel.ctl b/MAC/Navigator2/scripts/libs/navPanel.ctl index 2ce777d98cffa99eb2ade04953920ac7fcd7fdcb..bb0f65703bad0a927b46c79ceae292835e96d03c 100644 --- a/MAC/Navigator2/scripts/libs/navPanel.ctl +++ b/MAC/Navigator2/scripts/libs/navPanel.ctl @@ -392,3 +392,81 @@ navPanel_addLogMessage(string aMsg) } } } + +void navPanel_statePopup(string baseDP) { + dyn_string popup; + + // NCFObjectState vars + string DPName=""; + int state; + string message="Operator Overrule"; + bool force=true; + + // define the popupMenu + LOG_DEBUG("navPanel.ctl:navPanel_statePopup|define popup for DP: "+baseDP); + + int idx=1; + dynInsertAt(popup,"CASCADE_BUTTON,Set State, 1",idx++); + dynInsertAt(popup,"CASCADE_BUTTON,Set Recursive State, 1",idx++); + dynInsertAt(popup,"Set State",idx++); + for (int i = 1; i <= mappinglen(stateName); i++) { + string aS="PUSH_BUTTON,"+mappingGetValue(stateName,i)+",1"+mappingGetKey(stateName,i)+",1"; + dynInsertAt(popup,aS,idx++); + } + dynInsertAt(popup,"Set Recursive State",idx++); + for (int i = 1; i <= mappinglen(stateName); i++) { + string aS="PUSH_BUTTON,"+mappingGetValue(stateName,i)+",2"+mappingGetKey(stateName,i)+",1"; + dynInsertAt(popup,aS,idx++); + } + + LOG_DEBUG("navPanel.ctl:navPanel_statePopup|popup composed"); + if (popupMenu(popup,state)<0 || !state>0) { + return; + } + + LOG_DEBUG("navPanel.ctl:navPanel_statePopup|popup returned: "+state); + bool recursive = false; + if (state == 10 ) { + state = 0; + } else if (state == 20) { + state = 0; + recursive = true; + } else if (state < 200) { + state -= 100; + } else { + state -= 200; + recursive = true; + } + + LOG_DEBUG("navPanel.ctl:navPanel_statePopup|recursive="+recursive); + bool ack=navFunct_acknowledgePanel("This will (re)set the state of "+baseDP+" to "+getStateName(state)+". Are you sure?"); + if (!ack) { + LOG_DEBUG("navPanel.ctl:navPanel_statePopup|State change by operator cancelled"); + return; + } + LOG_DEBUG("navPanel.ctl:navPanel_statePopup|State change by operator confirmed"); + + string database = dpSubStr(baseDP,DPSUB_SYS); + string bareDP = dpSubStr(baseDP,DPSUB_DP); + if (state >= 0 ) { + if (!recursive) { + LOG_DEBUG("navPanel.ctl:navPanel_statePopup|Operator sets "+baseDP+".status.state to "+getStateName(state)+ " (SINGLE)"); + DPName=baseDP+".status.state"; + dpSet(database+"__navObjectState.DPName",DPName, + database+"__navObjectState.stateNr",state, + database+"__navObjectState.message",message, + database+"__navObjectState.force",force); + } else { + // we will write the info to the __resetObjectState point. + // All existing stations, CCU's and MCU's will be connected to this point + // via a ctl script that runs on each machine. + // that script will do an update (if needed) for their own Database. + LOG_DEBUG("navPanel.ctl:navPanel_statePopup|Operator sets "+baseDP+".status.state to "+getStateName(state)+" (RECURSIVE)"); + dpSet(database+"__resetObjectState.DPName",baseDP, + database+"__resetObjectState.stateNr",state, + database+"__resetObjectState.message",message); + } + + } + LOG_DEBUG("navPanel.ctl:navPanel_statePopup|end (re)set states reached"); +} diff --git a/MAC/Navigator2/scripts/libs/navigator.ctl b/MAC/Navigator2/scripts/libs/navigator.ctl index 701f4cac5a2d1f716a5565c3ef6531afb633eafc..68da6204c18fc5685077587b1182f4c72bbe638f 100644 --- a/MAC/Navigator2/scripts/libs/navigator.ctl +++ b/MAC/Navigator2/scripts/libs/navigator.ctl @@ -32,7 +32,7 @@ // navigator_initializing : returns false if init ready, else true // navigator_clearWorkDPs : clear the work Datapoints - +#uses "GCFCWD.ctl" #uses "GCFLogging.ctl" #uses "claimManager.ctl" #uses "GCFCommon.ctl" @@ -70,6 +70,9 @@ void navigator_handleEventInitialize() // Set the global statecolors/colornames. initLofarColors(); + + // Init the connection Watchdog + GCFCWD_Init(); // first thing to do: get a new navigator ID // check the commandline parameter: diff --git a/MAC/Navigator2/scripts/monitorStateChanges.ctl b/MAC/Navigator2/scripts/monitorStateChanges.ctl index 51c3841eee473b0284c85e0dce8d12a08ed3a8a9..816651541726d8fa6f7f294f36724eeefe3c1b6d 100644 --- a/MAC/Navigator2/scripts/monitorStateChanges.ctl +++ b/MAC/Navigator2/scripts/monitorStateChanges.ctl @@ -28,7 +28,7 @@ // global bool isConnected=false; -global bool bDebug = false; +global bool bDebug = true; main () { @@ -292,16 +292,16 @@ void setStates(string datapoint,string element,int state,string message,bool for // only the childState updates needs 2b done, unless stationTrigger = true, then childstate should be // handled the same way as state. if (element == "status.state" | stationTrigger) { - // set the state value of this dp, to avoid unneed update chains, check the value. If it - // is the same don't update it + // set the state value of this dp int aVal; dpGet(datapoint+"."+element,aVal); - if (aVal != state && state > -1) { + if (state > -1) { if (force) { dpSet(datapoint+"."+element,state); } else { - if (aVal <=10 && state <= 10) { + if (bDebug) DebugN("monitorStateChanges.ctl:setStates|original val: "+aVal+ " state to set to: " + state); + if (aVal <=10 && state <= 0) { dpSet(datapoint+"."+element,state); } else if (aVal <= state) { dpSet(datapoint+"."+element,state); @@ -311,7 +311,7 @@ void setStates(string datapoint,string element,int state,string message,bool for } } - dp = getPathLessOne(datapoint); + dp = navFunct_getPathLessOne(datapoint); datapoint=dp; } else { if (bDebug) DebugN("monitorStateChanges.ctl:setStates|Equal value or state < 0, no need to set new state"); @@ -329,7 +329,7 @@ void setStates(string datapoint,string element,int state,string message,bool for // continue while true while ( setChildState(datapoint,state)) { if (bDebug) DebugN( "monitorStateChanges.ctl:setStates|Continueing with setChildState passing path: "+datapoint); - dp = getPathLessOne(datapoint); + dp = navFunct_getPathLessOne(datapoint); datapoint=dp; } } @@ -435,55 +435,3 @@ bool setChildState(string Dp,int state) { return false; } -/////////////////////////////////////////////////////////////////////////// -//Function getPathLessOne -// -// Returns the given path string less the last item. Paths can contain -// _ and . seperated items Like in: -// LOFAR_PIC_Cabinet0_Subrack0_RSPBoard0.AP0 (In fact the . seperated members -// are nested elements, but we need to tread them as a Path member since they -// can contain states and or childStates -// -// -// Added 07-12-2008 A.Coolen -/////////////////////////////////////////////////////////////////////////// -string getPathLessOne(string path) { - if (bDebug) DebugN("monitorStateChanges.ctl:getPathLessOne|entered with: " + path); - - string returnVal=""; - dyn_string aS; - - // look if there is a . in the pathname, - // if so strip the last one plus point and return the result - // and we are done - - aS = strsplit(path,'.'); - if (dynlen(aS) > 1) { - returnVal = aS[1]; - for (int i=2; i< dynlen(aS);i++) { - returnVal += "."+aS[i]; - } - if (bDebug) DebugN("monitorStateChanges.ctl:getPathLessOne| returns "+returnVal); - return returnVal; - } - - if (bDebug) DebugN("monitorStateChanges.ctl:getPathLessOne|No . in Path found, continueing with _"); - // if no . found then look if there is a _ in the pathname, - // if so strip the last one plus _ and return the result - // and we are done - - aS = strsplit(path,'_'); - if (dynlen(aS) > 1) { - returnVal = aS[1]; - for (int i=2; i< dynlen(aS);i++) { - returnVal += "_"+aS[i]; - } - if (bDebug) DebugN("monitorStateChanges.ctl:getPathLessOne|returns "+returnVal); - return returnVal; - } - - // otherwise return empty string - - return returnVal; -} - diff --git a/MAC/Navigator2/scripts/monitorStateReset.ctl b/MAC/Navigator2/scripts/monitorStateReset.ctl new file mode 100644 index 0000000000000000000000000000000000000000..f1ede0ca0b908ded68a6055e4bd63e70fda8379b --- /dev/null +++ b/MAC/Navigator2/scripts/monitorStateReset.ctl @@ -0,0 +1,213 @@ +//# monitorStateReset +//# +//# Copyright (C) 2007-2008 +//# ASTRON (Netherlands Foundation for Research in Astronomy) +//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl +//# +//# This program is free software; you can redistribute it and/or modify +//# it under the terms of the GNU General Public License as published by +//# the Free Software Foundation; either version 2 of the License, or +//# (at your option) any later version. +//# +//# This program is distributed in the hope that it will be useful, +//# but WITHOUT ANY WARRANTY; without even the implied warranty of +//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//# GNU General Public License for more details. +//# +//# You should have received a copy of the GNU General Public License +//# along with this program; if not, write to the Free Software +//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//# +//# $Id$ +#uses "GCFCommon.ctl" +#uses "navFunct.ctl" + + +// This script needs to run on every CSU, CCU and MainCU +// it monitors if states needs to be reset this will be done in recursive mode +// down the LOFAR object tree for every state that is lower then the requested change. +// + +global bool isConnected=false; +global bool bDebug = true; + +main () { + + // Set the global statecolors/colornames. + initLofarColors(); + + + // subscribe to the statechange update mechanism + subscribeObjectStateReset(); +} + + +/////////////////////////////////////////////////////////////////////////// +//Function subscribeObjectStateReset +// +// subscribes to the __resetObjectState DP of the database to monitor +// possible stateResets +// +/////////////////////////////////////////////////////////////////////////// +void subscribeObjectStateReset() { + + if (bDebug){ + DebugN("monitorStateResets.ctl:subscribeObjectStateChange|entered"); + } + // Routine to connnect to the __resetObjectState point to trigger stateresets + + dpConnect("resetStateTriggered",false,"__resetObjectState.DPName", + "__resetObjectState.stateNr", + "__resetObjectState.message"); +} + +/////////////////////////////////////////////////////////////////////////// +//Function resetStateTriggered +// +// Callback where a trigger of __resetObjectState is handled. +// +// We have to see if the point asked is part of the database this +// ctl is running on. If so it can be handled. If not we just ignore it +// +// If this machine is the MainCU however, we might have to pass work to the different +// stations also whenever a DP resolves to be part of the station in a deeper +// +// The following appointments have been made about (re)setting states/childstates: +// 1) The state change must be worse then the original state, otherwise do NOT touch +// 2) if the state is not worse then the state must be either 10 or equal to the original state from the +// point selected. Otherwise do NOT touch +// 3) when looking at childStates, if status.leaf = TRUE then we should not touch the childstate +/////////////////////////////////////////////////////////////////////////// +void resetStateTriggered(string dp1, string trigger, + string dp2, int state, + string dp3, string message) { + // __resetObjectState change. + // This point should have points like: + // + // LOFAR_PIC_Cabinet0_Subrack0_RSPBoard0_RCU0 + // 1 (= good) + // a msg indicating extra comments on the state + // + // first find out if the involved DP resides on this system or not + + if (bDebug) DebugN("monitorStateResets.ctl:resetStateTriggered|entered with trigger:", trigger); + string database=dpSubStr(trigger,DPSUB_SYS); + + if (getSystemName() == database) { + if (bDebug) DebugN("monitorStateResets.ctl:resetStateTriggered|this DP resides on this system"); + + string bareDP=dpSubStr(trigger,DPSUB_DP); + int originatorState=-1; + dpGet(trigger+".status.state",originatorState); + if (bDebug) DebugN("monitorStateResets.ctl:resetStateTriggered|the original state is: "+ getStateColor(originatorState)); + + + + //since this dp is part of this system we need to get a full list of all de dp's that belong to this dp tree, where + // dp is the top. We only are allowed to set a state higher + if (setStates(bareDP,state,originatorState,message)) { + // now do the same for the childStates + if (!setChildStates(bareDP,state,originatorState,message)) { + return; + } else { + // since we were able to set the states and the childstates without errors + // we can finish it up by setting the __navObjectState with the last original dp + // so the values will be set in the remainder of the tree + if (dpExists("__navObjectState.DPName")) { + dpSet("__navObjectState.DPName",bareDP+".status.state", + "__navObjectState.stateNr",state, + "__navObjectState.message",message, + "__navObjectState.force",FALSE); + } + } + } + } +} + +bool setStates(string DP,int state, int originatorState,string message) { + string query = "SELECT '_online.._value' FROM '" + DP + "*.**.status.state' WHERE '_online.._value' < " + state + " OR '_online.._value' == "+OPERATIONAL + " OR '_online.._value' == "+ originatorState; + if (bDebug) DebugN("monitorStateResets.ctl:setStates|composed query: "+query); + + dyn_dyn_anytype tab; + + if (dpQuery(query,tab)<0) { + DebugTN("monitorStateResets.ctl:setState|ERROR during dpQuery"); + return false; + } + if (bDebug) DebugN("monitorStateResets.ctl:setStates|results query: "+tab); + dyn_string valDPs; + dyn_string msgDPs; + dyn_string msgs; + dyn_anytype values; + + // prepare a large dynarray with existing values and one with the values belonging to that dp + if (dynlen(tab) < 2) { + return true; + } + + for(int z=2;z<=dynlen(tab);z++){ + if (dpExists(tab[z][1]) ){ + dynAppend(valDPs,tab[z][1]); + dynAppend(values,state); + dynAppend(msgDPs,tab[z][1]); + dynAppend(msgs,message); + } + } + + // if dps found, do an update of all values in one go. + if (dynlen(valDPs) > 0) { + if (bDebug) DebugN("monitorStateResets.ctl:setState|found dp's to set: "+valDPs); + if (dpSetWait(valDPs,values,msgDPs,msgs) < 0) { + DebugTN("monitorStateResets.ctl:setState|ERROR during dpSet"); + return false; + } + } else { + return true; + } + return true; +} + +bool setChildStates(string DP,int state, int originatorState, string message) { + string query = "SELECT '_online.._value' FROM '" + DP + "*.**.status.childState' WHERE '.status.leaf:_online.._value' == 0 AND '.status.childState:_online.._value' < " + state + " OR '.status.childState:_online.._value' == "+OPERATIONAL+ " OR '.status.childState:_online.._value' == "+originatorState; + if (bDebug) DebugN("monitorStateResets.ctl:setChildStates|composed statequery: "+query); + + dyn_dyn_anytype tab; + + if (dpQuery(query,tab)<0) { + DebugTN("monitorStateResets.ctl:setChildState|ERROR during dpQuery"); + return false; + } + if (bDebug) DebugN("monitorStateResets.ctl:setChildState|results query: "+tab); + dyn_string valDPs; + dyn_string msgDPs; + dyn_string msgs; + dyn_anytype values; + + // prepare a large dynarray with existing values and one with the values belonging to that dp + if (dynlen(tab) < 2) { + return true; + } + + for(int z=2;z<=dynlen(tab);z++){ + if (dpExists(tab[z][1]) ){ + // for childStates we need to check if leaf = True, if so we are in the bottom of the tree, + // where dp's do NOT have children anymore, so childStates need not to be set. + dynAppend(valDPs,tab[z][1]); + dynAppend(values,state); + dynAppend(msgDPs,tab[z][1]); + dynAppend(msgs,message); + } + } + + // if dps found, do an update of all values in one go. + if (dynlen(valDPs) > 0) { + if (bDebug) DebugN("monitorStateResets.ctl:setChildState|found dp's to set: "+valDPs); + if (dpSetWait(valDPs,values,msgDPs,msgs)){ + DebugTN("monitorStateResets.ctl:setChildState|ERROR during dpSet"); + return false; + } + } else { + return true; + } + return true; +}