proc init_type { class_att_name class_att_type type_label} {
set newvalue "[ $class_att_name getCurrentValue ]"
set buffer [ GuidoExecServer "GetAttributeData" [subst {attribute = "$newvalue"} ]]
set status [ GuidoGetParamBufferValue $buffer status ]
if {$status >= 0} {
set data_type [ GuidoGetParamBufferValue $buffer type ]
if {[string compare $data_type "integer"] == 0 ||
[string compare $data_type "double"] == 0 ||
[string compare $data_type "float"] == 0} {
$class_att_type setCurrentValue "(Numeric)"
$type_label setCurrentValue "(Numeric)"
} else {
$class_att_type setCurrentValue "(Character)"
$type_label setCurrentValue "(Character)"
}
}
$class_att_type setInputAllowed false
}
proc finish { form } {
if { [string compare [$form getStatus] "legacy preprocess apply"] ==  0 } {
global method
$form writeOutputField "method" [$method getCurrentValue]
global "forward"
$form writeOutputField "forward" [$forward getCurrentValue]
global "backward"
$form writeOutputField "backward" [$backward getCurrentValue]
global "confirm_line_ends"
$form writeOutputField "confirm_line_ends" [$confirm_line_ends getCurrentValue]
global "step_distance"
$form writeOutputField "step_distance" [$step_distance getCurrentValue]
global "value"
$form writeOutputField "value" [$value getCurrentValue]
global "view_limits"
$form writeOutputField "view_limits" [$view_limits getCurrentValue]
catch {
global "zoom_plane"
$form writeOutputField "zoom_plane" [$zoom_plane getCurrentValue]
global "display_planes"
$form writeOutputField "display_planes" [$display_planes getCurrentValue]
global "use_interactive"
$form writeOutputField "use_interactive" [$use_interactive getCurrentValue]
}
catch {
global "interval_range"
$form writeOutputField "interval_range" [$interval_range getCurrentValue]
}
catch {
global "plane_thickness"
$form writeOutputField "plane_thickness" [$plane_thickness getCurrentValue]
global "colour_method"
$form writeOutputField "colour_method" [$colour_method getCurrentValue]
global "trace_colour"
$form writeOutputField "trace_colour" [$trace_colour getCurrentValue]
}
catch {
global "sectionBlockModel"
$form writeOutputField "sectionBlockModel" [$sectionBlockModel getCurrentValue]
global "block_layer"
$form writeOutputField "block_layer" [$block_layer getCurrentValue]
global "tolerance"
$form writeOutputField "tolerance" [$tolerance getCurrentValue]
global "colour_fill_bm_sections"
$form writeOutputField "colour_fill_bm_sections" [$colour_fill_bm_sections getCurrentValue]
}
catch {
global "section_objects"
$form writeOutputField "section_objects" [$section_objects getCurrentValue]
global "object_range"
$form writeOutputField "object_range" [$object_range getCurrentValue]
global "object_layer"
$form writeOutputField "object_layer" [$object_layer getCurrentValue]
}
$form finishedWritingFields
}
}
proc initialize { form } {
global method
$method setCurrentValue [$form readInputField "method"]
global "forward"
$forward setCurrentValue [$form readInputField "forward"]
global "backward"
$backward setCurrentValue [$form readInputField "backward"]
global "confirm_line_ends"
$confirm_line_ends setCurrentValue [$form readInputField "confirm_line_ends"]
global "step_distance"
$step_distance setCurrentValue [$form readInputField "step_distance"]
global "value"
$value setCurrentValue [$form readInputField "value"]
global "view_limits"
$view_limits setCurrentValue [$form readInputField "view_limits"]
catch {
global "zoom_plane"
$zoom_plane setCurrentValue [$form readInputField "zoom_plane"]
global "display_planes"
$display_planes setCurrentValue [$form readInputField "display_planes"]
global "use_interactive"
$use_interactive setCurrentValue [$form readInputField "use_interactive"]
}
catch {
global "interval_range"
$interval_range setCurrentValue [$form readInputField "interval_range"]
update_Value_Format $method $interval_range $value
}
catch {
global "plane_thickness"
$plane_thickness setCurrentValue [$form readInputField "plane_thickness"]
global "colour_method"
$colour_method setCurrentValue [$form readInputField "colour_method"]
global "trace_colour"
$trace_colour setCurrentValue [$form readInputField "trace_colour"]
}
catch {
global "sectionBlockModel"
$sectionBlockModel setCurrentValue [$form readInputField "sectionBlockModel"]
global "block_layer"
$block_layer setCurrentValue [$form readInputField "block_layer"]
global "tolerance"
$tolerance setCurrentValue [$form readInputField "tolerance"]
global "colour_fill_bm_sections"
$colour_fill_bm_sections setCurrentValue [$form readInputField "colour_fill_bm_sections"]
}
catch {
global "section_objects"
$section_objects setCurrentValue [$form readInputField "section_objects"]
global "object_range"
$object_range setCurrentValue [$form readInputField "object_range"]
global "object_layer"
$object_layer setCurrentValue [$form readInputField "object_layer"]
}
}
proc value_Dependency {method_var interval_range_var value_var} {
if { "[$interval_range_var getCurrentValue]" == "range" ||
"[$method_var getCurrentValue]" == "Northing" ||
"[$method_var getCurrentValue]" == "Easting" ||
"[$method_var getCurrentValue]" == "Elevation" } {
return 1
} else {
$value_var setCurrentValue 0
return 0
}
}
proc update_Value_Format {method_var interval_range_var value_var} {
if { "[$interval_range_var getCurrentValue]" == "interval" &&
("[$method_var getCurrentValue]" == "Northing" ||
"[$method_var getCurrentValue]" == "Easting" ||
"[$method_var getCurrentValue]" == "Elevation") } {
$value_var setFormat double
} else {
$value_var setFormat range
}
}
GuidoForm form {
-default_buttons
-label "Section Definition Method"
-tip SECTION_DEF_METHOD_TIP
-layout BoxLayout Y_AXIS
-action initial {[initialize $form]}
-action stateChanged {[ finish $form ]}
-next_focus zoomPanel
GuidoPanel zoomPanel {
-layout CentreLineLayout
GuidoCheckBox zoom_plane {
-default Y
-label "Zoom to section plane to show all drillholes?"
-selected_value Y
-unselected_value N
-tip SECTION_ZOOM_PLANE_TIP
-next_focus display_planes
}
GuidoCheckBox display_planes {
-default Y
-label "Show section planes?"
-selected_value Y
-unselected_value N
-next_focus use_interactive
}
GuidoCheckBox use_interactive {
-label "Interactive Method?"
-selected_value Y
-unselected_value N
-next_focus forward
}
}
GuidoTabbedPane tabPane {
-width 40
GuidoPanel panel {
-label "Section Method"
-layout CentreLineLayout
GuidoComboBox method {
-label "Section definition method"
-action valueChanged {[update_Value_Format $method $interval_range $value]}
-display_length 16
-exclusive true
-max_length 32
-value_in "Graphically select section line" Northing Easting Elevation
-tip SECTION_DEF_METHOD_TIP2
-null false
-next_focus forward
}
GuidoField forward {
-label "Distance forward of plane"
-display_length 5
-format double
-max_length 8
-null false
-tip SECTION_DEF_SLICING_PLANE_TIP
-default 1.0
-action focusLost {[
if {"[string length [$step_distance getCurrentValue]]" == 0} {
$step_distance setCurrentValue [$forward getCurrentValue]
}
]}
}
GuidoField backward {
-label "Distance backward of plane"
-display_length 5
-format double
-max_length 8
-null false
-tip SECTION_DEF_SLICING_PLANE_TIP
-default 1.0
-action focusLost {[
if {"[string length [$step_distance getCurrentValue]]" == 0} {
$step_distance setCurrentValue [$forward getCurrentValue]
}
]}
}
GuidoButtonGroupPanel interval_range {
-label "Section by"
-layout BoxLayout X_AXIS
-default "interval"
-action valueChanged {[update_Value_Format $method $interval_range $value]}
GuidoRadioButton interval {
-caption Interval
-selected_value "interval"
}
GuidoRadioButton range {
-caption Range
-selected_value "range"
}
}
GuidoField step_distance {
-dependency {"[$interval_range getCurrentValue]" == "interval"}
-label "Step distance"
-display_length 5
-format double
-max_length 8
-tip SECTION_DEF_STEP_DISTANCE_TIP
-default 1.0
}
GuidoPanel overlay {
-layout OverlayLayout
GuidoPanel northingpanel {
-layout OverlayLayout
-dependency {"[$method getCurrentValue]" == "Northing"}
GuidoPanel northingpanela {
-layout FlowLayout Right
-dependency {"[$interval_range getCurrentValue]" == "interval" && "[$method getCurrentValue]" == "Northing"}
GuidoLabel label1 {
-default "Northing"
}
}
GuidoPanel northingpanelb {
-layout FlowLayout Right
-dependency {"[$interval_range getCurrentValue]" == "range" && "[$method getCurrentValue]" == "Northing"}
GuidoLabel label1b {
-default "Northing range"
}
}
}
GuidoPanel eastingpanel {
-layout OverlayLayout
-dependency {"[$method getCurrentValue]" == "Easting"}
GuidoPanel eastingpanela {
-layout FlowLayout Right
-dependency {"[$interval_range getCurrentValue]" == "interval" && "[$method getCurrentValue]" == "Easting"}
GuidoLabel label2 {
-default "Easting"
}
}
GuidoPanel eastingpanelb {
-layout FlowLayout Right
-dependency {"[$interval_range getCurrentValue]" == "range" && "[$method getCurrentValue]" == "Easting"}
GuidoLabel label2b {
-default "Easting range"
}
}
}
GuidoPanel elevationpanel {
-layout OverlayLayout
-dependency {"[$method getCurrentValue]" == "Elevation"}
GuidoPanel elevationpanela {
-layout FlowLayout Right
-dependency {"[$interval_range getCurrentValue]" == "interval" && "[$method getCurrentValue]" == "Elevation"}
GuidoLabel label3 {
-default "Elevation"
}
}
GuidoPanel elevationpanelb {
-layout FlowLayout Right
-dependency {"[$interval_range getCurrentValue]" == "range" && "[$method getCurrentValue]" == "Elevation"}
GuidoLabel label3b {
-default "Elevation range"
}
}
}
GuidoPanel confirm_line_endspanel {
-layout BoxLayout Y_AXIS
-dependency {"[$method getCurrentValue]" == "Graphically select section line"}
GuidoPanel confirm_line_endspanela {
-layout FlowLayout Right
GuidoLabel label4 {
-dependency {"[$interval_range getCurrentValue]" == "range"}
-default "Section range"
}
}
GuidoLabel confirm_line_ends {
-default "Confirm selected endpoints"
}
}
GuidoPanel bestfitpanel {
-layout FlowLayout Right
-dependency {"[$method getCurrentValue]" == "Best fit to selected drillholes"}
GuidoLabel label5 {
-dependency {"[$interval_range getCurrentValue]" == "range"}
-default "Section range"
}
}
}
GuidoPanel overlay2 {
-layout BoxLayout Y_AXIS
GuidoPanel field_hider {
-layout CentreLineLayout Vertical
GuidoField value {
-dependency {[value_Dependency $method $interval_range $value]}
-display_length 15
-format range
-max_length 64
-null false
-tip SECTION_DEF_POSITION_TIP
-default 1.0
}
}
GuidoPanel field_hider2 {
-layout CentreLineLayout Vertical
-dependency {"[$method getCurrentValue]" == "Graphically select section line"}
GuidoCheckBox confirm_line_ends {
-default N
-selected_value Y
-unselected_value N
-tip SECTION_DEF_CONFIRM_TIP
}
}
}
GuidoCheckBox view_limits {
-label "Confirm section details"
-default N
-selected_value Y
-unselected_value N
-tip VIEW_LIMITS_TIP
}
}
set buffer [GuidoExecServer LegacyGetCurrentDatabaseHandle [subst {sessionType = "GeologyDatabase"}]]
set status [ GuidoGetParamBufferValue $buffer status ]
if {$status >= 0} {
set databaseHandle [ GuidoGetParamBufferValue $buffer DatabaseHandle ]
if {$databaseHandle != 0} {
$method addItem "Best fit to selected drillholes"
GuidoPanel DatabasePanel {
-layout OverlayLayout
-label "Off Section Holes"
GuidoPanel textPanel {
-dependency {"[$use_interactive getCurrentValue]" == "Y"}
GuidoLabel text {
-font_highlight 0 0 255
-label "No off section styles available in interactive mode"
}
}
GuidoPanel mainPanel {
-dependency {"[$use_interactive getCurrentValue]" == "N"}
-layout BoxLayout Y_AXIS
GuidoPanel plane_thickness_panel {
-layout CentreLineLayout
GuidoField plane_thickness {
-label "Extra thickness for offsection holes"
-display_length 5
-format double
-max_length 8
-tip SECTION_DEF_THICKNESS_TIP
-default 1.0
}
}
GuidoPanel DatabaseDependencyPanel1 {
-layout BoxLayout Y_AXIS
GuidoFiller infofiller {
-height 0.5
}
GuidoLabel infolabel1 {
-label DB_GEOLOGY_SECTION_MSG1
}
GuidoLabel infolabel2 {
-label DB_GEOLOGY_SECTION_MSG2
}
}
GuidoFiller infofiller {
-height 0.5
}
GuidoPanel styles {
-label "Off Section Drillhole Style"
-layout BoxLayout Y_AXIS
-border etched true
GuidoPanel panel {
-layout CentreLineLayout
GuidoComboBox colour_method {
-label "Colouring method"
-max_length 20
-value_in "Default colour" "Fade" "No change"
-null false
-default "No change"
-tip DB_OFFSECTION_FADE_TIP
}
GuidoPanel panel1 {
-layout CentreLineLayout
-dependency {"[ $colour_method getCurrentValue]" == "Default colour"}
GuidoLabel trace_colour_label {
-label "Default colour"
-dependency {"[ $colour_method getCurrentValue]" == "Default colour"}
}
}
GuidoPanel panel2 {
-layout CentreLineLayout
-dependency {"[ $colour_method getCurrentValue]" == "Default colour"}
GuidoColourBrowserField trace_colour {
-dependency {"[ $colour_method getCurrentValue]" == "Default colour"}
-display_length 16
-max_length 32
-exclusive false
-default red
-tip DB_OFFSECTION_COLOUR_TIP
}
}
}
}
}
}
}
}
set bmParam [GuidoExecServer IsBlockModelLoaded {}]
set bmLoaded [GuidoGetParamBufferValue $bmParam "BlockModelLoaded"]
if {$bmLoaded} {
GuidoPanel blockModelPanel {
-label "Section Block Model"
-layout BoxLayout Y_AXIS
GuidoPanel sectionBlockModelDependencyPanel1 {
-layout CentreLineLayout
GuidoCheckBox sectionBlockModel {
-default N
-label "Section Block Model"
-selected_value Y
-unselected_value N
-tip SECTION_DEF_BM_TIP
}
}
GuidoPanel sectionBlockModelDependencyPanel2 {
-dependency {"[ $sectionBlockModel getCurrentValue]" == "Y"}
-layout CentreLineLayout
GuidoField block_layer {
-dependency {"[$use_interactive getCurrentValue]" == "N"}
-default "block model sections"
-display_length 26
-format none
-label "Slice Layer"
-max_length 32
-tip SECTION_DEF_BM_LAYER_TIP
-translate none
-dependency {"[ $sectionBlockModel getCurrentValue]" == "Y"}
}
GuidoField tolerance {
-default 0
-display_length 14
-font_style bold
-format none
-label Shrinkage
-max_length 26
-tip SECTION_DEF_BM_SHRINKAGE_TIP
-dependency {"[ $sectionBlockModel getCurrentValue]" == "Y"}
}
GuidoCheckBox colour_fill_bm_sections {
-default N
-label "Colour fill block sections"
-selected_value Y
-unselected_value N
-tip SECTION_DEF_BM_COLOURFILL_TIP
}
}
GuidoPanel bmSectionDep {
-layout BoxLayout Y_AXIS
-dependency {"[$use_interactive getCurrentValue]" == "Y"}
GuidoFiller space {
-height 0.2
}
GuidoLabel text {
-font_highlight 0 0 255
-label "Block model sectioning in interactive mode only affects autoplotted sections"
}
GuidoFiller space {
-height 0.2
}
}
}
}
set objParam [GuidoExecServer GetNumTriobjects {}]
set numObj [GuidoGetParamBufferValue $objParam "NumTriobjects"]
if {$numObj > 0} {
GuidoPanel sectionObjectPanel {
-layout BoxLayout Y_AXIS
-label "Section Objects"
GuidoPanel sectionObjectDependencyPanel1 {
-layout CentreLineLayout
GuidoCheckBox section_objects {
-label "Section Objects"
-selected_value Y
-unselected_value N
-tip SECTION_DEF_OBJ_TIP
}
}
GuidoPanel sectionObjectDependencyPanel2 {
-dependency {"[ $section_objects getCurrentValue]" == "Y"}
-layout CentreLineLayout
GuidoField object_range {
-display_length 26
-format range
-label "Object Range"
-max_length 32
-translate none
-dependency {"[ $section_objects getCurrentValue]" == "Y"}
-tip SECTION_DEF_OBJ_RANGE_TIP
}
GuidoField object_layer {
-default "object sections"
-display_length 26
-format none
-label "Slice Layer"
-max_length 32
-tip SECTION_DEF_OBJ_LAYER_TIP
-translate none
-dependency {"[$use_interactive getCurrentValue]" == "N"}
-dependency {"[ $section_objects getCurrentValue]" == "Y"}
}
}
GuidoPanel bmSectionDep {
-layout BoxLayout Y_AXIS
-dependency {"[$use_interactive getCurrentValue]" == "Y"}
GuidoFiller space {
-height 0.2
}
GuidoLabel text {
-font_highlight 0 0 255
-label "Object sectioning in interactive mode only affects autoplotted sections"
}
GuidoFiller space {
-height 0.2
}
}
}
}
}
$form legacyProcessValues false
}
