GuidoScript scripts/dtmutilities.tcl
global dtmloc
global object_id
global trisolation_id
global obj_name
global tri_name
proc validateCenterLineString {strfile str_id} {
set location [$strfile getCurrentValue]
set stringNumber [$str_id getCurrentValue]
set filename ""
append filename $location ".str"
if {[string length $filename] > 4 } {
set buffer [GuidoExecServer doesStringExist [subst {FileName = "$filename" StrNumber = "$stringNumber"}]]
set status [GuidoGetParamBufferValue $buffer status]
if {$status == -10027} {
GuidoMessage warning APP_STRNOTFND $stringNumber
return false
}
if {$status == -10058} {
GuidoMessage warning APP_STR_CLOSED $stringNumber
return false
}
if {$status == -10057} {
GuidoMessage warning APP_TOO_MNY_SEGS
return false
}
if {$status == -10898} {
GuidoMessage warning CENTRELINE_SEGMENT_TOO_SHORT
return false
}
if {$status == -20001} {
GuidoMessage warning CENTRELINE_SINGLE_POINT
return false
}
}
}
GuidoForm frm00037 {
-action initial {[getObjectsTrisolationsForMultipleDTMS $dtmloc $object_id $obj_name $trisolation_id $tri_name]}
-default_buttons
-label "Extract sections from a DTM along a centre line"
-layout BoxLayout Y_AXIS
-tip 00037_TIP_0
-action final {[destroyMultipleDtms]}
GuidoPanel frm00037_28 {
-layout BoxLayout Y_AXIS
GuidoPanel frm00037_26 {
-border etched true
-label "Define the DTM"
-layout BoxLayout Y_AXIS
GuidoPanel frm00245_37 {
-layout CentreLineLayout Vertical Left
GuidoFileBrowserField dtmloc {
-action valueChanged {[getObjectsTrisolationsForMultipleDTMS $dtmloc $object_id $obj_name $trisolation_id $tri_name]}
-label "DTM location"
-display_length 25.5
-file_mask *.dtm
-format none
-max_length 252
-next_focus object_id
-tip 00037_TIP_1
-translate none
-extension false
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel triobject {
-label "Object ID"
}
GuidoPanel frm01320_6 {
-layout BoxLayout X_AXIS
GuidoComboBox object_id {
-display_length 5
-format integer
-max_length 32
-next_focus trisolation_id
-translate none
-exclusive false
-tip "04949_TIP_1"
-action valueChanged {[triobjectChanged $dtmloc $object_id $obj_name $trisolation_id $tri_name]}
}
GuidoFiller filler {
-width 0.2
}
GuidoLabel obj_name {
}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel trisol_panel {
-label "Trisolation ID"
}
GuidoPanel frm01320_7 {
-layout BoxLayout X_AXIS
GuidoComboBox trisolation_id {
-display_length 5
-format integer
-max_length 32
-translate none
-exclusive false
-next_focus strloc
-tip "04949_TIP_2"
-action valueChanged {[trisolationChanged $dtmloc $object_id $trisolation_id $tri_name]}
}
GuidoFiller filler {
-width 0.2
}
GuidoLabel tri_name {
}
}
}
}
GuidoPanel frm00037_27 {
-border etched true
-label "Define the center line string"
-layout BoxLayout Y_AXIS
GuidoPanel strloc_panel {
-layout CentreLineLayout Vertical Left
GuidoFileBrowserField strloc {
-label Location
-display_length 25.3
-file_mask *.str
-format none
-max_length 252
-next_focus iclstr
-tip 00037_TIP_3
-translate none
-extension false
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField iclstr {
-label "String number"
-display_length 7.5
-format integer
-high_bound 32767
-low_bound 1
-max_length 5
-next_focus secwidth
-null false
-tip 00037_TIP_4
-translate none
-validation {[validateCenterLineString $strloc $iclstr]}
}
}
}
}
GuidoPanel frm00037_31 {
-border etched true
-display_length 33
-label "Define the section method"
-layout BoxLayout Y_AXIS
GuidoPanel frm00037_22 {
-layout CentreLineLayout Vertical Left
-tip 00037_TIP_5
GuidoField secwidth {
-label "Width either side"
-display_length 7.6
-format double
-high_bound 999999999
-low_bound 0.1
-max_length 10
-next_focus sectype
-null false
-tip 00037_TIP_6
-translate upper
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel sectype_label {
-label "Position sections at"
}
GuidoPanel p1 {
-layout BoxLayout Y_AXIS
GuidoButtonGroupPanel sectype {
-layout BoxLayout Y_AXIS
-tip 00037_TIP_5
GuidoRadioButton frm00037_20 {
-caption "At each point"
-selected_value P
}
GuidoRadioButton frm00037_21 {
-caption "At each regular interval"
-default true
-next_focus secint
-selected_value I
}
}
GuidoPanel p1 {
-layout BoxLayout X_AXIS
GuidoFiller filler {
-width 1.7
}
GuidoPanel p2 {
-layout CentreLineLayout Vertical Left
GuidoField secint {
-dependency {"[$sectype getCurrentValue]" == "I"}
-label "Section spacing"
-display_length 7.6
-format double
-high_bound 999999999
-low_bound 0.1
-max_length 10
-next_focus oloc
-null false
-tip 00037_TIP_7
-translate upper
}
}
}
}
}
}
GuidoPanel frm00037_32 {
-border etched true
-label "Define the file to create"
-layout BoxLayout Y_AXIS
GuidoPanel oloc_panel {
-layout CentreLineLayout Vertical Left
GuidoFileBrowserField oloc {
-label Location
-display_length 27.8
-file_access write
-file_mask *.str
-format none
-max_length 252
-tip 00037_TIP_8
-translate none
-null false
-extension false
}
}
}
}
