GuidoScript scripts/dtmutilities.tcl
global dtmloc1
global object1_id
global trisolation1_id
global dtmloc2
global object2_id
global trisolation2_id
global obj1_name
global tri1_name
global obj2_name
global tri2_name
proc storeOldValOne { location object_id trisolation_id } {
global location_old_val_one
if {![info exists location_old_val_one]} {
set location_old_val_one ""
}
set locCheck [$location getCurrentValue]
if {![info exists location_old_val_one]} {
set location_old_val_one ""
}
if { "$location_old_val_one" != "$locCheck" } {
clearFieldListOne $location $object_id $trisolation_id
}
set location_old_val_one [$location getCurrentValue]
}
proc clearFieldListOne { location object_id trisolation_id }  {
global location_old_val_one
if {![info exists location_old_val_one]} {
set location_old_val_one ""
}
set location_new_val [$location getCurrentValue]
if { "$location_old_val_one" != "$location_new_val" } {
$object_id setExclusive false
$object_id removeAllItems
eval [concat {$object_id} {setValues} 1 ]
$object_id setCurrentValue 1
$trisolation_id setExclusive false
$trisolation_id removeAllItems
eval [concat {$trisolation_id} {setValues} 1 ]
$trisolation_id setCurrentValue 1
}
set location_old_val_one $location_new_val
}
proc storeOldValTwo { location object_id trisolation_id } {
global location_old_val_two
if {![info exists location_old_val_two]} {
set location_old_val_two ""
}
set locCheck [$location getCurrentValue]
if {![info exists location_old_val_two]} {
set location_old_val_two ""
}
if { "$location_old_val_two" != "$locCheck"} {
clearFieldListTwo $location $object_id $trisolation_id
}
set location_old_val_two [$location getCurrentValue]
}
proc clearFieldListTwo { location object_id trisolation_id }  {
global location_old_val_two
if {![info exists location_old_val_two]} {
set location_old_val_two ""
}
set location_new_val [$location getCurrentValue]
if { "$location_old_val_two" != "$location_new_val" } {
$object_id setExclusive false
$object_id removeAllItems
eval [concat {$object_id} {setValues} 1 ]
$object_id setCurrentValue 1
$trisolation_id setExclusive false
$trisolation_id removeAllItems
eval [concat {$trisolation_id} {setValues} 1 ]
$trisolation_id setCurrentValue 1
}
set location_old_val_two $location_new_val
}
GuidoForm frm00245 {
-default_buttons
-label "Extract sections from DTMs"
-layout BoxLayout Y_AXIS
-tip 00245_TIP_0
-action final {[destroyMultipleDtms]}
GuidoPanel frm00245_1 {
-layout CentreLineLayout
GuidoPanel frm00245_2 {
-label "Create cross sections from "
-layout BoxLayout Y_AXIS
-tip 00245_TIP_1
GuidoButtonGroupPanel numdtms {
-layout BoxLayout Y_AXIS
GuidoRadioButton frm00245_3 {
-caption "An upper surface DTM only"
-default true
-font_style bold
-selected_value 1
}
GuidoRadioButton frm00245_4 {
-caption "Upper and lower DTM surfaces"
-selected_value 2
-font_style bold
}
}
}
}
GuidoPanel frm00245_3 {
-layout BoxLayout X_AXIS
GuidoPanel frm00245_4 {
-border etched true
-label "Define the upper DTM"
-layout BoxLayout Y_AXIS
GuidoPanel frm00245_5 {
-layout CentreLineLayout Vertical Left
GuidoLabel loc2 {
-label Location
}
GuidoPanel loc2 {
-layout BoxLayout x_axis
GuidoFileBrowserField dtmloc1 {
-display_length 21
-file_mask *.dtm
-format none
-max_length 252
-tip 00245_TIP_1
-translate none
-next_focus object1_id
-extension false
-null false
}
GuidoButton readDtm1 {
-tip "TIP_POPULATE_TRI_TRIOBJ"
-icon "icons/12/refresh.png"
-action valueChanged { [ getObjectsTrisolationsForMultipleDTMS $dtmloc1 $object1_id $obj1_name $trisolation1_id $tri1_name]}
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel triobject1 {
-label "Object ID"
}
GuidoPanel frm00245_6 {
-layout BoxLayout X_AXIS
GuidoComboBox object1_id {
-action valueChanged {[triobjectChanged $dtmloc1 $object1_id $obj1_name $trisolation1_id $tri1_name]}
-display_length 4
-format none
-max_length 32
-translate none
-exclusive false
-tip "04949_TIP_1"
-next_focus trisolation1_id
}
GuidoFiller filler {
-width 0.2
}
GuidoLabel obj1_name {
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel trisol_panel {
-label "Trisolation ID"
}
GuidoPanel frm00245_7 {
-layout BoxLayout X_AXIS
GuidoComboBox trisolation1_id {
-display_length 4
-format none
-max_length 32
-translate none
-exclusive false
-tip "04949_TIP_2"
-next_focus dtmloc2
}
GuidoFiller filler {
-width 0.2
}
GuidoLabel tri1_name {
}
}
GuidoFiller filler {
-height 1.2
}
}
}
GuidoPanel frm00245_8 {
-border etched true
-label "Define the boundary string"
-layout BoxLayout Y_AXIS
-display_length 28.8
GuidoPanel frm00245_9 {
-layout CentreLineLayout Vertical Left
GuidoPanel frm00245_10 {
-layout CentreLineLayout Vertical Left
GuidoCheckBox usebdy {
-default false
-selected_value Y
-tip 00245_TIP_3
-unselected_value N
-next_focus bdyloc
}
GuidoLabel usebdy_label {
-label "Use a boundary string"
}
}
GuidoFiller filler {
-width 0.05
}
GuidoPanel frm00245_11 {
-layout CentreLineLayout Vertical Left
GuidoFiller filler {
-width 1.8
}
GuidoPanel frm00245_12 {
-layout CentreLineLayout Vertical Left
GuidoFileBrowserField bdyloc {
-dependency {"[ $usebdy getCurrentValue]" == "Y"}
-display_length 17
-file_mask *.str
-label Location
-format none
-link bdyid
-max_length 252
-tip 00245_TIP_3
-translate none
-next_focus bdyid
-action focusGained {[$bdyloc setNullAllowed false]}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField bdyid {
-display_length 6.5
-dependency {"[ $usebdy getCurrentValue]" == "Y"}
-format string
-label "ID number"
-max_length 16
-next_focus numbdystr
-action focusGained {[$bdyid setNullAllowed false]}
-translate upper
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField numbdystr {
-dependency {"[ $usebdy getCurrentValue]" == "Y"}
-display_length 6.5
-format integer
-high_bound 32000
-low_bound 1
-label "String number"
-max_length 5
-next_focus secloc
-action focusGained {[$numbdystr setNullAllowed false]}
-tip 00245_TIP_3
-translate none
}
}
GuidoFiller filler {
-height 0.2
}
}
}
}
}
GuidoPanel frm00245_13 {
-layout BoxLayout X_AXIS
GuidoPanel frm00245_14 {
-border etched true
-label "Define the lower DTM"
-layout BoxLayout Y_AXIS
GuidoPanel frm00245_15 {
-layout CentreLineLayout Vertical Left
GuidoLabel loc2 {
-label Location
}
GuidoPanel loc2 {
-layout BoxLayout x_axis
GuidoFileBrowserField dtmloc2 {
-display_length 21
-dependency {"[ $numdtms getCurrentValue]" == "2"}
-file_mask *.dtm
-format none
-action focusGained {[$dtmloc2 setNullAllowed false]}
-max_length 252
-tip 00245_TIP_1
-translate none
-extension false
-null false
-next_focus object2_id
}
GuidoButton readDtm1 {
-tip "TIP_POPULATE_TRI_TRIOBJ"
-icon "icons/12/refresh.png"
-action valueChanged { [ getObjectsTrisolationsForMultipleDTMS $dtmloc2 $object2_id $obj2_name $trisolation2_id $tri2_name]}
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel object2_label {
-label "Object ID"
-dependency {"[ $numdtms getCurrentValue]" == "2"}
}
GuidoPanel frm00245_16 {
-layout BoxLayout X_AXIS
GuidoComboBox object2_id {
-action valueChanged {[triobjectChanged $dtmloc2 $object2_id $obj2_name $trisolation2_id $tri2_name]}
-display_length 4
-dependency {"[ $numdtms getCurrentValue]" == "2"}
-format none
-max_length 32
-translate none
-exclusive false
-tip "04949_TIP_1"
-next_focus trisolation2_id
}
GuidoFiller frm00245_23 {
-width 0.2
}
GuidoLabel obj2_name {
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel trisolation2 {
-label "Trisolation ID"
-dependency {"[ $numdtms getCurrentValue]" == "2"}
}
GuidoPanel frm00245_17 {
-layout BoxLayout X_AXIS
GuidoComboBox trisolation2_id {
-dependency {"[ $numdtms getCurrentValue]" == "2"}
-display_length 4
-format none
-max_length 32
-translate none
-exclusive false
-next_focus usebdy
-tip "04949_TIP_2"
}
GuidoFiller filler {
-width 0.2
}
GuidoLabel tri2_name {
}
}
GuidoFiller filler {
-height 1.7
}
}
GuidoFiller filler {
-height 0.8
}
}
GuidoPanel frm00245_18 {
-border etched true
-label "Define the file to create"
-layout BoxLayout Y_AXIS
GuidoPanel frm00245_19 {
-layout CentreLineLayout Vertical Left
GuidoFileBrowserField secloc {
-display_length 21
-label Location
-file_access write
-file_mask *.str
-format none
-link secid
-max_length 252
-tip 00245_TIP_4
-translate none
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField secid {
-display_length 6.5
-label "ID number"
-format string
-max_length 16
-null false
-translate upper
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel sectype_label {
-label Section
}
GuidoPanel frm00245_20 {
-layout CentreLineLayout Vertical Left
-tip 00245_TIP_5
GuidoButtonGroupPanel sectype {
-layout BoxLayout Y_AXIS
GuidoRadioButton frm00245_38 {
-caption "By interval"
-selected_value Interval
}
GuidoRadioButton frm00245_39 {
-caption "By range"
-selected_value Range
}
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField secint {
-label "Section values"
-display_length 13.8
-format none
-max_length 40
-null false
-tip 00245_TIP_5
-translate none
}
}
}
}
$dtmloc1 setActionCallback focusGained {[storeOldValOne $dtmloc1 $object1_id $trisolation1_id]}
$dtmloc1 setActionCallback valueChanged {[clearFieldListOne $dtmloc1 $object1_id $trisolation1_id]}
$dtmloc2 setActionCallback valueChanged {[clearFieldListTwo $dtmloc2 $object2_id $trisolation2_id]}
$dtmloc2 setActionCallback focusGained {[storeOldValTwo $dtmloc2 $object2_id $trisolation2_id]}
}
