proc setNumberOfStructures {model} {
global nested_gh
global NestedPanel
if {[info exists nested_gh]} {
set model_type [$model getCurrentValue]
if {"$model_type" != "NSP"} {
$nested_gh setCurrentValue 1
$NestedPanel setVisible false
} else {
$NestedPanel setVisible true
}
}
}
proc makeVisible {model} {
if {"[ $model getCurrentValue]" == "NSP"} {
return true
} else {
return false
}
}
proc retrieveVariogramModelParameters { file } {
set name [$file getCurrentValue]
if {"$name" != ""} {
set buffer [GuidoExecServer "GetVariogramModellingParameters" [subst {VGModelName = "$name"} ]]
set status [GuidoGetParamBufferValue $buffer status]
if {$status >= 0} {
set model_type [GuidoGetParamBufferValue $buffer ModelType]
global model
if {"$model_type" == "Spherical"} {
$model setCurrentValue "SPH"
} elseif {"$model_type" == "Exponential"} {
$model setCurrentValue "EXP"
} elseif {"$model_type" == "Hole Effect"} {
$model setCurrentValue "HOL"
} elseif {"$model_type" == "Gaussian"} {
$model setCurrentValue "GAU"
}
global co
$co setCurrentValue [GuidoGetParamBufferValue $buffer Nugget]
set num_structures [GuidoGetParamBufferValue $buffer NumStructures]
if {$num_structures > 5} {
set num_structures 5
}
if {"$model_type" == "Spherical" && $num_structures > 1} {
$model setCurrentValue "NSP"
}
global nested_gh
$nested_gh setCurrentValue $num_structures
for {set idx 0} {$idx < $num_structures} {incr idx} {
set i [expr $idx + 1]
global c$i
upvar 0 "c$i" field
set val [format %.6f [GuidoGetParamBufferValue $buffer "Sill$idx"]]
$field setCurrentValue $val
global a$i
upvar 0 "a$i" field
set val [format %.3f [GuidoGetParamBufferValue $buffer "Range$idx"]]
$field setCurrentValue $val
}
}
}
return 1
}
GuidoForm frm00147 {
-default_buttons
-label "Variogram Model"
-layout BoxLayout Y_AXIS
-tip "00147_TIP_001"
GuidoPanel frm00147_25 {
-layout CentreLineLayout
GuidoFileBrowserField vg_model_file_name {
-action valueChanged {[retrieveVariogramModelParameters $vg_model_file_name]}
-display_length 32
-file_access read
-file_mask "*.vgm *.not"
-format none
-label "Variogram file name"
-max_length 256
-null true
-translate none
-tip GST_VG_FILENAME_TIP
}
GuidoComboBox model {
-label "Define the variogram model"
-value_in "SPH" "NSP" "EXP" "INV" "GAU" "HOL"
-alternative_values "Spherical" "Nested Spherical" "Exponential" "Inverse Distance" "Gaussian" "Hole Effect"
-legacy_action
-action valueChanged {[setNumberOfStructures $model]}
-action initial {[setNumberOfStructures $model]}
-null false
-format none
}
}
GuidoPanel overlaypanel {
-layout OverlayLayout
GuidoPanel VariogramPanel {
-dependency {"[ $model getCurrentValue]" != "INV"}
-layout BoxLayout Y_AXIS
GuidoPanel NestedPanel {
-layout CentreLineLayout
GuidoField nested_gh {
-dependency {"[ $model getCurrentValue]" == "NSP"}
-default 1
-display_length 2
-font_style bold
-format integer
-high_bound 5
-label "Number of structures"
-low_bound 1
-max_length 2
-null false
-tip "00147_TIP_002"
-translate upper
}
}
GuidoFiller frm00147_34 {
-height 1
}
GuidoPanel frm00147_39 {
-layout BoxLayout X_AXIS
GuidoPanel frm00147_35 {
-dependency {"[ $model getCurrentValue]" != "INV"}
-border etched true
-label "Nugget (Co)"
-layout BoxLayout Y_AXIS
GuidoField co {
-dependency {"[ $model getCurrentValue]" != "INV"}
-display_length 10
-font_style bold
-format double
-max_length 20
-next_focus c1
-null false
-tip "20101_TIP_003"
-translate upper
}
}
GuidoFiller frm00147_40 {
-width 1
}
GuidoPanel frm00147_36 {
-dependency {"[ $model getCurrentValue]" != "INV"}
-border etched true
-label "C(#)"
-layout CentreLineLayout
GuidoField c1 {
-dependency {"[ $model getCurrentValue]" != "INV" && "[$nested_gh getCurrentValue]" >= "1"}
-display_length 10
-font_style bold
-format double
-label 1
-max_length 20
-next_focus a1
-null false
-tip "00147_TIP_004"
-translate upper
}
GuidoField c2 {
-dependency {"[ $model getCurrentValue]" == "NSP"  && "[$nested_gh getCurrentValue]" >= "2"}
-display_length 10
-font_style bold
-format double
-label 2
-max_length 20
-next_focus a2
-null false
-tip "00147_TIP_005"
-translate upper
}
GuidoField c3 {
-dependency {"[ $model getCurrentValue]" == "NSP"  && "[$nested_gh getCurrentValue]" >= "3"}
-display_length 10
-font_style bold
-format double
-label 3
-max_length 20
-next_focus a3
-null false
-tip "00147_TIP_005"
-translate upper
}
GuidoField c4 {
-dependency {"[ $model getCurrentValue]" == "NSP" && "[$nested_gh getCurrentValue]" >= "4"}
-display_length 10
-font_style bold
-format double
-label 4
-max_length 20
-next_focus a4
-null false
-tip "00147_TIP_005"
-translate upper
}
GuidoField c5 {
-dependency {"[ $model getCurrentValue]" == "NSP" && "[$nested_gh getCurrentValue]" >= "5"}
-display_length 10
-font_style bold
-format double
-label 5
-max_length 20
-next_focus a5
-null false
-tip "00147_TIP_005"
-translate upper
}
}
GuidoFiller frm00147_40 {
-width 1
}
GuidoPanel frm00147_38 {
-dependency {"[ $model getCurrentValue]" != "INV"}
-border etched true
-label "Range (A(#))"
-layout BoxLayout Y_AXIS
GuidoField a1 {
-dependency {"[ $model getCurrentValue]" != "INV" && "[$nested_gh getCurrentValue]" >= "1"}
-display_length 14
-font_style bold
-format double
-max_length 14
-next_focus c2
-null false
-tip "00147_TIP_009"
-translate upper
}
GuidoField a2 {
-dependency {"[ $model getCurrentValue]" == "NSP" && "[$nested_gh getCurrentValue]" >= "2"}
-display_length 14
-font_style bold
-format double
-max_length 14
-next_focus c3
-null false
-tip "00147_TIP_010"
-translate upper
}
GuidoField a3 {
-dependency {"[ $model getCurrentValue]" == "NSP" && "[$nested_gh getCurrentValue]" >= "3"}
-display_length 14
-font_style bold
-format double
-max_length 14
-next_focus c4
-null false
-tip "00147_TIP_010"
-translate upper
}
GuidoField a4 {
-dependency {"[ $model getCurrentValue]" == "NSP" && "[$nested_gh getCurrentValue]" >= "4"}
-display_length 14
-font_style bold
-format double
-max_length 14
-next_focus c5
-null false
-tip "00147_TIP_010"
-translate upper
}
GuidoField a5 {
-dependency {"[ $model getCurrentValue]" == "NSP" && "[$nested_gh getCurrentValue]" >= "5"}
-display_length 14
-font_style bold
-format double
-max_length 14
-null false
-tip "00147_TIP_010"
-translate upper
}
}
GuidoFiller frm00147_40 {
-width 1
}
}
}
GuidoPanel InversePowerPanel {
-dependency {"[ $model getCurrentValue]" == "INV"}
-layout BoxLayout X_AXIS
GuidoPanel frm00147_28 {
-layout CentreLineLayout
GuidoField power {
-display_length 5
-font_style bold
-format double
-label "Power for Inverse distance "
-max_length 5
-null false
-tip "00147_TIP_014"
-translate upper
}
}
}
}
}
