Changeset 18370 for trunk/FACT++/scripts


Ignore:
Timestamp:
11/07/15 20:50:24 (9 years ago)
Author:
tbretz
Message:
Adapted handling of drive control states.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/scripts/handleDriveArmed.js

    r17351 r18370  
    1616    {
    1717    case "Disconnected":
     18        console.out("Drivectrl in 'Disconnected'... sending RECONNECT... waiting for 'Initialized'.");
     19        dim.send("DRIVE_CONTROL/RECONNECT");
     20        return "Initialized";
     21
    1822    case "Connected":
    19     case "Ready":
     23    case "Parking":
     24    case "Stopping":
     25    case "Armed":
     26    case "Blocked":
    2027        v8.sleep(1000);
    2128        return undefined;
    2229
    2330    case "Locked":
    24         //console.warn("Drive is LOCKED. Not all observation types will be supported.");
    2531        console.out("WARNING - Drive is LOCKED. Please unlock manually.");
     32        // Do NOT unlock the drive here... it is a safety feature which should
     33        // never be used in an auotmatic process otherwise it is not realiable!
    2634        return "";
    27         //throw new Error("Drive is LOCKED. Please unlock manually.");
    28         //return undefined;
    29         //dim.log("Drive in Locked... unlock.");
    30         //dim.send("DRIVE_CONTROL/UNLOCK");
    31         //return "Armed";
    3235
    3336    case "Moving":
     
    3841        return "Armed";
    3942
    40     case "NotReady":
    4143    case "ERROR":
    42         console.out("Drive in '"+state.name+"'... sending STOP.");
     44        console.out("Drive in '"+state.name+"'... sending STOP... waiting for 'Initialized'");
    4345        dim.send("DRIVE_CONTROL/STOP");
    44         dim.wait("DRIVE_CONTROL", "Armed", 60000);
    45         return undefined;  // Process that again if necessary
     46        return "Initialized";  // Process that again if necessary
    4647
    47     case "Armed":
     48    case "Initialized":
    4849        return "";
    4950    }
Note: See TracChangeset for help on using the changeset viewer.