Changeset 18429
- Timestamp:
- 01/29/16 20:50:20 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/scripts/Main.js
r18381 r18429 169 169 dim.log("Opening lid"); 170 170 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+"]"); 171 182 } 172 183 dim.wait("LID_CONTROL", "Open", 30000); … … 1130 1141 service_feedback.voltageOn(0); 1131 1142 1132 if (obs[sub].source != undefined)1143 if (obs[sub].source != null) // undefined != null -> false 1133 1144 { 1134 1145 dim.log("Pointing telescope to '"+obs[sub].source+"'."); … … 1227 1238 else 1228 1239 { 1229 if (obs[sub].source != undefined)1240 if (obs[sub].source != null) // undefined != null -> false 1230 1241 { 1231 1242 dim.log("Pointing telescope to '"+obs[sub].source+"'."); … … 1399 1410 // ...if at least ten minutes of observation time are left 1400 1411 // ...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! 1402 1413 1403 1414 // Take DRS Calib... … … 1417 1428 // start with alternating wobble positions each day 1418 1429 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+"]"); 1422 1436 1423 1437 // This is a workaround to make sure that we really catch … … 1426 1440 dim.wait("DRIVE_CONTROL", "Initialized", 15000); 1427 1441 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); 1430 1446 1431 1447 // Do we have to check if the telescope is really moving?
Note:
See TracChangeset
for help on using the changeset viewer.