GuidoScript scripts/dtmutilities.tcl
global location
global id
global object_id
global obj_name
global trisolation_id
global tri_name
proc storeOldVal { location id object_id trisolation_id } {
global location_old_val
if {![info exists location_old_val]} {
set location_old_val ""
}
global id_old_val
set locCheck [$location getCurrentValue]
set idCheck [$id getCurrentValue]
if {![info exists id_old_val]} {
set id_old_val ""
}
if { "$id_old_val" != "$idCheck"} {
clearFieldList $location $id $object_id $trisolation_id
}
if { "$location_old_val" != "$locCheck"} {
clearFieldList $location $id $object_id $trisolation_id
}
set location_old_val [$location getCurrentValue]
set id_old_val [$id getCurrentValue]
}
proc clearFieldList { location id object_id trisolation_id }  {
global location_old_val
global id_old_val
set location_new_val [$location getCurrentValue]
set id_new_val [$id getCurrentValue]
if { "$location_old_val" != "$location_new_val" ||
"$id_old_val" != "$id_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
refreshIdContent $id
}
set location_old_val $location_new_val
set id_old_val $id_new_val
}
GuidoForm frm00683 {
-default_buttons
-label "Expand a DTM to a new boundary"
-layout BoxLayout Y_AXIS
-tip "00683_TIP_001"
-action final {[destroyTemporaryProcessedDTMSwa]}
GuidoPanel LHS {
-layout CentreLineLayout VERTICAL LEFT
GuidoPanel frm00683_1 {
-layout BoxLayout Y_AXIS
GuidoPanel frm00683_2 {
-border etched true
-label "Input DTM"
-layout CentreLineLayout  VERTICAL LEFT
GuidoLabel loc2 {
-label Location
}
GuidoPanel loc2 {
-layout BoxLayout x_axis
GuidoFileBrowserField location {
-display_length 21
-format none
-max_length 252
-tip "Enter the location of the original DTM"
-file_mask *.dtm
-extension false
-link id
-next_focus id
}
GuidoButton readDtm1 {
-tip "TIP_POPULATE_TRI_TRIOBJ"
-icon "icons/12/refresh.png"
-action valueChanged {[checkthecontent $location $id ".dtm" $object_id $obj_name $trisolation_id $tri_name]}
}
}
GuidoFiller frm00683_3 {
-height 0.05
}
GuidoFiller frm00683_4 {
-height 0.05
}
GuidoField id {
-display_length 7.4
-format double
-label "ID number"
-max_length 16
-next_focus object_id
-tip "Enter the ID of the original DTM"
}
GuidoFiller frm00683_3 {
-height 0.05
}
GuidoFiller frm00683_4 {
-height 0.05
}
GuidoLabel obj_id_label {
-label "Object ID"
}
GuidoPanel frm00683_5 {
-layout CentreLineLayout VERTICAL LEFT
GuidoPanel frm00683_6 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox object_id {
-display_length 5
-action valueChanged {[wrapperTriobjectChanged $location $id ".dtm" $object_id $obj_name $trisolation_id $tri_name]}
-format integer
-exclusive false
-max_length 32
-translate none
-tip "Select the object ID to process"
}
GuidoFiller frm00683_7 {
-width 0.5
}
}
GuidoPanel frm00683_8 {
-layout CentreLineLayout VERTICAL LEFT
GuidoFiller frm00683_9 {
-width 0.5
}
GuidoLabel obj_name {
}
}
}
GuidoFiller frm00683_10 {
-height 0.05
}
GuidoFiller frm00683_11 {
-height 0.05
}
GuidoLabel trisolation_id_label {
-label "Trisolation ID"
}
GuidoPanel frm00683_12 {
-layout CentreLineLayout VERTICAL LEFT
GuidoPanel frm00683_13 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox trisolation_id {
-display_length 5
-format integer
-max_length 32
-exclusive false
-translate none
-tip "Select the trisolation ID to process"
}
GuidoFiller frm00683_14 {
-width 0.5
}
}
GuidoPanel frm00683_15 {
-layout CentreLineLayout VERTICAL LEFT
GuidoFiller frm00683_16 {
-width 0.5
}
GuidoLabel tri_name {
-height 1
}
}
}
}
GuidoFiller frm00683_17 {
-width 1
}
GuidoPanel frm00683_18 {
-border etched true
-label "Expand to boundary string"
-layout CentreLineLayout  VERTICAL LEFT
GuidoFileBrowserField b_location {
-display_length 20
-font_style bold
-format none
-label Location
-max_length 252
-next_focus b_id
-tip "Enter the location of the string file containing the new boundary"
-file_mask *.str
-link b_id
}
GuidoFiller frm00683_19 {
-height 0.05
}
GuidoFiller frm00683_20 {
-height 0.05
}
GuidoField b_id {
-display_length 20
-font_style bold
-format double
-label "ID number"
-max_length 16
-next_focus string_no
-tip "Enter the ID of the string file containing the new boundary"
}
GuidoFiller frm00683_21 {
-height 0.05
}
GuidoFiller frm00683_22 {
-height 0.05
}
GuidoField string_no {
-default 1
-display_length 20
-font_style bold
-format integer
-label "String No."
-max_length 16
-next_focus seg_no
-null false
-tip "Enter the string numer of the new boundary"
}
GuidoFiller frm00683_23 {
-height 0.05
}
GuidoFiller frm00683_24 {
-height 0.05
}
GuidoField seg_no {
-default 1
-display_length 20
-font_style bold
-format integer
-label "Segment No."
-max_length 16
-null false
-tip "Enter the segment numer of the new boundary"
}
}
GuidoPanel frm00683_25 {
-layout BoxLayout X_AXIS
GuidoPanel frm00683_26 {
-layout CentreLineLayout  VERTICAL LEFT
-label "Breakline properties"
-border etched true
GuidoPanel frm00683_27 {
-layout CentreLineLayout  VERTICAL LEFT
GuidoCheckBox break {
-default true
-font_style bold
-next_focus anyspots
-selected_value Y
-tip "00683_TIP_008"
-unselected_value N
}
GuidoLabel any_spot_heights {
-label "Strings to act as break lines"
}
}
GuidoFiller frm00683_28 {
-width 1
}
GuidoPanel frm00683_29 {
-layout CentreLineLayout  VERTICAL LEFT
GuidoFiller frm00683_30 {
-width 1.3
}
GuidoPanel frm00683_31 {
-layout CentreLineLayout  VERTICAL LEFT
GuidoCheckBox anyspots {
-default false
-dependency {"[ $break getCurrentValue]" == "Y"}
-next_focus spotrng
-selected_value Y
-tip "Were there any spot height strings in the original DTM?"
-unselected_value N
}
GuidoLabel any_spot_heights {
-dependency {"[ $break getCurrentValue]" == "Y"}
-label "Any spot height strings"
}
}
}
GuidoFiller frm00683_32 {
-width 1
}
GuidoPanel frm00683_33 {
-layout CentreLineLayout  VERTICAL LEFT
GuidoFiller frm00683_34 {
-width 4
}
GuidoLabel spot_height_range {
-dependency {"[ $anyspots getCurrentValue]" == "Y"}
-label "Spot height string range"
}
}
GuidoPanel frm00683_35 {
-layout CentreLineLayout  VERTICAL LEFT
GuidoField spotrng {
-dependency {"[ $anyspots getCurrentValue]" == "Y"}
-display_length 9.5
-font_style bold
-format range
-max_length 32
-next_focus frm00683_38
-tip "Enter the range of spot height strings"
}
GuidoFiller frm00683_36 {
-width 0.3
}
}
}
}
}
GuidoPanel RHS {
-layout CentreLineLayout  VERTICAL LEFT
GuidoPanel frm00683_38 {
-layout BoxLayout X_AXIS
-border etched true
-label "Expansion method"
GuidoPanel frm00683_37 {
-layout BoxLayout Y_AXIS
-tip "Enter the method used to determine the dips at the points on the old DTM boundary"
GuidoButtonGroupPanel method {
-layout BoxLayout Y_AXIS
GuidoRadioButton frm00683_38 {
-caption "Boundary dip"
-selected_value "BOUNDARY DIP"
-height 1
}
GuidoRadioButton frm00683_39 {
-caption "Fixed dip"
-selected_value "FIXED DIP"
-height 2
}
GuidoRadioButton frm00683_40 {
-caption "Slope strings"
-selected_value "SLOPE STRINGS"
-height 4.4
}
GuidoRadioButton frm00683_41 {
-caption "Plane fit"
-next_focus smooth_f
-selected_value "PLANE FIT"
}
}
}
GuidoFiller frm00683_42 {
-width 2
}
GuidoPanel label_panel {
-layout CentreLineLayout  VERTICAL LEFT
GuidoField smooth_f {
-default 10
-dependency {"[ $method getCurrentValue]" == "BOUNDARY DIP"}
-label "Smooth factor"
-display_length 9
-format integer
-high_bound 50
-low_bound 0
-max_length 5
-next_focus f_bearing
-null false
-tip "00683_TIP_012"
}
GuidoFiller frm00683_43 {
-height 0.4
}
GuidoFiller frm00683_44 {
-height 0.4
}
GuidoField f_bearing {
-default 0
-dependency {"[ $method getCurrentValue]" == "FIXED DIP"}
-label Bearing
-display_length 9
-format double
-high_bound 360.000000
-low_bound 0.000000
-max_length 5
-next_focus f_dip
-null false
-tip "Enter the bearing (0 to 360 degrees) for the fixed dip"
}
GuidoFiller frm00683_45 {
-height 0.05
}
GuidoFiller frm00683_46 {
-height 0.05
}
GuidoField f_dip {
-default 0
-dependency {"[ $method getCurrentValue]" == "FIXED DIP"}
-label Dip
-display_length 9
-format double
-high_bound 89.100000
-low_bound -89.100000
-max_length 5
-next_focus s_location
-null false
-tip "Enter the fixed dip (-89.1 to 89.1 degrees)"
}
GuidoFiller frm00683_47 {
-height 0.5
}
GuidoFiller frm00683_48 {
-height 0.5
}
GuidoFileBrowserField s_location {
-dependency {"[ $method getCurrentValue]" == "SLOPE STRINGS"}
-label Location
-display_length 9
-format none
-max_length 252
-next_focus s_id
-tip "Enter the location for the string file containing the slope strings"
-file_mask *.str
-link s_id
}
GuidoFiller frm00683_49 {
-height 0.05
}
GuidoFiller frm00683_50 {
-height 0.05
}
GuidoField s_id {
-dependency {"[ $method getCurrentValue]" == "SLOPE STRINGS"}
-label "ID number"
-display_length 9
-format double
-max_length 16
-tip "Enter the ID for the string file containing the slope strings"
}
}
GuidoFiller frm00683_51 {
-width 1
-height 1
}
}
GuidoFiller frm00683_52 {
-height 0.05
}
GuidoPanel frm00683_53 {
-border etched true
-label "Output DTM"
-layout CentreLineLayout  VERTICAL LEFT
-height 8.4
GuidoFileBrowserField n_location {
-display_length 21
-font_style bold
-format none
-label Location
-max_length 252
-tip "Enter the location for the file to store the new DTM"
-file_mask *.dtm
-link n_id
-file_access write
}
GuidoFiller frm00683_54 {
-height 0.05
}
GuidoFiller frm00683_55 {
-height 0.05
}
GuidoField n_id {
-display_length 21
-font_style bold
-format double
-label "ID number"
-max_length 16
-tip "Enter the ID for the file to store the new DTM"
}
GuidoFiller frm00683_56 {
-height 0.05
}
GuidoFiller frm00683_57 {
-height 0.05
}
GuidoField new_dtm_obj_id {
-label "Object ID"
-format integer
-max_length 5
-low_bound 1
-high_bound 32000
-display_length 8
-default 1
-input true
-null false
-tip "Enter the object number"
}
GuidoFiller frm00683_58 {
-height 0.05
}
GuidoFiller frm00683_59 {
-height 0.05
}
GuidoField new_dtm_obj_name {
-default " "
-format string
-label "Object name"
-display_length 8
-input true
-null false
-tip "Enter the name of the object"
}
}
}
}
$location setActionCallback focusGained {[storeOldVal $location $id $object_id $trisolation_id]}
$location setActionCallback valueChanged {[clearFieldList $location $id $object_id $trisolation_id]}
$id setActionCallback focusGained {[storeOldVal $location $id $object_id $trisolation_id]}
$id setActionCallback valueChanged {[clearFieldList $location $id $object_id $trisolation_id]}
}
