Changeset 17356 for trunk/FACT++/scripts


Ignore:
Timestamp:
11/23/13 13:09:18 (11 years ago)
Author:
tbretz
Message:
Switch trigger off before lid is closed to avoid smartfact complainaing about dropping rates; added an the irq 'off' which stops the current run and turns off voltage; added GPS_CONTROL to the checks.
File:
1 edited

Legend:

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

    r17324 r17356  
    179179    if (isOpen)
    180180    {
     181        if (dim.state("FTM_CONTROL").name=="TriggerOn")
     182        {
     183            dim.send("FTM_CONTROL/STOP_TRIGGER");
     184            dim.wait("FTM_CONTROL", "Valid", 3000);
     185        }
     186
    181187        dim.log("Closing lid.");
    182188        dim.send("LID_CONTROL/CLOSE");
     
    511517         "FTM_CONTROL/STATIC_DATA",
    512518         "FTM_CONTROL/TRIGGER_RATES",
     519         "GPS_CONTROL/NEMA",
    513520         "LID_CONTROL/DATA",
    514521         "MAGIC_LIDAR/DATA",
     
    684691var system_on;  // undefined
    685692
    686 while (!irq)
     693function processIrq()
     694{
     695    if (!irq)
     696        return false;
     697
     698    if (irq.toUpperCase()=="OFF")
     699    {
     700        service_feedback.voltageOff();
     701        dim.send("FAD_CONTROL/CLOSE_OPEN_FILES");
     702        return true;
     703    }
     704
     705    if (irq.toUpperCase()=="SHUTDOWN")
     706    {
     707        Shutdown();
     708        return true;
     709    }
     710
     711    console.log("IRQ "+irq+" unhandled... stopping script.");
     712    return true;
     713}
     714
     715while (!processIrq())
    687716{
    688717    // Check if observation position is still valid
     
    821850         [ "RATE_SCAN",       [ "Connected"                ] ],
    822851         [ "RATE_CONTROL",    [ "Connected", "GlobalThresholdSet", "InProgress"  ] ],
     852         [ "GPS_CONTROL",     [ "Locked"  ] ],
    823853        ];
    824854
     
    11541184dim.log("Left main loop [irq="+irq+"]");
    11551185
    1156 if (irq.toUpperCase()=="SHUTDOWN")
    1157     Shutdown();
    1158 
    11591186// ================================================================
    11601187// Comments and ToDo goes here
Note: See TracChangeset for help on using the changeset viewer.