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]} {
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]} {
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 frm00092 {
-default_buttons
-label "Intersect DTMs for line of contact"
-layout BoxLayout Y_AXIS
-tip 00092_TIP_0
-action final {[destroyMultipleDtms]}
GuidoPanel frm00092_19 {
-border etched true
-label "Define first DTM"
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel loc1label {
-label Location
}
GuidoPanel loc1label {
-layout BoxLayout x_axis
GuidoFileBrowserField dtmloc1 {
-display_length 26
-file_mask *.dtm
-format none
-null false
-max_length 252
-tip 00092_TIP_1
-translate none
-extension false
-next_focus object1_id
}
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 CentreLineLayout VERTICAL LEFT
GuidoPanel p1 {
-layout CentreLineLayout VERTICAL LEFT
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
-next_focus trisolation1_id
-tip "04949_TIP_1"
}
GuidoFiller filler {
-width 0.2
}
}
GuidoPanel p2 {
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel obj1_name {
}
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel trisol_panel {
-label "Trisolation ID"
}
GuidoPanel p3 {
-layout CentreLineLayout VERTICAL LEFT
GuidoPanel p4 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox trisolation1_id {
-display_length 4
-format none
-max_length 32
-translate none
-exclusive false
-next_focus dtmloc2
-tip "04949_TIP_2"
}
GuidoFiller filler {
-width 0.2
}
}
GuidoPanel p5 {
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel tri1_name {
}
}
}
}
GuidoPanel frm00092_21 {
-border etched true
-label "Define second DTM"
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel loc2 {
-label Location
}
GuidoPanel loc2 {
-layout BoxLayout x_axis
GuidoFileBrowserField dtmloc2 {
-display_length 26
-file_mask *.dtm
-format none
-null false
-max_length 252
-tip 00092_TIP_1
-translate none
-extension 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 fill {
-height 0.05
}
GuidoFiller fill {
-height 0.05
}
GuidoLabel object2_label {
-label "Object ID"
}
GuidoPanel p6 {
-layout CentreLineLayout VERTICAL LEFT
GuidoPanel p7 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox object2_id {
-action valueChanged {[triobjectChanged $dtmloc2 $object2_id $obj2_name $trisolation2_id $tri2_name]}
-display_length 4
-format none
-max_length 32
-translate none
-exclusive false
-next_focus trisolation2_id
-tip "04949_TIP_1"
}
GuidoFiller frm00245_23 {
-width 0.2
}
}
GuidoPanel p8 {
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel obj2_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 trisolation2_id {
-display_length 4
-format none
-max_length 32
-translate none
-exclusive false
-next_focus usebdy
-tip "04949_TIP_2"
}
GuidoFiller filler {
-width 0.2
}
}
GuidoPanel p11 {
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel tri2_name {
}
}
}
}
GuidoPanel frm00092_23 {
-border etched true
-label "Define the output file"
-layout CentreLineLayout VERTICAL LEFT
GuidoFileBrowserField outloc {
-display_length 25.7
-file_access write
-file_mask *.str
-format none
-label Location
-null false
-max_length 252
-tip 00092_TIP_2
-translate none
-extension false
}
GuidoFiller fill {
-height 0.05
}
GuidoFiller fill {
-height 0.05
}
GuidoField int_str {
-display_length 6
-format integer
-high_bound 32000
-label "String number"
-low_bound 1
-max_length 5
-null false
-tip 00092_TIP_3
-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]}
}
