View Single Post
Old 06-19-2014, 08:52 AM   #29 (permalink)
DIGItonium
A True Z Fanatic
 
DIGItonium's Avatar
 
Join Date: Jan 2009
Location: Kansas
Posts: 3,800
Drives: 09 Z34-TT 6MT
Rep Power: 42
DIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond reputeDIGItonium has a reputation beyond repute
Lightbulb C, C#, Java, etc., devs UNITE!

Here are some ideas off the top of my head:
  • Use an iDictionary to create a list of PIDs <int,class_object>, in which "class_object" defines fields to store the raw value and other properties of the PID.
  • Use the iDictionary list of PID objects to populate a checked Listbox control. Each ListBox item stores the ID, which can be used to look it up in the iDictionary. Add options to "Select All" and "Select None." I love LINQ since you can write 3 lines of code to "query" the List of objects without the need to write recursive search.
  • Add a search box that filters the list as you type. An "X" button to clear the textbox, which unfilters the list.
  • Also, you can add a toolstrip with the standard button layout. The save button can be used to export the data to a comma or tab delimited file.
  • Create a database which defines the PIDs and properties. These properties are used to decode the raw values. You'll need to research this part (e.g., data size, data type (int, double, string), resolution, bit range, etc.). You an put it in an MDB, SQLite, or even XML. On startup, you can read the contents to populate the iDictionary, which gets loaded into the ListBox. What you can do is create a table that defines the raw PIDs. The next table can break down the raw PID data into bit fields. For example the PID table can list IDs 000,001,100,200,etc. The next table can define 100-1, 001-1, etc. If the PID contains multiple fields of values in a single byte stream, you can define bit fields from there. You can create a column for the bit field range LSB and MSB. If it is equal, then you're defining a single bit. Then you can define the resolution, in which you do the basic math for the bit field and multiply the resolution to get the final result. Another column can be defined for units as well. If you need me to help you brainstorm the relationships, feel free to contact me.
  • Add a control to let users adjust the polling interval.
  • Add "playback" controls, which can scroll through the CSV log file. Don't forget to time stamp each row of data, so it can be read back.
  • Add scanning capability in which one can create a logic (e.g., when value ==, !=, <, >, etc., some threshold).
  • For plotting, I've had good luck with Zedgraph. It does have some issues that require some fiddling with code to workaround them.

The VS project I have at work is a tablet friendly real-time viewer which manipulates HTML displays, so I can flip images to simulate control state, update text values, and even set text colors. One can apply logic so perhaps the text color can indicate out of range values. HTML lets people create screens beyond looking like tables. I can probably port the entire project for ODB. Below is a program I wrote at work that reads XML files which can export the list as comma or tab separated with filtering capability.
__________________
http://www.the370z.com/image.php?type=sigpic&userid=950&dateline=13162988  42

Last edited by DIGItonium; 05-27-2015 at 10:04 AM.
DIGItonium is offline   Reply With Quote