Changeset 18515 for trunk


Ignore:
Timestamp:
06/01/16 21:39:29 (8 years ago)
Author:
smueller
Message:
the production code needs to be checked in
File:
1 edited

Legend:

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

    r18429 r18515  
    161161
    162162    var isClosed = dim.state("LID_CONTROL").name=="Closed";
     163    var isInconsistent = dim.state("LID_CONTROL").name=="Inconsistent";
    163164
    164165    var tm = new Date();
    165166
    166167    // Wait for lid to be open
    167     if (isClosed)
     168    if (isClosed || isInconsistent)
    168169    {
    169170        dim.log("Opening lid");
     
    183184    dim.wait("LID_CONTROL", "Open", 30000);
    184185
    185     if (isClosed)
     186    if (isClosed || isInconsistent)
    186187        dim.log("Lid open [%.1fs]".$((new Date()-tm)/1000));
    187188}
     
    205206        dim.send("LID_CONTROL/CLOSE");
    206207    }
    207     dim.wait("LID_CONTROL", "Closed", 30000);
     208    v8.timeout(30000, function() { if (dim.state("LID_CONTROL").name=="Closed" || dim.state("LID_CONTROL").name=="Inconsistent") return true; });
     209    //dim.wait("LID_CONTROL", "Closed", 30000);
     210    //dim.wait("LID_CONTROL", "Inconsistent", 30000);
    208211
    209212    if (isOpen)
     
    248251    for (var i=0; i<320; i++)
    249252    {
     253        // This is a fix for the channel with a shortcut
     254        if (i==272)
     255            continue;
     256
    250257        var dU = Uov[i]-Unom;
    251258
     
    444451        dim.log("Taking single p.e. run.");
    445452        while (!irq && !takeRun("single-pe", 10000));
     453
     454        /*
     455         Maybe we need to send a trigger... but data runs contain pedestal triggers... so it should work in any case...
     456        var customRun = function()
     457            {
     458                v8.sleep(500);//wait that configuration is set
     459                dim.wait("FTM_CONTROL", "TriggerOn", 15000);
     460                dim.send("FAD_CONTROL/SEND_SINGLE_TRIGGER");
     461                dim.send("RATE_CONTROL/STOP");
     462                dim.send("FTM_CONTROL/STOP_TRIGGER");
     463                dim.wait("FTM_CONTROL", "Valid", 3000);
     464                dim.send("FTM_CONTROL/ENABLE_TRIGGER", true);
     465                dim.send("FTM_CONTROL/SET_TIME_MARKER_DELAY", 123);
     466                dim.send("FTM_CONTROL/SET_THRESHOLD", -1, obs[sub].threshold);
     467                v8.sleep(500);//wait that configuration is set
     468                dim.send("FTM_CONTROL/START_TRIGGER");
     469                dim.wait("FTM_CONTROL", "TriggerOn", 15000);
     470            }*/
     471
     472
     473        dim.log("Taking data run with closed lid.");
     474        while (!irq && !takeRun("data", -1, 300));
    446475    }
    447476
     
    957986         [ "BIAS_CONTROL",        [ "VoltageOff", "VoltageOn", "Ramping" ] ],
    958987         [ "FEEDBACK",            [ "Calibrated", "InProgress", "OnStandby", "Warning", "Critical" ] ],
    959          [ "LID_CONTROL",         [ "Open", "Closed"           ] ],
     988//         [ "LID_CONTROL",         [ "Open", "Closed"           ] ],
     989         [ "LID_CONTROL",         [ "Open", "Closed", "Inconsistent"  ] ],
    960990         [ "DRIVE_CONTROL",       drive_states/*[ "Armed", "Tracking", "OnTrack" ]*/ ],
    961991         [ "FTM_CONTROL",         [ "Valid", "TriggerOn"       ] ],
     
    11681198                if (irq || !takeRun("pedestal",         1000))  // 80 Hz  -> 10s
    11691199                    continue;
    1170                 if (irq || !takeRun("light-pulser-ext", 1000))  // 80 Hz  -> 10s
    1171                     continue;
     1200                //if (irq || !takeRun("light-pulser-ext", 1000))  // 80 Hz  -> 10s
     1201                //    continue;
    11721202                break;
    11731203            }
     
    13761406            }
    13771407
    1378             takeRun(customRun, -1, obs[sub].time);
     1408            takeRun("custom", -1, obs[sub].time, customRun);
    13791409        }
    13801410        dim.log("Task finished [CUSTOM].");
Note: See TracChangeset for help on using the changeset viewer.