Changeset 19
- Timestamp:
- Dec 4, 2009 4:59:00 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/readexp.tcl
- Property rcs:date changed from 1999/01/01 18:30:08 to 1999/01/06 04:06:41
- Property rcs:lines changed from +48 -1 to +37 -10
- Property rcs:rev changed from 1.3 to 1.4
r15 r19 38 38 close $fil 39 39 return 0 40 } 41 42 proc createexp {expfile title} { 43 global exparray expmap 44 catch {unset exparray} 45 foreach key {" VERSION" " DESCR" "ZZZZZZZZZZZZ" " EXPR NPHAS"} \ 46 value {" 6" "" " Last EXP file record" } { 47 # truncate long keys & pad short ones 48 set key [string range "$key " 0 11] 49 set exparray($key) $value 50 } 51 expinfo title set $title 52 exphistory add " created readexp.tcl [lindex $expmap(Revision) 1] [clock format [clock seconds]]" 53 expwrite $expfile 40 54 } 41 55 … … 52 66 # get the defined phases 53 67 set line [readexp " EXPR NPHAS"] 54 if {$line == ""} {55 set msg "No EXPR NPHAS entry. This is an invalid .EXP file"56 tk_dialog .badexp "Error in EXP" $msg error 0 Exit57 destroy .58 }68 # if {$line == ""} { 69 # set msg "No EXPR NPHAS entry. This is an invalid .EXP file" 70 # tk_dialog .badexp "Error in EXP" $msg error 0 Exit 71 # destroy . 72 # } 59 73 set expmap(phaselist) {} 60 74 # loop over phases … … 148 162 proc existsexp {key} { 149 163 global exparray 150 # key can contain wild cards so don t pad164 # key can contain wild cards so don't pad 151 165 return [llength [array names exparray $key]] 152 166 } … … 245 259 set key [lindex [lsort -decreasing [array names exparray *HSTRY*]] 0] 246 260 if {$key == ""} { 247 set key " HSTRY 1"261 set index 1 248 262 } else { 249 263 set index [string trim [string range $key 9 end]] … … 262 276 # print -- GENLES print option (*) 263 277 # cycles -- number of GENLES cycles (*) 278 # title -- the overall title (*) 264 279 proc expinfo {parm "action get" "value {}"} { 265 280 switch ${parm}-$action { 281 title-get { 282 return [string trim [readexp " DESCR"]] 283 } 284 title-set { 285 setexp " DESCR" " $value" 1 68 286 } 287 266 288 cycles-get { 267 289 return [string trim [cdatget MXCY]] … … 355 377 name-get { 356 378 return [string trim [readexp "CRS$phase PNAM"]] 379 } 380 381 name-set { 382 setexp "CRS$phase PNAM" " $value" 1 68 357 383 } 358 384 … … 1082 1108 proc expwrite {expfile} { 1083 1109 global tcl_platform exparray 1110 set blankline " " 1084 1111 set fp [open ${expfile} w] 1085 1112 set keylist [lsort [array names exparray]] … … 1090 1117 foreach key $keylist { 1091 1118 puts $fp [string range \ 1092 "$key$exparray($key) 1119 "$key$exparray($key)$blankline" 0 79] 1093 1120 } 1094 1121 } else { 1095 1122 foreach key $keylist { 1096 1123 puts -nonewline $fp [string range \ 1097 "$key$exparray($key) 1124 "$key$exparray($key)$blankline" 0 79] 1098 1125 } 1099 1126 }
Note: See TracChangeset
for help on using the changeset viewer.