Team:Aachen/Notebook/Software/Serial Client

From 2014.igem.org

Revision as of 19:50, 17 October 2014 by Mosthege (Talk | contribs)

Serial Client - A Windows Desktop Application to Log Data

The methane sensor we built for Team Braunschweig as well as many microcontroller components of our project, including the OD Device, are capable of frequently broadcasting readings via their serial connection to a computer. For an efficient analysis and testing as well as the collection of online data, we wrote the Serial Client. This is a Windows Desktop app that plots data coming in on a serial (USB) port live and saves it for later export to Excel.

Aachen SerialClient1.png
Screenshot of the application window
All important features are available at glance: Not only the connection configuration, but also data acquisition and live-plotting ca be set in a user-friendly interface.

Usage

In the Data Acquisition section in the left pane of the application, the user can specify pre-processing and export options of the data received on the serial port selected above. Whenever online-data is collected, the measurement hardware is often capable of recording multiple readouts per second that are usually discarded. In most cases, however the recording of more data is advisable, because more information can be used for later analysis. Therefore we have implemented an averaging feature that can summarize multiple readouts into single datapoints (including the standard deviation). We have tested the Serial Client on different laptops and were able to receive about 200 readouts per second without major impact on the overall performance.

Multiple export options are available, including but not limited to:

  • export of the recent 10-1000 data points
  • export of all recorded data
  • export of a histogram on all collected data (useful for debugging purposes)

The data-export is exported to the clipboard and can directly be pasted into Excel for convenient analysis.



Architecture and Source Code

To help iGEM teams and developers to build, characterize and use their own exciting devices, here we provide not only the app itself, but also the complete code as Open Source:

Download Serial Client App and Sources



The application is implemented in a minimal MVVN pattern to permit efficient expansion with additional features. At the same time, the app only depends on two external libraries:

  • [http://dynamicdatadisplay.codeplex.com/ Dynamic Data Display] ([http://dynamicdatadisplay.codeplex.com/license license]) for live plotting of data
  • [http://www.nuget.org/packages/TCD.Controls/ TCD.Controls] for multiple controls and internal functionality


If you're a developer and want to modify/adapt the software to your own purpose, here you can see a dependency graph of the overall app architecture:

Aachen SerialClient DependencyGraph1.png
Overview dependency graph of the Serial Client architechture
In addition to the typical MVVM components (ViewModel, Converter, App, MainWindow), a Serial class is central to the architechture, receiving data from serial ports and forwarding it as SensorData to the ViewModel.

Essential to the MVVM pattern is the ViewModel that is shown in the following detailed dependency graph:

Aachen SerialClient DependencyGraph2.png
Detailed dependency graph of the Serial Client architechture
The ViewModel consists of public properties and RelayCommands that are required for DataBinding in the MainWindow. The methods within the ViewModel can be grouped in the categories Export, Visualization and Data Accumulation.

If you have questions on the Serial Client, please contact Michael.