source: trunk/FACT++/scripts/handleRatectrlConnected.js@ 16715

Last change on this file since 16715 was 16448, checked in by tbretz, 11 years ago
Fixed a typo and added DimNetworkNotAvailable.
File size: 773 bytes
Line 
1function handleRatectrlConnected(wait_state)
2{
3 var state = dim.state("RATE_CONTROL");
4 if (state===undefined)
5 return undefined;
6
7 if (wait_state && wait_state.length>0 && state.name!=wait_state)
8 return wait_state;
9
10 //dim.log("RATE_CONTROL: "+state.name+"["+state.index+"]");
11
12 switch (state.name)
13 {
14 case "DimNetworkNotAvailable":
15 case "Disconnected":
16 return undefined;
17
18 case "Calibrating":
19 case "GlobalThresholdSet":
20 case "InProgress":
21 console.out("Ratectrl in "+state.name+"... stop.");
22 dim.send("RATE_CONTROL/STOP");
23 return "Connected";
24
25 case "Connected":
26 return "";
27 }
28
29 throw new Error("RATE_CONTROL:"+state.name+"["+state.index+"] unknown or not handled.");
30}
31
Note: See TracBrowser for help on using the repository browser.