tsc_ITsMonitor

This interface is used to handle Total Station related Survey Core global events.  Any class may subclass from this interface, in addition to any other monitor interfaces and any regular base class.

See the Event handling page for more information on global events and event handling using the Monitor classes.

Class methods

void Start();
Call this method (use the tsc_ITsMonitor::Start() syntax) to start global events flowing into the monitor's event handlers.  The thread that calls this method will be the same thread on which the event handlers are called.  It is not an error to call Start more than once.

void Stop();
This method stops event handlers from being called.  Use the tsc_ITsMonitor::Stop() syntax.  The effect will be immediate.  It is not an error to call Stop more than once, and destruction of the monitor will also call Stop automatically.

Event handlers

Any of the following event handlers may be implemented.  Note that most of these handlers do not supply information about the event.  This is a performance consideration; the event sender does not know what the handler wishes to do and therefore does not waste time setting up interfaces that may never be used.  Rather, the event handler should "pull" the information it needs, when it needs it.  Multiple events are possible for certain actions: for example a running robotic survey may experience OnRadioStateChanged(false), OnTsDisconnected() and OnSurveyEnded() in that order when the total station battery suddenly runs flat.

virtual void OnNewStreamedObservation ()
Called when a streaming observation is reported from the total station.  Note that this is generally angles only information but will have EDM distances occassionally when the instrument is in tracking mode.  Supplies the raw HA, VA and EDM distance as part of the call.

Be aware that this is called frequently; avoid slow handling.

virtual void OnTsDisconnected ()
Called when the total station connection has been lost.  Note that tasks that rely on total station connectivity (see tsc_UITask) will typically be aborted by SurveyCore when this occurs.

virtual void OnSurveyEnded ()
Called when the user had ended the total station survey.

virtual void OnTsConnected ()
Called when a connection to a total station has been established.

virtual void OnTsError ()
Called when any total station operation fails.  An error x_Code will be provided in most cases, e.g.: X_NoTarget.

virtual void OnStationStarted ()
Called when a station setup routine marks a station as started (but is not yet completed).

virtual void OnStationCompleted ()
Called when a station setup is marked as completed (previously started or otherwise).  This indicates that a total station survey is now running.

virtual void OnInstrumentHeightChanged ()
This event is associated with station setups but may be found outside of running surveys.  The new (reduced) height in metres is supplied.

virtual void OnRadioStateChanged ()
Called to show the radio connectivity changes associated with the temporary disconnect.  A flag is passed to indicate the new state.

virtual void OnLevelLost ()
Called to show that the total station is in need of leveling.  It is recommended that code uses this message to pause their workflow and allow users to continue it.  Survey Core will automatically bring up levelling UI to prompt the user to correct the situation. 

OnLevelLost is triggered when the instrument tilt exceeds the compensator's limits.  It will only be triggered after the instrument levelling has been completed via the levelling form, and only if the level compensator is present and turned on. Trimble S-series and later instruments support this functionality.  Most others do not.

virtual void OnLevelGained ()
Called to show that the user has rectified the current levelling problem by adjusting the instrument or by disabling the compensator system (indicated).  Users who wish to get the actual tilt values can use the tsc_TsInstrument class to do so.

virtual void OnTargetChanged ()
Called when the target configuration has changed (the change will not appear in the database until a point is stored).  Note that while the reduced height is passed in, any target change will cause this event and you may need to get the complete current tsc_Target details to properly react.

virtual void OnMeasureModeChanged ()
Called when the MeasureMode is changed. The new mode is supplied.

virtual void OnTSAttemptingToReconnect ();
We are in a survey and have lost communications with the Total Station.  SurveyCore will now attempt to restore communications and the user can acknowledge a dialog to abort this for a full disconnect (and end conventional survey).  This will not occur outside of a survey which will proceed directly to a disconnect event.

virtual void OnTSReconnectSuccessful ();
SurveyCore successfully reconnected to the station and the survey may continue.  Note that any settings will need to be reapplied (e.g. Tracking measurements will have been stopped).

Possible TS Error codes

Here is a list of the error codes most likely to be encountered with OnTsError, it is not exhaustive.