proc greatThanZero { field } {
set value [$field getCurrentValue]
if (value > 0) {
return 1
} else {
return 0
}
}
GuidoForm form {
-default_buttons
-label "Apply longitudinal profile"
-layout BoxLayout Y_AXIS
-help_id 27
GuidoPanel input_panel {
-border etched true
-label "Output"
-layout CentreLineLayout
GuidoLabel l1 {
-label "Profile layer"
}
GuidoField profile_dataset_field {
-width 15
-tip ROAD_PROFILE_LAYER_TIP
-input false
}
GuidoLabel l2 {
-label "Profile string"
}
GuidoField profile_string_field {
-tip ROAD_PROFILE_STRING_TIP
-input false
}
GuidoLabel l3 {
-label "Profile segment"
}
GuidoField profile_segment_field {
-tip ROAD_PROFILE_SEGMENT_TIP
-input false
}
GuidoLabel l4 {
-label "Target layer"
}
GuidoField target_dataset_field {
-width 15
-tip ROAD_TARGET_LAYER_TIP
-input false
}
GuidoLabel l5 {
-label "Target string"
}
GuidoField target_string_field {
-tip ROAD_TARGET_STRING_TIP
-input false
}
GuidoLabel l6 {
-label "Target segment"
}
GuidoField target_segment_field {
-tip "ROAD_TARGET_SEGMENT_TIP"
-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
}
}
}
set tclPath [ GuidoGetParamBufferValue [ GuidoExecServer GetTCLPath { } ] tclPath ]
source "$tclPath/../scripts/graphicsPickSegment.tcl"
set pickresult [graphicsPickViewport "Pick the viewport that contains the longitudinal profile" profile_viewport]
if { $pickresult } {
set pickresult [graphicsPickSegment "Pick a longitudinal profile" profile_dataset profile_string profile_segment source_points source_is_collinear]
if { $pickresult } {
set pickresult [graphicsPickViewport "Pick the viewport that contains the horizontal design" target_viewport]
if {$pickresult } {
set pickresult [graphicsPickSegment "Pick a horizontal design to apply this to" target_dataset target_string target_segment source_points source_is_collinear]
if { $pickresult } {
$profile_dataset_field setCurrentValue $profile_dataset
$profile_string_field setCurrentValue $profile_string
$profile_segment_field setCurrentValue $profile_segment
$target_dataset_field setCurrentValue $target_dataset
$target_string_field setCurrentValue $target_string
$target_segment_field setCurrentValue $target_segment
set return_code [$form interact]
GuidoApp app "APPLY LONGITUDINAL PROFILE"
if {$return_code == "apply"} {
$app setParam profile_dataset $profile_dataset
$app setParam profile_string $profile_string
$app setParam profile_segment $profile_segment
$app setParam elevation_axis "Z"
$app setParam target_dataset $target_dataset
$app setParam target_string $target_string
$app setParam target_segment $target_segment
$app setParam target_viewport $target_viewport
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
$attrList destroy
