tsc_StationCalcStandardResection

This class provides free station (resection) calculations for use with the station setup class.  The resection calculation performed is the General Survey standard least-squares method.

For more information about Survey Core stations, see How Stations Work.

Constructor

tsc_StationCalcStandardResection (class tsc_StationSetup& station);

Constructs an instance for use with the given station setup.  The station must be "in progress" - it must have been started but not ended or aborted.

Public methods

virtual tsc_StationResults  CalculateStationWithFreeScale();

Computes a resection for all backsight observations in the given station, and returns the results.  The results are not stored anywhere but in the tsc_StationResults instance.  Depending on the current state of the station setup in the database, some (or all) values may have null values.  Scale Factor is calculated.

The returned tsc_StationResults will contain a list of all backsights that were found in the station, each with a reference to the observation, the calculated residuals, and a UseDimensions field which may be used to control further calculations (see the CalculateStation overloads below).

The results may be used to update the station by calling the UpdateStation() method on tsc_StationSetup, and the residuals may be written to the database by using the WriteResiduals() method also in tsc_StationSetup.  It is normal to only write the residuals once, at the end of the station setup.

virtual tsc_StationResults CalculateStationWithFreeScale (const tsc_BacksightList& useBacksights);

This overload computes a resection using the supplied list of backsights.  This list would typically be obtained from a previous call to CalculateStation(), or from a call to BacksightDetails().

The resection's use of observations is controlled by setting the value of the UseDimensions field of the items in the backsight list.  Setting UseDimensions to zero will prevent the observation from being used, setting it to 1 uses only the observation's elevation, 2 uses the north and east coordinates, and 3 uses all three coordinate values.  If a required coordinate value is not present, the observation will not be used.  The UseDimensions field is initialised to the highest value possible for the observation.

virtual tsc_StationResults CalculateStationWithFixedScale (double fixedScaleFactor);

This overload allows the scale factor to be fixed at the supplied value.  If the given value is double_Null, the scale factor will be calculated.

virtual tsc_StationResults CalculateStationWithFixedScale (const tsc_BacksightList& useBacksights, double fixedScaleFactor);

This overload allows the scale factor to be fixed at the supplied value.  If the given value is double_Null, the scale factor will be calculated.

virtual void UpdateStation (const tsc_StationResults& results);

From the results of the resection, updates the station record, the backbearing record, and the grid coordinates of the station.

The following somewhat simplistic examples demonstrate how to use tsc_StationCalcStandardResection.

Example working from a list of residuals

void DoStationSetup (tsc_Job& job, tsc_TsInstrument& instrument) {     tsc_StationSetup   ss (job, instrument);     tsc_StationResults results;      ss.WriteStationRecord ("Station1", double_Null, double_Null, true, 1.2, StationType_StandardResection);     ss.Start();      while (true)     {         // Add a backsight observation to the station (not shown in this example).         bool finished = MeasureAndStoreABacksightObservation();            if (finished) break;   // User indicated measurements are finished.          tsc_StationCalcStandardResection resect (ss);          // Do an initial calculation using all backsights measured so far.         tsc_StationResults initial = resect.CalculateStationWithFreeScale();          // Some logic here may decide to exclude some observations from the calculation.         // For simplicity, our example just excludes the first one.         initial.Backsights[0].UseDimensions = 0;          // Recompute the station, this time using only the included backsights.         results = resect.CalculateStationWithFreeScale (initial.Backsights);          // Note that we should be checking the results here...          // Update the station record, the station position, and the backbearing record.         resect.UpdateStation (results);     }     // Station measurements are complete, write the most recent residuals.     ss.WriteResiduals (results);      // Close off the station setup.     ss.End(); } 

 Example working from a list of backsights

void DoStationSetup (tsc_Job& job, tsc_TsInstrument& instrument) {     tsc_StationSetup   ss (job, instrument);     tsc_StationResults results;      ss.WriteStationRecord ("Station1", double_Null, double_Null, true, 1.2, StationType_StandardResection);     ss.Start();      while (true)     {         // Add a backsight observation to the station (not shown here).         bool finished = MeasureAndStoreABacksightObservation();            if (finished) break;   // User indicated measurements are finished.          tsc_StationCalcStandardResection resect (ss);          // Obtain a list of all backsights measured so far.         tsc_BacksightList bsights = resect.BacksightDetails();          // Some logic here may decide to exclude some observations from the calculation.         // Note that there will be no computed residuals in the backsight list.         // For simplicity, our example just excludes the first one.         bsights[0].UseDimensions = 0;          // Compute the station, using only the included backsights.         results = resect.CalculateStationWithFreeScale (bsights);          // Note that we should be checking the results here...          // Update the station record, the station position, and the backbearing record.         resect.UpdateStation (results);     }     // Station measurements are complete, write the most recent residuals.     ss.WriteResiduals (results);      // Close off the station setup.     ss.End(); } 

Checking the results

{     ...          // Check that the results meet your success criteria.     // For this example we need at least a horizontal point with a location deviation of not more than 1cm     // and a F1 and F2 orientation correction.              tsc_StationResults results = resect.CalculateStationWithFreeScale (bsights);      bool mySuccess =  results.Success &&                       results.PositionIsValid &&                      (results.PositionDimensions > 2) && // Alternatively: results.StationPosition.HasHorizontal()                      (results.StationNorthStdError <= 0.01) &&                      (results.StationEastStdError  <= 0.01) &&                      (results.F1OrientationCorrection != double_Null) &&                      (results.F2OrientationCorrection != double_Null);      ... }