03-11-2008 02:43 PM
03-11-2008 02:49 PM
03-11-2008 02:53 PM
03-11-2008 03:21 PM
03-12-2008 06:45 AM
03-12-2008 07:52 AM
Let me confess that I have only quickly read through this thread and have not attempted to review any of the posted code.
I'd like to step back from the low level details and try to look at this from a bird-eye view.
You are doing two things in this code;
1) Reading from the serial port
2) Processing the data.
I would restructure the code such that the reading is handled seperately from the processing.
Using this approach, the processing code* can decide which collum the data goes in and maintain the list. It would also allow you to do extensive unit testing of the processing code without having to jump through hoops to get the serial port to read all of the possible variations as well as handling corrupted recieve data.
Ben
*This may be a good candidate for an Action Engine that has the states;
"Init" Clears history
"Process" accept arbitrary string and sorts depending on what it parses out of the string. Optionally buffer incomplete strings for use when processing the next update.
"Reset" clears history
"Get table" returns the history for use in a GUI.
03-12-2008 08:59 AM