Newer
Older
V 11
1
LANG:1 0
PANEL,-1 -1 251 88 N "_3DFace" 1
"$station"
"main()
{
//Point to show the swlevel of a certain station
station = $station;
station_text.text = station;
baseDP = station+\":LOFAR_PermSW_Daemons_SoftwareMonitor\";
if (navFunct_dpReachable(baseDP)) {
if (dpExists(baseDP)) {
showLevels();
} else {
station_text.foreCol(\"Lofar_dpdoesnotexist\");
}
station_text.foreCol(\"Lofar_dpOffline\");

Marcel Loose
committed
E E E E 1 -1 -1 0 0 0
""0 1
E "#uses \"navPanel.ctl\"
string station = \"\";
string baseDP=\"\";
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// routine for single mouse click
void click(string name) {
// set delay in case double click was meant
delay(0, 100);
if (!bDoubleClicked) {
navPanel_setEvent(name,\"EventClick\");
}
}
// routine for double mouse click
void dblClick(string name) {
// indicate this is a doubleClick
bDoubleClicked = true;
if (name == station) baseDP=station+\":LOFAR\";
if (dpExists(baseDP) ) {
LOG_DEBUG(\"swlevel.pnl:DoubleClick|Setting currentDatapoint from : \"+g_currentDatapoint+\" to \"+baseDP);
g_currentDatapoint=baseDP;
if (name == station) {
navPanel_setEvent(station,\"ChangePanel\");
} else {
//we also have to set the tabctrl to think this was initiated from the ProcessesTab, otherwise we will get the wrong panel.
navPanel_setEvent(\"Processes\",\"ChangeTab\");
}
}
// set delay to avoid click event will be triggered
delay(0, 500);
bDoubleClicked = false;
}
// routine for right mouse click
void rClick(string name) {
}
// ****************************************
// Name: showLogging
// ****************************************
// Connects to the given datapoint .logMsg it's historical data (if any)
// and logs all
//
// ****************************************
showLevels()
{
LOG_TRACE(\"swlevel.pnl:showLevels| Entered for DP:\" ,baseDP);
string dpLvl = baseDP+\".SWLevel\";
string systemName = dpSubStr(dpLvl,DPSUB_SYS);
string bareDP = dpSubStr(dpLvl,DPSUB_DP_EL_CONF_DET_ATT);
if (navFunct_dpReachable(dpLvl)) {
if(dpExists(dpLvl)) {
// gather the historical data:
dyn_dyn_anytype tab;
int z;
time tStart;
time tStop;
tStop = getCurrentTime();
tStart = tStop - 15*3600; // 15 hours of history
string query=\"\";
if (systemName != MainDBName) {
query = \"SELECT ALL '_original.._value','_original.._stime' FROM '\" + dpLvl + \"' REMOTE'\"+systemName +\"' TIMERANGE(\\\"\" +
formatTime(\"%Y.%m.%d %H:%M:%S\",tStart) + \"\\\",\\\"\" +
formatTime(\"%Y.%m.%d %H:%M:%S\",tStop) + \"\\\",1,0) LAST 15\";
} else {
query = \"SELECT ALL '_original.._value','_original.._stime' FROM '\" + dpLvl + \"' TIMERANGE(\\\"\" +
formatTime(\"%Y.%m.%d %H:%M:%S\",tStart) + \"\\\",\\\"\" +
formatTime(\"%Y.%m.%d %H:%M:%S\",tStop) + \"\\\",1,0) LAST 15\";
}
dpQuery(query, tab);
for(z=2;z<dynlen(tab);z++) {
addLevel(tab[z][2],tab[z][3]);
}
// connect to levels
if (dpConnect(\"updateLevel\",dpLvl,
dpLvl+\":_original.._stime\",
dpLvl+\":_online.._invalid\") == -1) {
LOG_ERROR(\"swlevel.pnl:showLevels|Couldn't connect to \"+dpLvl+ \" \" + getLastError());
}
} else {
LOG_DEBUG(\"swlevel.pnl:showLevels|error connecting to: \"+ dpLvl);
}
station_text.foreCol(\"Lofar_dpOffline\");
}
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
}
// ****************************************
// Name: updateLevel
// ****************************************
// callback for showLevels
//
// ****************************************
updateLevel(string dp1, int lvl,
string dp2, string changed,
string dp3, bool invalid)
{
LOG_TRACE(\"swlevel.pnl:showLevelsg|Level: \"+lvl);
if (invalid) {
station_text.foreCol(\"Lofar_invalid\");
} else {
station_text.foreCol(\"_WindowText\");
addLevel(lvl,changed);
}
}
// ****************************************
// Name: addLevel
// ****************************************
// fill the 15 timestamped SWlevels for this Database
//
// ****************************************
addLevel(int lvl,string changed)
{
LOG_TRACE(\"swlevel.pnl:addlevel|lvl: \" + lvl);
string toolTip = changed+\"<br> level: \"+lvl;
string lvlcolor=\"\";
if (lvl == 0) {
lvlcolor=\"red\";
} else if (lvl == 1) {
lvlcolor=\"{255,170,0}\"; //orange
} else if (lvl >= 2 && lvl < 6) {
lvlcolor=\"yellow\";
} else if (lvl == 6) {
lvlcolor=\"green\";
} else {
lvlcolor = \"white\";
}
string oldlvl=\"white\";
string oldToolTip = \"\";
for (int i=15-filled; i< 15 ;i++) {
if (i=0) continue;
// get the original color and tooltip from the next right point and move it to this point
getValue(\"level\"+(i+1)+\"_text\",\"backCol\",oldlvl);
setValue(\"level\"+(i)+\"_text\",\"backCol\",oldlvl);
getValue(\"level\"+(i+1)+\"_text\",\"toolTipText\",oldToolTip);
setValue(\"level\"+(i)+\"_text\",\"toolTipText\",oldToolTip);
}
// set new values
setValue(\"level15_text\",\"backCol\",lvlcolor);
setValue(\"level15_text\",\"toolTipText\",toolTip);
}
" 0
2
"CBRef" "1"
"EClose" E
""
DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
LAYER, 0
1
LANG:1 0
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
6 16
"station_highLight"
""
1 240 10 E E E 1 E 0 E N "_Transparent" E N "Lofar_highLight" E E
"main()
{
rClick();
}" 0
"main()
{
dblClick();
}" 0
16 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
"main()
{
dpConnect( \"swlevel_stationCallback\",true,DPNAME_NAVIGATOR + g_navigatorID +\".objectTrigger\" );
}
void swlevel_stationCallback(string dp1, bool aTrig) {
LOG_DEBUG(\"swlevel.pnl:swlevel_stationCallback|ObjectTrigger Callback on: \"+dp1+\" trigger: \"+aTrig);
LOG_DEBUG(\"swlevel.pnl:swlevel_stationCallback|Found highlight : \" + highlight + \" Looking for station\");
bool bHighlight=false;
if (dynContains(highlight,station)) {
bHighlight=true;
}
LOG_DEBUG(\"swlevel.pnl:swlevel_stationCallback|Highlight request: \"+bHighlight);
station_highLight.visible = bHighlight;
}
" 0
"main()
{
click();
}" 0
0 1 1 2 1 E 1 0 1 2 1 1 E 0 8 33 23
6 0
"level1_text"
""
1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
"main()
{
rClick(this.name);
}" 0
"main(int x, int y)
{
dblClick(this.name);
}" 0
0 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
E "main(int x, int y)
{
click(this.name);
}" 0
0 1 1 2 1 E 1 0 1 -180 -140 1 E 230 150 234 159
1 5 10 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E
"main()
{
rClick(station);
}" 0
"main(int x, int y)
{
dblClick(station);
}" 0
1 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
E "main(int x, int y)
{
click(station);
}" 0
0 1 1 2 1 E U 0 E 5 10 33 23
0 2 2 "0s" 0 0 0 192 0 0 5 10 1
1
LANG:1 34 MS Shell Dlg 2,8,-1,5,50,0,0,0,0,0
0 1
LANG:1 5 cs001
6 2
"level2_text"
""
1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
"main()
{
rClick(this.name);
}" 0
"main(int x, int y)
{
dblClick(this.name);
}" 0
2 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
E "main(int x, int y)
{
click(this.name);
}" 0
0 1 1 2 1 E 1 0 1 -175 -140 1 E 230 150 234 159
6 3
"level3_text"
""
1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
"main()
{
rClick(this.name);
}" 0
"main(int x, int y)
{
dblClick(this.name);
}" 0
3 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
E "main(int x, int y)
{
click(this.name);
}" 0
0 1 1 2 1 E 1 0 1 -170 -140 1 E 230 150 234 159
6 4
"level4_text"
""
1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
"main()
{
rClick(this.name);
}" 0
"main(int x, int y)
{
dblClick(this.name);
}" 0
4 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
E "main(int x, int y)
{
click(this.name);
}" 0
0 1 1 2 1 E 1 0 1 -165 -140 1 E 230 150 234 159
6 5
"level5_text"
""
1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
"main()
{
rClick(this.name);
}" 0
"main(int x, int y)
{
dblClick(this.name);
}" 0
5 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
E "main(int x, int y)
{
click(this.name);
}" 0
0 1 1 2 1 E 1 0 1 -160 -140 1 E 230 150 234 159
6 6
"level6_text"
""
1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
"main()
{
rClick(this.name);
}" 0
"main(int x, int y)
{
dblClick(this.name);
}" 0
6 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
E "main(int x, int y)
{
click(this.name);
}" 0
0 1 1 2 1 E 1 0 1 -155 -140 1 E 230 150 234 159
6 7
"level7_text"
""
1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
"main()
{
rClick(this.name);
}" 0
"main(int x, int y)
{
dblClick(this.name);
}" 0
7 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
E "main(int x, int y)
{
click(this.name);
}" 0
0 1 1 2 1 E 1 0 1 -150 -140 1 E 230 150 234 159
6 8
"level8_text"
""
1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
"main()
{
rClick(this.name);
}" 0
"main(int x, int y)
{
dblClick(this.name);
}" 0
8 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
E "main(int x, int y)
{
click(this.name);
}" 0
0 1 1 2 1 E 1 0 1 -145 -140 1 E 230 150 234 159
6 9
"level9_text"
""
1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
"main()
{
rClick(this.name);
}" 0
"main(int x, int y)
{
dblClick(this.name);
}" 0
9 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
E "main(int x, int y)
{
click(this.name);
}" 0
0 1 1 2 1 E 1 0 1 -140 -140 1 E 230 150 234 159
6 10
"level10_text"
""
1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
"main()
{
rClick(this.name);
}" 0
"main(int x, int y)
{
dblClick(this.name);
}" 0
10 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
E "main(int x, int y)
{
click(this.name);
}" 0
0 1 1 2 1 E 1 0 1 -135 -140 1 E 230 150 234 159
6 11
"level11_text"
""
1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
"main()
{
rClick(this.name);
}" 0
"main(int x, int y)
{
dblClick(this.name);
}" 0
11 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
E "main(int x, int y)
{
click(this.name);
}" 0
0 1 1 2 1 E 1 0 1 -130 -140 1 E 230 150 234 159
6 12
"level12_text"
""
1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
"main()
{
rClick(this.name);
}" 0
"main(int x, int y)
{
dblClick(this.name);
}" 0
12 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
E "main(int x, int y)
{
click(this.name);
}" 0
0 1 1 2 1 E 1 0 1 -125 -140 1 E 230 150 234 159
6 13
"level13_text"
""
1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
"main()
{
rClick(this.name);
}" 0
"main(int x, int y)
{
dblClick(this.name);
}" 0
13 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
E "main(int x, int y)
{
click(this.name);
}" 0
0 1 1 2 1 E 1 0 1 -120 -140 1 E 230 150 234 159
6 14
"level14_text"
""
1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
"main()
{
rClick(this.name);
}" 0
"main(int x, int y)
{
dblClick(this.name);
}" 0
14 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
E "main(int x, int y)
{
click(this.name);
}" 0
0 1 1 2 1 E 1 0 1 -115 -140 1 E 230 150 234 159
6 15
"level15_text"
""
1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
"main()
{
rClick(this.name);
}" 0
"main(int x, int y)
{
dblClick(this.name);
}" 0
15 0 0 0 0 0
E E E
0
1
LANG:1 0
1
"dashclr"N "_Transparent"
E "main(int x, int y)
{
click(this.name);
}" 0
0 1 1 2 1 E 1 0 1 -110 -140 1 E 230 150 234 159