I am working on a project for a physics class and would like to try and get an app together to perform the following. The test unit has a serial port on it that is outputting data at 1 Hz. I would like to have an app that will read the serial port data and save it to a file. I have created this in a Console app and it works fine. Now, I would like a GUI. On the main screen of the GUI I would like a couple of check boxes. One where the user can add a timestamp to the incoming data stream, one to output the data to a text file, and may be one to send the data to my graphite graphing server.
So, I am looking for some pointers here. Right now, I have a connect button. When pressed, it opens the serial port and performs a serial.readline() But if no data is currently being pushed across the link, the app is locked up. So I am assuming I need to use threading. Does this sound correct?
And last, how do I handle the check boxes? I would like 4 total buttons. Connect/Disconnect Record/Pause. At least these is my thoughts.
Instead of creating a thread for the serial port just hook into the DataReceived event.
As for the checkboxes hook into the CheckedChanged event.
So it would look something like: