#!/bin/csh -f # # NAME: daytest_v03 # # PURPOSE: C-Shell script version of mdi day control files. # # COMMENTS: Uses $mdi_task_dir/egse_cmd program which allows egse console # commands to be issued from shell. # # HISTORY: Created 7-Nov-1995 by Joe Covington (JFC) # 27-Nov-95 (MDM) - Added DYN_DAY option # - Moved DAYSTART call inside the loop (so that # the ALT cadence is re-set after running # DAY_DYN) # 28-Nov-95 (MDM) - Renamed from dayscript to daytest # - MOdified how R5 is used in DAY_DYN # 5-Dec-95 (MDM) - Added "perf reset" and "perf runstr" # outside of the loop (since it was removed # from day_start # 7-Dec-95 (MDM) - Changed the new campaign address # - Removed the extended campaign question # - Added a "cd c "dev"" to the execution # 12-Dec-95 (MDM) - Manually added "_v03" to all perfs # and to the daywait_script call # ############################################################################## #set datenorm = `date` #set dateexp = `date +%m%d%y` ##set egsecmd = $MDI_TASK_DIR/egse_cmd alias egsecmd " sleep 1 ; $MDI_TASK_DIR/egse_cmd \!*" echo -n "Enter 1(Unscaled:24hr/1=24hr day),or other scale factor " set scale = $< egsecmd set \!GI2 = $scale echo -n "Run day_cam ? (Y/N) " set daycamresponse = $< echo -n "Run day_dyn ? (Y/N) " set daydynresponse = $< ##echo -n "Run day_came ? (Y/N) " ## set daycameresponse = $< set daycameresponse = "N" set gi1 = 1 #egsecmd cd c \"dev\" egsecmd perf reset_v03 sleep 6 egsecmd perf runstr_v03 sleep 100 loop1: egsecmd perf day_start_v03 sleep 20 ##Clear IP Error Count egsecmd tcb mbdpflgs 16 0xffff 0 egsecmd set \!GI1 = $gi1 switch ($daycamresponse) case [yY]: egsecmd open decom160 \!GS1 egsecmd open sci5k \!GS2 ## close u !GS0 ## if(!GS0 != "") then ## User file already open? ## egsecmd close u \!GS0 ## endif egsecmd open u \"day_cam\" dt \!GS0 w egsecmd writen \!GS0 \"Usr filename: \%s\" \!GS0 egsecmd writen \!GS0 \" 160k data stored in: \%s\" \!GS1 egsecmd writen \!GS0 \" sci5k data stored in: \%s\" \!GS2 egsecmd display \"DAY_CAM Loop\# \%d\" \!GI1 egsecmd writen \!GS0 \"DAY_CAM Loop\# \%d\" \!GI1 egsecmd writen \!GS0 \"Program version 1.01\" egsecmd writen \!GS0 \"Time Scaling Factor = \%d\" \!GI2 egsecmd write \!GS0 \"DATE: \%s \" \!DATE egsecmd writen \!GS0 \"TIME: \%s\" \!TIME #Perhaps break this sections down into a separate script called day_cam_script?? #********************* Entering 20 min IDLE *************************** egsecmd setstr \!GS3 = '"Entering 20 minute IDLE "' daywait_script_v03 1200 $scale #********************* Entering 8hr Campaign ************************** egsecmd setstr \!GS3 = '"Entering VC2 campaign prior to 8 hr VC3 "' egsecmd perf m_ts_idtomm_v03 ##Transition from IDLE to VC2 daywait_script_v03 360 1 egsecmd setstr \!GS3 = '"Entering 8hr campaign at VC3 "' egsecmd perf m_ts_mmtomh_v03 ##Transition from VC2 to VC3 daywait_script_v03 14400 $scale egsecmd setstr \!GS3 = '"Set New Campaign List FLag "' egsecmd tcb mbsqreg 68 1 ##Set DEP New List flag reg #egsecmd tcb mbsqreg 69 0x0060 ##Set DEP New List address egsecmd tcb mbsqreg 69 44 ##Set DEP New List address daywait_script_v03 7200 $scale egsecmd setstr \!GS3 = '"Transitioning from VC3 to VC2 "' egsecmd perf m_ts_mhtomm_v03 ##Transition from VC3 to VC2 daywait_script_v03 360 1 egsecmd setstr \!GS3 = '"Transitioning from VC2 to VC3 "' egsecmd perf m_ts_mmtomh_v03 ##Transition from VC2 to VC3 daywait_script_v03 7200 $scale #************************ 16 hr Stucture Begins ******************** egsecmd setstr \!GS3 = '"Entering 16hr Structure "' egsecmd perf m_ts_mhtoid_v03 ##Transition from VC3 to IDLE ## be into for 08:00 5 times 96min daywait_script_v03 28800 $scale #**************** 10min VC2 ********************************************* egsecmd setstr \!GS3 = '"Entering 10min of VC2 "' egsecmd perf m_ts_idtomm_v03 ##Transition from IDLE to VC2 ## be into for 10 min daywait_script_v03 360 1 #******************* VC2 to IDLE ************************************* egsecmd setstr \!GS3 = '"Wait for 1 magnetogram "' egsecmd perf m_ts_mmtoid_v03 ##Transition from VC2 to IDLE ## be into for 01:36 1 times 96min daywait_script_v03 5760 $scale #**************** 10min VC2 ********************************************** egsecmd setstr \!GS3 = '"Entering 10min of VC2 "' egsecmd perf m_ts_idtomm_v03 ##Transition from IDLE to VC2 ## be into for 10 min daywait_script_v03 360 1 #******************* VC2 to IDLE ************************************* egsecmd setstr \!GS3 = '"Wait for 7 magnetograms "' egsecmd perf m_ts_mmtoid_v03 ##Transition from VC2 to IDLE ## be into for 11:12 7 times 96min daywait_script_v03 40320 $scale #**************** 10min VC2 ********************************************** egsecmd setstr \!GS3 = '"Entering 10min of VC2 "' egsecmd perf m_ts_idtomm_v03 ##Transition from IDLE to VC2 ## be into for 10 min daywait_script_v03 360 1 #******************* VC2 to IDLE ************************************* egsecmd setstr \!GS3 = '"Going back to IDLE.... "' egsecmd perf m_ts_mmtoid_v03 ##Transition from VC2 to IDLE daywait_script_v03 1800 $scale egsecmd setstr \!GS3 = '"All Finished......... "' daywait_script_v03 0 $scale egsecmd close u \!GS0 egsecmd close decom160 \!GS1 egsecmd close sci5k \!GS2 breaksw endsw switch ($daydynresponse) case [yY]: egsecmd open decom160 \!GS1 egsecmd open sci5k \!GS2 egsecmd open u \"day_dyn\" dt \!GS0 w egsecmd writen \!GS0 \"Usr filename: \%s\" \!GS0 egsecmd writen \!GS0 \" 160k data stored in: \%s\" \!GS1 egsecmd writen \!GS0 \" sci5k data stored in: \%s\" \!GS2 egsecmd display \"DAY_DYN Loop\# \%d\" \!GI1 egsecmd writen \!GS0 \"DAY_DYN Loop\# \%d\" \!GI1 egsecmd writen \!GS0 \"Program version 1.01\" egsecmd writen \!GS0 \"Time Scaling Factor = \%d\" \!GI2 egsecmd write \!GS0 \"DATE: \%s \" \!DATE egsecmd writen \!GS0 \"TIME: \%s\" \!TIME egsecmd setstr \!GS3 = '"Entering VC2 prior to 8 hr VC3 "' egsecmd perf m_ts_idtomm_v03 ##Transition from IDLE to VC2 egsecmd tcb mbsqreg 66 0 ##clear the campaign flag daywait_script_v03 360 1 egsecmd setstr \!GS3 = '"Entering 8hr at VC3 (1st 8hr -- mag in 160k) "' egsecmd perf m_ts_mmtomh_v03 ##Transition from VC2 to VC3 egsecmd tcb mbsqreg 5 1 ##mag in 160K daywait_script_v03 28200 $scale egsecmd setstr \!GS3 = '"Entering VC2 prior to 8 hr VC3 "' egsecmd perf m_ts_mhtomm_v03 ##Transition from IDLE to VC2 daywait_script_v03 360 1 egsecmd setstr \!GS3 = '"Entering 8hr at VC3 (2nd 8hr -- mag in 5k) "' egsecmd perf m_ts_mmtomh_v03 ##Transition from VC2 to VC3 egsecmd tcb mbsqreg 5 0 ##mag in 5k egsecmd tcb mbsqreg 54 45 ##ALT cadence (allow enough time to downlink) daywait_script_v03 28200 $scale egsecmd setstr \!GS3 = '"Entering VC2 prior to 8 hr VC3 "' egsecmd perf m_ts_mhtomm_v03 ##Transition from IDLE to VC2 daywait_script_v03 360 1 egsecmd setstr \!GS3 = '"Entering 8hr at VC3 (3rd 8hr -- mag in 160k) "' egsecmd perf m_ts_mmtomh_v03 ##Transition from VC2 to VC3 egsecmd tcb mbsqreg 5 1 ##mag in 160k daywait_script_v03 28200 $scale egsecmd setstr \!GS3 = '"All Finished......... "' daywait_script_v03 0 $scale egsecmd close u \!GS0 egsecmd close decom160 \!GS1 egsecmd close sci5k \!GS2 breaksw endsw switch ($daycameresponse) case [yY]: breaksw endsw @ gi1 ++ goto loop1