GuidoScript scripts/dtmutilities.tcl
global dtm1loc
global object1_id
global trisolation1_id
global dtm2loc
global object2_id
global trisolation2_id
global obj1_name
global obj2_name
global tri1_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 frm00380 {
-default_buttons
-label "DTM cut and fill volumes"
-tip "CUT_FILL_DESCRIPTION"
-action final {[destroyMultipleDtms]}
-layout CentreLineLayout Vertical Left
GuidoPanel p1 {
-layout BoxLayout Y_AXIS
GuidoPanel frm00380_2 {
-layout CentreLineLayout Vertical Left
-border etched true
-label "Define the first DTM"
GuidoLabel labelLoc {
-label Location
}
GuidoPanel frm00380_5 {
-layout BoxLayout X_AXIS
GuidoFileBrowserField dtm1loc {
-display_length 22
-file_mask *.dtm
-format none
-max_length 252
-next_focus object1_id
-tip "CUT_FILL_UPPER"
-translate none
-extension false
-null false
}
GuidoButton readDtm1 {
-tip "TIP_POPULATE_TRI_TRIOBJ"
-icon "icons/12/refresh.png"
-action valueChanged { [ getObjectsTrisolationsForMultipleDTMS $dtm1loc $object1_id $obj1_name $trisolation1_id $tri1_name ]}
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel triobject1 {
-label "Object ID"
}
GuidoPanel frm00380_5 {
-layout BoxLayout X_AXIS
GuidoComboBox object1_id {
-action valueChanged {[triobjectChanged $dtm1loc $object1_id $obj1_name $trisolation1_id $tri1_name]}
-display_length 5.7
-format none
-max_length 32
-next_focus trisolation1_id
-translate none
-exclusive false
-tip 04949_TIP_1
}
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 frm00380_6 {
-layout BoxLayout X_AXIS
GuidoComboBox trisolation1_id {
-display_length 5.7
-format none
-max_length 32
-translate none
-exclusive false
-next_focus dtm2loc
-tip 04949_TIP_2
}
GuidoFiller filler {
-width 0.2
}
GuidoLabel tri1_name {
}
}
}
GuidoPanel frm00380_9 {
-border etched true
-label "Define the second DTM"
-layout CentreLineLayout Vertical Left
GuidoLabel labelLoc {
-label Location
}
GuidoPanel frm00380_5 {
-layout BoxLayout X_AXIS
GuidoFileBrowserField dtm2loc {
-display_length 22
-file_mask *.dtm
-format none
-max_length 252
-next_focus object2_id
-tip "CUT_FILL_LOWER"
-translate none
-extension false
-null false
}
GuidoButton readDtm2 {
-tip "TIP_POPULATE_TRI_TRIOBJ"
-icon "icons/12/refresh.png"
-action valueChanged { [ getObjectsTrisolationsForMultipleDTMS $dtm2loc $object2_id $obj2_name $trisolation2_id $tri2_name]}
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel object2_label {
-label "Object ID"
}
GuidoPanel frm00380_13 {
-layout BoxLayout X_AXIS
GuidoComboBox object2_id {
-action valueChanged {[triobjectChanged $dtm2loc $object2_id $obj2_name $trisolation2_id $tri2_name]}
-display_length 5.7
-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"
}
GuidoPanel frm00380_14 {
-layout BoxLayout X_AXIS
GuidoComboBox trisolation2_id {
-display_length 5.7
-format none
-max_length 32
-translate none
-exclusive false
-next_focus volbdy_loc
-tip 04949_TIP_2
}
GuidoFiller filler {
-width 0.2
}
GuidoLabel tri2_name {
}
}
}
GuidoPanel frm00380_9 {
-border etched true
-label "Define the volume boundary string"
-layout CentreLineLayout Vertical Left
GuidoFileBrowserField volbdy_loc {
-label Location
-display_length 21
-file_mask *.str
-format none
-max_length 252
-next_focus volbdy_str_no
-tip "CUT_FILL_MEANINGFUL"
-translate none
-extension false
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField volbdy_str_no {
-label "Boundary string"
-display_length 6.5
-format integer
-high_bound 32000
-low_bound 1
-max_length 5
-next_focus cutfill_loc
-null false
-translate none
}
GuidoFiller filler {
-height 2.3
}
GuidoFiller filler {
-height 2.3
}
}
}
GuidoPanel p2 {
-layout BoxLayout Y_AXIS
GuidoPanel frm00380_18 {
-border etched true
-label "Define the file for the cut and fill boundary"
-layout CentreLineLayout Vertical Left
GuidoFileBrowserField cutfill_loc {
-label Location
-display_length 22.5
-file_mask *.str
-format none
-max_length 252
-link cutfill_id
-next_focus cutfill_id
-tip "CUT_FILL_INTERSECT"
-translate none
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField cutfill_id {
-label "ID number"
-display_length 8
-format double
-max_length 16
-next_focus fill_str_no
-tip "CUT_FILL_INTERSECT"
-translate upper
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField fill_str_no {
-label "Fill string"
-display_length 8
-format integer
-high_bound 32000
-low_bound 1
-max_length 5
-next_focus cut_str_no
-null false
-tip "CUT_FILL_IDENTICAL_STRINGS"
-translate none
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField cut_str_no {
-label "Cut string"
-display_length 8
-format integer
-high_bound 32000
-low_bound 1
-max_length 5
-next_focus bdy_str_no
-null false
-tip "CUT_FILL_IDENTICAL_STRINGS"
-translate none
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField bdy_str_no {
-label "Boundary string"
-display_length 8
-format integer
-high_bound 32000
-low_bound 1
-max_length 5
-next_focus decimals
-null false
-tip "CUT_FILL_SAVE"
-translate none
}
}
GuidoPanel frm00380_15 {
-border etched true
-label "Define reporting options"
-display_length 31
-layout BoxLayout Y_AXIS
GuidoPanel p3 {
-layout CentreLineLayout Vertical Left
GuidoField decimals {
-label "Decimals"
-default "0"
-display_length 9
-format integer
-low_bound 0
-high_bound 3
-max_length 1
-null false
-tip "DTM_VOL_DECIMALS"
-next_focus density
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField density {
-label "Density"
-default 1.00
-display_length 9
-max_length 5
-decimals 3
-format double
-low_bound 0.01
-high_bound 150.0
-null false
-tip "DENSITY_TIP"
-next_focus report_format
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoComboBox report_format {
-label "Report format"
-display_length 6.7
-format none
-max_length 5
-next_focus report_by_elevation
-null false
-value_in .not .csv .htm .html .rtf .pdf .ps
-tip "The extension nominated here defines the type of report generated."
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
}
GuidoPanel p5 {
-layout CentreLineLayout Vertical Left
GuidoCheckBox detailed_report {
-default false
-selected_value Y
-tip "DTM_VOL_DETAILED_DESC"
-unselected_value N
-next_focus volbdy_loc
}
GuidoLabel detailed_report_label {
-label "Detailed report"
}
}
GuidoPanel p4 {
-layout CentreLineLayout Vertical Left
GuidoCheckBox report_by_elevation {
-default false
-selected_value Y
-tip "Select this to allow reporting by elevation."
-unselected_value N
-next_focus elevation_range
}
GuidoLabel report_by_elevation_label {
-label "Report by elevation"
}
GuidoFiller filler {
-width 0.05
}
GuidoFiller filler {
-width 0.05
}
GuidoFiller f1 {
-width 2
}
GuidoPanel frm00380_17 {
-layout CentreLineLayout Vertical Left
GuidoField elevation_range {
-label "Range"
-dependency {"[ $report_by_elevation getCurrentValue]" == "Y"}
-display_length 10
-format range
-max_length "MAX_RNG_LENGTH"
-null false
-legacy_validation
-tip "DTM_VOL_RANGE"
-translate none
-validation {[validateRangeClassification]}
}
}
}
}
}
$dtm1loc setActionCallback focusGained {[storeOldValOne $dtm1loc $object1_id $trisolation1_id]}
$dtm1loc setActionCallback valueChanged {[clearFieldListOne $dtm1loc $object1_id $trisolation1_id]}
$dtm2loc setActionCallback valueChanged {[clearFieldListTwo $dtm2loc $object2_id $trisolation2_id]}
$dtm2loc setActionCallback focusGained {[storeOldValTwo $dtm2loc $object2_id $trisolation2_id]}
}
