proc updateTabLabels {fields field variogramTabPane} {
set tab_idx 0
for {set row_idx 0} {$row_idx < [$fields getRowCount]} {incr row_idx} {
set dfield [$field getCurrentValue $row_idx]
$variogramTabPane setTitleAt $tab_idx $dfield
incr tab_idx
set row_idx2 $row_idx
incr row_idx2
if {$row_idx2 < [$fields getRowCount]} {
for {} {$row_idx2 < [$fields getRowCount]} {incr row_idx2} {
set dfield2 [$field getCurrentValue $row_idx2]
$variogramTabPane setTitleAt $tab_idx "Cross $dfield - $dfield2"
incr tab_idx
}
}
}
}
proc createNewPanel {insertIndex} {
incr insertIndex
global variogram_$insertIndex
global vpanel_$insertIndex
global cutoff_$insertIndex
global cutoff_value_$insertIndex
global nugget_$insertIndex
global sill_label_$insertIndex
global sill_$insertIndex
global variogram_scroll_$insertIndex
global variograms_$insertIndex
global type_$insertIndex
global cc_$insertIndex
global angle1_$insertIndex
global angle2_$insertIndex
global angle3_$insertIndex
global hmax_$insertIndex
global hmin_$insertIndex
global hvert_$insertIndex
if [catch {
set table "variograms_$insertIndex"
set variograms_rows [GuidoGetParamBufferValue [GuidoExecServer GetLastValues [subst {function_name = "BM GSLIB COKB3D" form_name = "COKB3DParameters." table = $table table_row = 0 field_name = "__num_instances"}]] constant]
} result] {
set variograms_rows 1
}
GuidoPanel variogram_$insertIndex {
-layout BoxLayout Y_AXIS
-label "0"
GuidoPanel vpanel_$insertIndex {
-layout CentreLineLayout
GuidoField nugget_$insertIndex {
-display_length 5
-label "Nugget"
-default 1
-null false
-tip GSLIB_KT3D_NUGGET_TIP
-format double
}
GuidoLabel sill_label_$insertIndex {
-label "Sill"
}
GuidoLabel sill_$insertIndex {
-label "2"
}
}
GuidoScrollPane variogram_scroll_$insertIndex {
-scroll_size 60 16
GuidoTable variograms_$insertIndex {
-instances $variograms_rows 1 100
-interactive true
GuidoComboBox type_$insertIndex {
-display_length 10
-exclusive true
-label "Type"
-null false
-tip GSLIB_IK3D_TYPE_1_TIP
-value_in 1 2 4 5
-alternative_mlt_keys "Spherical (1)" "Exponential (2)" "Power (4)" "Hole effect (5)"
-default 1
}
GuidoField cc_$insertIndex {
-display_length 5
-label "Cc"
-default 1
-null false
-tip GSLIB_IK3D_CC_1_TIP
-format double
}
GuidoField hmax_$insertIndex {
-label "hMax"
-display_length 5
-default 1
-low_bound 0.0001
-null false
-tip GSLIB_IK3D_HMAX_1_TIP
-format double
}
GuidoField hmin_$insertIndex {
-label "hMin"
-display_length 5
-default 1
-low_bound 0.0001
-null false
-tip GSLIB_IK3D_HMIN_1_TIP
-format double
}
GuidoField hvert_$insertIndex {
-label "Vert"
-display_length 5
-default 1
-low_bound 0.0001
-null false
-tip GSLIB_IK3D_HVERT_1_TIP
-format double
}
GuidoField angle1_$insertIndex {
-label "Angle1"
-display_length 5
-default 0
-null false
-tip GSLIB_ROTATION_ANGLE_TIP
-format double
}
GuidoField angle2_$insertIndex {
-label "Angle2"
-display_length 5
-default 0
-null false
-tip GSLIB_ROTATION_ANGLE_TIP
-format double
}
GuidoField angle3_$insertIndex {
-label "Angle3"
-display_length 5
-default 0
-null false
-tip GSLIB_ROTATION_ANGLE_TIP
-format double
}
}
}
}
upvar 0 nugget_$insertIndex useNugget
upvar 0 variograms_$insertIndex useTable
upvar 0 cc_$insertIndex useCc
upvar 0 sill_$insertIndex useSill
$useNugget setActionCallback valueChanged {[
set sill_value [$useNugget getCurrentValue]
for {set row_idx 0} {$row_idx < [$useTable getRowCount]} {incr row_idx} {
set val [$useCc getCurrentValue $row_idx]
set sill_value [expr $sill_value + $val]
}
eval [$useSill setCurrentValue $sill_value]
]}
$useCc setActionCallback valueChanged {[
set sill_value [$useNugget getCurrentValue]
for {set row_idx 0} {$row_idx < [$useTable getRowCount]} {incr row_idx} {
set val [$useCc getCurrentValue $row_idx]
set sill_value [expr $sill_value + $val]
}
eval [$useSill setCurrentValue $sill_value]
]}
$useTable setActionCallback rowAdded {[
set sill_value [$useNugget getCurrentValue]
for {set row_idx 0} {$row_idx < [$useTable getRowCount]} {incr row_idx} {
set val [$useCc getCurrentValue $row_idx]
set sill_value [expr $sill_value + $val]
}
eval [$useSill setCurrentValue $sill_value]
]}
$useTable setActionCallback rowInserted {[
set sill_value [$useNugget getCurrentValue]
for {set row_idx 0} {$row_idx < [$useTable getRowCount]} {incr row_idx} {
set val [$useCc getCurrentValue $row_idx]
set sill_value [expr $sill_value + $val]
}
eval [$useSill setCurrentValue $sill_value]
]}
$useTable setActionCallback rowDeleted {[
set sill_value [$useNugget getCurrentValue]
for {set row_idx 0} {$row_idx < [$useTable getRowCount]} {incr row_idx} {
set val [$useCc getCurrentValue $row_idx]
set sill_value [expr $sill_value + $val]
}
eval [$useSill setCurrentValue $sill_value]
]}
upvar 0 variogram_$insertIndex newPanel
return $newPanel
}
proc addVariogram {variogramTabPane idx} {
set numPanels [$variogramTabPane getTabCount]
set newPanel [createNewPanel $numPanels]
$variogramTabPane insertTabAt $numPanels [$newPanel getObject]
if {$idx < $numPanels} {
set numTabs [$variogramTabPane getTabCount]
for {set shuffle_row_idx [expr $numTabs]} {$shuffle_row_idx > [expr $idx + 1]} {incr shuffle_row_idx -1} {
set shuffle_row_jdx [expr $shuffle_row_idx - 1]
global nugget_$shuffle_row_idx
global nugget_$shuffle_row_jdx
upvar 0 nugget_$shuffle_row_idx a
upvar 0 nugget_$shuffle_row_jdx b
$a setCurrentValue [$b getCurrentValue]
global variograms_$shuffle_row_idx
global variograms_$shuffle_row_jdx
upvar 0 variograms_$shuffle_row_idx a
upvar 0 variograms_$shuffle_row_jdx b
while {[$a getRowCount] < [$b getRowCount]} {
$a addRows 1
}
while {[$a getRowCount] > [$b getRowCount]} {
$a removeRow 1
}
global type_$shuffle_row_idx
global type_$shuffle_row_jdx
upvar 0 type_$shuffle_row_idx typea
upvar 0 type_$shuffle_row_jdx typeb
global cc_$shuffle_row_idx
global cc_$shuffle_row_jdx
upvar 0 cc_$shuffle_row_idx cca
upvar 0 cc_$shuffle_row_jdx ccb
global angle1_$shuffle_row_idx
global angle1_$shuffle_row_jdx
upvar 0 angle1_$shuffle_row_idx angle1a
upvar 0 angle1_$shuffle_row_jdx angle1b
global angle2_$shuffle_row_idx
global angle2_$shuffle_row_jdx
upvar 0 angle2_$shuffle_row_idx angle2a
upvar 0 angle2_$shuffle_row_jdx angle2b
global angle3_$shuffle_row_idx
global angle3_$shuffle_row_jdx
upvar 0 angle3_$shuffle_row_idx angle3a
upvar 0 angle3_$shuffle_row_jdx angle3b
global hmin_$shuffle_row_idx
global hmin_$shuffle_row_jdx
upvar 0 hmin_$shuffle_row_idx hmina
upvar 0 hmin_$shuffle_row_jdx hminb
global hmax_$shuffle_row_idx
global hmax_$shuffle_row_jdx
upvar 0 hmax_$shuffle_row_idx hmaxa
upvar 0 hmax_$shuffle_row_jdx hmaxb
global hvert_$shuffle_row_idx
global hvert_$shuffle_row_jdx
upvar 0 hvert_$shuffle_row_idx hverta
upvar 0 hvert_$shuffle_row_jdx hvertb
for {set v_row_idx 0} {$v_row_idx < [$a getRowCount]} {incr v_row_idx} {
$typea setCurrentValue $v_row_idx [$typeb getCurrentValue $v_row_idx]
$cca setCurrentValue $v_row_idx [$ccb getCurrentValue $v_row_idx]
$angle1a setCurrentValue $v_row_idx [$angle1b getCurrentValue $v_row_idx]
$angle2a setCurrentValue $v_row_idx [$angle2b getCurrentValue $v_row_idx]
$angle3a setCurrentValue $v_row_idx [$angle3b getCurrentValue $v_row_idx]
$hmina setCurrentValue $v_row_idx [$hminb getCurrentValue $v_row_idx]
$hmaxa setCurrentValue $v_row_idx [$hmaxb getCurrentValue $v_row_idx]
$hverta setCurrentValue $v_row_idx [$hvertb getCurrentValue $v_row_idx]
}
}
incr idx
global nugget_$idx
upvar 0 nugget_$idx a
$a setCurrentValue 1
global variograms_$idx
upvar 0 variograms_$idx a
$a addRows 1
while {[$a getRowCount] > 1} {
$a removeRow 0
}
}
}
proc deleteVariogram {variogramTabPane idx} {
set numTabs [$variogramTabPane getTabCount]
for {set shuffle_row_idx [expr $idx + 1]} {$shuffle_row_idx < $numTabs} {incr shuffle_row_idx} {
set shuffle_row_jdx [expr $shuffle_row_idx + 1]
global nugget_$shuffle_row_idx
global nugget_$shuffle_row_jdx
upvar 0 nugget_$shuffle_row_idx a
upvar 0 nugget_$shuffle_row_jdx b
$a setCurrentValue [$b getCurrentValue]
global variograms_$shuffle_row_idx
global variograms_$shuffle_row_jdx
upvar 0 variograms_$shuffle_row_idx a
upvar 0 variograms_$shuffle_row_jdx b
while {[$a getRowCount] < [$b getRowCount]} {
$a addRows 1
}
while {[$a getRowCount] > [$b getRowCount]} {
$a removeRow 1
}
global type_$shuffle_row_idx
global type_$shuffle_row_jdx
upvar 0 type_$shuffle_row_idx typea
upvar 0 type_$shuffle_row_jdx typeb
global cc_$shuffle_row_idx
global cc_$shuffle_row_jdx
upvar 0 cc_$shuffle_row_idx cca
upvar 0 cc_$shuffle_row_jdx ccb
global angle1_$shuffle_row_idx
global angle1_$shuffle_row_jdx
upvar 0 angle1_$shuffle_row_idx angle1a
upvar 0 angle1_$shuffle_row_jdx angle1b
global angle2_$shuffle_row_idx
global angle2_$shuffle_row_jdx
upvar 0 angle2_$shuffle_row_idx angle2a
upvar 0 angle2_$shuffle_row_jdx angle2b
global angle3_$shuffle_row_idx
global angle3_$shuffle_row_jdx
upvar 0 angle3_$shuffle_row_idx angle3a
upvar 0 angle3_$shuffle_row_jdx angle3b
global hmin_$shuffle_row_idx
global hmin_$shuffle_row_jdx
upvar 0 hmin_$shuffle_row_idx hmina
upvar 0 hmin_$shuffle_row_jdx hminb
global hmax_$shuffle_row_idx
global hmax_$shuffle_row_jdx
upvar 0 hmax_$shuffle_row_idx hmaxa
upvar 0 hmax_$shuffle_row_jdx hmaxb
global hvert_$shuffle_row_idx
global hvert_$shuffle_row_jdx
upvar 0 hvert_$shuffle_row_idx hverta
upvar 0 hvert_$shuffle_row_jdx hvertb
for {set v_row_idx 0} {$v_row_idx < [$a getRowCount]} {incr v_row_idx} {
$typea setCurrentValue $v_row_idx [$typeb getCurrentValue $v_row_idx]
$cca setCurrentValue $v_row_idx [$ccb getCurrentValue $v_row_idx]
$angle1a setCurrentValue $v_row_idx [$angle1b getCurrentValue $v_row_idx]
$angle2a setCurrentValue $v_row_idx [$angle2b getCurrentValue $v_row_idx]
$angle3a setCurrentValue $v_row_idx [$angle3b getCurrentValue $v_row_idx]
$hmina setCurrentValue $v_row_idx [$hminb getCurrentValue $v_row_idx]
$hmaxa setCurrentValue $v_row_idx [$hmaxb getCurrentValue $v_row_idx]
$hverta setCurrentValue $v_row_idx [$hvertb getCurrentValue $v_row_idx]
}
}
incr numTabs -1
$variogramTabPane removeTabAt $numTabs
}
GuidoApp check_bm "CHECK BM CONNECTED"
$check_bm setParam functionName "BM GSLIB COKB3D"
set result [$check_bm invoke]
$check_bm destroy
if {$result == "0"} {
GuidoApp appHandle "BM GSLIB COKB3D"
$appHandle setParam license "test"
set appStatus [$appHandle invoke]
$appHandle destroy
if {$appStatus == "-10311"} {
return
}
if [catch {
set variograms_1_rows [GuidoGetParamBufferValue [GuidoExecServer GetLastValues {function_name = "BM GSLIB COKB3D" form_name = "COKB3DParameters." table = "variograms_1" table_row = 0 field_name = "__num_instances"}] constant]
} result] {
set variograms_1_rows 1
}
GuidoForm COKB3DParameters {
-help_id 785
-default_buttons
-label "GSLIB interface: Cokriging (cokb3d)"
-tip GSLIB_COKB3D_FORM_TIP
-defaults_management true
-layout BoxLayout Y_AXIS
GuidoTabbedPane tabPane {
GuidoPanel panel1 {
-layout BoxLayout Y_AXIS
-label GUI_FILES
GuidoPanel panel1a {
-layout CentreLineLayout
-border etched true
-label "Input"
-width 62
GuidoFileBrowserField string_file_location {
-display_length 26
-file_mask *.str
-link string_file_id
-format none
-input true
-label "Location"
-max_length 252
-null false
-tip GSLIB_COKB3D_STRING_FILE_TIP
}
GuidoField string_file_id {
-display_length 10
-font_style bold
-format none
-input true
-label "ID Number"
-max_length 16
-null false
-tip GSLIB_COKB3D_STRING_FILE_TIP
}
GuidoField range {
-default 1
-display_length 10
-format range
-label "String range"
-max_length 26
-null false
-tip GSLIB_COKB3D_STRING_FILE_TIP
-translate none
}
GuidoLabel field_scroll_label {
-label "D-fields"
}
GuidoScrollPane field_scroll {
-scroll_size 16 6
GuidoTable fields {
-instances 1 1 4
-interactive true
GuidoComboBox field {
-display_length 4.8
-exclusive true
-label "D-field"
-max_length 4
-default D1
-null false
-tip GSLIB_COKB3D_STRING_FILE_TIP
-value_in D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15 D16 D17 D18 D19 D20 D21 D22 D23 D24 D25 D26 D27 D28 D29 D30 D31 D32 D33 D34 D35 D36 D37 D38 D39 D40 D41 D42 D43 D44 D45 D46 D47 D48 D49 D50 D51 D52 D53 D54 D55 D56 D57 D58 D59 D60 D61 D62 D63 D64 D65 D66 D67 D68 D69 D70 D71 D72 D73 D74 D75 D76 D77 D78 D79 D80 D81 D82 D83 D84 D85 D86 D87 D88 D89 D90 D91 D92 D93 D94 D95 D96 D97 D98 D99 D100
}
GuidoField mean {
-display_length 3
-label "Mean"
-default ""
-null false
-tip GSLIB_COKB3D_MEAN_FILE_TIP
}
}
}
GuidoField tmin {
-display_length 10
-label "Minimum"
-default -1E+21
-null false
-tip GSLIB_IK3D_TMIN_TIP
-format double
}
GuidoField tmax {
-display_length 10
-label "Maximum"
-default 1E+21
-null false
-tip GSLIB_IK3D_TMAX_TIP
-format double
}
}
GuidoPanel panel1b {
-layout CentreLineLayout
-border etched true
-label "Output"
-width 62
GuidoBMAttributeBrowser attribute {
-label "Estimate"
-display_length 10
-max_length BM_MAX_ATT_NAME_LEN
-null false
-format none
-translate none
-exclusive false
-attribute_types real
-tip GSLIB_KT3D_ATTRIBUTE_TIP
}
GuidoBMAttributeBrowser variance_attribute {
-label "Estimation variance"
-display_length 10
-max_length BM_MAX_ATT_NAME_LEN
-null true
-format none
-translate none
-exclusive false
-attribute_types real
-tip GSLIB_KT3D_VARIANCE_ATTRIBUTE_TIP
}
GuidoCheckBox constrain_interpolation {
-label "Constrain interpolation"
-default false
-tip GSLIB_IK3D_CONSTRAIN_TIP
}
GuidoFileBrowserField debug_file {
-display_length 26
-file_mask *.dbg
-format none
-input true
-label "Debug file"
-max_length 252
-null false
-tip GSLIB_DEBUG_TIP
}
GuidoComboBox debug_level {
-dependency {"[ $debug_file getCurrentValue]" != ""}
-display_length 8
-exclusive true
-label "Debug level"
-null false
-tip GSLIB_DEBUG_LEVEL_TIP
-value_in 0 1 2 3
-alternative_mlt_keys "none (0)" "low (1)" "medium (2)" "high (3)"
-default 0
}
GuidoCheckBox remove_intermediate_files {
-label "Clean up"
-default true
-tip GSLIB_COKB3D_CLEANUP_TIP
}
}
}
GuidoPanel panel2 {
-label "Kriging Options"
-layout BoxLayout Y_AXIS
GuidoPanel panel2_a {
-layout CentreLineLayout
GuidoPanel panel2a {
-border etched true
-label "Kriging parameters"
-layout BoxLayout Y_AXIS
-width 62
-height 25.7
GuidoPanel top {
-layout CentreLineLayout
GuidoComboBox kriging_type {
-label "Kriging type"
-display_length 16
-exclusive true
-null false
-tip GSLIB_COKB3D_KRIGING_TYPE_TIP
-value_in 0 1 2
-alternative_mlt_keys "Simple co-kriging (0)" "Standardized ordinary co-kriging (1)" "Traditional ordinary co-kriging (2)"
-default 2
}
}
GuidoFiller fill1 {
-height 0.5
}
GuidoPanel panel2ac {
-layout BoxLayout X_AXIS
GuidoPanel search_panel_1 {
-layout CentreLineLayout
GuidoField minimum_primary {
-display_length 5
-label "Minimum primary samples to krige a block"
-default 4
-null false
-format double
-tip GSLIB_COKB3D_MINIMUM_PRIMARY_TIP
}
GuidoField maximum_primary {
-display_length 5
-label "Maximum primary samples to krige a block"
-default 8
-null false
-format double
-tip GSLIB_COKB3D_MAXIMUM_PRIMARY_TIP
}
GuidoField maximum_secondary {
-display_length 5
-label "Maximum secondary samples to krige a block"
-default 8
-null false
-format double
-tip GSLIB_COKB3D_MAXIMUM_SECONDARY_TIP
}
}
}
GuidoPanel panel2ac {
-layout CentreLineLayout
GuidoPanel panel2aca {
-layout BoxLayout Y_AXIS
GuidoLabel label1 {
-label " "
-height 1.1
}
GuidoLabel label2 {
-label "Block descretization"
-height 1.1
}
GuidoLabel label3 {
-label " "
-height 1.1
}
GuidoLabel label4 {
-label "Primary search radius"
-height 1.1
}
GuidoLabel label5 {
-label "Secondary search radius"
-height 1.1
}
GuidoLabel label6 {
-label " "
-height 1.1
}
GuidoLabel label7 {
-label "Search angles"
-height 1.1
}
}
GuidoPanel panel2acb {
-layout GridLayout 7 3
GuidoLabel labelx {
-label "X"
}
GuidoLabel labely {
-label "Y"
}
GuidoLabel labelz {
-label "Z"
}
GuidoField x_descretization {
-display_length 6
-default 1
-null false
-tip GSLIB_KT3D_X_DESCRETIZATION_TIP
-format integer
}
GuidoField y_descretization {
-display_length 6
-default 1
-null false
-tip GSLIB_KT3D_Y_DESCRETIZATION_TIP
-format integer
}
GuidoField z_descretization {
-display_length 6
-default 1
-null false
-tip GSLIB_KT3D_Z_DESCRETIZATION_TIP
-format integer
}
GuidoLabel labelx1 {
-label "hMax"
}
GuidoLabel labely1 {
-label "hMin"
}
GuidoLabel labelz1 {
-label "Vert"
}
GuidoField hmax_primary {
-display_length 6
-default 20
-null false
-tip GSLIB_IK3D_X_SEARCH_RADIUS_TIP
-format double
}
GuidoField hmin_primary {
-display_length 6
-default 20
-null false
-tip GSLIB_IK3D_Y_SEARCH_RADIUS_TIP
-format double
}
GuidoField vert_primary {
-display_length 6
-default 20
-null false
-tip GSLIB_IK3D_Z_SEARCH_RADIUS_TIP
-format double
}
GuidoField hmax_secondary {
-display_length 6
-default 20
-null false
-tip GSLIB_IK3D_X_SEARCH_RADIUS_TIP
-format double
}
GuidoField hmin_secondary {
-display_length 6
-default 20
-null false
-tip GSLIB_IK3D_Y_SEARCH_RADIUS_TIP
-format double
}
GuidoField vert_secondary {
-display_length 6
-default 20
-null false
-tip GSLIB_IK3D_Z_SEARCH_RADIUS_TIP
-format double
}
GuidoLabel labelx2 {
-label "Angle1"
}
GuidoLabel labely2 {
-label "Angle2"
}
GuidoLabel labelz2 {
-label "Angle3"
}
GuidoField x_search_angle {
-display_length 6
-default 0
-null false
-tip GSLIB_IK3D_X_SEARCH_ANGLE_TIP
-format double
}
GuidoField y_search_angle {
-display_length 6
-default 0
-null false
-tip GSLIB_IK3D_Y_SEARCH_ANGLE_TIP
-format double
}
GuidoField z_search_angle {
-display_length 6
-default 0
-null false
-tip GSLIB_IK3D_Z_SEARCH_ANGLE_TIP
-format double
}
}
}
}
}
}
GuidoPanel panel4 {
-label "Variograms"
-layout BoxLayout Y_AXIS
GuidoPanel 4a {
-layout BoxLayout Y_AXIS
-border etched true
-label "Variograms and cross-variograms"
-width 62
-height 25.7
GuidoTabbedPane variogramTabPane {
GuidoPanel variogram_1 {
-layout BoxLayout Y_AXIS
-label "D1"
GuidoPanel vpanel_1 {
-layout CentreLineLayout
GuidoField nugget_1 {
-display_length 5
-label "Nugget"
-default 1
-null false
-tip GSLIB_IK3D_NUGGET_1_TIP
-format double
}
GuidoLabel sill_label_1 {
-label "Sill"
}
GuidoLabel sill_1 {
-label "1"
}
}
GuidoScrollPane variogram_scroll_1 {
-scroll_size 60 16
GuidoTable variograms_1 {
-instances $variograms_1_rows 1 100
-interactive true
GuidoComboBox type_1 {
-display_length 10
-exclusive true
-label "Type"
-null false
-tip GSLIB_IK3D_TYPE_1_TIP
-value_in 1 2 3 5
-alternative_mlt_keys "Spherical (1)" "Exponential (2)" "Gaussian (3)" "Hole effect (5)"
-default 1
}
GuidoField cc_1 {
-display_length 5
-label "Cc"
-default 1
-null false
-tip GSLIB_IK3D_CC_1_TIP
-format double
}
GuidoField hmax_1 {
-label "hMax"
-display_length 5
-default 1
-low_bound 0.0001
-null false
-tip GSLIB_IK3D_HMAX_1_TIP
-format double
}
GuidoField hmin_1 {
-label "hMin"
-display_length 5
-default 1
-low_bound 0.0001
-null false
-tip GSLIB_IK3D_HMIN_1_TIP
-format double
}
GuidoField hvert_1 {
-label "Vert"
-display_length 5
-default 1
-low_bound 0.0001
-null false
-tip GSLIB_IK3D_HVERT_1_TIP
-format double
}
GuidoField angle1_1 {
-label "Angle1"
-display_length 5
-default 0
-null false
-tip GSLIB_ROTATION_ANGLE_TIP
-format double
}
GuidoField angle2_1 {
-label "Angle2"
-display_length 5
-default 0
-null false
-tip GSLIB_ROTATION_ANGLE_TIP
-format double
}
GuidoField angle3_1 {
-label "Angle3"
-display_length 5
-default 0
-null false
-tip GSLIB_ROTATION_ANGLE_TIP
-format double
}
}
}
}
}
}
}
}
}
$mean setDependency {"[ $kriging_type getCurrentValue]" != "2"}
$string_file_location setActionCallback focusLost {[
set val [$string_file_location getCurrentValue]
if {$val > ""} {
if {[string match *.str $val]} {
set len [string length $val]
incr len -5
set val [string range $val 0 $len]
}
set filen "$val.dbg"
$debug_file setCurrentValue $filen
}
]}
$variograms_1 setActionCallback rowAdded {[
set sill_value [$nugget_1 getCurrentValue]
for {set row_idx 0} {$row_idx < [$variograms_1 getRowCount]} {incr row_idx} {
set val [$cc_1 getCurrentValue $row_idx]
set sill_value [expr $sill_value + $val]
}
catch {
$sill_1 setCurrentValue $sill_value
}
]}
$variograms_1 setActionCallback rowInserted {[
set sill_value [$nugget_1 getCurrentValue]
for {set row_idx 0} {$row_idx < [$variograms_1 getRowCount]} {incr row_idx} {
set val [$cc_1 getCurrentValue $row_idx]
set sill_value [expr $sill_value + $val]
}
catch {
$sill_1 setCurrentValue $sill_value
}
]}
$variograms_1 setActionCallback rowDeleted {[
set sill_value [$nugget_1 getCurrentValue]
for {set row_idx 0} {$row_idx < [$variograms_1 getRowCount]} {incr row_idx} {
set val [$cc_1 getCurrentValue $row_idx]
set sill_value [expr $sill_value + $val]
}
catch {
$sill_1 setCurrentValue $sill_value
}
]}
$cc_1 setActionCallback valueChanged {[
set sill_value [$nugget_1 getCurrentValue]
for {set row_idx 0} {$row_idx < [$variograms_1 getRowCount]} {incr row_idx} {
set val [$cc_1 getCurrentValue $row_idx]
set sill_value [expr $sill_value + $val]
}
$sill_1 setCurrentValue $sill_value
]}
$nugget_1 setActionCallback valueChanged {[
set sill_value [$nugget_1 getCurrentValue]
for {set row_idx 0} {$row_idx < [$variograms_1 getRowCount]} {incr row_idx} {
set val [$cc_1 getCurrentValue $row_idx]
set sill_value [expr $sill_value + $val]
}
$sill_1 setCurrentValue $sill_value
]}
array set dfieldvalue { 0 "D1" }
$fields setActionCallback rowAdded {[
set dfieldvalue([expr [$fields getRowCount] - 1]) "D1"
set w [expr [$fields getRowCount] - 1]
set v $w
for {set i 0} {$w >= 0} {incr w -1} {
if {$w == 0} {
set title "D1"
} else {
set title "Cross $dfieldvalue($i) - D1"
}
addVariogram $variogramTabPane $v
$variogramTabPane setTitleAt $v $title
incr v $w
incr i
}
updateTabLabels $fields $field $variogramTabPane
]}
$fields setActionCallback rowInserted {[
set row [expr [$fields getRowChanged] + 1]
for {set i [$fields getRowCount]} {$i > $row} {incr i -1} {
set dfieldvalue([expr $i - 1]) $dfieldvalue([expr $i - 2])
}
set dfieldvalue([$fields getRowChanged]) "D1"
set tab_idx 0
for {set srow_idx 0} {$srow_idx < [$fields getRowCount]} {incr srow_idx} {
if {$srow_idx == [$fields getRowChanged]} {
addVariogram $variogramTabPane $tab_idx
}
incr tab_idx
set row_idx2 $srow_idx
incr row_idx2
if {$row_idx2 < [$fields getRowCount]} {
for {} {$row_idx2 < [$fields getRowCount]} {incr row_idx2} {
if {$row_idx2 == [$fields getRowChanged] || $srow_idx == [$fields getRowChanged]} {
addVariogram $variogramTabPane $tab_idx
}
incr tab_idx
}
}
}
updateTabLabels $fields $field $variogramTabPane
]}
$fields setActionCallback rowDeleted {[
for {set i [$fields getRowChanged]} {$i < [$fields getRowCount]} {incr i} {
set dfieldvalue($i) $dfieldvalue([expr $i + 1])
}
unset dfieldvalue([expr [$fields getRowCount]])
array set variogramtodelete {}
set tab_idx 0
set total [expr [$fields getRowCount] + 1]
for {set srow_idx 0} {$srow_idx < $total} {incr srow_idx} {
if {$srow_idx == [$fields getRowChanged]} {
set variogramtodelete([array size variogramtodelete]) $tab_idx
}
incr tab_idx
set row_idx2 $srow_idx
incr row_idx2
if {$row_idx2 < $total} {
for {} {$row_idx2 < $total} {incr row_idx2} {
if {$row_idx2 == [$fields getRowChanged] || $srow_idx == [$fields getRowChanged]} {
set variogramtodelete([array size variogramtodelete]) $tab_idx
}
incr tab_idx
}
}
}
for {set i [expr [array size variogramtodelete] - 1]} {$i >= 0} {incr i -1} {
deleteVariogram $variogramTabPane $variogramtodelete($i)
}
updateTabLabels $fields $field $variogramTabPane
]}
$field setActionCallback valueChanged {[
if {[$fields getRowCount] == [array size dfieldvalue]} {
if {[$fields getEditingRow] >= 0} {
if {[$fields getEditingRow] < [$fields getRowCount]} {
if {$dfieldvalue([$fields getEditingRow]) != [$field getCurrentValue]} {
set dfieldvalue([$fields getEditingRow]) [$field getCurrentValue]
updateTabLabels $fields $field $variogramTabPane
}
}
}
}
]}
$tabPane setActionCallback mousePressed {[
set numTabs [$variogramTabPane getTabCount]
for {set tab_idx 1} {$tab_idx <= $numTabs} {incr tab_idx} {
global nugget_$tab_idx
global variograms_$tab_idx
global cc_$tab_idx
global sill_$tab_idx
upvar 0 nugget_$tab_idx useNugget
upvar 0 variograms_$tab_idx useTable
upvar 0 cc_$tab_idx useCc
upvar 0 sill_$tab_idx useSill
set sill_value [$useNugget getCurrentValue]
for {set row_idx 0} {$row_idx < [$useTable getRowCount]} {incr row_idx} {
set val [$useCc getCurrentValue $row_idx]
set sill_value [expr $sill_value + $val]
}
$useSill setCurrentValue $sill_value
}
]}
$tabPane setActionCallback keyReleased {[
set numTabs [$variogramTabPane getTabCount]
for {set tab_idx 1} {$tab_idx <= $numTabs} {incr tab_idx} {
global nugget_$tab_idx
global variograms_$tab_idx
global cc_$tab_idx
global sill_$tab_idx
upvar 0 nugget_$tab_idx useNugget
upvar 0 variograms_$tab_idx useTable
upvar 0 cc_$tab_idx useCc
upvar 0 sill_$tab_idx useSill
set sill_value [$useNugget getCurrentValue]
for {set row_idx 0} {$row_idx < [$useTable getRowCount]} {incr row_idx} {
set val [$useCc getCurrentValue $row_idx]
set sill_value [expr $sill_value + $val]
}
$useSill setCurrentValue $sill_value
}
]}
$COKB3DParameters setActionCallback mouseEntered {[
set val [$string_file_location getCurrentValue]
if {$val > ""} {
if {[string match *.str $val]} {
set len [string length $val]
incr len -5
set val [string range $val 0 $len]
}
set filen "$val.dbg"
$debug_file setCurrentValue $filen
}
set sill_value [$nugget_1 getCurrentValue]
for {set row_idx 0} {$row_idx < [$variograms_1 getRowCount]} {incr row_idx} {
set val [$cc_1 getCurrentValue $row_idx]
set sill_value [expr $sill_value + $val]
}
$sill_1 setCurrentValue $sill_value
]}
set empty 0
if [catch {
set variable_count [GuidoGetParamBufferValue [GuidoExecServer GetLastValues {function_name = "BM GSLIB COKB3D" form_name = "COKB3DParameters." table = "fields" table_row = 0 field_name = "__num_instances"}] constant]
} result] {
set variable_count 2
set empty 1
}
for {set row_idx 1} {$row_idx < $variable_count} {incr row_idx} {
$fields addRows 1
}
if {$empty} {
$field setCurrentValue 1 "D2"
}
$attribute updateBrowserList
$variance_attribute updateBrowserList
set formStatus [$COKB3DParameters interact]
if {$formStatus == "apply"} {
GuidoApp appHandle "BM GSLIB COKB3D"
$appHandle setParam string_file_location [$string_file_location getCurrentValue]
$appHandle setParam string_file_id [$string_file_id getCurrentValue]
$appHandle setParam range [$range getCurrentValue]
for {set row_idx 0} {$row_idx < [$fields getRowCount]} {incr row_idx} {
$appHandle setParam "field($row_idx)" [$field getCurrentValue $row_idx]
if {"[$kriging_type getCurrentValue]" != "2"} {
$appHandle setParam "mean($row_idx)" [$mean getCurrentValue $row_idx]
}
}
$appHandle setParam tmin [$tmin getCurrentValue]
$appHandle setParam tmax [$tmax getCurrentValue]
$appHandle setParam attribute [$attribute getCurrentValue]
$appHandle setParam variance_attribute [$variance_attribute getCurrentValue]
$appHandle setParam constrain_interpolation [$constrain_interpolation getCurrentValue]
$appHandle setParam debug_file [$debug_file getCurrentValue]
$appHandle setParam debug_level [$debug_level getCurrentValue]
$appHandle setParam remove_intermediate_files [$remove_intermediate_files getCurrentValue]
$appHandle setParam kriging_type [$kriging_type getCurrentValue]
$appHandle setParam minimum_primary [$minimum_primary getCurrentValue]
$appHandle setParam maximum_primary [$maximum_primary getCurrentValue]
$appHandle setParam maximum_secondary [$maximum_secondary getCurrentValue]
$appHandle setParam hmax_primary [$hmax_primary getCurrentValue]
$appHandle setParam hmax_secondary [$hmax_secondary getCurrentValue]
$appHandle setParam x_search_angle [$x_search_angle getCurrentValue]
$appHandle setParam hmin_primary [$hmin_primary getCurrentValue]
$appHandle setParam hmin_secondary [$hmin_secondary getCurrentValue]
$appHandle setParam y_search_angle [$y_search_angle getCurrentValue]
$appHandle setParam vert_primary [$vert_primary getCurrentValue]
$appHandle setParam vert_secondary [$vert_secondary getCurrentValue]
$appHandle setParam z_search_angle [$z_search_angle getCurrentValue]
$appHandle setParam x_descretization [$x_descretization getCurrentValue]
$appHandle setParam y_descretization [$y_descretization getCurrentValue]
$appHandle setParam z_descretization [$z_descretization getCurrentValue]
set count [$variogramTabPane getTabCount]
for {set row_idx 0} {$row_idx < $count} {incr row_idx} {
set use_idx [expr $row_idx + 1]
upvar 0 nugget_$use_idx useHandle
$appHandle setParam "nugget($row_idx)" [$useHandle getCurrentValue]
upvar 0 variograms_$use_idx useHandle
set numStruct [$useHandle getRowCount]
$appHandle setParam "nrows($row_idx)" $numStruct
for {set vrow_idx 0} {$vrow_idx < $numStruct} {incr vrow_idx} {
upvar 0 type_$use_idx useHandle
set variogramType [$useHandle getCurrentValue $vrow_idx]
regexp {([0-9]+)} $variogramType number
$appHandle setParam "type$row_idx\($vrow_idx\)" $number
upvar 0 cc_$use_idx useHandle
$appHandle setParam "cc$row_idx\($vrow_idx\)"      [$useHandle getCurrentValue $vrow_idx]
upvar 0 angle1_$use_idx useHandle
$appHandle setParam "angle1_$row_idx\($vrow_idx\)" [$useHandle getCurrentValue $vrow_idx]
upvar 0 angle2_$use_idx useHandle
$appHandle setParam "angle2_$row_idx\($vrow_idx\)" [$useHandle getCurrentValue $vrow_idx]
upvar 0 angle3_$use_idx useHandle
$appHandle setParam "angle3_$row_idx\($vrow_idx\)" [$useHandle getCurrentValue $vrow_idx]
upvar 0 hmin_$use_idx useHandle
$appHandle setParam "hmin$row_idx\($vrow_idx\)"    [$useHandle getCurrentValue $vrow_idx]
upvar 0 hmax_$use_idx useHandle
$appHandle setParam "hmax$row_idx\($vrow_idx\)"    [$useHandle getCurrentValue $vrow_idx]
upvar 0 hvert_$use_idx useHandle
$appHandle setParam "hvert$row_idx\($vrow_idx\)"   [$useHandle getCurrentValue $vrow_idx]
}
}
$appHandle invoke
$appHandle destroy
}
$COKB3DParameters destroy
}
