GuidoScript scripts/dtmutilities.tcl
global dtm_layer
global dtmfld
global object_id
global trisolation_id
proc getTrisolationBounds {dtmLayer objectId trisolId dfield} {
global conmin
global conmax
global conrng
global ci
set obj_num [$objectId getCurrentValue]
set tri_num [$trisolId getCurrentValue]
set layer [$dtmLayer getCurrentValue]
set dtmDfield [$dfield getCurrentValue]
set buffer [GuidoExecServer GetLayerTrisolationBounds [subst {Layer = "$layer" CurrentTriobject = "$obj_num" CurrentTrisolation = "$tri_num" DField = "$dtmDfield"}]]
set status [GuidoGetParamBufferValue $buffer status]
if {$status >= 0} {
set conmin_temp [ GuidoGetParamBufferValue $buffer "conMin" ]
set conmax_temp [ GuidoGetParamBufferValue $buffer "conMax" ]
set ci_temp [ GuidoGetParamBufferValue $buffer "conInt" ]
$conmin setCurrentValue $conmin_temp
$conmax setCurrentValue $conmax_temp
$ci setCurrentValue $ci_temp
append range_temp $conmin_temp "," $conmax_temp "," $ci_temp
$conrng setCurrentValue "$range_temp"
}
}
global obj_name
global tri_name
proc validateDuplicationOflayers {} {
global new_layer
set layer [$new_layer getCurrentValue]
set buffer [ GuidoExecServer "GetLayerNames" {} ]
set layernames [GuidoGetParamBufferValue $buffer layers]
set layernameslist [split $layernames "\n"]
foreach item $layernameslist {
if {"$layer" == "$item"} {
GuidoMessage warning APP_LAYER_EXIST_ALREADY "$layer"
return false
}
}
}
GuidoForm frm01316 {
-action initial {[fill_triobject_trisolation_details_for_layers $dtm_layer $object_id $obj_name $trisolation_id $tri_name]}
-default_buttons
-label "Extract Contours From a DTM"
-layout BoxLayout Y_AXIS
-tip "Contours extracted from a DTM will be linear interpolations of the original data points."
-action initial {[getLayerDFieldNames $dtm_layer $dtmfld]}
GuidoPanel p1 {
-border etched true
-label "Define the DTM to be contoured"
-layout CentreLineLayout Vertical Left
GuidoComboBox dtm_layer {
-action valueChanged {[fill_triobject_trisolation_details_for_layers $dtm_layer $object_id $obj_name $trisolation_id $tri_name]}
-display_length 23
-format none
-label "Layer name"
-max_length APP_MAX_LAYER_NAME_LENGTH
-null false
-tip "A layer with a dtm loaded into it must be selected."
-action valueChanged {[getTrisolationBounds $dtm_layer $object_id $trisolation_id $dtmfld]}
-action valueChanged {[getLayerDFieldNames $dtm_layer $dtmfld]}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoComboBox dtmfld {
-display_length 3.7
-format none
-label "Field to contour"
-max_length 4
-translate none
-exclusive false
-tip "00048_TIP_2"
-action valueChanged {[getTrisolationBounds $dtm_layer $object_id $trisolation_id $dtmfld]}
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel triobject1 {
-label "Object ID"
}
GuidoPanel p2 {
-layout BoxLayout X_AXIS
GuidoComboBox object_id {
-display_length 5
-format integer
-max_length 32
-translate none
-exclusive false
-tip "04949_TIP_1"
-action valueChanged {[getTrisolationBounds $dtm_layer $object_id $trisolation_id $dtmfld]}
-action valueChanged {[fill_triobject_details $dtm_layer $object_id $obj_name $trisolation_id $tri_name "false" "true"]}
}
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 p3 {
-layout BoxLayout X_AXIS
GuidoComboBox trisolation_id {
-display_length 5
-format integer
-max_length 32
-translate none
-exclusive false
-tip "04949_TIP_2"
-action valueChanged {[fill_trisolation_details $dtm_layer $object_id $trisolation_id $tri_name "true" "true"]}
}
GuidoFiller filler {
-width 0.2
}
GuidoLabel tri_name {
}
}
}
GuidoFiller frm01316_11 {
-height 0.5
}
GuidoPanel p4 {
-layout BoxLayout Y_AXIS
-border etched true
GuidoPanel p5 {
-layout CentreLineLayout Vertical Left
GuidoLabel interval_or_range_label {
-label "Define contours by"
}
GuidoButtonGroupPanel interval_or_range {
-layout BoxLayout Y_AXIS
-tip "01316_TIP_003"
GuidoRadioButton frm01316_5 {
-caption Interval
-default true
-selected_value INTERVAL
}
GuidoRadioButton frm01316_6 {
-caption Range
-selected_value RANGE
}
}
}
GuidoPanel p1 {
-layout BoxLayout X_AXIS
GuidoFiller filler {
-width 10.5
}
GuidoPanel p1 {
-layout OverlayLayout
GuidoPanel p2 {
-layout CentreLineLayout Vertical Left
-dependency {"[ $interval_or_range getCurrentValue]" == "INTERVAL"}
GuidoLabel Minimum_contour {
-dependency {"[ $interval_or_range getCurrentValue]" == "INTERVAL"}
-label "Minimum contour"
}
GuidoField conmin {
-dependency {"[ $interval_or_range getCurrentValue]" == "INTERVAL"}
-display_length 10
-format double
-max_length 10
-null false
-tip "01316_TIP_004"
-translate upper
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel Maximum_contour {
-dependency {"[ $interval_or_range getCurrentValue]" == "INTERVAL"}
-label "Maximum contour"
}
GuidoField conmax {
-dependency {"[ $interval_or_range getCurrentValue]" == "INTERVAL"}
-display_length 10
-format double
-max_length 10
-null false
-tip "01316_TIP_004"
-translate upper
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoLabel Contour_interval {
-dependency {"[ $interval_or_range getCurrentValue]" == "INTERVAL"}
-label "Contour interval"
}
GuidoField ci {
-dependency {"[ $interval_or_range getCurrentValue]" == "INTERVAL"}
-display_length 10
-format double
-max_length 10
-null false
-tip "01316_TIP_004"
-translate upper
}
}
GuidoPanel p3 {
-dependency {"[ $interval_or_range getCurrentValue]" == "RANGE"}
-layout CentreLineLayout Vertical Left
GuidoLabel Contour_Range {
-dependency {"[ $interval_or_range getCurrentValue]" == "RANGE"}
-label "Contour range"
}
GuidoField conrng {
-dependency {"[ $interval_or_range getCurrentValue]" == "RANGE"}
-display_length 14
-format range
-max_length 32
-null false
-tip "01316_TIP_007"
}
}
}
}
}
GuidoFiller frm01316_13 {
-height 1
}
GuidoPanel p4 {
-layout CentreLineLayout Vertical Left
GuidoField new_layer {
-display_length 26
-format none
-label "Contour layer"
-validation {[validateDuplicationOflayers]}
-max_length 32
-null false
-tip "A new layer must be selected."
-translate none
}
}
}
