PCM Hammer Suite development

They go by many names, P01, P59, VPW, '0411 etc. Also covering E38 and newer here.
User avatar
NSFW
Posts: 679
Joined: Fri Feb 02, 2018 3:13 pm

Re: PCM Hammer Suite development

Post by NSFW »

I just realized that I was only half done merging logger parameter contributions from Dustin Graham when I made the last zip file.
Attachments
PcmHammer16I-Preview.zip
(2.02 MiB) Downloaded 157 times
Please don't PM me with technical questions - start a thread instead, and send me a link to it. That way I can answer in public, and help other people who have the same question. Thanks!
nsafran1217
Posts: 2
Joined: Mon May 17, 2021 11:39 am
cars: 1986 Camaro IROC-Z LS swap

Re: PCM Hammer Suite development

Post by nsafran1217 »

Hi all,

I've been working on creating a histogram page for PCM Logger, similar to what HP Tuners has. Right now I have it adding values to the histogram when the UI updates. It can also read in a previous log file .CSV and display the values from that. It supports column and row or just column tables.

Right now, to select what cell to place the value in, it just picks the column and row value that is closest (PcmHacks/Apps/PcmLibrary/Logging/Histogram.cs:97). Is this how HP tuners and other programs do it?


When you open the Setup dialog, either by opening a CSV, or when setting it up to log in real-time, it gets the available parameters and displays them for the user to select. You have to specify the column and row header values. HP tuners dialog box was the main inspiration (Though I've never used HP Tuners, just based on a youtube video).

I still am working on some bugs and beautification. I want to be able to color the cell based on the value, but DataGridView doesn't support colors with Alpha values for the BackColor property. Apparently the WPF DataGrid does, so I'm going to look into using that inside of a WinForms application.
I also want to add the ability to save and load the setup to a file similar to the LogProfile. I also need to add the row and column labels

I uploaded the code to the histogram branch on my github fork of the project. I will make a pull request once I feel its close to being done. https://github.com/nsafran1217/PcmHacks/tree/histogram . My code is based on the develop branch.

Also, I want to mention that I am not a programmer and this is my first time programming in c#. I took Java in college, and I use Powershell a lot at work, but I am definitely not a professional. Apologies if the code is messy/inefficient. I compared the normal version of PCM Logger with this one and there was no difference in the refresh speed from the PCM.

I plan to keep working on this throughout the week, and I will push my code as I go.
histogram.PNG
histogram.PNG (34.33 KiB) Viewed 3056 times
setupDialog.PNG
setupDialog.PNG (21.24 KiB) Viewed 3056 times
Last edited by nsafran1217 on Tue May 18, 2021 9:08 am, edited 1 time in total.
User avatar
NSFW
Posts: 679
Joined: Fri Feb 02, 2018 3:13 pm

Re: PCM Hammer Suite development

Post by NSFW »

That is really cool!
Please don't PM me with technical questions - start a thread instead, and send me a link to it. That way I can answer in public, and help other people who have the same question. Thanks!
User avatar
NSFW
Posts: 679
Joined: Fri Feb 02, 2018 3:13 pm

Re: PCM Hammer Suite development

Post by NSFW »

nsafran1217 wrote:I still am working on some bugs and beautification. I want to be able to color the cell based on the value, but DataGridView doesn't support colors with Alpha values for the BackColor property. Apparently the WPF DataGrid does, so I'm going to look into using that inside of a WinForms application.
I also want to add the ability to save and load the setup to a file similar to the LogProfile. I also need to add the row and column labels
Just thinking out loud here:

A lot of the value of DataGridView is in its support for different data types, and user interactions like editing cell values, resizing rows and columns, etc... If you're content to just render numbers, you might consider dropping DataGridView entirely, and just do all of the rendering yourself using WinForms graphics APIs. Then you can do whatever shading you want - just draw a colored rectangle, and then draw text over it. Use a nested loop to render the whole grid, and a couple more loops to render the X and Y axis values.

The catch is that if you want users to be able to interact with the grid, that sort of thing takes work. But it might be sufficient to just draw it.

I hadn't thought about adding log-viewing features to this app, but now you've got me thinking that was a huge oversight. Not everbody has Excel, and not everybody who has it wants to deal with that complexity. So I kinda like the idea of adding a "View Log..." button on the main tab, which would open a file-picker dialog, and after the user picks a file, we'd would open a tabbed dialog that has the log contents in a simple grid, plus additional tabs to show histograms and whatever other ideas we can come up with - scatter plots, line charts, etc.

Is that something that people would use?

I wrote a very simple log file viewer years ago, so that part is already done... https://github.com/LegacyNsfw/LogViewer
Please don't PM me with technical questions - start a thread instead, and send me a link to it. That way I can answer in public, and help other people who have the same question. Thanks!
nsafran1217
Posts: 2
Joined: Mon May 17, 2021 11:39 am
cars: 1986 Camaro IROC-Z LS swap

Re: PCM Hammer Suite development

Post by nsafran1217 »

NSFW wrote:dropping DataGridView entirely, and just do all of the rendering yourself using WinForms graphics APIs
That's a good idea. I'll start down that path after I get the profile feature finished. I spent 3 or 4 nights trying to get WPF DataGrid to work, but I just can't figure out the data binding. I was able to get it to display, but I never could change colors. I've never worked with the graphics APIs, but they are probably easier than WPF DataGrid. And probably faster than a datagridview.
I still wanted to have the ability to copy out of the table, so maybe I can have a DataGridView window open that just displays the values. Or have a datagridview where you can paste the table from your tune, then do some math on those values based on the histogram table.

I think having log viewing capabilities built in would make tuning with PCM Logger and TunerPro more accessible to people. I imagine some people would get a CSV file of data and have no idea what to do with it.
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: Pontiac Firebird 1978

Re: PCM Hammer Suite development

Post by joukoy »

Just added "Paste special" -function to UniversalPatcher, so you can paste values from histogram.
And literally just added, need testing and probably fixing...
Attachments
up-pastespecial-2021-05-22.png
up-pastespecial-2021-05-22.png (8.51 KiB) Viewed 2877 times
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: Pontiac Firebird 1978

Re: PCM Hammer Suite development

Post by joukoy »

Setting cell color in datagridview:
dataGridView1.Rows[r].Cells[c].Style.BackColor = Color.FromArgb(alpha, red, green, blue);
Edit. Or:
dataGridView1.Rows[r].Cells[c].Style.BackColor = Color.Aquamarine;
User avatar
NSFW
Posts: 679
Joined: Fri Feb 02, 2018 3:13 pm

Re: PCM Hammer Suite development

Post by NSFW »

New features in the pipeline for the next release:

- if you add a logging parameter that the PCM doesn't support, the app will tell you so, rather than just reporting 0.00 for that parameter (working on my desktop, not checked in yet)

- a new menu item to test checksums, without connecting to a PCM (checked in)

Under consideration for the next-next release: Don't even show unsupported parameters in the list. I'm open to ideas about how to do this. I lean toward this approach:

When the logger connects to a PCM, it gets the OSID and looks for file with a name like "OSID.pids.xml" - if the file doesn't exist, it tries every PID and saves the a list of supported PID to the file. This process would take a while (hopefully just a few minutes but I really don't know), so it would be good to collect these files and check them in. If the file DOES exist, it would just use the file to filter unsupported parameters from the list.
checksums.png
checksums.png (51.18 KiB) Viewed 2013 times
Please don't PM me with technical questions - start a thread instead, and send me a link to it. That way I can answer in public, and help other people who have the same question. Thanks!
User avatar
antus
Site Admin
Posts: 8237
Joined: Sat Feb 28, 2009 8:34 pm
cars: TX Gemini 2L Twincam
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Contact:

Re: PCM Hammer Suite development

Post by antus »

AVT 838 support is in testing, in a thread here: viewtopic.php?f=42&t=6570
From looking at the code and AVT docs I suspect the 842 support was not working but not in great demand. Now 838, 842 and 852 should all be ok. Any testing of the build in that thread with any of those 3 interfaces would great, hopefully we can add official support to the next release.
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
User avatar
Gampy
Posts: 2330
Joined: Sat Dec 15, 2018 7:38 am

Re: PCM Hammer Suite development

Post by Gampy »

So you're going to mix tools and operations on the same menu ... Cool!
Intelligence is in the details!

It is easier not to learn bad habits, then it is to break them!

If I was here to win a popularity contest, their would be no point, so I wouldn't be here!
Post Reply