Changeset 19517


Ignore:
Timestamp:
05/26/19 12:04:11 (6 years ago)
Author:
tbretz
Message:
Fixed a problem with the prpare-interrupt and load sources, fixed another case that prevented the feedback from staying in InProgress
File:
1 edited

Legend:

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

    r19514 r19517  
    816816    console.out("  IRQ:  "+cmd);
    817817    console.out("  Time: "+time);
    818     console.out("  User: "+user);
     818    if (user)
     819        console.out("  User: "+user);
    819820
    820821    if (cmd.toUpperCase()=="RELOADSOURCES")
     
    829830    // This will end a run in progress as if it where correctly stopped
    830831    if (dim.state("MCP").name=="TakingData")
    831         dim.send("MCP/STOP");
     832    {
     833        if (irq.toUpperCase()=="PREPARE")
     834        {
     835            // Avoid stopping the trigger preparing for a ToO
     836            // this would result in the FEEDBACK going from InProgress to Connected
     837            // and thus the threshold settings cannot be reused
     838            if (dim.state("FAD_CONTROL").name=="RunInProgress")
     839                dim.send("FAD_CONTROL/CLOSE_OPEN_FILES");
     840        }
     841        else
     842            dim.send("MCP/STOP");
     843    }
     844
     845    if (irq.toUpperCase()=="PREPARE")
     846    {
     847        triggerReloadSources = true;
     848        dim.send("DRIVE_CONTROL/STOP");
     849        irq = undefined;
     850    }
     851
     852    /*
     853        if (fDimFTM.state()==FTM::State::kTriggerOn)
     854        {
     855            Message("Stopping FTM");
     856            Dim::SendCommandNB("FTM_CONTROL/STOP_TRIGGER");
     857        }
     858
     859        // FIXME: Do step 2 only when FTM is stopped
     860        if (fDimFAD.state()==FAD::State::kConnected || fDimFAD.state()==FAD::State::kRunInProgress)
     861        {
     862            if (fDimFAD.state()==FAD::State::kRunInProgress)
     863                Dim::SendCommandNB("FAD_CONTROL/CLOSE_OPEN_FILES");
     864        }
     865
     866        return GetCurrentState();
     867     */
    832868
    833869    // This will stop a rate scan in progress
     
    879915        return false;
    880916
     917    while (irq.toUpperCase()=="PREPARE")
     918        v8.sleep(10);
     919
    881920    if (irq.toUpperCase()=="RESCHEDULE")
    882921    {
     
    903942    {
    904943        Shutdown();
    905         return true;
    906     }
    907 
    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);
    913944        return true;
    914945    }
     
    15941625        // Now we are 'OnTrack', so we can ramp to nominal voltage
    15951626        // and wait for the feedback to get stable
    1596         service_feedback.voltageOn();
     1627        //if (!obs[sub].grb || dim.state("FEEDBACK").name!="InProgress")
     1628            service_feedback.voltageOn();
    15971629        if (!obs[sub].grb)
    15981630            service_feedback.waitForVoltageOn();
     
    16171649            if (dim.state("LID_CONTROL").name!="Open")
    16181650            {
     1651                dim.log("Waiting for an open lid.");
    16191652                dim.wait("LID_CONTROL", "Open", 30000);
    16201653                service_feedback.waitForVoltageOn();
Note: See TracChangeset for help on using the changeset viewer.