GuidoScript scripts/dtmutilities.tcl
global dtmloc1
global dtmloc2
global first_obj_id
global first_trisol_id
global first_obj_name
global first_trisol_name
global second_obj_id
global second_trisol_id
global second_obj_name
global second_trisol_name
global intersection_type
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
}
proc get_dtm_loc2_details {dtmloc2 second_obj_id second_obj_name second_trisol_id second_trisol_name} {
global intersection_type
if {[$intersection_type getCurrentValue] == "between two dtms"} {
getObjectsTrisolationsForMultipleDTMS $dtmloc2 $second_obj_id $second_obj_name $second_trisol_id $second_trisol_name
}
}
GuidoForm frm00317 {
-default_buttons
-help_id 692
-label "Drill hole intersect DTM"
-layout BoxLayout Y_AXIS
-tip "00317_TIP_001"
-action final {[destroyMultipleDtms]}
GuidoPanel frm00317_26 {
-layout CentreLineLayout VERTICAL LEFT
GuidoPanel frm00317_18 {
-label "Intersection type"
-layout CentreLineLayout VERTICAL LEFT
-tip "00317_TIP_002"
GuidoButtonGroupPanel intersection_type {
-layout BoxLayout Y_AXIS
GuidoRadioButton frm00317_15 {
-caption "Above one dtm"
-selected_value "above one dtm"
}
GuidoRadioButton frm00317_16 {
-caption "Below one dtm"
-selected_value "below one dtm"
}
GuidoRadioButton frm00317_17 {
-caption "Between two dtms"
-selected_value "between two dtms"
}
}
}
}
GuidoFiller frm00317_27 {
-height 0.1
}
GuidoPanel frm00317_50 {
-layout BoxLayout X_AXIS
GuidoPanel frm00317_30 {
-layout BoxLayout Y_AXIS
GuidoPanel frm00317_28 {
-border etched true
-label "Define the first DTM"
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel loc2 {
-label Location
}
GuidoPanel loc2 {
-layout BoxLayout x_axis
GuidoFileBrowserField dtmloc1 {
-display_length 18.5
-file_mask *.dtm
-extension false
-format none
-max_length FIO_MAX_LOCATION_LENGTH
-null false
-tip "00317_TIP_002"
-translate lower
-next_focus first_obj_id
}
GuidoButton readDtm1 {
-tip "TIP_POPULATE_TRI_TRIOBJ"
-icon "icons/12/refresh.png"
-action valueChanged { [ getObjectsTrisolationsForMultipleDTMS $dtmloc1 $first_obj_id $first_obj_name $first_trisol_id $first_trisol_name]}
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel obj_label {
-label "Object ID"
}
GuidoPanel p1 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox first_obj_id {
-display_length 6
-action valueChanged {[triobjectChanged $dtmloc1 $first_obj_id $first_obj_name $first_trisol_id $first_trisol_name]}
-high_bound 32000
-low_bound 1
-exclusive false
-format none
-max_length 6
-tip "04949_TIP_1"
-translate upper
}
GuidoPanel p11 {
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel first_obj_name {}
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel trisol_label {
-label "Trisolation ID"
}
GuidoPanel p2 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox first_trisol_id {
-display_length 6
-high_bound 32000
-low_bound 1
-exclusive false
-format none
-max_length 6
-translate upper
-tip "04949_TIP_2"
}
GuidoPanel p2 {
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel first_trisol_name {}
}
}
}
GuidoFiller frm00317_31 {
-width 1
}
GuidoPanel frm00317_29 {
-border etched true
-label "Define the second DTM"
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel loc2 {
-label Location
}
GuidoPanel loc2 {
-layout BoxLayout x_axis
GuidoFileBrowserField dtmloc2 {
-dependency {"[ $intersection_type getCurrentValue]" == "between two dtms"}
-display_length 18.5
-file_mask *.dtm
-extension false
-format none
-null false
-max_length FIO_MAX_LOCATION_LENGTH
-tip "00317_TIP_002"
-translate lower
-next_focus second_obj_id
}
GuidoButton readDtm1 {
-dependency {"[ $intersection_type getCurrentValue]" == "between two dtms"}
-tip "TIP_POPULATE_TRI_TRIOBJ"
-icon "icons/12/refresh.png"
-action valueChanged { [ getObjectsTrisolationsForMultipleDTMS $dtmloc2 $second_obj_id $second_obj_name $second_trisol_id $second_trisol_name]}
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel obj_label {
-dependency {"[ $intersection_type getCurrentValue]" == "between two dtms"}
-label "Object ID"
}
GuidoPanel p3 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox second_obj_id {
-dependency {"[ $intersection_type getCurrentValue]" == "between two dtms"}
-display_length 6
-action valueChanged {[triobjectChanged $dtmloc2 $second_obj_id $second_obj_name $second_trisol_id $second_trisol_name]}
-high_bound 32000
-low_bound 1
-exclusive false
-format none
-max_length 6
-translate upper
-tip "04949_TIP_1"
}
GuidoPanel p33 {
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel second_obj_name {}
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel tri_label {
-dependency {"[ $intersection_type getCurrentValue]" == "between two dtms"}
-label "Trisolation ID"
}
GuidoPanel p4 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox second_trisol_id {
-dependency {"[ $intersection_type getCurrentValue]" == "between two dtms"}
-display_length 6
-exclusive false
-high_bound 32000
-low_bound 1
-format none
-max_length 6
-translate upper
-tip "04949_TIP_2"
}
GuidoPanel p4 {
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel second_trisol_name {}
}
}
}
GuidoFiller frm00317_31 {
-width 0.5
}
}
GuidoFiller frm00317_32 {
-height 0.05
}
GuidoPanel frm00317_36 {
-layout BoxLayout Y_AXIS
GuidoPanel frm00317_34 {
-border etched true
-label "Define the database table name"
-layout CentreLineLayout VERTICAL LEFT
GuidoCheckBox save_to_db {
-default false
-selected_value Y
-tip "00317_TIP_007"
-unselected_value N
}
GuidoLabel lbl {
-label "Save results to database"
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoPanel p1 {
-layout CentreLineLayout VERTICAL LEFT
GuidoFiller filler {
-width 0
}
GuidoPanel p2 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox table {
-dependency {"[ $save_to_db getCurrentValue]" == "Y"}
-display_length 13.5
-format none
-label "Table name"
-no_mlt
-max_length 11
-next_focus code
-tip "The table to which the code will be written must be an interval table."
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField code {
-dependency {"[ $save_to_db getCurrentValue]" == "Y"}
-display_length 16
-format none
-label Code
-max_length 32
-next_focus logloc
-tip "00317_TIP_009"
-translate none
}
}
}
}
GuidoFiller frm00317_31 {
-width 1
}
GuidoPanel frm00317_35 {
-label "Define results file"
-border etched true
-layout CentreLineLayout VERTICAL LEFT
GuidoFiller filler {
-height 1
}
GuidoFiller filler {
-height 1
}
GuidoFileBrowserField logloc {
-display_length 20
-file_mask reports|*.log
-format none
-label "Report file"
-max_length 252
-null false
-tip "00317_TIP_010"
-translate lower
-extension false
-file_access write
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoComboBox report_format {
-label "Format"
-display_length 17.5
-null false
-tip "The file format nominated here will be the output report format."
-value_in ".not - Surpac Note File" ".csv - Comma Separated (Spreadsheet)" ".htm - Hypertext Markup Language (Web)" ".html - Hypertext Markup Language (Web)" ".rtf - Rich Text Format (Microsoft Word)" ".pdf - Adobe Acrobat" ".ps - Postscript" ".log - Surpac log file"
}
}
}
}
$dtmloc1 setActionCallback focusGained {[storeOldValOne $dtmloc1 $first_obj_id $first_trisol_id]}
$dtmloc1 setActionCallback valueChanged {[clearFieldListOne $dtmloc1 $first_obj_id $first_trisol_id]}
$dtmloc2 setActionCallback focusGained {[storeOldValTwo $dtmloc2 $second_obj_id $second_trisol_id]}
$dtmloc2 setActionCallback valueChanged {[clearFieldListTwo $dtmloc2 $second_obj_id $second_trisol_id]}
}
