::nexus::data report error if trying to link a data axis which doesn't have an hdb node, ie privilege=internal
::nexus::nxscript::save support saving mutable data from a sicsdata object ::nexus::nxscript::sdsinfo support mutable data r2225 | ffr | 2007-11-05 13:20:36 +1100 (Mon, 05 Nov 2007) | 5 lines
This commit is contained in:
committed by
Douglas Clowes
parent
5d491581e6
commit
008249dc18
@@ -365,6 +365,9 @@ proc ::nexus::newfile {type {namestyle data}} {
|
||||
"axis" {
|
||||
debug_msg "'axis' case of switch"
|
||||
set link_target [lindex $arguments 2]
|
||||
if {[getatt $link_target privilege] == "internal"} {
|
||||
error "[info level 0], Cannot link $link_target because it doesn't have an hdb node."
|
||||
}
|
||||
set axnum [lindex $arguments 1]
|
||||
if {[string is integer $axnum] == 0} {
|
||||
error "ERROR: [info level -1]->data, index for data axis should be an integer, not $axnum"
|
||||
@@ -791,23 +794,28 @@ proc ::nexus::script::save {script nxalias data_type args} {
|
||||
array set attribute [attlist $script]
|
||||
set darray [$script -arrayname]
|
||||
set size [array size $darray]
|
||||
switch $data_type {
|
||||
"intar" - "intvarar" {
|
||||
nxscript putintarray $nxalias $darray $size
|
||||
}
|
||||
"floatar" - "floatvarar" {
|
||||
nxscript putarray $nxalias $darray $size
|
||||
}
|
||||
set size [SplitReply [$darray used]]
|
||||
if {[lindex $args 0] == "point"} {
|
||||
set index [lindex $args 1]
|
||||
nxscript putslab $nxalias [list $index 0] [list 1 $size] $darray
|
||||
} else {
|
||||
nxscript putslab $nxalias [list 0] [list $size] $darray
|
||||
}
|
||||
if {[info exists attribute(units)]} {
|
||||
nxscript putattribute $nxalias units $attribute(units)
|
||||
}
|
||||
}
|
||||
|
||||
proc ::nexus::script::sdsinfo {script data_type args} {
|
||||
array set param $args
|
||||
set dtype [::nexus::hdb2nx_type $data_type]
|
||||
set darray [$script -arrayname]
|
||||
set size [array size $darray]
|
||||
set darray [$script -arrayname]
|
||||
set size [SplitReply [$darray used]]
|
||||
if {$param(mutable) == true} {
|
||||
return " -type $dtype -rank 2 -dim {-1,$size}"
|
||||
} else {
|
||||
return " -type $dtype -rank 1 -dim {$size}"
|
||||
}
|
||||
}
|
||||
|
||||
namespace import ::nexus::*
|
||||
@@ -827,7 +835,7 @@ foreach expt $::nexus::exports {
|
||||
|
||||
set tmpstr [string map {"$" ""} {$Name: not supported by cvs2svn $}]
|
||||
set nx_content_release_tag [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
||||
set tmpstr [string map {"$" ""} {$Revision: 1.33 $}]
|
||||
set tmpstr [string map {"$" ""} {$Revision: 1.34 $}]
|
||||
set nx_content_revision_num [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
||||
|
||||
namespace eval data {
|
||||
|
||||
Reference in New Issue
Block a user