source: trunk/FACT++/scripts/handleFtuCheck.js@ 18116

Last change on this file since 18116 was 16857, checked in by tbretz, 11 years ago
Added the 'use strict'
File size: 750 bytes
Line 
1'use strict';
2
3function handleFtuCheck(wait_state)
4{
5 var service = this.ftuList.get();
6 if (!service.obj || service.obj.length==0)
7 return undefined;
8
9 if (!wait_state)
10 {
11 dim.send("FTM_CONTOL/PING");
12 return toString(service.counter);
13 }
14
15 if (toInt(wait_state)==service.counter)
16 return wait_state;
17
18 var ping = service.data['Ping'];
19 for (var i=0; i<40; i++)
20 {
21 if (ping[i]==1)
22 continue;
23
24 dim.log("Problems in the FTU communication found.");
25 dim.log("Send command to disable all FTUs.");
26 dim.log(" => Power cycle needed.");
27 dim.send("FTM_CONTOL/ENABLE_FTU", -1, false);
28 throw new Error("CrateReset[FTU]");
29 }
30
31 return "";
32}
Note: See TracBrowser for help on using the repository browser.