GuidoScript scripts/dtmutilities.tcl
global vertical
global string_file_panel
global dtm_file_panel
global fault_loc
global object_id
global obj_name
global trisolation_id
global tri_name
global save_layer
global save_file
global surf_range
proc arewesavingtheresultsomewhere {} {
global save_layer
global save_file
set saving_file [$save_file getCurrentValue]
set saving_layer [$save_layer getCurrentValue]
if {$saving_file == "Y" || $saving_layer == "Y"} {
return true
} else {
GuidoMessage warning DTM_MUST_SAVE_SOMEWHERE
return false
}
}
proc overlaypanelcallback {file_name} {
global string_file_panel
global dtm_file_panel
global fault_loc
global oblique_button
global vertical_button
global surf_range
set range_value "[$surf_range getCurrentValue]"
set fileloc "[$file_name getCurrentValue]"
if {"$fileloc" != ""} {
if { [string match *.dtm [string tolower $fileloc]]} {
$string_file_panel setVisible false
$dtm_file_panel setVisible true
$oblique_button setCurrentValue "Y"
} else {
$dtm_file_panel setVisible false
$string_file_panel setVisible true
$vertical_button setCurrentValue "Y"
}
} else {
$string_file_panel setVisible false
$dtm_file_panel setVisible true
}
if {"$range_value" == ""} {
$surf_range setInputAllowed false
} else {
$surf_range setInputAllowed true
}
}
proc setFileMaskBasedOnFaultType {} {
global vertical
global fault_loc
global string_file_panel
global dtm_file_panel
set falut_type [ $vertical getCurrentValue]
set fileName [ $fault_loc getCurrentValue]
if { "$falut_type" == "OBLIQUE" } {
$fault_loc setFileMask "*.*"
$fault_loc setFileMask "*.dtm"
$string_file_panel setVisible false
$dtm_file_panel setVisible true
if { [string match *.str $fileName]} {
$fault_loc setCurrentValue ""
}
} else {
$fault_loc setFileMask "*.*"
$fault_loc setFileMask "*.str *.dtm"
}
}
GuidoForm frm20612 {
-action initial {[setFileMaskBasedOnFaultType]}
-action initial {[overlaypanelcallback $fault_loc]}
-default_buttons
-label "Apply fault to multiple surfaces"
-layout BoxLayout Y_AXIS
-tip "20612_TIP_001"
-action initial {[fill_triobject_trisolation_details $fault_loc $object_id $obj_name $trisolation_id $tri_name]}
-action final {[destroyTemporaryProcessedDTMSwa]}
GuidoPanel frm20612_31 {
-layout CentreLineLayout VERTICAL LEFT
GuidoPanel frm20612_29 {
-layout BoxLayout Y_AXIS
GuidoPanel frm20612_29 {
-layout BoxLayout Y_AXIS
-label Fault
-border etched true
GuidoPanel p13 {
-layout CentreLineLayout VERTICAL LEFT
GuidoButtonGroupPanel vertical {
-layout BoxLayout Y_AXIS
-label "Nominate the fault type"
GuidoRadioButton oblique_button {
-action mouseClicked {[setFileMaskBasedOnFaultType]}
-caption Oblique
-default true
-selected_value OBLIQUE
-tip oblique_button_tip
}
GuidoRadioButton vertical_button {
-action mouseClicked {[setFileMaskBasedOnFaultType]}
-caption Vertical
-selected_value VERTICAL
-next_focus fault_loc
-tip vertical_button_tip
}
}
}
GuidoPanel p12 {
-layout CentreLineLayout VERTICAL LEFT
GuidoFileBrowserField fault_loc {
-action valueChanged {[fill_triobject_trisolation_details $fault_loc $object_id $obj_name $trisolation_id $tri_name]}
-display_length 25
-extension true
-format none
-label Location
-max_length 252
-next_focus fault_id
-null false
-tip "20612_TIP_002"
-translate none
-action valueChanged {[overlaypanelcallback $fault_loc ]}
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoPanel overlay_panel {
-layout OverlayLayout
GuidoPanel string_file_panel {
-layout CentreLineLayout VERTICAL LEFT
GuidoField fault_strobj_id {
-default 1
-display_length 8
-format integer
-label String
-low_bound 1
-max_length 6
-next_focus fault_segtri_id
-null false
-tip "20612_TIP_004"
-translate none
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField fault_segtri_id {
-default 1
-display_length 8
-format integer
-label Segment
-low_bound 1
-max_length 6
-next_focus surf_loc
-null false
-translate none
}
}
GuidoPanel dtm_file_panel {
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel object2_label {
-label "Object ID"
}
GuidoPanel p6 {
-layout CentreLineLayout VERTICAL LEFT
GuidoPanel p7 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox object_id {
-display_length 4
-format none
-max_length 32
-translate none
-exclusive false
-next_focus trisolation_id
-tip "04949_TIP_1"
-action valueChanged {[fill_triobject_details $fault_loc $object_id $obj_name $trisolation_id $tri_name "false" "false"]}
}
GuidoFiller frm00245_23 {
-width 0.2
}
}
GuidoPanel p8 {
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel obj_name {
}
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel trisolation2 {
-label "Trisolation ID"
}
GuidoPanel p9 {
-layout CentreLineLayout VERTICAL LEFT
GuidoPanel p10 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox trisolation_id {
-display_length 4
-format none
-max_length 32
-translate none
-exclusive false
-next_focus usebdy
-tip "04949_TIP_2"
-action valueChanged {[fill_trisolation_details $fault_loc $object_id $trisolation_id $tri_name "true" "false"]}
}
GuidoFiller filler {
-width 0.2
}
}
GuidoPanel p11 {
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel tri_name {
}
}
}
}
}
}
GuidoPanel surpac_output_panel {
-layout BoxLayout Y_AXIS
GuidoPanel surpac_panel {
-border etched true
-label Surfaces
-layout CentreLineLayout VERTICAL LEFT
GuidoFileBrowserField surf_loc {
-action focusGained {[if {[$surf_range getCurrentValue] == ""} {$surf_range setInputAllowed false} else {$surf_range setInputAllowed true}]}
-display_length 21.8
-extension false
-file_mask *.str
-format none
-label "Surface location"
-link surf_range
-max_length 252
-next_focus surf_range
-null false
-tip "20612_TIP_005"
-translate none
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField surf_range {
-display_length 9.5
-format range
-label "ID Range"
-max_length 32
-null false
-tip "20612_TIP_005"
-translate none
-next_focus out_loc
}
GuidoFiller filler {
-height 0.3
}
}
}
}
GuidoPanel frm20612_35 {
-border etched true
-label "Define output parameters"
-layout CentreLineLayout VERTICAL LEFT
GuidoFileBrowserField out_loc {
-display_length 20
-label "Output layer name"
-extension false
-file_mask *.dtm
-format none
-max_length 256
-tip "20612_TIP_007"
-translate none
-file_access write
-next_focus newobject_id
-null false
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField newobject_id {
-display_length 9.5
-input true
-null false
-format integer
-label "Object ID"
-default 1
-low_bound 1
-max_length 5
-high_bound 32000
-tip 00126_TIP_0010
-next_focus newobj_name
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField newobj_name {
-display_length 9.5
-label "Object name"
-input true
-tip 00126_TIP_0011
-max_length FIO_MAX_LOCATION_LENGTH
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel method_label {
-label "Surface expansion method"
}
GuidoPanel p1 {
-layout BoxLayout Y_AXIS
GuidoButtonGroupPanel method {
-layout BoxLayout Y_AXIS
-tip "20611_TIP_002"
GuidoRadioButton frm20612_16 {
-caption "Plane fit"
-default true
-selected_value "PLANE FIT"
}
GuidoRadioButton frm20612_15 {
-caption "Boundary dip"
-selected_value "BOUNDARY DIP"
-next_focus smooth_factor
}
}
GuidoPanel p2 {
-layout BoxLayout X_AXIS
GuidoFiller filler {
-width 1.7
}
GuidoPanel p3 {
-layout CentreLineLayout VERTICAL LEFT
GuidoField smooth_factor {
-default 10
-dependency {"[ $method getCurrentValue]" == "BOUNDARY DIP"}
-display_length 6
-format integer
-high_bound 50
-label "Smoothing factor"
-low_bound 0
-max_length 6
-next_focus save_file
-tip "20611_TIP_003"
-translate none
-next_focus save_file
}
}
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoPanel p3 {
-layout BoxLayout Y_AXIS
GuidoPanel p4 {
-layout CentreLineLayout VERTICAL LEFT
GuidoCheckBox save_file {
-validation {[arewesavingtheresultsomewhere]}
-default true
-next_focus save_layer
-selected_value Y
-tip "20612_TIP_010"
-unselected_value N
}
GuidoLabel save_file_label {
-label "Save to file?"
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoPanel p5 {
-layout CentreLineLayout VERTICAL LEFT
GuidoCheckBox save_layer {
-validation {[arewesavingtheresultsomewhere]}
-default false
-selected_value Y
-tip "20612_TIP_011"
-unselected_value N
}
GuidoLabel save_layer_label {
-label "Save to layer?"
}
}
}
}
}
}
