Pages: 1 [2]
Author Topic: Gauges for ME7Logger  (Read 16675 times)
Jason
Hero Member
*****

Karma: +38/-0
Offline Offline

Posts: 500


Breaks everything!


« Reply #15 on: November 30, 2012, 07:47:44 PM »

I attempted several different ways trying to get the output directly from ME7logger, but I kept having problems left and right.  I know this is not the most efficient way to do it, but in my limited time to work on it this was the best and most stable option.

And it actually is fairly efficient as I don't load the file in memory, I just start reading the file from the end byte by byte until I get to an EOL marker, then read out from there(which is the last line).  My initial tests showed this running at over 1000 per second, but when I added in parsing the data and updating the gui it slowed down to it's current speed.


There's a faster/easier way to do it if you're using .NET.  My C# logger wraps the ME7L as a process and combines the innovate LC1's data.  I read the ME7L data from stdout line by line, which is the fastest method to get the data.

In a nutshell, you create a process, redirect stdout, create an event handler for OutputDataReceived (the stdout stream), pass the command line arguments to ME7L (including the argument to dump the data to stdout), and then start the process.

The event handler reads the ME7L output line by line passing the line via the DataReceivedEventArgs class (I believe it's called that) to the event handler, then it parses that output line.  ME7L will also write the data to the file.

Voila!

edit:  derp
« Last Edit: November 30, 2012, 07:51:15 PM by Jason » Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.012 seconds with 17 queries. (Pretty URLs adds 0s, 0q)