GuidoApp check_db "CHECK STATION ERRORS EXISTS"
$check_db setParam "displayMessages" "true"
set result [$check_db invoke]
$check_db destroy
if {$result == "0"} {
GuidoForm form {
-default_buttons
-label "Edit station orders"
-layout BoxLayout Y_AXIS
-tip EDIT_STATION_ERRORS_FORM_TIP
-help_id 1575
GuidoPanel p3 {
GuidoScrollPane s1 {
-height 10
-border etched true
-label "Orders and definitions"
GuidoTable orders {
-instances 1 1 500
-interactive true
-column_sorting false
GuidoComboBox order {
-format none
-label "order"
-value_in "1st" "2nd" "3rd" "4th" "5th"
-exclusive false
-max_length 24
-null false
-tip EDIT_STATION_ERRORS_ORDER_TIP
-translate none
}
GuidoComboBox parameter {
-format none
-label "parameter"
-value_in "HORIZONTAL ANGLE STANDARD DEVIATION" "VERTICAL ANGLE STANDARD DEVIATION" "SLOPE DISTANCE STANDARD DEVIATION" "RESECTION X STANDARD DEVIATION" "RESECTION Y STANDARD DEVIATION" "RESECTION Z STANDARD DEVIATION" "3D SURVEY NETWORK ADJUSTMENT X STANDARD DEVIATION" "3D SURVEY NETWORK ADJUSTMENT Y STANDARD DEVIATION" "3D SURVEY NETWORK ADJUSTMENT Z STANDARD DEVIATION" "2D SURVEY NETWORK ADJUSTMENT X STANDARD DEVIATION" "2D SURVEY NETWORK ADJUSTMENT Y STANDARD DEVIATION"
-exclusive false
-tip EDIT_STATION_ERRORS_PARAM_TIP
-null false
-translate none
}
GuidoField num_meas_from {
-display_length 10
-format integer
-low_bound 0
-label "num meas from"
-max_length 5
-null false
-tip EDIT_STATION_ERRORS_NMF_TIP
-translate none
}
GuidoField num_meas_to {
-display_length 10
-format integer
-low_bound 0
-label "num meas to"
-max_length 5
-null true
-tip EDIT_STATION_ERRORS_NMT_TIP
-translate none
}
GuidoField value_from {
-display_length 7
-format double
-low_bound 0.0
-decimals 5
-label "value from"
-max_length 11
-null true
-tip EDIT_STATION_ERRORS_VF_TIP
-translate none
}
GuidoField value_to {
-display_length 5
-format double
-low_bound 0.0
-decimals 5
-label "value to"
-max_length 11
-null true
-tip EDIT_STATION_ERRORS_VT_TIP
-translate none
}
GuidoField dist_from {
-display_length 7
-format double
-low_bound 0.0
-decimals 3
-label "dist from"
-max_length 11
-null true
-tip EDIT_STATION_ERRORS_DF_TIP
-translate none
}
GuidoField dist_to {
-display_length 5
-format double
-low_bound 0.0
-decimals 3
-label "dist to"
-max_length 11
-null true
-tip EDIT_STATION_ERRORS_DT_TIP
-translate none
}
GuidoComboBox action {
-display_length 20
-format none
-label "action"
-null false
-tip EDIT_STATION_ERRORS_ACTION_TIP
-value_in "CONTINUE" "INFORMATIONAL" "WARNING" "ERROR"
-exclusive true
-translate upper
}
GuidoField instruments {
-display_length 100
-format none
-label "instruments"
-max_length STAT_ERR_INSTRUMENT_FIELD_MAX_LENGTH
-null true
-tip EDIT_STATION_ERRORS_INSTRUMENTS_TIP
-translate upper
}
}
}
}
GuidoFiller f1 {
-height 0.25
}
GuidoPanel outer_panel {
-layout Boxlayout X_AXIS
GuidoPanel p4 {
-layout Boxlayout Y_AXIS
GuidoPanel p5 {
-border etched true
-label EDIT_STATION_ERRORS_DEF_ORDER_LABEL
-layout CentreLineLayout
GuidoComboBox default_action {
-display_length 15
-format none
-label "Action"
-null false
-value_in "CONTINUE" "INFORMATIONAL" "WARNING" "ERROR"
-exclusive true
-tip EDIT_STATION_ERRORS_DEFA_TIP
-translate upper
}
GuidoComboBox default_order {
-display_length 15
-format none
-label "Order"
-value_in "1st" "2nd" "3rd" "4th" "5th"
-exclusive false
-max_length 24
-null false
-tip EDIT_STATION_ERRORS_DEFO_TIP
-translate none
}
}
GuidoPanel p8 {
-border etched true
-label EDIT_STATION_ERRORS_1SD_SINGANG_LABEL
-layout CentreLineLayout
GuidoComboBox single_sloped_angles_action {
-display_length 15
-format none
-label "Action"
-null false
-value_in "CONTINUE" "INFORMATIONAL" "WARNING" "ERROR"
-exclusive true
-tip EDIT_STATION_ERRORS_1SDSINGANGS_TIP
-translate upper
}
GuidoComboBox single_sloped_angles_order {
-display_length 15
-format none
-label "Order"
-value_in "1st" "2nd" "3rd" "4th" "5th"
-exclusive false
-max_length 24
-null false
-translate none
-tip EDIT_STATION_ERRORS_1SDSINGANGS_ORDER_TIP
}
}
GuidoPanel p13 {
-border etched true
-label "Resection observation adjustment options"
-layout CentreLineLayout
GuidoCheckBox adjustments_warnings {
-default false
-label "Give warnings on adjustments?"
-selected_value Y
-unselected_value N
-tip EDIT_STATION_ERRORS_ADJ_WARN_TIP
}
GuidoField adj_warn_ha {
-dependency {"[$adjustments_warnings getCurrentValue]" == "Y"}
-display_length 10
-format dms_angle
-decimals 5
-label "Warning horizontal angle"
-max_length 12
-null true
-tip EDIT_STATION_ERRORS_ADJ_WARN_HA_TIP
}
GuidoField adj_warn_va {
-dependency {"[$adjustments_warnings getCurrentValue]" == "Y"}
-display_length 10
-format dms_angle
-decimals 5
-label "Warning vertical angle"
-max_length 12
-null true
-tip EDIT_STATION_ERRORS_ADJ_WARN_VA_TIP
}
GuidoField adj_warn_dist {
-dependency {"[$adjustments_warnings getCurrentValue]" == "Y"}
-display_length 10
-format double
-decimals 5
-label "Warning slope distance PPM"
-max_length 12
-null true
-low_bound 0.0
-tip EDIT_STATION_ERRORS_ADJ_WARN_SD_PPM_TIP
}
GuidoCheckBox adjustments_errors {
-default false
-label "Give errors on adjustments?"
-selected_value Y
-unselected_value N
-tip EDIT_STATION_ERRORS_ADJ_ERR_TIP
}
GuidoField adj_error_ha {
-dependency {"[$adjustments_errors getCurrentValue]" == "Y"}
-display_length 10
-format dms_angle
-decimals 5
-label "Error horizontal angle"
-max_length 12
-null true
-tip EDIT_STATION_ERRORS_ADJ_ERR_HA_TIP
}
GuidoField adj_error_va {
-dependency {"[$adjustments_errors getCurrentValue]" == "Y"}
-display_length 10
-format dms_angle
-decimals 5
-label "Error vertical angle"
-max_length 12
-null true
-tip EDIT_STATION_ERRORS_ADJ_ERR_VA_TIP
}
GuidoField adj_error_dist {
-dependency {"[$adjustments_errors getCurrentValue]" == "Y"}
-display_length 10
-format double
-decimals 5
-label "Error slope distance PPM"
-max_length 12
-null true
-low_bound 0.0
-tip EDIT_STATION_ERRORS_ADJ_ERR_SD_PPM_TIP
}
}
}
GuidoPanel p7 {
-layout Boxlayout Y_AXIS
GuidoPanel p6 {
-border etched true
-label EDIT_STATION_ERRORS_1ANG_OR_1SD_LABEL
-layout CentreLineLayout
GuidoComboBox mfo_1ang_or_1sd_action {
-display_length 15
-format none
-label "Data Recorder Multiface Observations: Action"
-null false
-value_in "CONTINUE" "INFORMATIONAL" "WARNING" "ERROR"
-exclusive true
-tip EDIT_STATION_ERRORS_MFO1SD_TIP
-translate upper
}
GuidoComboBox mfo_1ang_or_1sd_order {
-display_length 15
-format none
-label "Data Recorder Multiface Observations: Default Order"
-value_in "1st" "2nd" "3rd" "4th" "5th"
-default ""
-exclusive false
-max_length 24
-null true
-translate none
-tip EDIT_STATION_ERRORS_MFO1SD_TIP
}
GuidoComboBox surf_1ang_or_1sd_action {
-display_length 15
-format none
-label "Surface Traverse: Action"
-null false
-value_in "CONTINUE" "INFORMATIONAL" "WARNING" "ERROR"
-exclusive true
-max_length 24
-tip EDIT_STATION_ERRORS_SURFT1SD_TIP
-translate upper
}
GuidoComboBox surf_1ang_or_1sd_order {
-display_length 15
-format none
-label "Surface Traverse: Default Order"
-value_in "1st" "2nd" "3rd" "4th" "5th"
-default ""
-exclusive false
-max_length 24
-null true
-translate none
-tip EDIT_STATION_ERRORS_SURFT1SD_TIP
}
GuidoComboBox ug_1ang_or_1sd_action {
-display_length 15
-format none
-label "Underground Traverse: Action"
-null false
-value_in "CONTINUE" "INFORMATIONAL" "WARNING" "ERROR"
-exclusive true
-tip EDIT_STATION_ERRORS_UGT1SD_TIP
-translate upper
}
GuidoComboBox ug_1ang_or_1sd_order {
-display_length 15
-format none
-label "Underground Traverse: Default Order"
-value_in "1st" "2nd" "3rd" "4th" "5th"
-default ""
-exclusive false
-max_length 24
-null true
-translate none
-tip EDIT_STATION_ERRORS_UGT1SD_TIP
}
}
GuidoPanel p22 {
-layout Boxlayout X_AXIS
GuidoPanel p9 {
-border etched true
-label EDIT_STATION_ERRORS_REPORT_OUTPUT_OPTIONS
-layout BoxLayout X_AXIS
GuidoPanel p10 {
-layout CentreLineLayout
GuidoFileBrowserField report_filename {
-display_length 20
-format none
-label "Report filename"
-extension false
-file_mask "*.not *.csv *.htm *.html *.rtf *.pdf *.ps"
-max_length 60
-null true
-tip EDIT_STATION_ERRORS_REPORT_FILENAME_TIP
-translate none
}
GuidoFileBrowserField validate_filename {
-display_length 20
-format none
-label "Validation Filename"
-extension false
-file_mask "*.not *.csv *.htm *.html *.rtf *.pdf *.ps"
-max_length 60
-null true
-tip EDIT_STATION_ERRORS_VALIDATION_FILENAME_TIP
-translate none
}
GuidoComboBox report_format {
-label "Report Format"
-display_length 20
-format none
-max_length 40
-null false
-tip EDIT_STATION_ERRORS_REPORT_FORMAT_TIP
-value_in ".not - Surpac Note File" ".csv - Comma Separated (Spreadsheet)" ".htm - Hypertext Markup Language (Web)" ".html - Hypertext Markup Language (Web)" ".rtf - Rich Text Format (Microsoft Word)" ".pdf - Adobe Acrobat" ".ps  - Postscript"
}
}
GuidoPanel p11 {
-layout Boxlayout Y_AXIS
GuidoButton  report {
-caption "Report..."
-selected_value "report"
-legacy_button
-width 10
}
GuidoButton validate {
-caption "Validate..."
-selected_value "validate"
-legacy_button
-width 10
}
}
}
}
}
}
}
set databuf [ GuidoExecServer GetStationErrors {} ]
set version_ok [GuidoGetParamBufferValue $databuf VersionOK]
if {$version_ok == "true"} {
set num_syntax_errors [GuidoGetParamBufferValue $databuf NumberOfSyntaxErrors]
if {$num_syntax_errors == 0} {
set num_initial_rows [GuidoGetParamBufferValue $databuf RowCount]
if {$num_initial_rows > 0} {
$default_order setCurrentValue [GuidoGetParamBufferValue $databuf "DefValueOrder"]
$default_action setCurrentValue [GuidoGetParamBufferValue $databuf "DefValueAction"]
$mfo_1ang_or_1sd_action setCurrentValue [GuidoGetParamBufferValue $databuf "DrmfOneAngSDAction"]
$mfo_1ang_or_1sd_order setCurrentValue [GuidoGetParamBufferValue $databuf "DrmfOneAngSDOrder"]
$surf_1ang_or_1sd_action setCurrentValue [GuidoGetParamBufferValue $databuf "SurftOneAngSDAction"]
$surf_1ang_or_1sd_order setCurrentValue [GuidoGetParamBufferValue $databuf "SurftOneAngSDOrder"]
$ug_1ang_or_1sd_action setCurrentValue [GuidoGetParamBufferValue $databuf "UgtOneAngSDAction"]
$ug_1ang_or_1sd_order setCurrentValue [GuidoGetParamBufferValue $databuf "UgtOneAngSDOrder"]
$single_sloped_angles_order setCurrentValue [GuidoGetParamBufferValue $databuf "SingleValOrder"]
$single_sloped_angles_action setCurrentValue [GuidoGetParamBufferValue $databuf "SingleValAction"]
set adj_warn [GuidoGetParamBufferValue $databuf "ResectionAdjWarning"]
$adjustments_warnings setCurrentValue $adj_warn
if {$adj_warn == "Y"} {
set adjustment_warning_ha [GuidoGetParamBufferValue $databuf "ResectionAdjWarningHA"]
if {$adjustment_warning_ha < -0.001} {
$adj_warn_ha setCurrentValue  ""
} else {
$adj_warn_ha setCurrentValue $adjustment_warning_ha
}
set adjustment_warning_va [GuidoGetParamBufferValue $databuf "ResectionAdjWarningVA"]
if {$adjustment_warning_va < -0.001} {
$adj_warn_va setCurrentValue  ""
} else {
$adj_warn_va setCurrentValue $adjustment_warning_va
}
set adjustment_warning_sd [GuidoGetParamBufferValue $databuf "ResectionAdjWarningSD"]
if {$adjustment_warning_sd < -0.001} {
$adj_warn_dist setCurrentValue  ""
} else {
$adj_warn_dist setCurrentValue $adjustment_warning_sd
}
}
set adj_error [GuidoGetParamBufferValue $databuf "ResectionAdjError"]
$adjustments_errors setCurrentValue $adj_error
if {$adj_error == "Y"} {
set adjustment_error_ha [GuidoGetParamBufferValue $databuf "ResectionAdjErrorHA"]
if {$adjustment_error_ha < -0.001} {
$adj_error_ha setCurrentValue  ""
} else {
$adj_error_ha setCurrentValue $adjustment_error_ha
}
set adjustment_error_va [GuidoGetParamBufferValue $databuf "ResectionAdjErrorVA"]
if {$adjustment_error_va < -0.001} {
$adj_error_va setCurrentValue  ""
} else {
$adj_error_va setCurrentValue $adjustment_error_va
}
set adjustment_error_sd [GuidoGetParamBufferValue $databuf "ResectionAdjErrorSD"]
if {$adjustment_error_sd < -0.001} {
$adj_error_dist setCurrentValue  ""
} else {
$adj_error_dist setCurrentValue $adjustment_error_sd
}
}
$orders setInitialRows $num_initial_rows 1 500
for {set i 0} {$i < $num_initial_rows} {incr i} {
$order setCurrentValue $i [GuidoGetParamBufferValue $databuf "StationOrder($i)"]
$parameter setCurrentValue $i [GuidoGetParamBufferValue $databuf "ParamName($i)"]
set num_from [GuidoGetParamBufferValue $databuf "NumFrom($i)"]
if {$num_from < 0} {
$num_meas_from setCurrentValue $i ""
} else {
$num_meas_from setCurrentValue $i $num_from
}
set num_to [GuidoGetParamBufferValue $databuf "NumTo($i)"]
if {$num_to < 0} {
$num_meas_to setCurrentValue $i ""
} else {
$num_meas_to setCurrentValue $i $num_to
}
set val_from [GuidoGetParamBufferValue $databuf "ValFrom($i)"]
if {$val_from < -0.001} {
$value_from setCurrentValue $i ""
} else {
$value_from setCurrentValue $i $val_from
}
set val_to [GuidoGetParamBufferValue $databuf "ValTo($i)"]
if {$val_to < -0.001} {
$value_to setCurrentValue $i ""
} else {
$value_to setCurrentValue $i $val_to
}
set distance_from [GuidoGetParamBufferValue $databuf "DistFrom($i)"]
if {$distance_from < -0.001} {
$dist_from setCurrentValue $i ""
} else {
$dist_from setCurrentValue $i $distance_from
}
set distance_to [GuidoGetParamBufferValue $databuf "DistTo($i)"]
if {$distance_to < -0.001} {
$dist_to setCurrentValue $i ""
} else {
$dist_to setCurrentValue $i $distance_to
}
$action setCurrentValue $i [GuidoGetParamBufferValue $databuf "RowAction($i)"]
$instruments setCurrentValue $i [GuidoGetParamBufferValue $databuf "Instruments($i)"]
}
}
while {1} {
set return_code [$form interact]
if {$return_code != "cancel"} {
GuidoApp app "EDIT STATION ERRORS"
$app setParam function $return_code
$app setParam DefValueOrder [$default_order getCurrentValue]
$app setParam DefValueAction [$default_action getCurrentValue]
$app setParam DrmfOneAngSDAction [$mfo_1ang_or_1sd_action getCurrentValue]
$app setParam DrmfOneAngSDOrder [$mfo_1ang_or_1sd_order getCurrentValue]
$app setParam SurftOneAngSDAction [$surf_1ang_or_1sd_action getCurrentValue]
$app setParam SurftOneAngSDOrder [$surf_1ang_or_1sd_order getCurrentValue]
$app setParam UgtOneAngSDAction [$ug_1ang_or_1sd_action getCurrentValue]
$app setParam UgtOneAngSDOrder [$ug_1ang_or_1sd_order getCurrentValue]
$app setParam SingleValOrder [$single_sloped_angles_order getCurrentValue]
$app setParam SingleValAction [$single_sloped_angles_action getCurrentValue]
$app setParam reportFormat [$report_format getCurrentValue]
$app setParam reportFilename [$report_filename getCurrentValue]
$app setParam validateFilename [$validate_filename getCurrentValue]
$app setParam ResectionAdjWarning [$adjustments_warnings getCurrentValue]
if {[$adjustments_warnings getCurrentValue] == "Y"} {
if {[$adj_warn_ha getCurrentValue] == ""} {
$app setParam "ResectionAdjWarningHA" "-1.0"
} else {
if {[$adj_warn_ha getCurrentValue] < 0.0} {
set valueToUse [expr -1.0 * [$adj_warn_ha getCurrentValue]]
} else {
set valueToUse [$adj_warn_ha getCurrentValue]
}
$app setParam "ResectionAdjWarningHA" $valueToUse
}
if {[$adj_warn_va getCurrentValue] == ""} {
$app setParam "ResectionAdjWarningVA" "-1.0"
} else {
if {[$adj_warn_va getCurrentValue] < 0.0} {
set valueToUse [expr -1.0 * [$adj_warn_va getCurrentValue]]
} else {
set valueToUse [$adj_warn_va getCurrentValue]
}
$app setParam "ResectionAdjWarningVA" $valueToUse
}
if {[$adj_warn_dist getCurrentValue] == ""} {
$app setParam "ResectionAdjWarningSD" "-1.0"
} else {
$app setParam "ResectionAdjWarningSD" [$adj_warn_dist getCurrentValue]
}
}
$app setParam ResectionAdjError [$adjustments_errors getCurrentValue]
if {[$adjustments_errors getCurrentValue] == "Y"} {
if {[$adj_error_ha getCurrentValue] == ""} {
$app setParam "ResectionAdjErrorHA" "-1.0"
} else {
if {[$adj_error_ha getCurrentValue] < 0.0} {
set valueToUse [expr -1.0 * [$adj_error_ha getCurrentValue]]
} else {
set valueToUse [$adj_error_ha getCurrentValue]
}
$app setParam "ResectionAdjErrorHA" $valueToUse
}
if {[$adj_error_va getCurrentValue] == ""} {
$app setParam "ResectionAdjErrorVA" "-1.0"
} else {
if {[$adj_error_va getCurrentValue] < 0.0} {
set valueToUse [expr -1.0 * [$adj_error_va getCurrentValue]]
} else {
set valueToUse [$adj_error_va getCurrentValue]
}
$app setParam "ResectionAdjErrorVA" $valueToUse
}
if {[$adj_error_dist getCurrentValue] == ""} {
$app setParam "ResectionAdjErrorSD" "-1.0"
} else {
$app setParam "ResectionAdjErrorSD" [$adj_error_dist getCurrentValue]
}
}
set num_final_rows [$orders getRowCount]
$app setParam RowCount $num_final_rows
for {set i 0} {$i < $num_final_rows} {incr i} {
$app setParam "StationOrder($i)" [$order getCurrentValue $i]
$app setParam "ParamName($i)" [$parameter getCurrentValue $i]
if {[$num_meas_from getCurrentValue $i] == ""} {
$app setParam "NumFrom($i)" "-1"
} else {
$app setParam "NumFrom($i)" [$num_meas_from getCurrentValue $i]
}
if {[$num_meas_to getCurrentValue $i] == ""} {
$app setParam "NumTo($i)" "-1"
} else {
$app setParam "NumTo($i)" [$num_meas_to getCurrentValue $i]
}
if {[$value_from getCurrentValue $i] == ""} {
$app setParam "ValFrom($i)" "-1.0"
} else {
$app setParam "ValFrom($i)" [$value_from getCurrentValue $i]
}
if {[$value_to getCurrentValue $i] == ""} {
$app setParam "ValTo($i)" "-1.0"
} else {
$app setParam "ValTo($i)" [$value_to getCurrentValue $i]
}
if {[$dist_from getCurrentValue $i] == ""} {
$app setParam "DistFrom($i)" "-1.0"
} else {
$app setParam "DistFrom($i)" [$dist_from getCurrentValue $i]
}
if {[$dist_to getCurrentValue $i] == ""} {
$app setParam "DistTo($i)" "-1.0"
} else {
$app setParam "DistTo($i)" [$dist_to getCurrentValue $i]
}
$app setParam "RowAction($i)" [$action getCurrentValue $i]
$app setParam "Instruments($i)" [$instruments getCurrentValue $i]
}
set report_status 0
if {$return_code == "report"} {
if {[$report_filename getCurrentValue] != ""} {
GuidoApp check "CHECK FILE EXISTS"
$check setParam "filename" [$report_filename getCurrentValue]
$check setParam "format" [$report_format getCurrentValue]
set report_status [$check invoke]
$check destroy
} else {
set report_status 1
}
}
if {$return_code == "validate"} {
if {[$validate_filename getCurrentValue] != ""} {
GuidoApp check "CHECK FILE EXISTS"
$check setParam "filename" [$validate_filename getCurrentValue]
$check setParam "format" [$report_format getCurrentValue]
set report_status [$check invoke]
$check destroy
} else {
set report_status 1
}
}
if {$report_status == 0} {
set return_status [$app invoke]
}
$app destroy
} else {
break
}
if {$return_code == "apply" && $return_status == "0"} {
break
}
}
}
}
$form destroy
}
