GuidoScript scripts/geologyutilities.tcl
proc getDatabaseHandle {} {
set buffer [GuidoExecServer LegacyGetCurrentDatabaseHandle [subst {sessionType = "GeologyDatabase"}]]
return [GuidoGetParamBufferValue $buffer DatabaseHandle]
}
proc updateGeoFieldList { table field } {
$field setTableHandle [$table getCurrentValue]
$field updateBrowserList
}
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
}
}
GuidoForm frm00044 {
-default_buttons
-help_id 142
-label "Composite by Geology"
-layout BoxLayout Y_AXIS
-tip DB_COMPOSITE_BY_GEOLOGY_TIP
GuidoPanel frm00044_47 {
-border etched true
-label "Define the string file to create"
-layout CentreLineLayout
GuidoFileBrowserField loc {
-display_length 26
-file_mask *.str
-format none
-label Location
-null false
-link rid
-max_length 252
-tip DB_ONE_COMPOSITE_PER_HOLE_TIP
-translate lower
}
GuidoField rid {
-display_length 16
-format double
-label "ID number"
-max_length 16
-null false
-tip DB_ONE_COMPOSITE_PER_HOLE_TIP
-translate upper
}
GuidoField istr {
-display_length 5
-format integer
-high_bound 32000
-label String
-low_bound 1
-max_length 5
-null false
-tip DB_ONE_COMPOSITE_PER_HOLE_TIP
-translate none
}
GuidoField no_zone_str {
-display_length 5
-format integer
-high_bound 32000
-label "No zone string"
-low_bound 0
-max_length 5
-null false
-tip DB_NO_ZONE_STRING_TIP
-translate none
}
GuidoField no_samples_str {
-display_length 5
-format integer
-high_bound 32000
-label "No samples string"
-low_bound 0
-max_length 5
-null false
-tip DB_NO_SAMPLES_STRING_TIP
-translate none
}
}
GuidoFiller frm00044_46 {
-height 1
}
GuidoPanel frm00044_48 {
-layout CentreLineLayout
GuidoPanel frm00044_14 {
-label "Define the zone selection method"
-layout BoxLayout X_AXIS
-tip DB_ZONE_SELECTION_TIP
GuidoButtonGroupPanel selection {
GuidoRadioButton frm00044_12 {
-caption "MULTIPLE ZONES"
-selected_value "MULTIPLE ZONES"
}
GuidoRadioButton frm00044_13 {
-caption "ZONE FROM TO"
-selected_value "ZONE FROM TO"
}
}
}
GuidoCheckBox dilute {
-default false
-label "Dilute blank or negative samples"
-selected_value Y
-tip DB_NEGATIVE_SAMPLE_TIP
-unselected_value N
}
GuidoPanel frm00044_21 {
-label "Sample co-ordinate point"
-layout BoxLayout X_AXIS
-tip DB_SAMPLE_COORDINATE_TIP
GuidoButtonGroupPanel outchoice {
GuidoRadioButton frm00044_17 {
-caption bottom
-selected_value bottom
}
GuidoRadioButton frm00044_18 {
-caption middle
-selected_value middle
}
GuidoRadioButton frm00044_19 {
-caption segment
-selected_value segment
}
GuidoRadioButton frm00044_20 {
-caption top
-selected_value top
}
}
}
set databaseHandle [getDatabaseHandle]
GuidoDatabaseTableBrowser table {
-null false
-format none
-database_handle $databaseHandle
-table_types interval
-translate lower
-label "Table name"
-tip DB_TABLE_NAME_TIP
}
$table updateBrowserList
}
GuidoFiller frm00044_49 {
-height 1
}
GuidoPanel frm00044_56 {
-layout BoxLayout X_AXIS
GuidoScrollPane frm00044_35 {
-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 frm00044_57 {
-width 1
}
GuidoScrollPane frm00044_44 {
-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_WEIGHTING_FIELD_NAME_TIP
-translate lower
}
$weighting_field updateBrowserList
GuidoField weighting_default {
-default 1
-display_length 10
-format none
-label Default
-max_length 10
-null false
-tip DB_WEIGHTING_FIELD_DEFAULT_TIP
-translate none
}
}
}
GuidoFiller frm00044_57 {
-width 1
}
}
GuidoPanel geologyIntervalPanel {
-border etched true
-label "Define code for composite intervals"
-layout CentreLineLayout
GuidoComboBox write_codes {
-default ""
-exclusive true
-label "Write codes to"
-max_length 10
-null true
-value_in "database" "graphics"
-tip DB_WRITE_COMPOSITE_INTERVALS_TIP1
}
GuidoDatabaseTableBrowser geo_table {
-dependency {"[$write_codes getCurrentValue]" == "database"}
-display_length 12
-exclusive true
-label "Table name"
-database_handle $databaseHandle
-table_types "interval"
-null false
-translate lower
-tip DB_WRITE_COMPOSITE_INTERVALS_TIP
}
$geo_table updateBrowserList
GuidoTableFieldBrowser geo_field {
-validation {[validateTableFieldPair $geo_table $geo_field]}
-dependency {"[$write_codes getCurrentValue]" == "database"}
-display_length 12
-format none
-database_handle $databaseHandle
-table_handle [$geo_table getCurrentValue]
-field_types "optional"
-label "Field name"
-max_length 18
-null false
-tip DB_WRITE_COMPOSITE_INTERVALS_TIP
-translate lower
}
$geo_field updateBrowserList
$geo_table setActionCallback valueChanged {[updateGeoFieldList $geo_table $geo_field]}
GuidoField geo_code {
-label "Interval code"
-dependency {"[$write_codes getCurrentValue]" != ""}
-display_length 12
-format none
-max_length 32
-null false
-tip DB_WRITE_COMPOSITE_INTERVALS_TIP
-translate none
}
}
}
