User Manual

98 Location Software Library PLUS System Manual
Proprietary Information: Do not disclose unless authorized under a Nondisclosure Agreement and the Partner Agreement.
This calls the ResetBtn_Click() handler, which sets the application to an initialized, empty state. The
last-used configuration file is loaded, if one is recorded in the system registry.
Once initialization is complete, the code waits for the user to select a data source before continuing.
To enable logging position updates to a .csv file which can be viewed by a typical spreadsheet
application, change the following sections of code:
Uncomment the OutputPositionFile.Visible = true; line at the end of
MainForm.MainForm_Load()
Uncomment the entire body of MainForm.OutputPositionFile_Click().
Change MainForm.tagToSavePositions to the Tag ID for which position updates are to be saved. This
change is in MainForm.OutputPositionFile_Click(), near line 257.
With these changes, the application will have a new button on the form at runtime, which lets the user
select a .csv file to save position updates to from the hardcoded Tag ID.
4.7.2.1 Single-Threaded Apartment Versus Multi-Threaded Apartment
The PLUS Location Software Library is multithreaded and as such most of the events are fired in the
context of its thread, rather than the application’s UI thread.
Threading issues are avoided through the use of single-threaded apartment (STAThread). A more
sophisticated application using multi-threaded apartment (MTAThread) would handle the threading
issues in its event handler(s) by performing a thread-safe transfer of data to the UI thread.
4.7.2.2 MainForm Properties
String configFileName;
Path of the currently loaded configuration file.
StreamWriter positionFile = null;
File for saving Tag position updates.
uint tagToSavePositions = 0;
Tag ID for which positions are saved in the position log file.
4.7.2.3 MainForm Methods and Event Handlers
public MainForm_Load()
Initializes the COM objects and calls ResetBtn_Click(), which sets the application to an intialized, empty state.