GuidoScript scripts/geologyutilities.tcl
proc getDatabaseHandle {} {
set buffer [GuidoExecServer LegacyGetCurrentDatabaseHandle [subst {sessionType = "GeologyDatabase"}]]
return [GuidoGetParamBufferValue $buffer DatabaseHandle]
}
set dbHandle [getDatabaseHandle]
proc updateTraceTableName {field table} {
global dbHandle
set current_field "[$field getCurrentValue]"
set current_table "[$table getCurrentValue]"
if {"$current_table" == ""} {
$field removeAllItems
$field setCurrentValue ""
return 0
} else {
$field setDatabaseHandle $dbHandle
$field setTableHandle "$current_table"
$field updateBrowserList
if {[$field findItemIndex "$current_field"] == -1} {
$field setCurrentValue ""
} else {
$field setCurrentValue "$current_field"
}
return 1
}
}
GuidoForm frm12016 {
-default_buttons
-label "Drill hole log report"
-help_id 1066
-tip 12016_TIP_0
GuidoPanel frm12016_01 {
-border etched true
-layout BoxLayout Y_AXIS
GuidoPanel frm12016_02 {
-border etched true
-label "Define the note file for the report"
-layout CentreLineLayout Vertical Left
GuidoFileBrowserField loc {
-display_length 22.5
-extension false
-file_access write
-file_mask reports|*.not
-format none
-label "File name"
-max_length 256
-null false
-tip 12016_TIP_1
-translate lower
}
GuidoFiller frm12016_03 {
-height 0.05
}
GuidoFiller frm12016_04 {
-height 0.05
}
GuidoComboBox report_format {
-display_length 20
-format none
-label Format
-max_length 40
-null false
-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" ".log - Surpac log file"
-tip "The file format nominated here will be the output report format."
}
}
GuidoFiller frm12016_05 {
-height 0.1
}
GuidoPanel frm12016_06 {
-border etched true
-label "Define optional collar fields"
-layout BoxLayout Y_AXIS
GuidoPanel frm12016_07 {
-layout CentreLineLayout Vertical Left
GuidoLabel frm12016_08 {
-label "Fields"
}
GuidoScrollPane frm12016_09 {
-height 4
GuidoTable collar_fields {
-instances 1 1 20
-interactive true
GuidoComboBox field {
-display_length 17
-format none
-no_mlt
-max_length 9
-tip 12016_TIP_7
}
}
}
}
GuidoFiller frm12016_10 {
-height 0.05
}
GuidoLabel frm12016_11 {
-label "Hole_id, y, x, z, max_depth, azimuth and dip already included"
}
}
GuidoFiller frm12016_12 {
-height 0.1
}
GuidoPanel frm12016_13 {
-layout CentreLineLayout Vertical Left
-border etched true
-label "Define the samples table and fields"
GuidoDatabaseTableBrowser samp_table {
-display_length 21.5
-label "Table"
-format String
-database_handle $dbHandle
-table_types "interval"
-exclusive true
-tip 12016_TIP_3
-action valueChanged {[updateTableName $samp_field $samp_table]}
}
$samp_table updateBrowserList
GuidoFiller frm12016_14 {
-height 0.05
}
GuidoFiller frm12016_15 {
-height 0.05
}
GuidoLabel frm12016_16 {
-label "Fields"
}
GuidoScrollPane scroller {
-height 4
-width 24
GuidoTable stable {
-instances 1 1 20
-interactive true "insert|remove|add"
GuidoTableFieldBrowser samp_field {
-display_length 17.2
-format string
-exclusive true
-database_handle $dbHandle
-table_handle [$samp_table getCurrentValue]
-null false
-dependency {"[updateTraceTableName $samp_field $samp_table]"}
-action focusGained {[updateTraceTableName $samp_field $samp_table]}
-validation {[validateTableFieldPair $samp_table $samp_field]}
-tip 12017_TIP_1
}
}
}
GuidoFiller frm12016_17 {
-height 0.05
}
GuidoFiller frm12016_18 {
-height 0.05
}
GuidoFiller frm12016_19 {
-height 0.05
}
GuidoPanel frm12016_20 {
-layout CentreLineLayout Vertical Left
GuidoCheckBox combine_samp {
-default false
-next_focus geo_table
-selected_value Y
-tip 12016_TIP_4
-unselected_value N
}
GuidoLabel frm12016_21 {
-label "Combine samples"
}
}
}
GuidoPanel frm12016_22 {
-layout CentreLineLayout Vertical Left
-border etched true
-label "Define the geology table and fields"
GuidoDatabaseTableBrowser geo_table {
-display_length 21.5
-label "Table"
-database_handle $dbHandle
-table_types "interval"
-exclusive true
-format String
-tip 12016_TIP_5
-action valueChanged {[updateTableName $geo_field $geo_table]}
}
$geo_table updateBrowserList
GuidoFiller frm12016_23 {
-height 0.05
}
GuidoFiller frm12016_24 {
-height 0.05
}
GuidoLabel frm12016_25 {
-label "Fields"
}
GuidoScrollPane scroller {
-height 4
-width 24
GuidoTable gtable {
-instances 1 1 20
-interactive true "insert|remove|add"
GuidoTableFieldBrowser geo_field {
-display_length 17.2
-format string
-exclusive true
-database_handle $dbHandle
-table_handle [$geo_table getCurrentValue]
-null false
-dependency {"[updateTraceTableName $geo_field $geo_table]"}
-action focusGained {[updateTraceTableName $geo_field $geo_table]}
-validation {[validateTableFieldPair $geo_table $geo_field]}
-tip 12016_TIP_8
}
}
}
GuidoFiller frm12016_26 {
-height 0.05
}
GuidoFiller frm12016_27 {
-height 0.05
}
GuidoFiller frm12016_28 {
-height 0.05
}
GuidoPanel frm12016_29 {
-layout CentreLineLayout Vertical Left
GuidoCheckBox combine_geo {
-default false
-selected_value Y
-tip 12016_TIP_6
-unselected_value N
}
GuidoLabel frm12016_30 {
-label "Combine samples"
}
}
}
}
}
