Changeset 19513


Ignore:
Timestamp:
05/25/19 14:02:30 (6 years ago)
Author:
tbretz
Message:
New interrupt 'PREPARE' which reloads the sources and stops the drive while the schedule is entered into the data base. This might still be optimized. Allow the scheduler during data taking on in Armed state, fixed some typos in the ToO specific code, only take 60s runs for the first two 5min slots.
File:
1 edited

Legend:

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

    r19452 r19513  
    906906    }
    907907
     908    if (irq.toUpperCase()=="PREPARE")
     909    {
     910        dim.log("Preparing for ToO observation.");
     911        dim.send("DRIVE_CONTROL/STOP");
     912        dim.wait("DRIVE_CONTROL", "Initialized", 15000);
     913        return true;
     914    }
     915
    908916    dim.log("IRQ "+irq+" unhandled... stopping script.");
    909917    return true;
     
    10581066         [ "PFMINI_CONTROL",      [ "Disconnected", "Connected", "Receiving" ] ],
    10591067         [ "BIAS_TEMP",           [ "Valid" ] ],
     1068         [ "SCHEDULER",           [ /*"Connected",*/ "Armed" ] ],
    10601069        ];
    10611070
     
    15161525        {
    15171526            // Switch the voltage to a reduced voltage level
    1518             service_feedback.voltageOn(0);
     1527            if (!obs[sub].grb)
     1528                service_feedback.voltageOn(0);
    15191529
    15201530            // Change wobble position every four runs,
     
    15521562        {
    15531563            doDrsCalibration("data");  // will turn voltage off
    1554 
    1555             // Now we switch on the voltage and a significant amount of
    1556             // time has been passed, so do the check again.
    1557             sun = Sun.horizon(-12);
    1558             if (!was_up && sun.isUp)
    1559             {
    1560                 dim.log("Sun rise detected....");
    1561                 continue;
    1562             }
     1564        }
     1565
     1566        // Now we switch on the voltage and a significant amount of
     1567        // time has been passed, so do the check again.
     1568        sun = Sun.horizon(-12);
     1569        if (!was_up && sun.isUp)
     1570        {
     1571            dim.log("Sun rise detected....");
     1572            continue;
    15631573        }
    15641574
     
    16051615            // If the lid is not yet open, wait for the lid to be open and
    16061616            // go on as usual.
    1607             if (dim.state("LID_CONTROL")!="Open")
     1617            if (dim.state("LID_CONTROL").name!="Open")
    16081618            {
    16091619                dim.wait("LID_CONTROL", "Open", 30000);
     
    16211631
    16221632            dim.wait("FEEDBACK",      "InProgress",  45000); // This is most likely the first to happen
    1623             dim.wait("DRIVE_CONTROL", "Tracking",   150000); // 110s for turning and 30s for stabilizing
    1624 
    1625             v8.wait(1000); // By now we should have collected the required three current events in FEEDBACK
     1633            dim.wait("DRIVE_CONTROL", "OnTrack",    150000); // 110s for turning and 30s for stabilizing
     1634
     1635            v8.sleep(1000); // By now we should have collected the required three current events in FEEDBACK
    16261636            // Current are averaged over 10s. So by now we should have a reasonable idea of the brightness of the sky
    16271637            // Individual pixels might still suffer wrong settings
     
    16521662        var twilight = Sun.horizon(-16).isUp;
    16531663
    1654         if (twilight || obs[sub].grb)
     1664        if (twilight || (obs[sub].grb && run<2))
    16551665        {
    16561666            for (var i=0; i<5 && !irq; i++)
Note: See TracChangeset for help on using the changeset viewer.