source: trunk/FACT++/scripts/handleFeedbackConnected.js@ 16771

Last change on this file since 16771 was 14969, checked in by tbretz, 12 years ago
Replaced dim.print by dim.log
File size: 908 bytes
Line 
1function handleFeedbackConnected(wait_state)
2{
3 var state = dim.state("FEEDBACK");
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 "Disconnected":
15 case "Connecting":
16 case "ConnectedFSC":
17 case "ConnectedFAD":
18 return undefined;
19
20 case "Connected":
21 return "";
22
23 case "FeedbackIdle":
24 case "TempCtrlIdle":
25 case "CurrentCtrlIdle":
26 case "FeedbackControl":
27 case "TempControl":
28 case "CurrentControl":
29 case "Calibrating":
30 console.out("Feedback in "+state.name+"... stop feedback.");
31 dim.send("FEEDBACK/STOP");
32 return "Connected";
33 }
34
35 throw new Error("FEEDBACK:"+state.name+"["+state.index+"] unknown or not handled.");
36}
37
Note: See TracBrowser for help on using the repository browser.