Changeset 18381 for trunk/FACT++/scripts


Ignore:
Timestamp:
11/24/15 12:45:24 (9 years ago)
Author:
Daniela Dorner
Message:
adapted to new drivectrl
File:
1 edited

Legend:

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

    r18372 r18381  
    409409
    410410    // FIXME: This might not work is the drive is already close to park position
    411     dim.wait("DRIVE_CONTROL", "Locked", 3000);
    412 
    413     //unlock drive if task was sleep
    414     if (type=="sleep")
    415         dim.send("DRIVE_CONTROL/UNLOCK");
    416 
    417     var sub = new Subscription("DRIVE_CONTROL/POINTING_POSITION");
    418     sub.get(5000);  // FIXME: Proper error message in case of failure
    419 
    420     function func()
    421     {
    422         var report = sub.get();
    423 
    424         var zd = report.obj['Zd'];
    425         var az = report.obj['Az'];
    426 
    427         if (zd>100 && Math.abs(az)<1)
    428             return true;
    429 
    430         return undefined;
    431     }
    432 
    433     try { v8.timeout(150000, func); }
    434     catch (e)
    435     {
    436         var p = sub.get();
    437         dim.log('Park position not reached? Telescope at Zd='+p.obj['Zd']+' Az='+p.obj['Az']);
    438     }
     411    //dim.wait("DRIVE_CONTROL", "Parking", 3000);
     412
    439413    /*
    440414    // Check if DRS calibration is necessary
     
    447421    }*/
    448422
     423    //take single pe run if required
    449424    if (type=="singlepe")
    450425    {
     
    459434        while (!irq && !takeRun("single-pe", 10000));
    460435    }
     436
     437    //wait until drive is in locked (after it reached park position)
     438    dim.wait("DRIVE_CONTROL", "Locked", 150000);
     439
     440    //unlock drive if task was sleep
     441    if (type=="sleep")
     442        dim.send("DRIVE_CONTROL/UNLOCK");
     443
    461444
    462445    // It is unclear what comes next, so we better switch off the voltage
     
    486469        dim.wait("PWR_CONTROL",  "DriveOff",     6000);
    487470    }
     471
     472    var sub = new Subscription("DRIVE_CONTROL/POINTING_POSITION");
     473    sub.get(5000);  // FIXME: Proper error message in case of failure
    488474
    489475    var report = sub.get();
Note: See TracChangeset for help on using the changeset viewer.