Line | |
---|
1 | // Get bias control connected and voltage off
|
---|
2 | function handleBiasVoltageOff(wait_state)
|
---|
3 | {
|
---|
4 | var state = dim.state("BIAS_CONTROL");
|
---|
5 | if (state===undefined)
|
---|
6 | return undefined;
|
---|
7 |
|
---|
8 | if (wait_state && wait_state.length>0 && state.name!=wait_state)
|
---|
9 | return wait_state;
|
---|
10 |
|
---|
11 | //dim.log("BIAS_CONTROL: "+state.name+"["+state.index+"]");
|
---|
12 |
|
---|
13 | switch (state.name)
|
---|
14 | {
|
---|
15 | // Do-nothing conditions
|
---|
16 | case "Connecting":
|
---|
17 | case "Initializing":
|
---|
18 | case "Connected":
|
---|
19 | case "Ramping":
|
---|
20 | return wait_state;
|
---|
21 |
|
---|
22 | // Do-something conditions
|
---|
23 | case "Disconnected":
|
---|
24 | console.out("Bias in Diconnected... connect.");
|
---|
25 | dim.send("BIAS_CONTROL/RECONNECT");
|
---|
26 | return "VoltageOff";
|
---|
27 |
|
---|
28 | case "NotReferenced":
|
---|
29 | case "VoltageOn":
|
---|
30 | console.out("Bias in "+state.name+"... switch voltage off.");
|
---|
31 | dim.send("BIAS_CONTROL/SET_ZERO_VOLTAGE");
|
---|
32 | return "VoltageOff";
|
---|
33 |
|
---|
34 | // Final state reached condition
|
---|
35 | case "VoltageOff":
|
---|
36 | return "";
|
---|
37 |
|
---|
38 | // Conditions which cannot be handled
|
---|
39 | case "OverCurrent": throw "BIAS_CONTROL in OverCurrent";
|
---|
40 | case "ExpertMode": throw "BIAS_CONTROL in expert mode";
|
---|
41 | }
|
---|
42 |
|
---|
43 | throw new Error("BIAS_CONTROL:"+state.name+"["+state.index+"] unknown or not handled.");
|
---|
44 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.