set param [GuidoExecServer "GetBlockModelFillAlgorithm" {}]
set fill_algorithm "[GuidoGetParamBufferValue $param fill_algorithm]"
proc isBlankValueInAllRows {attributes table} {
set return_code false
for {set row 0} {$row < [$table getRowCount]} {incr row} {
if {[string length [$attributes getCurrentValue $row]] > 0} {
set return_code true
break
}
}
if {"$return_code" == "false"} {
GuidoMessage warning BM_NO_ATTS_FND
}
return $return_code
}
proc displayEstimateAttribute {fld table_label} {
global fill_algorithm
if {"$fill_algorithm" == "nearest neighbour"} {
$fld setVisible false
} else {
$fld setLabel "$table_label"
}
}
proc getScrollWidth {} {
global fill_algorithm
if {"$fill_algorithm" == "nearest neighbour"} {
return 49.9
} else {
return 70.3
}
}
proc setDataSrcType {dataSourceType source} {
upvar $dataSourceType data_src_type
if {"[$source getCurrentValue]" == "STRING FILE"} {
$data_src_type setCurrentValue "STRING FILE"
} else {
$data_src_type setCurrentValue "BLOCK MODEL"
}
}
proc updateDataSrcType {data_source table} {
global data_src_type
upvar $table atts
set num_rows [$atts getRowCount]
for {set idx 0} {$idx < $num_rows} {incr idx} {
if {"[$data_source getCurrentValue]" == "STRING FILE"} {
$data_src_type setCurrentValue $idx "STRING FILE"
} else {
$data_src_type setCurrentValue $idx "BLOCK MODEL"
}
}
}
GuidoForm frm20511 {
-default_buttons
-label "Data Source Specifications"
-layout BoxLayout Y_AXIS
-tip "20040_TIP_001"
GuidoPanel frm20511_25 {
-layout CentreLineLayout
GuidoPanel frm20511_6 {
-label "Data source type"
-font_style bold
-layout BoxLayout Y_AXIS
-tip "The data source may be specified as a string file or as another block model."
GuidoButtonGroupPanel datasrc {
-layout BoxLayout Y_AXIS
-action valueChanged {[updateDataSrcType $datasrc atts]}
GuidoRadioButton frm20511_5 {
-caption "BLOCK MODEL"
-selected_value "BLOCK MODEL"
-height 1
}
GuidoRadioButton frm20511_4 {
-caption "STRING FILE"
-selected_value "STRING FILE"
-height 1
}
}
}
}
GuidoPanel main_panel {
-layout OverlayLayout
GuidoPanel block_panel {
-layout BoxLayout Y_AXIS
-dependency {"[ $datasrc getCurrentValue]" == "BLOCK MODEL"}
GuidoLabel block_label {
-dependency {"[ $datasrc getCurrentValue]" == "BLOCK MODEL"}
-font_style bold
-label "BLOCK MODEL"
}
GuidoPanel inside_block {
-layout CentreLineLayout
-dependency {"[ $datasrc getCurrentValue]" == "BLOCK MODEL"}
GuidoLabel model_label {
-dependency {"[ $datasrc getCurrentValue]" == "BLOCK MODEL"}
-label "Model Name"
}
GuidoFileBrowserField model {
-dependency {"[ $datasrc getCurrentValue]" == "BLOCK MODEL"}
-display_length 15
-file_mask *.mdl
-format none
-legacy_action
-max_length 40
-tip "20040_TIP_007"
-translate lower
-null false
}
}
}
GuidoPanel string_panel {
-layout BoxLayout Y_AXIS
-dependency {"[ $datasrc getCurrentValue]" == "STRING FILE"}
GuidoLabel string_label {
-dependency {"[ $datasrc getCurrentValue]" == "STRING FILE"}
-font_style bold
-label "STRING FILE"
}
GuidoPanel frm20511_29 {
-dependency {"[ $datasrc getCurrentValue]" == "STRING FILE"}
-layout CentreLineLayout
GuidoLabel location_label {
-dependency {"[ $datasrc getCurrentValue]" == "STRING FILE"}
-label Location
}
GuidoFileBrowserField location {
-dependency {"[ $datasrc getCurrentValue]" == "STRING FILE"}
-display_length 15
-file_mask *.str
-format none
-link id
-max_length 252
-tip "20040_TIP_003"
-translate lower
-null false
}
GuidoLabel id_label {
-dependency {"[ $datasrc getCurrentValue]" == "STRING FILE"}
-label "Id range"
}
GuidoField id {
-dependency {"[ $datasrc getCurrentValue]" == "STRING FILE"}
-display_length 15
-format range
-max_length 32
-null true
-tip "20040_TIP_003"
-translate upper
}
GuidoLabel range_label {
-dependency {"[ $datasrc getCurrentValue]" == "STRING FILE"}
-label "String range"
}
GuidoField range {
-dependency {"[ $datasrc getCurrentValue]" == "STRING FILE"}
-default 1
-display_length 6
-format range
-max_length 26
-null false
-tip "20040_TIP_003"
-translate none
}
}
}
}
GuidoFiller space {
-height 1
}
GuidoPanel constrain_panel {
-layout CentreLineLayout
GuidoCheckBox constrain {
-default false
-label "Constrain data"
-selected_value Y
-tip "20040_TIP_009"
-unselected_value N
}
GuidoCheckBox save_points {
-dependency {"[ $constrain getCurrentValue]" == "Y"}
-default false
-label "Save constrained sample points?"
-selected_value Y
-tip "Save the constrained sample points to a string file?"
-unselected_value N
}
GuidoFileBrowserField point_location {
-dependency {"[ $constrain getCurrentValue]" == "Y"}
-dependency {"[ $save_points getCurrentValue]" == "Y"}
-label "Output location"
-display_length 15
-file_mask *.str
-format none
-link point_id
-max_length 252
-tip "The location of the string file to save the constrained sample points to."
-translate lower
-null false
-file_access write
}
GuidoField point_id {
-dependency {"[ $constrain getCurrentValue]" == "Y"}
-dependency {"[ $save_points getCurrentValue]" == "Y"}
-label "Output id number"
-default 1
-display_length 6
-format double
-max_length 16
-null false
-tip "The id number of the string file to save the constrained sample points to."
-translate upper
}
}
GuidoScrollPane frm20511_17 {
-width [getScrollWidth]
GuidoTable atts {
-instances 1 1 20
-interactive true
GuidoComboBox data_src_type {
-action initial {[setDataSrcType data_src_type $datasrc]}
-display_length 0
-max_length 11
-null false
-translate upper
-value_in "STRING FILE" "BLOCK MODEL"
}
GuidoComboBox att {
-display_length 10
-format none
-label "Attribute to Fill"
-max_length BM_MAX_ATT_NAME_LEN
-no_mlt
-validation {[isBlankValueInAllRows $att $atts]}
-tip "Enter the name of the attribute to fill"
}
GuidoField field {
-dependency {"[$data_src_type getCurrentValue]" == "STRING FILE"}
-default 1
-display_length 10
-format integer
-high_bound 100
-label "Description Field"
-legacy_validation
-low_bound 1
-max_length 30
-tip "20040_TIP_003"
-translate none
}
GuidoComboBox attribute {
-dependency {"[$data_src_type getCurrentValue]" == "BLOCK MODEL"}
-display_length 10
-format none
-label "Attribute Name"
-legacy_validation
-no_mlt
-max_length BM_MAX_ATT_NAME_LEN
-tip "20040_TIP_007"
-translate lower
}
GuidoComboBox dist_att {
-display_length 8
-format none
-label "Anisotropic dist to nearest sample"
-max_length BM_MAX_ATT_NAME_LEN
-null true
-no_mlt
-tip BM_NEAREST_SAMPLE_TIP
-translate lower
-exclusive false
}
GuidoComboBox avgdist_att {
-action initial {[displayEstimateAttribute $avgdist_att "Average anisotropic dist to samples"]}
-display_length 0
-format none
-max_length BM_MAX_ATT_NAME_LEN
-null true
-no_mlt
-tip BM_AVERAGE_DISTANCE_TIP
-translate lower
-exclusive false
}
GuidoComboBox numsam_att {
-action initial {[displayEstimateAttribute $numsam_att "Number of samples"]}
-display_length 0
-format none
-max_length BM_MAX_ATT_NAME_LEN
-null true
-no_mlt
-tip BM_NUMBER_OF_SAMPLES_TIP
-translate lower
-exclusive false
}
$data_src_type setVisible false
}
}
GuidoPanel warningPanel {
-dependency {"[$constrain getCurrentValue]" == "Y"}
GuidoLabel warning {
-label DATA_SOURCE_ALERT_FORM20511
}
}
}
