Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | function handleFeedbackConnected(wait_state)
|
---|
4 | {
|
---|
5 | var state = dim.state("FEEDBACK");
|
---|
6 | if (state===undefined)
|
---|
7 | return undefined;
|
---|
8 |
|
---|
9 | if (wait_state && wait_state.length>0 && state.name!=wait_state)
|
---|
10 | return wait_state;
|
---|
11 |
|
---|
12 | //dim.log("FEEDBACK: "+state.name+"["+state.index+"]");
|
---|
13 |
|
---|
14 | switch (state.name)
|
---|
15 | {
|
---|
16 | case "Disconnected":
|
---|
17 | case "Connecting":
|
---|
18 | case "ConnectedFSC":
|
---|
19 | case "ConnectedFAD":
|
---|
20 | return undefined;
|
---|
21 |
|
---|
22 | case "Connected":
|
---|
23 | return "";
|
---|
24 |
|
---|
25 | case "FeedbackIdle":
|
---|
26 | case "TempCtrlIdle":
|
---|
27 | case "CurrentCtrlIdle":
|
---|
28 | case "FeedbackControl":
|
---|
29 | case "TempControl":
|
---|
30 | case "CurrentControl":
|
---|
31 | case "Calibrating":
|
---|
32 | console.out("Feedback in '"+state.name+"'... sending STOP... waiting for 'Connected'.");
|
---|
33 | dim.send("FEEDBACK/STOP");
|
---|
34 | return "Connected";
|
---|
35 | }
|
---|
36 |
|
---|
37 | throw new Error("FEEDBACK:"+state.name+"["+state.index+"] unknown or not handled.");
|
---|
38 | }
|
---|
39 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.