proc greatThanZero { field } {
set value [$field getCurrentValue]
if (value > 0) {
return 1
} else {
return 0
}
}
GuidoForm form {
-default_buttons
-label "Create longitudinal profile"
-layout BoxLayout Y_AXIS
-help_id 179
GuidoPanel input_panel {
-border etched true
-label "Input"
-layout CentreLineLayout
GuidoLabel l1 {
-label "Source layer"
}
GuidoField source_dataset_field {
-width 15
-tip "ROAD_PROFILE_LAYER_TIP"
-input false
}
GuidoLabel l2 {
-label "Source string"
}
GuidoField source_string_field {
-tip "The profile string selected"
-input false
}
GuidoLabel l3 {
-label "Source segment"
}
GuidoField source_segment_field {
-tip "The profile segment selected"
-input false
}
GuidoCheckBox use_chainage_field {
-default true
-label ROAD_USE_CHAINAGE_FIELD
-tip ROAD_USE_CHAINAGE_FIELD_TIP
-selected_value Y
-unselected_value N
}
}
GuidoPanel output_panel {
-border etched true
-label "Output"
-layout CentreLineLayout
GuidoField output_layer {
-label "Output layer"
-default "longitudinal profile"
-width 25
-tip "FRM_CREATELONGITUDINALPROFILE_1"
-null false
}
GuidoField output_string {
-label "Output string"
-tip "FRM_CREATELONGITUDINALPROFILE_2"
-validation { [ greatThanZero $output_string ] }
-width 5
-null false
-format integer
}
GuidoField view_scale_factor {
-label ROAD_SCALE_FACTOR_LABEL
-tip ROAD_SCALE_FACTOR_TIP
-width 5
-default 1.0
-null false
-format float
}
GuidoCheckBox enable_plane_mode {
-default true
-label ROAD_ENABLE_PLANE_MODE
-tip ROAD_ENABLE_PLANE_MODE_TIP
-selected_value 1
-unselected_value 0
}
}
}
set tclPath [ GuidoGetParamBufferValue [ GuidoExecServer GetTCLPath { } ] tclPath ]
source "$tclPath/../scripts/graphicsPickSegment.tcl"
set pickresult [graphicsPickSegment "Pick a segment to create a profile from" source_dataset source_string source_segment source_points source_is_collinear]
if { $pickresult } {
$source_dataset_field setCurrentValue $source_dataset
$source_string_field setCurrentValue $source_string
$source_segment_field setCurrentValue $source_segment
set return_code [$form interact]
if {$return_code == "apply"} {
GuidoApp app "CREATE LONGITUDINAL PROFILE"
$app setParam source_dataset $source_dataset
$app setParam source_string $source_string
$app setParam source_segment $source_segment
$app setParam output_layer [$output_layer getCurrentValue]
$app setParam output_string [$output_string getCurrentValue]
$app setParam elevation_axis "Z"
$app setParam view_scale_factor [$view_scale_factor getCurrentValue]
$app setParam enable_plane_mode [$enable_plane_mode getCurrentValue]
if { [$use_chainage_field getCurrentValue] == "Y" } {
$app setParam use_chainage_field 1
} else {
$app setParam use_chainage_field 0
}
set return_code [$app invoke]
$app destroy
}
}
$form destroy
