GuidoScript scripts/geologyutilities.tcl
proc getDatabaseHandle {} {
set buffer [GuidoExecServer LegacyGetCurrentDatabaseHandle [subst {sessionType = "GeologyDatabase"}]]
return [GuidoGetParamBufferValue $buffer DatabaseHandle]
}
proc updateFieldList { table composite_field 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 frm12019 {
-default_buttons
-help_id 1066
-label "High Grade Report"
-layout CentreLineLayout
-tip "12019_TIP_001"
GuidoPanel p1 {
-layout CentreLineLayout
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
}
GuidoTabbedPane fieldspane {
GuidoPanel fields {
-label "Sample fields"
GuidoScrollPane frm12005_43 {
-height 8
-next_focus weighting_fields
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"
-display_length 15.2
-format none
-label "Field Name"
-max_length 18
-tip DB_FIELD_NAME_TIP
-translate lower
}
}
}
}
$composite_field updateBrowserList
GuidoPanel weightings {
-label "Weighting fields"
GuidoScrollPane frm12005_52 {
-height 8
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"
-display_length 10
-format none
-label "Field Name"
-max_length 18
-tip DB_WEIGHTING_FIELD_NAME_TIP
-translate none
}
$weighting_field updateBrowserList
GuidoField weighting_default {
-default 1
-display_length 5
-format none
-label Default
-max_length 10
-null false
-tip DB_WEIGHTING_FIELD_DEFAULT_TIP
-translate none
}
}
}
}
$table setActionCallback valueChanged {[updateFieldList $table $composite_field $weighting_field]}
}
GuidoFiller f1 {
-height 1
}
GuidoFiller f2 {
-height 1
}
GuidoField minimum_grade {
-display_length 4
-format double
-label "Minimum grade"
-max_length 10
-null false
-tip "Enter the minimum acceptable grade for the composite samples which are to be created."
-translate upper
}
GuidoField minwidth {
-display_length 4
-format double
-high_bound 999
-label "Minimum composite width"
-low_bound 0
-max_length 4
-null false
-tip "12019_TIP_004"
-translate upper
}
GuidoFiller filler_1 {
-height 0.5
}
GuidoFiller filler_1 {
-height 0.5
}
GuidoField dilution {
-display_length 4
-format double
-high_bound 9999
-label "Maximum internal dilution"
-low_bound 0
-max_length 4
-null false
-tip "12019_TIP_005"
-translate upper
}
GuidoField total_dilution {
-display_length 4
-format double
-high_bound 9999
-label "Maximum total internal dilution"
-low_bound 0
-max_length 4
-null true
-tip DB_COMPOSITE_BY_GRADE_TOTAL_DILUTION_TIP
-translate upper
}
GuidoCheckBox join_intervals {
-default false
-label "Join high grade composites"
-selected_value Y
-tip DB_COMPOSITE_JOIN_TIP
-unselected_value N
}
GuidoFiller filler_2 {
-height 0.5
}
GuidoFiller filler_2 {
-height 0.5
}
GuidoField external_cutoff {
-display_length 4
-format double
-high_bound 9999
-label "Minimum external dilution grade"
-low_bound 0
-max_length 4
-null true
-tip DB_COMPOSITE_BY_GRADE_EXTERNAL_GRADE
-translate upper
}
GuidoComboBox external_priority {
-default "above or below (above before below)"
-exclusive true
-label "External dilution priority"
-max_length 35
-display_length 18
-null false
-value_in "above only" "below only" "above or below (above before below)" "above or below (below before above)"
-tip DB_COMPOSITE_BY_GRADE_EXTERNAL_PRIORITY
}
GuidoFiller filler_3 {
-height 0.5
}
GuidoFiller filler_3 {
-height 0.5
}
GuidoField metre_percent {
-display_length 4
-format double
-high_bound 9999
-label "Minimum length weighted grade for thin composites"
-low_bound 0
-max_length 4
-null true
-tip DB_COMPOSITE_BY_GRADE_METRE_PERCENT
-translate upper
}
GuidoFiller filler_3 {
-height 0.5
}
GuidoFiller filler_3 {
-height 0.5
}
GuidoCheckBox use_true_thickness {
-default false
-label "Use true thickness"
-selected_value Y
-tip 00615_TIP_5
-unselected_value N
}
GuidoCheckBox break {
-default false
-label "Break on blank or negative master assay"
-selected_value Y
-tip "12019_TIP_008"
-unselected_value N
}
GuidoCheckBox dilute {
-default false
-label "Dilute blank or negative samples"
-selected_value Y
-tip "12019_TIP_009"
-unselected_value N
}
GuidoLabel l1 {
-label "Select by hole depth"
}
GuidoPanel p0 {
-layout BoxLayout X_AXIS
GuidoCheckBox seldepth {
-default false
-next_focus updepth
-selected_value Y
-tip DB_COMPOSITE_BY_GRADE_SELDEPTH_TIP
-unselected_value N
}
GuidoPanel depthPanel {
-layout BoxLayout X_AXIS
GuidoFiller frm12005_61 {
-width 1
}
GuidoLabel l2 {
-label Upper
}
GuidoFiller f0 {
-width 0.5
}
GuidoField updepth {
-default 0
-dependency {"[ $seldepth getCurrentValue]" == "Y"}
-display_length 5
-format double
-high_bound 9999999
-low_bound 0
-max_length 10
-next_focus lowdepth
-null false
-translate upper
-tip DB_COMPOSITE_BY_GRADE_UPPER_DEPTH_TIP
}
GuidoFiller frm12005_61 {
-width 1
}
GuidoLabel l3 {
-label Lower
}
GuidoFiller f0 {
-width 0.5
}
GuidoField lowdepth {
-default 100
-dependency {"[ $seldepth getCurrentValue]" == "Y"}
-display_length 5
-format double
-max_length 10
-null false
-translate upper
-tip DB_COMPOSITE_BY_GRADE_LOWER_DEPTH_TIP
}
GuidoFiller frm12005_61 {
-width 1
}
}
}
GuidoLabel l4 {
-label "Define the zone selection method"
}
GuidoButtonGroupPanel selection {
-layout BoxLayout X_AXIS
GuidoRadioButton frm12005_17 {
-caption "No Selection"
-selected_value "NO SELECTION"
-tip DB_COMPOSITE_BY_GRADE_SELECTION_TIP
}
GuidoRadioButton frm12005_18 {
-caption "Multiple Zones"
-selected_value "MULTIPLE ZONES"
-tip DB_COMPOSITE_BY_GRADE_SELECTION_TIP
}
GuidoRadioButton frm12005_19 {
-caption "Zone From To"
-selected_value "ZONE FROM TO"
-tip DB_COMPOSITE_BY_GRADE_SELECTION_TIP
}
}
GuidoFiller f3 {
-height 1
}
GuidoFiller f4 {
-height 1
}
GuidoLabel l5 {
-label "Define the report file to create"
-font_style bold
}
GuidoFiller f4 {
-height 1
}
GuidoFileBrowserField loc {
-display_length 26
-file_mask "*.not *.csv *.htm *.html *.rtf *.pdf *.ps"
-format none
-label "REPORT_FILE_NAME"
-max_length 252
-null false
-extension false
-tip "REPORT_FILE_NAME_TIP"
-translate lower
-file_access write
}
GuidoComboBox reportformat {
-label "Format"
-display_length 23.5
-null false
-tip "The file format nominated here will be the output report format."
-value_in ".not - Surpac Note File" ".csv - Comma Separated (Spreadsheet)" ".htm - Hypertext Markup Language (Web)" ".html - Hypertext Markup Language (Web)" ".rtf - Rich Text Format (Microsoft Word)" ".pdf - Adobe Acrobat" ".ps - Postscript"
}
}
