GuidoScript scripts/geologyutilities.tcl
proc getDatabaseHandle {} {
set buffer [GuidoExecServer LegacyGetCurrentDatabaseHandle [subst {sessionType = "GeologyDatabase"}]]
return [GuidoGetParamBufferValue $buffer DatabaseHandle]
}
proc updateFieldList { table cfield wfield} {
upvar $cfield composite_field
upvar $wfield weighting_field
if {[info exists composite_field]} {
$composite_field setTableHandle [$table getCurrentValue]
$composite_field updateBrowserList
}
if {[info exists weighting_field]} {
$weighting_field setTableHandle [$table getCurrentValue]
$weighting_field updateBrowserList
}
}
proc checkForStupidity {comp_min} {
set min_value [$comp_min getCurrentValue]
if {$min_value > 90} {
GuidoMessage warning DB_WARN_VERY_RISKY_MIN_COMP_LENGTH $min_value
} elseif {$min_value > 75} {
GuidoMessage warning DB_WARN_MORE_RISKY_MIN_COMP_LENGTH $min_value
} elseif {$min_value > 50} {
GuidoMessage warning DB_WARN_RISKY_MIN_COMP_LENGTH $min_value
}
}
GuidoForm frm12004 {
-default_buttons
-help_id 284
-label "Composite Downhole"
-layout BoxLayout Y_AXIS
-tip "12004_TIP_001"
GuidoPanel frm12004_43 {
-border etched true
-label "Define the string file to create"
-layout CentreLineLayout
GuidoFileBrowserField loc {
-display_length 26
-file_mask *.str
-format none
-label Location
-link rid
-max_length 252
-tip "12004_TIP_002"
-translate lower
-file_access write
}
GuidoField rid {
-display_length 16
-format double
-label "ID number"
-max_length 16
-null false
-tip "12004_TIP_002"
-translate upper
}
GuidoField istr {
-display_length 5
-format integer
-high_bound 32000
-label String
-low_bound 1
-max_length 5
-null false
-tip "12004_TIP_002"
-translate none
}
}
GuidoFiller frm12004_42 {
-height 1
}
GuidoPanel frm12004_44 {
-layout CentreLineLayout
GuidoField comp_len {
-display_length 5
-format double
-high_bound 999
-label "Composite length"
-low_bound 0
-max_length 5
-null false
-tip "12004_TIP_005"
-translate upper
}
GuidoComboBox composite_length_method {
-label "Determine composite length by"
-null false
-value_in "fixed length" "best fit"
-max_length 11
-display_length 12
-tip DB_COMPOSITE_LENGTH_METHOD_TIP
-format none
-exclusive true
-default "fixed length"
}
GuidoField comp_min {
-label "Minimum % of sample to be included"
-display_length 3
-format double
-high_bound 100
-low_bound 1
-max_length 3
-null false
-tip "12004_TIP_002"
-translate upper
-action valueChanged {[checkForStupidity $comp_min]}
}
GuidoLabel l5 {
-label "Define the zone selection method"
}
GuidoButtonGroupPanel selection {
-tip "12004_TIP_007"
-layout BoxLayout Y_AXIS
GuidoRadioButton frm12004_11 {
-caption "NO SELECTION"
-selected_value "NO SELECTION"
}
GuidoRadioButton frm12004_12 {
-caption "MULTIPLE ZONES"
-selected_value "MULTIPLE ZONES"
}
GuidoRadioButton frm12004_13 {
-caption "ZONE FROM TO"
-selected_value "ZONE FROM TO"
}
}
GuidoCheckBox dilution {
-default false
-label "Dilute negative samples"
-selected_value Y
-tip "00073_TIP_009"
-unselected_value N
}
set databaseHandle [getDatabaseHandle]
GuidoDatabaseTableBrowser table {
-format none
-null false
-display_length 18
-database_handle $databaseHandle
-table_types interval
-translate lower
-label "Table name"
-tip "DB_TABLE_NAME_TIP"
}
$table updateBrowserList
}
GuidoFiller frm12004_45 {
-height 1
}
GuidoPanel frm12004_52 {
-layout BoxLayout X_AXIS
GuidoScrollPane frm12004_29 {
-height 10
-next_focus weighting_fields
-label "Fields to be composited"
-border etched true
GuidoTable composite_fields {
-instances 1 1 20
-interactive true
GuidoTableFieldBrowser composite_field {
-validation {[validateTableFieldPair $table $composite_field]}
-database_handle $databaseHandle
-table_handle [$table getCurrentValue]
-field_types "optional,calculated"
-display_length 10
-format none
-label "Field Name"
-max_length 18
-tip "DB_FIELD_NAME_TIP"
-translate lower
}
}
}
$composite_field updateBrowserList
$table setActionCallback valueChanged {[updateFieldList $table composite_field weighting_field]}
GuidoFiller frm12004_53 {
-width 1
}
GuidoScrollPane frm12004_40 {
-label "Optional weighting fields"
-height 10
-border etched true
GuidoTable weighting_fields {
-instances 1 1 5
-interactive true
GuidoTableFieldBrowser weighting_field {
-validation {[validateTableFieldPair $table $weighting_field]}
-database_handle $databaseHandle
-table_handle [$table getCurrentValue]
-field_types "optional,calculated"
-display_length 10
-format none
-label "Field Name"
-max_length 18
-tip "DB_COMPOSITE_OPT_WGT_FLD_TIP"
-translate lower
}
$weighting_field updateBrowserList
GuidoField weighting_default {
-default 1
-display_length 4
-format none
-label Default
-max_length 10
-null false
-tip "DB_COMPOSITE_OPT_WGT_DEFAULT_TIP"
-translate none
}
GuidoField weighting_limit {
-display_length 4
-format double
-label "Include Limit"
-low_bound .0001
-max_length 10
-tip "12004_TIP_013"
-translate upper
}
}
}
GuidoFiller frm12004_53 {
-width 1
}
}
}
