tsc_MeasureFormHandlerFactory

SurveyCore has many measurement workflows as part of its existing features.  By launching UITasks SCAPI is able to invoke many of these directly but is generally unable to customise the measurement process.

There are several ways to customise measurements:

Please refer to tsc_IMeasureFormMonitor to learn about the events and how they work.  Note that the factory creates and starts the monitor on the measure form thread so any UI will be a modal part of the measure form.

Your application may have one factory registered for the purpose of providing a monitor object for the measurements that occur within your application.  The factory is only invoked for measurements on your application and while only one can be active at a time you may change or remove the factory at any time.  Monitors that were launched by the factory can continue monitoring after the factory is destroyed.

It is best to consider the lifespan of the factory instance so that the Factory is cleanly created, destroyed and invoked depending on its purpose.  For example if you have a workflow which places special requirements on measurements while it is running then the factory could be hosted by that UITask; alternatively if you want to monitor all measurements then the tsc_AppMainWindow could host it instead.

Note that there are some measurement forms that are not connected to this system, these include Conventional Continuous Topo, Conventional Stakeout, Station Setups, Rounds, Multi BackSight & Resection.

Constructor/Destructor

Construction will not register automatically.

tsc_MeasureFormHandlerFactory();

The destructor will invoke UnregisterMeasureFormHandlerFactory if required.

virtual ~tsc_MeasureFormHandlerFactory();

Statics

Register the specified factory with your current application, it will replace any existing factory without destroying it.

static void RegisterMeasureFormHandlerFactory  (tsc_MeasureFormHandlerFactory* factory);

Unregister this factory from the application, no factory will be called until another is set.

static void UnregisterMeasureFormHandlerFactory(tsc_MeasureFormHandlerFactory* factory);

Abstract Events

Create a new Monitor to listen to a measure form. The x_Code of the UITask that is hosting the measure form is supplied in case only certain workflows should be customised.

Please note that a returned tsc_IMeasureFormMonitor may live longer than the factory that created it and creation should be a light-weight operation as several of the handlers may be discarded.

Where a tsc_MeasureForm monitor is also present the factory supplied monitor will defer to the specified one; in this case the tsc_MeasureForm supplied monitor will get the last say (called second).  Cancellation and shutdown/supplant events are called in the reverse order.

virtual tsc_IMeasureFormMonitor* OnCreateNewMeasureFormHandler(x_Code hostUiTask);

A different factory has been set for the application while this one was registered.

virtual void OnFactorySupplanted ();