Added newFileName so we can control the file name structure.

Moved nxcreatefile here.

r1480 | ffr | 2007-02-13 16:24:46 +1100 (Tue, 13 Feb 2007) | 3 lines
This commit is contained in:
Ferdi Franceschini
2007-02-13 16:24:46 +11:00
committed by Douglas Clowes
parent c230c17a73
commit 8922f3ac66

View File

@ -4,6 +4,27 @@ proc getVal {msg} {
return [string trim [lindex [split $msg =] 1 ] ]
}
proc newFileName {} {
sicsdatanumber incr;
set idNum [SplitReply [sicsdatanumber]];
set dataPath [SplitReply [sicsdatapath]];
set prefix [SplitReply [sicsdataprefix]];
set postfix [SplitReply [sicsdatapostfix]];
set isodate [lindex [split [sicstime] " "] 0];
return [format "%s/%s_%s_%s%s" $dataPath $prefix $isodate $idNum $postfix];
}
proc nxcreatefile {{type nx.hdf}} {
global dataFileName nxFileOpen;
SicsDataPostFix .$type;
array set nxmode [list nx.hdf create5 h5 create5 nx5 create5 xml createxml];
set dataFileName [newFileName]
nxscript $nxmode($type) $dataFileName echidna.dic;
set nxFileOpen true
}
proc nxreopenfile {} {
global dataFileName nxFileOpen;
nxscript reopen $dataFileName echidna.dic;
@ -120,6 +141,8 @@ proc putslitmotors {nxobj} {
$nxobj putfloat $motor [getVal [$motor] ];
}
}
publish nxcreatefile user
publish addnxentry user
publish bm_addnxentry user