Changeset 18429


Ignore:
Timestamp:
01/29/16 20:50:20 (9 years ago)
Author:
tbretz
Message:
Preliminary implementation of wobble mode; turn off IR camera LEDs when opening Lid.
File:
1 edited

Legend:

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

    r18381 r18429  
    169169        dim.log("Opening lid");
    170170        dim.send("LID_CONTROL/OPEN");
     171
     172        dim.log("Turning off IR camera LEDs...");
     173
     174        var cam = new Curl("fact@cam/cgi-bin/user/Config.cgi");
     175        cam.data.push("action=set");
     176        cam.data.push("Camera.System.Title=Camera1");
     177        cam.data.push("Camera.General.IRControl.Value=2");
     178        cam.data.push("Camera.System.Display=ALL");
     179        cam.data.push("Camera.Environment=OUTDOOR");
     180        var ret = cam.send();
     181        dim.log("Camera response: "+ret.data.replace("\n","/")+" ["+ret.rc+"]");
    171182    }
    172183    dim.wait("LID_CONTROL", "Open", 30000);
     
    11301141        service_feedback.voltageOn(0);
    11311142
    1132         if (obs[sub].source != undefined)
     1143        if (obs[sub].source != null) // undefined != null -> false
    11331144        {
    11341145            dim.log("Pointing telescope to '"+obs[sub].source+"'.");
     
    12271238        else
    12281239        {
    1229             if (obs[sub].source != undefined)
     1240            if (obs[sub].source != null)  // undefined != null -> false
    12301241            {
    12311242                dim.log("Pointing telescope to '"+obs[sub].source+"'.");
     
    13991410        //  ...if at least ten minutes of observation time are left
    14001411        //  ...if this is the first run on the source
    1401         var point  = (run%4==0 && remaining>10) || run==0;
     1412        var point  = (run%4==0 && remaining>10 && !obs[sub].orbit) || run==0; // undefined==null -> true!
    14021413
    14031414        // Take DRS Calib...
     
    14171428            // start with alternating wobble positions each day
    14181429            var wobble = (parseInt(run/4) + parseInt(new Date()/1000/3600/24-0.5))%2+1;
    1419 
    1420             //console.out("  Move telescope to '"+source+"' "+offset+" "+wobble);
    1421             dim.log("Pointing telescope to '"+obs[sub].source+"' [wobble="+wobble+"]");
     1430            var angle  = obs[sub].angle == null ? Math.random()*360 : obs[sub].angle;
     1431
     1432            if (obs[sub].orbit) // != undefined, != null, != 0
     1433                dim.log("Pointing telescope to '"+obs[sub].source+"' [orbit="+obs[sub].orbit+"min, angle="+angle+"]");
     1434            else
     1435                dim.log("Pointing telescope to '"+obs[sub].source+"' [wobble="+wobble+"]");
    14221436
    14231437            // This is a workaround to make sure that we really catch
     
    14261440            dim.wait("DRIVE_CONTROL", "Initialized", 15000);
    14271441
    1428             //dim.send("DRIVE_CONTROL/MOON");
    1429             dim.send("DRIVE_CONTROL/TRACK_WOBBLE", wobble, obs[sub].source);
     1442            if (obs[sub].orbit) // != undefined, != null, != 0
     1443                dim.send("DRIVE_CONTROL/TRACK_ORBIT", angle, obs[sub].orbit, obs[sub].source);
     1444            else
     1445                dim.send("DRIVE_CONTROL/TRACK_WOBBLE", wobble, obs[sub].source);
    14301446
    14311447            // Do we have to check if the telescope is really moving?
Note: See TracChangeset for help on using the changeset viewer.