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

Last change on this file since 14782 was 14763, checked in by neise, 12 years ago
initial include
File size: 736 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.print("FEEDBACK: "+state.name+"["+state.index+"]");
11
12 switch (state.name)
13 {
14 case "Diconnected":
15 return undefined;
16
17 case "Calibrating":
18 case "GlobalThresholdSet":
19 case "InProgress":
20 console.out("Ratectrl in "+state.name+"... stop.");
21 dim.send("RATE_CONTROL/STOP");
22 return "Connected";
23
24 case "Connected":
25 return "";
26 }
27
28 throw new Error("RATE_CONTROL:"+state.name+"["+state.index+"] unknown or not handled.");
29}
30
Note: See TracBrowser for help on using the repository browser.