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

Last change on this file since 16388 was 14969, checked in by tbretz, 12 years ago
Replaced dim.print by dim.log
File size: 734 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("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.