Changeset 18216
- Timestamp:
- 06/16/15 17:04:04 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/scripts/Main.js
r18176 r18216 388 388 dim.log("Starting shutdown ["+type+"]."); 389 389 390 var shutdown_start_date= new Date();390 var now1 = new Date(); 391 391 392 392 var bias = dim.state("BIAS_CONTROL").name; … … 396 396 CloseLid(); 397 397 398 var shutdown_after_close_lid_date = new Date(); 399 398 var now2 = new Date(); 399 400 dim.send("DRIVE_CONTROL/PARK"); 401 402 console.out("","Waiting for telescope to park. This may take a while."); 403 404 // FIXME: This might not work is the drive is already close to park position 405 dim.wait("DRIVE_CONTROL", "Locked", 3000); 406 407 //unlock drive if task was sleep 400 408 if (type=="sleep") 401 dim.send("DRIVE_CONTROL/MOVE_TO", 101, 0); 402 else 403 dim.send("DRIVE_CONTROL/PARK"); 404 405 console.out("","Waiting for telescope to park. This may take a while."); 406 407 // FIXME: This might not work is the drive is already close to park position 408 if (type!="sleep") 409 dim.wait("DRIVE_CONTROL", "Locked", 3000); 409 dim.send("DRIVE_CONTROL/UNLOCK"); 410 410 411 411 var sub = new Subscription("DRIVE_CONTROL/POINTING_POSITION"); … … 459 459 dim.log("Finishing shutdown."); 460 460 461 var shutdown_after_bias_off_data= new Date();461 var now3 = new Date(); 462 462 463 463 dim.send("FTM_CONTROL/STOP_TRIGGER"); … … 470 470 { 471 471 dim.send("BIAS_CONTROL/DISCONNECT"); 472 dim.send("PWR_CONTROL/TOGGLE_DRIVE"); 473 dim.wait("BIAS_CONTROL", "Disconnected", 6000); 474 dim.wait("PWR_CONTROL", "DriveOff", 6000); 472 473 var pwrctrl_state = dim.state("PWR_CONTROL").name; 474 if (pwrctrl_state=="SystemOn" || 475 pwrctrl_state=="BiasOff" || 476 pwrctrl_state=="DriveOn") 477 dim.send("PWR_CONTROL/TOGGLE_DRIVE"); 478 479 dim.wait("BIAS_CONTROL", "Disconnected", 3000); 480 dim.wait("PWR_CONTROL", "DriveOff", 3000); 475 481 } 476 482 … … 489 495 console.out(" FTM_CONTROL: "+dim.state("FTM_CONTROL").name); 490 496 console.out(" BIAS_CONTROL: "+dim.state("BIAS_CONTROL").name); 491 console.out(" PWR_CONTROL: "+dim.state("PWR_CONTROL").name);497 console.out(" PWR_CONTROL: "+dim.state("PWR_CONTROL").name); 492 498 console.out(""); 493 dim.log("Shutdown: end [" 494 + (shutdown_after_close_lid_date-shutdown_start_date)/1000 495 + "s, " 496 + (shutdown_after_bias_off_data-shutdown_after_close_lid_date)/1000 497 + "s, " 498 + (new Date()-shutdown_after_bias_off_data)/1000+"s]" 499 ); 499 dim.log("Shutdown: end ["+(now2-now1)/1000+"s, "+(now3-now2)/1000+"s, "+(new Date()-now3)/1000+"s]"); 500 500 console.out(""); 501 501 … … 625 625 "TNG_WEATHER/DATA", 626 626 "TNG_WEATHER/DUST", 627 "PFMINI_CONTROL/DATA", 627 628 ]; 628 629 … … 961 962 [ "GPS_CONTROL", [ "Locked" ] ], 962 963 [ "SQM_CONTROL", [ "Disconnected", "Connected", "Valid" ] ], 964 [ "PFMINI_CONTROL", [ "Disconnected", "Connected", "Receiving" ] ], 963 965 ]; 964 966 … … 1160 1162 dim.log("Starting ratescan."); 1161 1163 1164 //set reference to whole camera (in case it was changed) 1165 dim.send("RATE_SCAN/SET_REFERENCE_CAMERA"); 1162 1166 // Start rate scan 1163 1167 dim.send("RATE_SCAN/START_THRESHOLD_SCAN", 50, 1000, -10, "default"); … … 1247 1251 dim.log("Starting ratescan 2/1 ["+obs[sub].rstype+"]"); 1248 1252 1253 //set reference to whole camera (in case it was changed) 1254 dim.send("RATE_SCAN/SET_REFERENCE_CAMERA"); 1249 1255 // Start rate scan 1250 1256 dim.send("RATE_SCAN/START_THRESHOLD_SCAN", 50, 300, 20, obs[sub].rstype);
Note:
See TracChangeset
for help on using the changeset viewer.