GuidoScript scripts/dtmutilities.tcl
global dtmloc
global dtmid
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 {![info exists location_old_val]} {
set location_old_val ""
}
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
if {![info exists location_old_val]} {
set 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 frm00209 {
-default_buttons
-label "Overlay strings on a DTM"
-layout BoxLayout X_AXIS
-tip "00209_TIP_001"
-action final { [destroyTemporaryProcessedDTMSwa] }
GuidoPanel file_inp {
-layout CentreLineLayout VERTICAL LEFT
-border etched true
-label "Define the DTM"
-height 18
GuidoFiller frm00209_81 {
-height 0.5
}
GuidoFiller frm00209_82 {
-height 0.5
}
GuidoLabel labelLoc {
-label Location
}
GuidoPanel frm00380_5 {
-layout BoxLayout X_AXIS
GuidoFileBrowserField dtmloc {
-display_length 17
-max_length 252
-file_mask *.dtm
-format none
-tip "The DTM and DTM field (Z, D1, D2, D3, etc.) must be designated."
-link dtmid
-next_focus dtmid
-extension false
-translate none
}
GuidoButton readDtm1 {
-tip "TIP_POPULATE_TRI_TRIOBJ"
-icon "icons/12/refresh.png"
-action valueChanged {[checkthecontent $dtmloc $dtmid ".dtm" $object_id $obj_name $trisolation_id $tri_name]}
}
}
GuidoFiller frm00209_3 {
-height 0.05
}
GuidoFiller frm00209_4 {
-height 0.05
}
GuidoField dtmid {
-display_length 17
-format double
-label "ID number"
-max_length 16
-next_focus object_id
-null true
-tip "The DTM and DTM field (Z, D1, D2, D3, etc.) must be designated."
-translate upper
}
GuidoFiller frm00209_3 {
-height 0.05
}
GuidoFiller frm00209_4 {
-height 0.05
}
GuidoLabel obj_id_label {
-label "Object ID"
}
GuidoPanel frm01127_26 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox object_id {
-display_length 5
-action focusGained {[WrapperUpdateObjectDetailsForMultipleDtms $dtmloc $dtmid ".dtm" $object_id $trisolation_id]}
-action valueChanged {[wrapperTriobjectChanged $dtmloc $dtmid ".dtm" $object_id $obj_name $trisolation_id $tri_name]}
-format none
-max_length 32
-translate none
-exclusive false
-tip "Select the object ID to process"
}
GuidoLabel obj_name {
-height	1
}
}
GuidoFiller frm00209_5 {
-height 0.05
}
GuidoFiller frm00209_6 {
-height 0.05
}
GuidoLabel frm00209_49 {
-label "Trisolation ID"
}
GuidoPanel frm00209_47 {
-layout CentreLineLayout VERTICAL LEFT
GuidoComboBox trisolation_id {
-display_length 5
-format none
-max_length 32
-translate none
-exclusive false
-tip "Select the trisolation ID to process"
}
GuidoLabel tri_name {
-height 1
}
}
GuidoFiller frm00209_12 {
-width 0.5
}
GuidoFiller frm00209_42 {
-height 1
}
GuidoFiller frm00209_43 {
-height 1
}
GuidoPanel file_inp_3 {
-layout CentreLineLayout  VERTICAL LEFT
GuidoCheckBox swadesc {
-default true
-next_focus swadescuse1
-selected_value Y
-tip "00209_TIP_004"
-unselected_value N
}
GuidoLabel triobject {
-label "Use descriptions"
}
}
GuidoFiller frm00209_13 {
-width 0.05
}
GuidoPanel frm00209_14 {
-layout CentreLineLayout  VERTICAL LEFT
GuidoPanel frm00209_15 {
-layout CentreLineLayout  VERTICAL LEFT
GuidoFiller frm00209_16 {
-width 2
}
GuidoLabel desc {
-dependency { "[$swadesc getCurrentValue]" == "Y" }
-label "Handle descriptions as"
}
}
GuidoButtonGroupPanel swadescusage {
-layout BoxLayout Y_AXIS
GuidoRadioButton swadescuse1 {
-dependency { "[$swadesc getCurrentValue]" == "Y" }
-caption "Default"
-default true
-selected_value Y
-height 1.5
-tip "00209_TIP_004"
}
GuidoRadioButton swadescuse2 {
-dependency { "[$swadesc getCurrentValue]" == "Y" }
-caption "Text"
-selected_value desc_text
-height 1.5
-tip "00209_TIP_004"
}
GuidoRadioButton swadescuse3 {
-dependency { "[$swadesc getCurrentValue]" == "Y" }
-caption "Math"
-selected_value desc_math
-height 1.5
-tip "00209_TIP_004"
}
}
}
}
GuidoPanel frm00209_27 {
-layout BoxLayout Y_AXIS
GuidoPanel frm00209_28 {
-border etched true
-label "Define the input strings"
-layout CentreLineLayout VERTICAL LEFT
GuidoFileBrowserField inploc {
-label Location
-display_length 17
-file_mask *.str
-format none
-link rinpid
-max_length 252
-next_focus rinpid
-tip "00209_TIP_010"
-translate none
}
GuidoFiller frm00209_29 {
-height 0.05
}
GuidoFiller frm00209_30 {
-height 0.05
}
GuidoField rinpid {
-label "ID number"
-display_length 17
-format double
-max_length 16
-next_focus strange
-tip "00209_TIP_010"
-translate upper
}
GuidoFiller frm00209_31 {
-height 0.05
}
GuidoFiller frm00209_32 {
-height 0.05
}
GuidoField strange {
-label "String range"
-display_length 17
-format range
-max_length 32
-next_focus interp
-tip "00209_TIP_010"
-translate none
}
}
GuidoPanel frm00209_33 {
-border etched true
-label "Define the output strings"
-layout CentreLineLayout VERTICAL LEFT
GuidoPanel interp_P {
-layout CentreLineLayout VERTICAL LEFT
GuidoCheckBox interp {
-default false
-selected_value Y
-tip "00209_TIP_009"
-unselected_value N
}
GuidoLabel interp_Label {
-label "Interpolate new points"
}
}
GuidoFiller frm00209_33 {
}
GuidoPanel interp_P1 {
-layout CentreLineLayout VERTICAL LEFT
GuidoFileBrowserField outloc {
-label Location
-display_length 17
-file_mask *.str
-format none
-link outid
-max_length 252
-next_focus outid
-tip "00209_TIP_013"
-translate none
-file_access write
}
GuidoFiller frm00209_34 {
-height 0.05
}
GuidoFiller frm00209_35 {
-height 0.05
}
GuidoField outid {
-label "ID number"
-display_length 17
-format double
-max_length 16
-null false
-tip "00209_TIP_013"
-translate upper
}
}
}
GuidoPanel frm00209_17 {
-border etched true
-label "Define the boundary string"
-layout CentreLineLayout  VERTICAL LEFT
GuidoPanel frm00209_18 {
-layout CentreLineLayout  VERTICAL LEFT
GuidoCheckBox bdyopt {
-default false
-next_focus bdyloc
-selected_value Y
-tip "00209_TIP_005"
-unselected_value N
}
GuidoLabel bdyoptLabel {
-label "Use a boundary string"
}
}
GuidoFiller frm00209_19 {
}
GuidoPanel frm00209_20 {
-layout CentreLineLayout VERTICAL LEFT
GuidoFiller frm00209_21 {
-width 2
}
GuidoPanel frm00209_22 {
-layout CentreLineLayout VERTICAL LEFT
GuidoFileBrowserField bdyloc {
-dependency {"[ $bdyopt getCurrentValue]" == "Y"}
-label Location
-display_length 13
-file_mask *.str
-format none
-link bdyid
-max_length 252
-next_focus bdyid
-tip "00209_TIP_005"
-translate none
}
GuidoFiller frm00209_23 {
-height 0.05
}
GuidoFiller frm00209_24 {
-height 0.05
}
GuidoField bdyid {
-dependency {"[ $bdyopt getCurrentValue]" == "Y"}
-display_length 13
-format double
-label "ID number"
-max_length 16
-next_focus ibdystr
-tip "00209_TIP_005"
-translate upper
}
GuidoFiller frm00209_25 {
-height 0.05
}
GuidoFiller frm00209_26 {
-height 0.05
}
GuidoField ibdystr {
-default 1
-dependency {"[ $bdyopt getCurrentValue]" == "Y"}
-label "String number"
-display_length 13
-format integer
-high_bound 32767
-low_bound 1
-max_length 5
-null false
-tip "00209_TIP_005"
-translate none
}
}
}
}
}
$dtmloc setActionCallback focusGained {[storeOldVal $dtmloc $dtmid $object_id $trisolation_id]}
$dtmloc setActionCallback valueChanged {[clearFieldList $dtmloc $dtmid $object_id $trisolation_id]}
$dtmid setActionCallback focusGained {[storeOldVal $dtmloc $dtmid $object_id $trisolation_id]}
$dtmid setActionCallback valueChanged {[clearFieldList $dtmloc $dtmid $object_id $trisolation_id]}
}
