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

Last change on this file since 14773 was 14763, checked in by neise, 12 years ago
initial include
File size: 910 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.print("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.