So my program is displaying a lot of data to a GUI. Attached is a screenshot.
My laptop is a Compaq Presario 3000 model 3045us; specs are as follows. P4 2.4, 512mb, 60gb, 16"lcd 1280x1024, SiS 650m video shared ram.
My program reads in serial data at approximately 37.6kbps where the data is async sent blind. Each packet si 277bytes where 256 is from the car's computers ram dumped followed by 8 10-bit a/d channels followed by a 16-bit checksum of all of the data followed by the start/stop bytes "55AA" repeated continuously (duh, async). Anyways, my program has several loops, 1 for events, 1 for looking at the serial port or playback file, and 1 to display the GUI. After the serial loop has gotten a full packet it runs a checksum on the packet and compares it to the checksum bytes in the packet, if good, send it to the queue. The GUI loop has the queue (FIFO) which outs the byte array "packet" which is indexed and sent to the gauges and various displays. Here is the problem, it takes up about 35-40% of my cpu power ONLY when the data is being sent to the gauges. Mind you, there are a couple tabs in my program, when one tab is in focus there is a conditional case structure that only updates what is visible. With that being said, it's obvious that the indexing and calculations being run on the byte array aren't the slow down because when I display "flag" (aka boolean) only the CPU usage is SUPER lower, like 2-6%, change over to the gauges and 1 line chart and it jumps up .
Here might be my problem; I'm using classical gauges instead of the default 7.0 gauges because I thought it would be lower cpu usage, is this wrong? Are the newer gauges with the alpha blending edges and smooth appearance better code wise? I don't have the time to convert all of my gauges so maybe somebody knows. Other than that, I'm at a complete loss. The gauges are only refreshed 17Hz! Slower laptops have had similar issues with my program and honestly, I'm fed up. My last step is to update the GUI less frequently, every other packet and from there I might try indexing the byte array for only the bytes I need instead of sending the whole packet into the queue... although I need to display 1/3 of the bytes in the packets :headbang:\