package require java
proc third_axis_change { axis} {
global Plunge_pitch_lbl
global DipLB
if { [string compare $axis "Z"] != 0} {
$Plunge_pitch_lbl setLabel "Plunge"
$DipLB setLabel "Dip"
} else {
$Plunge_pitch_lbl setLabel "Dip"
$DipLB setLabel "Pitch"
}
}
proc graphicalEllipsoid { formHandle } {
global third_axis
global sec_axis
$formHandle hide
set visualiserForm [java::new com.surpac.gui.VisualiserForm 1]
$visualiserForm setSecAxis [$formHandle getField sec_axis]
$visualiserForm setThirdAxis [$formHandle getField third_axis]
$visualiserForm setFirstAxisRotation [$formHandle getField first_axis_rotation]
$visualiserForm setSectAxisRotation [$formHandle getField sec_axis_rotation]
$visualiserForm setThirdAxisRotation [$formHandle getField third_axis_rotation]
$visualiserForm setMajorSemi [$formHandle getField semimajfact]
$visualiserForm setMajorMinor [$formHandle getField minorfact]
$visualiserForm setMaxDistance [$formHandle getField majordist]
$visualiserForm setBearing [$formHandle getField "axis_1"]
$visualiserForm setPlunge [$formHandle getField "axis_2"]
$visualiserForm setDip [$formHandle getField "axis_3"]
$visualiserForm setRotationConvention [$formHandle getField rotationTypes]
$visualiserForm setSecAxisLabel [$formHandle getField Plunge_pitch_lbl]
$visualiserForm setThirdAxisLabel [$formHandle getField DipLB]
$visualiserForm interactFrame
if {[$visualiserForm getReturnStatus] == 1 } {
$formHandle setField semimajfact [$visualiserForm getMajorSemi]
$formHandle setField minorfact [$visualiserForm getMajorMinor]
$formHandle setField majordist [$visualiserForm getDist]
$formHandle setField axis_1 [$visualiserForm getBrg]
$formHandle setField axis_2 [$visualiserForm getPlunge]
$formHandle setField axis_3 [$visualiserForm getDip]
$formHandle setField sec_axis [$visualiserForm getSecAxis]
$formHandle setField third_axis [$visualiserForm getThirdAxis]
$formHandle setField first_axis_rotation [$visualiserForm getFirstAxisRotation]
$formHandle setField sec_axis_rotation [$visualiserForm getSecAxisRotation]
$formHandle setField third_axis_rotation [$visualiserForm getThirdAxisRotation]
$formHandle setField rotationTypes [$visualiserForm getRotationConvention]
third_axis_change "[$third_axis getCurrentValue]"
if {[$visualiserForm getRotationConvention] == "Other"} {
sec_axis_change "[$sec_axis getCurrentValue]"
}
}
$visualiserForm destroyFrame
$formHandle show
}
proc sec_axis_change {axis} {
global third_axis
global sec_axis
global rb3_x
global rb3_y
global rb3_z
if { [string compare $axis "X"] == 0} {
$rb3_x setInputAllowed false
$rb3_y setInputAllowed true
if { [string compare "[$third_axis getCurrentValue]" "X"] == 0} {
$third_axis setCurrentValue "Y"
}
} else {
$rb3_x setInputAllowed true
$rb3_y setInputAllowed false
if { [string compare "[$third_axis getCurrentValue]" "Y"] == 0} {
$third_axis setCurrentValue "X"
}
}
}
proc rotationConvention {} {
global rotationTypes
global sec_axis
global third_axis
global first_axis_rotation
global sec_axis_rotation
global third_axis_rotation
global rb_z
global rb2_x
global rb2_y
global rb3_x
global rb3_y
global rb3_z
global first_rot_L
global first_rot_R
global sec_rot_L
global sec_rot_R
global third_rot_L
global third_rot_R
global tilt
global Plunge_pitch_lbl
global DipLB
set rotConvet [$rotationTypes getCurrentValue]
set zposition [string first "Z" $rotConvet]
if {$zposition == -1} {
set rotConvet "Surpac ZXY LRL"
set zposition [string first "Z" $rotConvet]
$rb_z  setInputAllowed true
$rb2_x setInputAllowed true
$rb2_y setInputAllowed true
$rb3_y setInputAllowed true
$rb3_z setInputAllowed true
$first_rot_L setInputAllowed true
$first_rot_R setInputAllowed true
$sec_rot_L setInputAllowed true
$sec_rot_R setInputAllowed true
$third_rot_L setInputAllowed true
$third_rot_R setInputAllowed true
} else {
$rb_z  setInputAllowed false
$rb2_x setInputAllowed false
$rb2_y setInputAllowed false
$rb3_x setInputAllowed false
$rb3_y setInputAllowed false
$rb3_z setInputAllowed false
$first_rot_L setInputAllowed false
$first_rot_R setInputAllowed false
$sec_rot_L setInputAllowed false
$sec_rot_R setInputAllowed false
$third_rot_L setInputAllowed false
$third_rot_R setInputAllowed false
}
set num [expr $zposition + 1]
if {[string compare [string index $rotConvet $num] "X"] == 0} {
$sec_axis setCurrentValue "X"
} else {
$sec_axis setCurrentValue "Y"
}
set num [expr $num + 1]
if {[string compare [string index $rotConvet $num] "X"] == 0} {
$third_axis setCurrentValue "X"
$Plunge_pitch_lbl setLabel "Plunge"
$DipLB setLabel "Dip"
} elseif {[string compare [string index $rotConvet $num] "Y"] == 0} {
$third_axis setCurrentValue "Y"
$Plunge_pitch_lbl setLabel "Plunge"
$DipLB setLabel "Dip"
} else {
$third_axis setCurrentValue "Z"
$Plunge_pitch_lbl setLabel "Dip"
$DipLB setLabel "Pitch"
}
set num [expr $num + 2]
if {[string compare [string index $rotConvet $num] "L"] == 0} {
$first_axis_rotation setCurrentValue "L"
} else {
$first_axis_rotation setCurrentValue "R"
}
set num [expr $num + 1]
if {[string compare [string index $rotConvet $num] "L"] == 0} {
$sec_axis_rotation setCurrentValue "L"
} else {
$sec_axis_rotation setCurrentValue "R"
}
set num [expr $num + 1]
if {[string compare [string index $rotConvet $num] "L"] == 0} {
$third_axis_rotation setCurrentValue "L"
} else {
$third_axis_rotation setCurrentValue "R"
}
}
GuidoForm frm20080 {
-default_buttons
-label "Search Parameters"
-layout BoxLayout Y_AXIS
-tip "20080_TIP_001"
GuidoPanel frm20080_17 {
-layout BoxLayout X_AXIS
-tip "00141_TIP_017"
GuidoLabel search_label {
-label "Search type"
-height 1
}
GuidoFiller filler_width1 {
-width 1
}
GuidoButtonGroupPanel search {
GuidoRadioButton frm20080_15 {
-caption Ellipsoid
-default true
-selected_value ELLIPSOID
}
GuidoRadioButton frm20080_16 {
-caption Octant
-selected_value OCTANT
}
}
}
GuidoPanel frm20080_26 {
-layout CentreLineLayout
GuidoFiller frm20080_20 {
-height 1
}
GuidoFiller frm20080_21 {
-height 1
}
GuidoField minsamples {
-default 3
-display_length 4
-format short
-high_bound 50
-label "Minimum number of samples to select"
-low_bound 1
-max_length 2
-null false
-tip "20253_TIP_003"
-translate upper
}
GuidoField maxsamples {
-default 15
-display_length 4
-format short
-label "Maximum number of samples to select"
-low_bound 1
-max_length 4
-null false
-tip "The nearest n samples will be used to create the estimate."
-translate upper
}
GuidoFiller frm20080_22 {
-height 1
}
GuidoFiller frm20080_23 {
-height 1
}
GuidoField majordist {
-display_length 10
-format double
-label "Maximum search radius"
-max_length 16
-null false
-tip "20080_TIP_005"
-translate upper
}
GuidoField vertdist {
-default 9999
-display_length 10
-format double
-label "Maximum vertical search distance"
-max_length 16
-null false
-tip "20253_TIP_006"
-translate upper
}
GuidoFiller frm20080_24 {
-height 1
}
GuidoFiller frm20080_25 {
-height 1
}
GuidoCheckBox const_by_id {
-default false
-label "Constrain by drill hole?"
-selected_value Y
-tip "Limit the number of sample points that can be selected from each drill hole?"
-unselected_value N
}
GuidoComboBox desc_field {
-default d2
-dependency {"[ $const_by_id getCurrentValue]" == "Y"}
-display_length 5
-exclusive false
-format none
-label "Desc field"
-max_length 32
-null false
-tip "The description field that defines which drill hole a sample belongs to."
-value_in d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20
}
GuidoField max_samp_per_id {
-default 15
-dependency {"[ $const_by_id getCurrentValue]" == "Y"}
-display_length 10
-format short
-label "Maximum number of samples per drill hole"
-max_length 16
-null false
-tip "The maximum number of samples per drill hole that can be used in the estimation."
-translate upper
}
GuidoFiller frm20080_26 {
-height 1
}
GuidoFiller frm20080_27 {
-height 1
}
}
GuidoPanel bottom_panel {
-layout BoxLayout Y_AXIS
GuidoPanel max_no_smaples_panel {
-dependency {"[ $search getCurrentValue]" == "OCTANT"}
-layout CentreLineLayout
GuidoField adjoct {
-dependency {"[ $search getCurrentValue]" == "OCTANT"}
-display_length 4
-format short
-label "Maximum number of adjacent octants with no samples"
-max_length 2
-null false
-tip "00141_TIP_018"
-translate upper
}
}
GuidoPanel ellipsoid_panel {
-layout OverlayLayout
GuidoPanel frm20081_25 {
-dependency {1}
-border etched true
-label "Search Ellipsoid Specifications"
-layout BoxLayout Y_AXIS
GuidoPanel frm20081_25a {
-layout BoxLayout X_AXIS
GuidoPanel frm20081_20 {
-border etched true
-label "Ellipsoid Orientation"
-layout CentreLineLayout
GuidoField axis_1 {
-display_length 6
-format double
-label "Bearing"
-high_bound 360.000000
-low_bound 0.000000
-max_length 6
-null false
-tip ANISOTROPY_RATIO_TOOLTIP
-default 0
}
GuidoLabel Plunge_pitch_lbl {
-label "Plunge"
}
GuidoField axis_2 {
-display_length 6
-format double
-high_bound 90.000000
-low_bound -90.000000
-max_length 6
-null false
-tip ANISOTROPY_RATIO_TOOLTIP
-default 0
}
GuidoLabel DipLB {
-label "Dip"
}
GuidoField axis_3 {
-display_length 6
-format double
-high_bound 90.000000
-low_bound -90.000000
-max_length 6
-next_focus semimajfact
-null false
-tip ANISOTROPY_RATIO_TOOLTIP
-default 0
}
}
GuidoPanel ANISOTROPY_panel {
-border etched true
-label "Anisotropy Ratios"
-layout CentreLineLayout
GuidoField semimajfact {
-default 1
-display_length 5
-format double
-label "major / semi-major"
-max_length 5
-next_focus minorfact
-null false
-tip ANISOTROPY_RATIO_TOOLTIP
-translate upper
}
GuidoField minorfact {
-default 1
-display_length 5
-format double
-label "major / minor"
-max_length 5
-null false
-tip ANISOTROPY_RATIO_TOOLTIP
-translate upper
-next_focus visualiser
}
GuidoFiller f0 {
-height 1
}
GuidoFiller f1 {
-height 1
}
}
}
GuidoFiller f2 {
-height 1
}
GuidoPanel axisRotationtypes {
-layout BoxLayout Y_AXIS
GuidoPanel p0 {
-layout CentreLineLayout
GuidoComboBox rotationTypes {
-format none
-label "Rotation Convention"
-null false
-value_in  "Surpac ZXY LRL" "Geology ZYZ LLL" "DataMine ZXY LLL" "Gemcom 1 ZXZ RRR" "Gemcom 2 ZYZ RRR" "GSLIB ZXY LRR"  "MapTek ZXY LRL"  "Medsystems ZXY LRL" "Other"
-action valueChanged  {[rotationConvention ]}
-help  ROTATION_CONV_TIP
}
}
GuidoPanel axis {
-layout BoxLayout X_AXIS
GuidoPanel first_axis_with_rotation {
-border etched true
-layout BoxLayout Y_AXIS
GuidoButtonGroupPanel first_axis {
-layout BoxLayout X_AXIS
-tip "Bearing"
GuidoRadioButton rb_z {
-caption Z
-selected_value Z
-default true
-input false
-help ELLIP_1ST_AXIS_TIP
}
}
GuidoButtonGroupPanel first_axis_rotation {
-layout BoxLayout X_AXIS
GuidoRadioButton first_rot_L {
-caption "L"
-selected_value "L"
-default true
-input false
-help ELLIP_1ST_AXIS_LEFT_ROT_TOOLTIP
}
GuidoRadioButton first_rot_R {
-caption "R"
-selected_value "R"
-input false
-help ELLIP_1ST_AXIS_RIGHT_ROT_TOOLTIP
}
}
}
GuidoFiller spacer {
-width 0.05
}
GuidoPanel sec_axis_with_rotation {
-border etched true
-layout BoxLayout Y_AXIS
GuidoButtonGroupPanel sec_axis {
-layout BoxLayout X_AXIS
-tip "Second axis"
GuidoRadioButton rb2_x {
-caption "X"
-selected_value "X"
-default true
-action mouseClicked {[sec_axis_change "X"]}
-input false
-help ELLIP_2ND_X_AXIS_TIP
}
GuidoRadioButton rb2_y {
-caption Y
-selected_value "Y"
-action mouseClicked {[sec_axis_change "Y"]}
-input false
-help ELLIP_2ND_Y_AXIS_TIP
}
}
GuidoButtonGroupPanel sec_axis_rotation {
-layout BoxLayout X_AXIS
GuidoRadioButton sec_rot_L {
-caption "L"
-selected_value "L"
-input false
-help ELLIP_2ND_AXIS_LEFT_ROT_TOOLTIP
}
GuidoRadioButton sec_rot_R {
-caption "R"
-selected_value "R"
-default true
-input false
-help ELLIP_2ND_AXIS_RIGHT_ROT_TOOLTIP
}
}
}
GuidoFiller spacer {
-width 0.05
}
GuidoPanel third_axis_with_rotation {
-border etched true
-layout BoxLayout Y_AXIS
GuidoButtonGroupPanel third_axis {
-layout BoxLayout X_AXIS
GuidoRadioButton rb3_x {
-caption "X"
-selected_value "X"
-input false
-action mouseClicked {[third_axis_change "X"]}
-input false
-help ELLIP_3RD_X_AXIS_TIP
}
GuidoRadioButton rb3_y {
-caption "Y"
-selected_value "Y"
-default true
-action mouseClicked {[third_axis_change "Y"]}
-input false
-help ELLIP_3RD_Y_AXIS_TIP
}
GuidoRadioButton rb3_z {
-caption "Z"
-selected_value "Z"
-action mouseClicked {[third_axis_change "Z"]}
-input false
-help ELLIP_3RD_Z_AXIS_TIP
}
}
GuidoButtonGroupPanel third_axis_rotation {
-layout BoxLayout X_AXIS
GuidoRadioButton third_rot_L {
-caption "L"
-selected_value "L"
-default true
-input false
-help ELLIP_3RD_AXIS_LEFT_ROT_TOOLTIP
}
GuidoRadioButton third_rot_R {
-caption "R"
-selected_value "R"
-input false
-help ELLIP_3RD_AXIS_RIGHT_ROT_TOOLTIP
}
}
}
}
}
}
GuidoPanel hidden_string_file_source_panel {
-dependency {0}
-layout CentreLineLayout
GuidoCheckBox string_file_source {
-default true
-selected_value true
-unselected_value false
}
}
}
$const_by_id setDependency {"[$string_file_source getCurrentValue]" == "true"}
}
GuidoPanel evPanel {
-layout BoxLayout Y_AXIS
GuidoFiller ev1_1 {
-height 0.2
}
GuidoPanel evPanel2 {
-layout FlowLayout
GuidoButton visualiser {
-caption "Ellipsoid Visualiser"
-action valueChanged {[graphicalEllipsoid $frm20080]}
-tip "A Visual Representation of the Search Ellipsoid"
}
}
GuidoFiller ev1_2 {
-height 0.2
}
}
}
