GuidoScript forms/SurveyInstrumentCommon.tcl
set enabledList [list true true true true]
set result "not run"
proc initialise { observationsTable
include_ha
horizontal_angle
include_va
vertical_angle
include_sd
slope_distance
include_row
survey_station
target_height
fTest
resection_station
res_y
res_x
res_z
instrument
angle_accuracy
inst_height_accuracy
targ_height_accuracy
dist_accuracy
inst_centring_accuracy
targ_centring_accuracy
dist_parts_per_million
inputs
stationHeight
ftestIcon
ftestResult
confidence_level
redundancy
accuracies_panel
preferredBacksight  } {
global result
global translated_SRV_RESECTION_LOG_NOT_APPLICABLE
set translated_SRV_RESECTION_LOG_NOT_APPLICABLE [GuidoMessage translate SRV_RESECTION_LOG_NOT_APPLICABLE]
set translated_val [GuidoMessage translate SRV_RESECTION_FORM_STD_DEV]
$resection_station setCurrentValue 1 $translated_val
runResection true $observationsTable $include_ha $horizontal_angle $include_va $vertical_angle $include_sd $slope_distance $include_row $survey_station $target_height $fTest $resection_station $res_y $res_x $res_z $instrument $angle_accuracy $inst_height_accuracy $targ_height_accuracy $dist_accuracy $inst_centring_accuracy $targ_centring_accuracy $dist_parts_per_million $inputs $stationHeight $ftestIcon $ftestResult $confidence_level $redundancy $accuracies_panel $preferredBacksight
set callback {[runResection false $observationsTable $include_ha $horizontal_angle $include_va $vertical_angle $include_sd $slope_distance $include_row $survey_station $target_height $fTest $resection_station $res_y $res_x $res_z $instrument $angle_accuracy $inst_height_accuracy $targ_height_accuracy $dist_accuracy $inst_centring_accuracy $targ_centring_accuracy $dist_parts_per_million $inputs $stationHeight $ftestIcon $ftestResult $confidence_level $redundancy $accuracies_panel $preferredBacksight]}
$confidence_level setActionCallback valueChanged $callback
$include_row setActionCallback valueChanged $callback
$include_ha setActionCallback valueChanged $callback
$include_va setActionCallback valueChanged $callback
$include_sd setActionCallback valueChanged $callback
$dist_accuracy setActionCallback valueChanged $callback
$angle_accuracy setActionCallback valueChanged $callback
$dist_parts_per_million setActionCallback valueChanged $callback
$inst_height_accuracy setActionCallback valueChanged $callback
$targ_height_accuracy setActionCallback valueChanged $callback
$inst_centring_accuracy setActionCallback valueChanged $callback
$targ_centring_accuracy setActionCallback valueChanged $callback
$instrument setActionCallback valueChanged $callback
$include_row setActionCallback valueChanged {[includeRowChanged $observationsTable $include_row $include_ha $horizontal_angle $include_va $vertical_angle $include_sd $slope_distance $survey_station $target_height]}
}
proc includeRowChanged {observationsTable
include_row
include_ha
horizontal_angle
include_va
vertical_angle
include_sd
slope_distance
survey_station
target_height } {
global enabledList
set length [llength $enabledList]
for {set i 0} {$i < [$observationsTable getRowCount]} {incr i} {
set value [$include_row getCurrentValue $i]
set storedValue [lindex $enabledList $i]
if { $value != $storedValue } {
if {$value == "true"} {
set enabledList [lreplace $enabledList $i $i true]
$survey_station setInputAllowed $i true
$target_height setInputAllowed $i true
$horizontal_angle setInputAllowed $i true
$include_ha setInputAllowed $i true
$include_ha setCurrentValue $i true
$vertical_angle setInputAllowed $i true
$include_va setInputAllowed $i true
$include_va setCurrentValue $i true
$slope_distance setInputAllowed $i true
$include_sd setInputAllowed $i true
$include_sd setCurrentValue $i true
} else {
$include_sd setCurrentValue $i false
set enabledList [lreplace $enabledList $i $i false]
$survey_station setInputAllowed $i false
$target_height setInputAllowed $i false
$horizontal_angle setInputAllowed $i false
$include_ha setInputAllowed $i false
$include_ha setCurrentValue $i false
$vertical_angle setInputAllowed $i false
$include_va setInputAllowed $i false
$include_va setCurrentValue $i false
$slope_distance setInputAllowed $i false
$include_sd setInputAllowed $i false
}
}
}
return 1
}
proc runResection { firstTime
observationsTable
include_ha
horizontal_angle
include_va
vertical_angle
include_sd
slope_distance
include_row
survey_station
target_height
fTest
resection_station
res_y
res_x
res_z
instrument
angle_accuracy
inst_height_accuracy
targ_height_accuracy
dist_accuracy
inst_centring_accuracy
targ_centring_accuracy
dist_parts_per_million
inputs
stationHeight
ftestIcon
ftestResult
confidence_level
redundancy
accuracies_panel
preferredBacksight } {
global enabledList
global result
global translated_SRV_RESECTION_LOG_NOT_APPLICABLE
set returnValue false
set formData [subst {FirstTime = $firstTime} ]
set value [$accuracies_panel validateObject]
if { $value != "true"} {
set fragment " RunResection = false"
append formData $fragment
} else {
if {$firstTime != "true"} {
for {set i 0} {$i < [$observationsTable getRowCount]} {incr i} {
set fragment " [subst {IncludeRow($i) = [$include_row getCurrentValue $i]}]"
append formData $fragment
set fragment " [subst {IncludeHA($i) = [$include_ha getCurrentValue $i]}]"
append formData $fragment
set fragment " [subst {IncludeVA($i) = [$include_va getCurrentValue $i]}]"
append formData $fragment
set fragment " [subst {IncludeSD($i) = [$include_sd getCurrentValue $i]}]"
append formData $fragment
}
}
set fragment " RunResection = true"
append formData $fragment
set fragment " [subst {distanceSD = [$dist_accuracy getCurrentValue]}]"
append formData $fragment
set fragment " [subst {distancePPM = [$dist_parts_per_million getCurrentValue]}]"
append formData $fragment
set fragment " [subst {angleSD = [$angle_accuracy getCurrentValue]}]"
append formData $fragment
set fragment " [subst {instHeightSD = [$inst_height_accuracy getCurrentValue]}]"
append formData $fragment
set fragment " [subst {targetHeightSD = [$targ_height_accuracy getCurrentValue]}]"
append formData $fragment
set fragment " [subst {instCentSD = [$inst_centring_accuracy getCurrentValue]}]"
append formData $fragment
set fragment " [subst {targetCentSD = [$targ_centring_accuracy getCurrentValue]}]"
append formData $fragment
set fragment " [subst {confidenceLevel = [$confidence_level getCurrentValue]}]"
append formData $fragment
set bsValue [$preferredBacksight getCurrentValue]
if {$bsValue == ""} {
set fragment " preferredBacksight = \"\""
} else {
set fragment " [subst {preferredBacksight = [$preferredBacksight getCurrentValue]}]"
}
append formData $fragment
}
set buffer [ GuidoExecServer RunResection $formData]
$fTest setCurrentValue [GuidoGetParamBufferValue $buffer "fTestStr"]
$ftestResult setCurrentValue [GuidoGetParamBufferValue $buffer "fTestResult"]
set result [GuidoGetParamBufferValue $buffer "result"]
if {$result == "ok" } {
$ftestIcon setIconByName "icons/ok.png"
set returnValue true
} elseif {$result == "statTestWarning"} {
$ftestIcon setIconByName "icons/16/messager_filter_information.png"
set returnValue true
} else {
$ftestIcon setIconByName "icons/16/stop.png"
}
$redundancy setCurrentValue [GuidoGetParamBufferValue $buffer "redundancy"]
$resection_station setCurrentValue 0 [GuidoGetParamBufferValue $buffer "stationName"]
$res_y setCurrentValue 0 [GuidoGetParamBufferValue $buffer "stationY"]
$res_x setCurrentValue 0 [GuidoGetParamBufferValue $buffer "stationX"]
$res_z setCurrentValue 0 [GuidoGetParamBufferValue $buffer "stationZ"]
$res_y setCurrentValue 1 [GuidoGetParamBufferValue $buffer "residualY"]
$res_x setCurrentValue 1 [GuidoGetParamBufferValue $buffer "residualX"]
$res_z setCurrentValue 1 [GuidoGetParamBufferValue $buffer "residualZ"]
$res_z setCurrentValue 1 [GuidoGetParamBufferValue $buffer "residualZ"]
$stationHeight setCurrentValue [GuidoGetParamBufferValue $buffer "stationHeight"]
$inputs setTitleAt 0 [GuidoGetParamBufferValue $buffer "obsTabHeader"]
set num_rows [GuidoGetParamBufferValue $buffer "NumObservations"]
$observationsTable setInitialRows $num_rows $num_rows $num_rows
for {set i 0} {$i < $num_rows} {incr i} {
$survey_station setCurrentValue $i [GuidoGetParamBufferValue $buffer "station($i)"]
$target_height setCurrentValue $i [GuidoGetParamBufferValue $buffer "target($i)"]
$include_ha setCurrentValue $i [GuidoGetParamBufferValue $buffer "includeHA($i)"]
$horizontal_angle setCurrentValue $i [GuidoGetParamBufferValue $buffer "valueHA($i)"]
$include_va setCurrentValue $i [GuidoGetParamBufferValue $buffer "includeVA($i)"]
$vertical_angle setCurrentValue $i [GuidoGetParamBufferValue $buffer "valueVA($i)"]
set sdval [GuidoGetParamBufferValue $buffer "valueSD($i)"]
if {$sdval == "SRV_RESECTION_LOG_NOT_APPLICABLE"} {
set sdval $translated_SRV_RESECTION_LOG_NOT_APPLICABLE
$include_sd setInputAllowed $i false
$slope_distance setInputAllowed $i false
}
$include_sd setCurrentValue $i [GuidoGetParamBufferValue $buffer "includeSD($i)"]
$slope_distance setCurrentValue $i $sdval
}
set numStations [GuidoGetParamBufferValue $buffer "stationsCount"]
$preferredBacksight removeAllItems
for {set i 0} {$i < $numStations} {incr i} {
$preferredBacksight addItem [GuidoGetParamBufferValue $buffer "stations($i)"]
}
$preferredBacksight setCurrentValue [GuidoGetParamBufferValue $buffer "preferredBacksight"]
if {$firstTime == "true"} {
set enabledList [list]
for {set i 0} {$i < $num_rows} {incr i} {lappend enabledList {true}}
}
return $returnValue
}
GuidoForm recorder_resection {
-default_buttons
-label SRV_RESECTION_FORM_TITLE
-layout BoxLayout Y_AXIS
-help_id 1716
GuidoFiller fill_before_resection {
-height 0.5
}
GuidoPanel resection_wrapper {
-layout BoxLayout X_Axis
GuidoPanel resultsAnalysis {
-width 40
-label SRV_RESECTION_FORM_RESULTS_ANALYSIS
-border etched true
-layout BorderLayout
GuidoPanel resultsLeft {
-layout BoxLayout Y_AXIS
-position West
GuidoPanel resultsLeftTop {
-layout FlowLayout Left
GuidoLabel fTest {
-label "<html><body><b>1.234</b></font></html>"
}
GuidoLabel varianceLabel {
-label SRV_RESECTION_FORM_GLOBAL_VARIANCE_FACTOR
}
}
GuidoPanel resultsLeftBottom {
-layout FlowLayout Left
GuidoLabel ftestIcon {
-icon "icons/16/messager_filter_information.png"
}
GuidoLabel ftestResult {
}
}
}
GuidoPanel resultsRight {
-layout BoxLayout Y_AXIS
-position East
GuidoPanel resultsRightTop {
-layout FlowLayout Right
GuidoComboBox confidence_level {
-display_length 5
-input true
-format double
-label SRV_RESECTION_FORM_CONFIDENCE_LEVEL
-tip SRV_RESECTION_FORM_TOOLTIP_CONFIDENCE
-exclusive true
-no_mlt
-value_in 0.90 0.95 0.975 0.99 0.999
-default 0.99
-null false
}
}
GuidoPanel resultsRightBottom {
-layout FlowLayout Right
GuidoLabel redundancyLabel {
-label SRV_RESECTION_FORM_REDUNDANT_OBS
}
GuidoLabel redundancy {
-label "<html><body><b>2</b></body></html>"
}
}
}
}
GuidoPanel resultsAnalysisPanel {
GuidoScrollPane resectTablePane {
-height 5
-width 40
-vertical_scroll_bar never
-horizontal_scroll_bar never
GuidoTable resect {
-instances 2 2 2
-interactive false
-column_sorting false
-row_headings_visible false
GuidoLabel resection_station {
-font_style bold
-display_length 10.3
-label SRV_RESECTION_FORM_RESECTED_STATION
-height 1.2
}
GuidoLabel res_y {
-text_alignmentX left
-display_length 10
-label "Y"
}
GuidoLabel res_x {
-text_alignmentX left
-display_length 10
-label "X"
}
GuidoLabel res_z {
-text_alignmentX left
-display_length 10
-label "Z"
}
}
}
}
}
GuidoPanel heightPanel {
-layout BorderLayout
-position South
GuidoPanel heightPanel {
-position East
GuidoComboBox preferredBacksight {
-display_length 10
-format none
-max_length 128
-null false
-exclusive false
-label SRV_RESECTION_FORM_PREFERRED_BACKSIGHT
-tip SRV_RESECTION_FORM_TOOLTIP_PREFERRED_BACKSIGHT
}
GuidoLabel stationHeightLabel {
-label SRV_RESECTION_FORM_RESECTION_STATION_HEIGHT
}
GuidoLabel stationHeight {
-label "0.000"
}
}
}
GuidoFiller f1 {
-height 1
}
GuidoTabbedPane inputs {
GuidoPanel observations_and_results_with_buttons_panel {
-layout BoxLayout Y_AXIS
-label SRV_RESECTION_FORM_TAB_OBSERVATIONS
GuidoFiller fill_before_obs {
-height 0.5
}
GuidoPanel observations_panel {
-layout FlowLayout Left
-font_style bold
GuidoScrollPane scroll_obs {
-height 15
-width 80
GuidoTable observationsTable {
-instances 1 1 500
-interactive false
GuidoCheckBox include_row {
-default true
-label Include
-selected_value true
-unselected_value false
-tip SRV_RESECTION_FORM_TOOLTIP_SELECT_CHECKBOX
}
GuidoLabel survey_station {
-display_length 14
-label "Station"
}
GuidoLabel target_height {
-display_length 3
-label "Target Height"
-text_alignmentX left
}
GuidoCheckBox include_ha  {
-default true
-selected_value true
-unselected_value false
-width 4
-tip SRV_RESECTION_FORM_TOOLTIP_SELECT_CHECKBOX
}
GuidoLabel horizontal_angle {
-display_length 13
-label SRV_RESECTION_FORM_HZ_HEADER
-text_alignmentX left
}
GuidoCheckBox include_va {
-default true
-selected_value true
-unselected_value false
-width 4
-tip SRV_RESECTION_FORM_TOOLTIP_SELECT_CHECKBOX
}
GuidoLabel vertical_angle {
-display_length 13
-label SRV_RESECTION_FORM_VA_HEADER
-text_alignmentX left
}
GuidoCheckBox include_sd {
-default true
-selected_value true
-unselected_value false
-width 4
-tip SRV_RESECTION_FORM_TOOLTIP_SELECT_CHECKBOX
}
GuidoLabel slope_distance {
-display_length 13
-label SRV_RESECTION_FORM_SLOPE_DIST
-text_alignmentX left
}
}
}
}
}
GuidoPanel accuracies_panel {
-font_style bold
-layout BoxLayout Y_AXIS
-label SRV_RESECTION_FORM_TAB_ACCURACIES
GuidoFiller accs_45_1a {
-height 0.5
}
GuidoPanel accuracies_panel1 {
-layout BoxLayout X_AXIS
GuidoComboBox instrument {
-display_length 10
-format none
-max_length 128
-null true
-exclusive false
-label "Instrument type"
-tip INSTRUMENT_TYPE
-action initial {[initializeInstrumentList $instrument]}
-action valueChanged {[instrumentChanged $instrument $angle_accuracy $inst_height_accuracy $targ_height_accuracy $dist_accuracy $inst_centring_accuracy $targ_centring_accuracy $dist_parts_per_million]}
}
}
GuidoFiller accs_45_1a {
-height 0.5
}
GuidoPanel accs_52 {
-border etched true
-label RESECTION_ACCS_TEXT
-layout CentreLineLayout
GuidoPanel accs_49 {
-layout BoxLayout X_AXIS
GuidoPanel accs_51 {
-layout CentreLineLayout
GuidoField dist_accuracy {
-default 0.005
-display_length 5
-format double
-label "Distance standard deviation"
-low_bound 0
-max_length 10
-next_focus dist_parts_per_million
-null false
-tip SRV_RESEC_ACCS_DIST_TIP
-translate upper
-decimals 4
}
GuidoFiller accs_45_4 {
-height 0.5
}
GuidoFiller accs_45_4a {
-height 0.5
}
GuidoField angle_accuracy {
-default 3
-display_length 5
-format double
-label "Angle standard deviation"
-low_bound 0
-max_length 10
-next_focus inst_height_accuracy
-null false
-tip SRV_RESEC_ACCS_ANGLE_TIP
-translate upper
-decimals 4
}
GuidoFiller accs_45_2 {
-height 0.5
}
GuidoFiller accs_45_a {
-height 0.5
}
GuidoField inst_height_accuracy {
-default 0.003
-display_length 5
-format double
-label "Instrument height sd"
-low_bound 0
-max_length 10
-next_focus inst_centring_accuracy
-null false
-tip SRV_RESEC_ACCS_INST_HT_TIP
-translate upper
-decimals 4
}
GuidoFiller accs_45_2 {
-height 0.5
}
GuidoFiller accs_45_a {
-height 0.5
}
GuidoField targ_height_accuracy {
-default 0.003
-display_length 5
-format double
-label "Target height sd"
-low_bound 0
-max_length 10
-next_focus targ_centring_accuracy
-null false
-tip SRV_RESEC_ACCS_TARG_HT_TIP
-translate upper
-decimals 4
}
}
GuidoFiller accs_45 {
-width 1
}
GuidoPanel accs_53 {
-layout CentreLineLayout
GuidoField dist_parts_per_million {
-default 2
-display_length 5
-format double
-label "Distance error (ppm)"
-low_bound 0
-max_length 10
-next_focus angle_accuracy
-null false
-tip SRV_RESEC_ACCS_DIST_PPM_TIP1
-translate upper
-decimals 4
}
GuidoFiller accs_45_6 {
-height 0.5
}
GuidoFiller accs_45_6a {
-height 0.5
}
GuidoField hiddenfield {
-visible false
-label " "
}
GuidoFiller accs_45_6 {
-height 0.5
}
GuidoFiller accs_45_6a {
-height 0.5
}
GuidoField inst_centring_accuracy {
-default 0.003
-display_length 5
-format double
-label "Instrument centring sd"
-low_bound 0
-max_length 10
-next_focus targ_height_accuracy
-null false
-tip SRV_RESEC_ACCS_INST_CENT_TIP
-translate upper
-decimals 4
}
GuidoFiller accs_45_5 {
-height 0.5
}
GuidoFiller accs_45_5a {
-height 0.5
}
GuidoField targ_centring_accuracy {
-default 0.003
-display_length 5
-format double
-label "Target centring sd"
-low_bound 0
-max_length 10
-null false
-tip SRV_RESEC_ACCS_TARG_CENT_TIP
-translate upper
-decimals 4
}
}
}
}
}
}
-action initial {[initialise $observationsTable $include_ha $horizontal_angle $include_va $vertical_angle $include_sd $slope_distance $include_row $survey_station $target_height $fTest $resection_station $res_y $res_x $res_z $instrument $angle_accuracy $inst_height_accuracy $targ_height_accuracy $dist_accuracy $inst_centring_accuracy $targ_centring_accuracy $dist_parts_per_million $inputs $stationHeight $ftestIcon $ftestResult $confidence_level $redundancy $accuracies_panel $preferredBacksight]}
}
