This article demonstrates a multi-serial port terminal with a plug-in architecture to allow different views.
This started off as an internal project by myself for our company Pi Logic. I thought that it might be useful to others who do serial port development.
Using the Code
The source zip file contains one Visual Studio 2005 solution with three projects.
This is the actual program, it is very simplistic because most of the important stuff happens in the support libraries.
This implements the core functionality of the terminal program. This was separated out into a DLL so that the plugins can reference this one without having the program's code cluttering up things.
This is a simple implementation of a plug-in viewer, it derives from
PortWindow which has some basic controls to support adding ports, etc. and parses data (with no error handling) to plot a graph of the values.
To see this in action, send it two double values in the range 0-10 separated by a comma and it will plot the value as it receives it.
Points of Interest
One driver which I have found invaluable in this project and in others is com0com which is a null-modem emulator. Basically it creates two virtual COM ports and maps the input and output of each one to the output and input of the other respectively, resulting in a software COM port for testing stuff.
Docking has been accomplished through Weifen Luo's Dock Panel Suite.
GraphWindow demo was accomplished using ZedGraph.
The file associations are managed by Bredan Grant's System File Association classes, with the namespace changed for ease of use.
Sorry the article is so short. Hopefully when I get some time, I shall update it to include more code snippets and more detailed explanations of how things operate.
Please let me know of any bugs as this was written overnight from an existing code-base (Terminal 2 by coincidence) so I haven't fully tested it.
- 7th June, 2007 - v1 - Uploaded the initial project
- 7th June, 2007 - v2 - Updated project to include "Restore File Associations..." menu item