Changeset 35305
- Timestamp:
- Mar 12, 2013, 2:13:13 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/addstar.pro (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/addstar.pro
r34804 r35305 6 6 check.globals 7 7 8 9 if ($?ADDSTAGES:n == 0) set ADDSTAGES:n = 0 10 11 12 8 13 book init addPendingExp 9 14 … … 17 22 18 23 macro addstar.on 19 task addstar.exp.load.stack 20 active true 21 end 22 task addstar.exp.load.cam 23 active true 24 end 25 task addstar.exp.load.staticsky 26 active true 27 end 28 task addstar.exp.load.skycal 24 task addstar.exp.load 29 25 active true 30 26 end … … 35 31 36 32 macro addstar.off 37 task addstar.exp.load.stack 38 active false 39 end 40 task addstar.exp.load.cam 41 active false 42 end 43 task addstar.exp.load.staticsky 44 active false 45 end 46 task addstar.exp.load.skycal 33 task addstar.exp.load 47 34 active false 48 35 end … … 83 70 84 71 72 #addstar stages 73 74 macro add.addstages 75 if ($0 != 2) 76 echo "USAGE: add.addstages (addstages)" 77 break 78 end 79 if ($?ADDSTAGES:n == 0) 80 list ADDSTAGES -add $1 81 return 82 end 83 84 local found 85 $found = 0 86 for i 0 $ADDSTAGES:n 87 if ($ADDSTAGES:$i == $1) 88 $found = 1 89 echo "$ADDSTAGES:$i set" 90 last 91 end 92 end 93 94 if ($found == 0) 95 list ADDSTAGES -add $1 96 end 97 end 98 99 macro del.addstages 100 if ($0 != 2) 101 echo "USAGE: del.addstages (addstages)" 102 break 103 end 104 if ($?ADDSTAGES:n == 0) 105 return 106 end 107 108 list ADDSTAGES -del $1 109 end 110 111 macro show.addstages 112 if ($0 != 1) 113 echo "USAGE: show.addstages" 114 break 115 end 116 if ($?ADDSTAGES:n == 0) 117 echo "no addstar stages defined" 118 end 119 if ($ADDSTAGES:n == 0) 120 echo "no addstar stages defined" 121 end 122 123 local i 124 for i 0 $ADDSTAGES:n 125 echo $ADDSTAGES:$i 126 end 127 end 128 129 macro stuff 130 echo $LOADEXEC_ADD 131 echo $LOADPOLL 132 end 133 85 134 # this variable will cycle through the known database names 86 135 $addstar_DB = 0 136 $addstar_stages_DB = 0 87 137 #this may not work for more databases (addstar) will do that later) 88 138 $addstar_revert_DB_C = 0 … … 92 142 $addstar_revert_DB_SC = 0 93 143 94 $LOADEXEX_ADD = 30095 144 #$LOADEXEC_ADD = 300 145 $LOADEXEC_ADD = 10 96 146 97 147 … … 99 149 # new entries are added to addPendingExp 100 150 # skip already-present entries 101 task addstar.exp.load .stack151 task addstar.exp.load 102 152 host local 103 153 … … 111 161 112 162 task.exec 113 # if ($LABEL:n == 0) break 114 $run = addtool -pendingexp -stage stack 115 if ($DB:n == 0) 116 option DEFAULT 117 else 118 # save the DB name for the exit tasks 119 option $DB:$addstar_DB 120 $run = $run -dbname $DB:$addstar_DB 121 $addstar_DB ++ 122 if ($addstar_DB >= $DB:n) set addstar_DB = 0 123 end 163 #if no stages defined we can't run 164 if ($ADDSTAGES:n == 0) echo "what" 165 # if ($ADDSTAGES:n == 0) break 166 $run = addtool -pendingexp 167 168 #option $ADDSTAGES:$addstar_stages_DB 169 $run = $run -stage $ADDSTAGES:$addstar_stages_DB 170 option $DB:$addstar_DB 171 $run = $run -dbname $DB:$addstar_DB 172 $addstar_stages_DB ++ 173 if ($addstar_stages_DB >= $ADDSTAGES:n) 174 set addstar_stages_DB = 0 175 $addstar_DB ++ 176 if ($addstar_DB >= $DB:n) set addstar_DB = 0 177 #go to next stage. if run out of stages, go to 0 stage and 178 #cycle through dbname, if run out of dbnames, go to 0 dbname 179 end 124 180 add_poll_args run 125 181 add_poll_labels run 182 echo $run 126 183 command $run 127 184 end … … 153 210 end 154 211 end 155 156 task addstar.exp.load.cam157 host local158 159 periods -poll $LOADPOLL160 periods -exec $LOADEXEC_ADD161 periods -timeout 300162 npending 1163 164 stdout NULL165 stderr $LOGDIR/addstar.exp.log166 167 task.exec168 # if ($LABEL:n == 0) break169 $run = addtool -pendingexp -stage cam170 if ($DB:n == 0)171 option DEFAULT172 else173 # save the DB name for the exit tasks174 option $DB:$addstar_DB175 $run = $run -dbname $DB:$addstar_DB176 $addstar_DB ++177 if ($addstar_DB >= $DB:n) set addstar_DB = 0178 end179 add_poll_args run180 add_poll_labels run181 command $run182 end183 184 # success185 task.exit 0186 # convert 'stdout' to book format187 ipptool2book stdout addPendingExp -key add_id -uniq -setword dbname $options:0 -setword pantaskState INIT188 if ($VERBOSE > 2)189 book listbook addPendingExp190 end191 192 # delete existing entries in the appropriate pantaskStates193 process_cleanup addPendingExp194 end195 196 # default exit status197 task.exit default198 showcommand failure199 end200 201 task.exit crash202 showcommand crash203 end204 205 # operation times out?206 task.exit timeout207 showcommand timeout208 end209 end210 211 task addstar.exp.load.staticsky212 host local213 periods -poll $LOADPOLL214 periods -exec $LOADEXEC_ADD215 periods -timeout 300216 npending 1217 218 stdout NULL219 stderr $LOGDIR/addstar.exp.log220 221 task.exec222 # if ($LABEL:n == 0) break223 $run = addtool -pendingexp -stage staticsky224 if ($DB:n == 0)225 option DEFAULT226 else227 # save the DB name for the exit tasks228 option $DB:$addstar_DB229 $run = $run -dbname $DB:$addstar_DB230 $addstar_DB ++231 if ($addstar_DB >= $DB:n) set addstar_DB = 0232 end233 add_poll_args run234 add_poll_labels run235 command $run236 end237 238 # success239 task.exit 0240 # convert 'stdout' to book format241 ipptool2book stdout addPendingExp -key add_id -uniq -setword dbname $options:0 -setword pantaskState INIT242 if ($VERBOSE > 2)243 book listbook addPendingExp244 end245 246 # delete existing entries in the appropriate pantaskStates247 process_cleanup addPendingExp248 end249 250 # default exit status251 task.exit default252 showcommand failure253 end254 255 task.exit crash256 showcommand crash257 end258 259 # operation times out?260 task.exit timeout261 showcommand timeout262 end263 end264 265 task addstar.exp.load.skycal266 host local267 periods -poll $LOADPOLL268 periods -exec $LOADEXEC_ADD269 periods -timeout 300270 npending 1271 272 stdout NULL273 stderr $LOGDIR/addstar.exp.log274 275 task.exec276 # if ($LABEL:n == 0) break277 $run = addtool -pendingexp -stage skycal278 if ($DB:n == 0)279 option DEFAULT280 else281 # save the DB name for the exit tasks282 option $DB:$addstar_DB283 $run = $run -dbname $DB:$addstar_DB284 $addstar_DB ++285 if ($addstar_DB >= $DB:n) set addstar_DB = 0286 end287 add_poll_args run288 add_poll_labels run289 command $run290 end291 292 # success293 task.exit 0294 # convert 'stdout' to book format295 ipptool2book stdout addPendingExp -key add_id -uniq -setword dbname $options:0 -setword pantaskState INIT296 if ($VERBOSE > 2)297 book listbook addPendingExp298 end299 300 # delete existing entries in the appropriate pantaskStates301 process_cleanup addPendingExp302 end303 304 # default exit status305 task.exit default306 showcommand failure307 end308 309 task.exit crash310 showcommand crash311 end312 313 # operation times out?314 task.exit timeout315 showcommand timeout316 end317 end318 319 212 320 213 # run the addstar script on pending exposures
Note:
See TracChangeset
for help on using the changeset viewer.
