Changeset 18169 for trunk/FACT++/scripts


Ignore:
Timestamp:
04/16/15 12:06:47 (9 years ago)
Author:
dneise
Message:
on 21. or 22.02.15 Daniela Dorner made this modification. Since it's now nearly 2 month ago and all tests of this new feature should be done, I take the liberty to check it in. 

File:
1 edited

Legend:

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

    r18114 r18169  
    12931293        break; // case "RATESCAN2"
    12941294
     1295    case "CUSTOM":
     1296
     1297        // This is a workaround to make sure that we really catch
     1298        // the new OnTrack state later and not the old one
     1299        dim.send("DRIVE_CONTROL/STOP");
     1300        dim.wait("DRIVE_CONTROL", "Armed", 15000);
     1301
     1302        // Ramp bias if needed
     1303        if (!obs[sub].biason)
     1304            service_feedback.voltageOff();
     1305        else
     1306        {
     1307            // Switch the voltage to a reduced level (Ubd)
     1308            var bias = dim.state("BIAS_CONTROL").name;
     1309            if (bias=="VoltageOn" || bias=="Ramping")
     1310                service_feedback.voltageOn(0);
     1311        }
     1312        // Close lid
     1313        CloseLid();
     1314
     1315        // Move to position (zd/az)
     1316        dim.log("Moving telescope to zd="+obs[sub].zd+" az="+obs[sub].az);
     1317        dim.send("DRIVE_CONTROL/MOVE_TO", obs[sub].zd, obs[sub].az);
     1318        v8.sleep(3000);
     1319        dim.wait("DRIVE_CONTROL", "Armed", 150000); // 110s for turning and 30s for stabilizing
     1320
     1321        // Now tracking stable, switch voltage to nominal level and wait
     1322        // for stability.
     1323        if (obs[sub].biason)
     1324        {
     1325            service_feedback.voltageOn();
     1326            service_feedback.waitForVoltageOn();
     1327        }
     1328
     1329        if (!irq)
     1330        {
     1331            dim.log("Taking custom run with time "+obs[sub].time+"s, threshold="+obs[sub].threshold+", biason="+obs[sub].biason);
     1332
     1333            var customRun = function()
     1334            {
     1335                v8.sleep(500);//wait that configuration is set
     1336                dim.wait("FTM_CONTROL", "TriggerOn", 15000);
     1337                dim.send("FAD_CONTROL/SEND_SINGLE_TRIGGER");
     1338                dim.send("RATE_CONTROL/STOP");
     1339                dim.send("FTM_CONTROL/STOP_TRIGGER");
     1340                dim.wait("FTM_CONTROL", "Valid", 3000);
     1341                dim.send("FTM_CONTROL/ENABLE_TRIGGER", true);
     1342                dim.send("FTM_CONTROL/SET_TIME_MARKER_DELAY", 123);
     1343                dim.send("FTM_CONTROL/SET_THRESHOLD", -1, obs[sub].threshold);
     1344                v8.sleep(500);//wait that configuration is set
     1345                dim.send("FTM_CONTROL/START_TRIGGER");
     1346                dim.wait("FTM_CONTROL", "TriggerOn", 15000);
     1347            }
     1348
     1349            takeRun(customRun, -1, obs[sub].time);
     1350        }
     1351        dim.log("Task finished [CUSTOM].");
     1352        dim.log("");
     1353        break; // case "CUSTOM"
     1354
    12951355    case "DATA":
    12961356
Note: See TracChangeset for help on using the changeset viewer.