source: trunk/FACT++/scripts/handleFscConnected.js@ 16817

Last change on this file since 16817 was 16787, checked in by tbretz, 11 years ago
Improved the output whenever a command is sent.
File size: 721 bytes
Line 
1// Get FSC connected
2function handleFscConnected(wait_state)
3{
4 var state = dim.state("FSC_CONTROL");
5 if (state===undefined)
6 return undefined;
7
8 if (wait_state && wait_state.length>0 && state.name!=wait_state)
9 return wait_state;
10
11 //console.out("FSC_CONTROL: "+state.name+"["+state.index+"]");
12
13 switch (state.name)
14 {
15 // Do-nothing conditions
16 case "Disconnected":
17 console.out("Fscctrl in 'Diconnected'... sending RECONNECT... waiting for 'Connected'.");
18 dim.send("FSC_CONTROL/RECONNECT");
19 return "Connected";
20
21 case "Connected":
22 return "";
23 }
24
25 throw new Error("FSC_CONTROL:"+state.name+"["+state.index+"] unknown or not handled.");
26}
Note: See TracBrowser for help on using the repository browser.