PDA

View Full Version : CalX Compare Software



MopàrBCN
08-12-2008, 11:23 AM
Hi,

This is CalX Compare.

With this tool you can quickly compare 2 Calibrations to find either changed values of tables etc. or differences in the calibrations such as objects not used in one but in the other.

CalX Compare compares the binary values of 2 Calibrations.

To do the comparision CalX Compare needs a Template. The templates are either the .tbl files or the .calx files of the calibration. you can not compare two binary files directly.

To compare 2 calibrations load either (.tbl/.calx) for your main calibration and either (.tbl/.calx) of the calibration you want to compare.
Make sure the binaries are in the same directory of the .tbl/.calx files you compare. Also the binaries need to have the same name as the .tbl/.calx files.

To get a very detailed comparison you should load the .tbl files rather then the .calx files because the .tbl files contain all the disassembled calibration objects, meanwhile .calx usually only provides a subset of available objects.

The Tool is simple and should be self explaining.

You load your 2 Calibration Files (calx or tbl) and hit the compare button. As a result you see the differences between both cals.

The following method of comparison is used:

Test 1. It checks if an Object (Table/Byte/Word) is contained in the comparison cal.
->If no, it put's it on the list with a message, that it does not exist in the comparison.
->If yes it goes on with Test 2

Test 2. Now it checks if the Object has the same type as the existing object in the comparison.
-> When Types are different it puts it on the List.
-> If Types are equal it goes on with Test 3

Test 3. Now it checks if the quantity of Datapoints is the same in both cals.
Example, a Table in A could have 4 Datapoints but in B it could have 20.
-> If the number of Datapoints is different it puts it on the list
-> If the number of Datapoints are equal it goes on with Test 4.

Test 4. Finally it compares all Datapoints one by one.
-> If it finds a difference between Datapoints it will list it with information where the difference occurs and what the different values are
-> If it finds matching values it does not list them!


In case of a mismatch:

For Byte Values you always find one entry

For Word Values you find either one or two entries. It depends which Byte is different. When both are different you find two entries, when only one, then one.

For Table Values you find one entry for each mismatching point.

To install CalX Compare you need to unpack the .zip file into one directory of you choice and execute the file.

You must have the Microsoft .Net Framework 2.0 installed on your machine!

http://img368.imageshack.us/img368/8357/calcompyv6.jpg

Current Version: BETA 2 (Build 2.0.0.1 - Stable)

New Release, 08/17/2008
-New Layout on Front Page
-Calibration Objects are now loaded in Treeview seperated by Datatype.
-You can list the entire Main Calibration, Comparison Calibration or only the differences
-Calibrationdata is now displayed in a seperate control, tables grafically the rest by it's value
- Better explaination of datapoints
- When looking at Calibrabtion Data the entire Table inkl. offsets is shown in the datapart
- When looking at Comparison Date only the differences are listed in the Datasection - but the entire Tabledata is visualised of both
-Solved an error comparing 16bit tables
Known issues:
- Table Graphs have yet to be scaled
- Slope is ignored by drawing graphs
- So basically the graphing I only started....

Aries_Turbo
08-12-2008, 04:44 PM
any chance it can be modded to compare using .tbl files?

Brian

cordes
08-12-2008, 05:00 PM
It wouldn't work for me. :confused2:

MopàrBCN
08-12-2008, 05:08 PM
Hi, two updates:

1. I realize that there is a problem loading ladybug60 calx files. don't know why but I am at it.
2. yes. I am studying the .tbl files since I realize that calx only holds a subset of data

@Cordes: Why wouldn't it work for you??

MopàrBCN
08-12-2008, 06:05 PM
any chance it can be modded to compare using .tbl files?

Brian

You can use the tbl2calx (supplied in my zip) converter to create calx files from your table files. this would be the quick work around for the moment. I will built something like this into the programm at a later point. it is a good idea.

Aries_Turbo
08-12-2008, 06:15 PM
that tbltocalx converter has rarely worked for anyone and never for me. oh well.

Brian

MopàrBCN
08-12-2008, 06:24 PM
it doesn't work well if you then want to use the calx in chem. basically because you won't have the groups etc.

However, for the purpose of getting a calx file - and this is all that I need, alongside with the binary of cause, it works well! try it!

cordes
08-12-2008, 06:37 PM
Hi, two updates:

1. I realize that there is a problem loading ladybug60 calx files. don't know why but I am at it.
2. yes. I am studying the .tbl files since I realize that calx only holds a subset of data

@Cordes: Why wouldn't it work for you??

Probably due to the ladybug60 file I was trying to load. I will try something else later tonight and report back.

MopàrBCN
08-12-2008, 06:58 PM
hi, basically for the time beeing using ladybug60:

1. if you are using chem, you should save your calx which you are working on with a different name. this is the easiest as using tbl2calx will generate a calx using the same filename as the tbl name (which normally is your working calx name as well)

2. Generate the calx from your tbl file using tbl2calx. The resulting calx is crap for the purpose of editing it with chem, BUT IT IS PERFECT for the comparison.

3. Do the same for the calx you want to compare to! This assures you that you compare as well tables and values which you usually only see in D-Cal

4. Use CalX Compare to compare your cals

BTW: I use always calx files generated with tbl2calx to compare for the sole purpose of getting all data this way. the .tbl files however don't pose any secrets or problems which would prevent me from implementing a direct import. I will however internally keep using the calx definition since I feel using a standard opens opportunities as well!

Aries_Turbo
08-12-2008, 07:56 PM
what os do you use tbl2calx in? do you drag the tbl onto the tbl2calx.exe or do you do some command line stuff?

i guess id try this if i could ever get that exe to work.

now, will this compare direct bin locations even if the tbl doesnt define the location in addition to the ones that are defined?

thanks

Brian

MopàrBCN
08-12-2008, 08:15 PM
hi,

1. As it is currently released you would have to do the tbl to calx conversion by hand beforehand. Howerver, this is going to change quite soon. Just don't want to commit me on a day.

2. Either the calx or the tbl files are search templates for the respective programs to tell the editor where to look in the bin for values. So my program basically uses those for the same purpose. It would not do a binary comparison directly. For the simple reason that I would need a hint to what I should search. The calx/tbl gives me the hint.

To sum it up: My program takes a search template (calx) and whatever is on that it looks it up in the bin and compares it to second template and bin. The differences between those will be listed. If something is not on the template, my program won't search for it.

Now, fact is that those who post calibrations on here provide a very complete .tbl file and a less complete .calx (Ladybug60/Turbonator). The tbl2calx utility creates a 1:1 copy of the .tbl file using the calx xml schema. Therefore it is quite a valid option for comparison as done in my program. It is however nearly no option doing so for chem2 because chem2 requires descriptions which are not provided in the tbl files.

MopàrBCN
08-12-2008, 08:25 PM
what os do you use tbl2calx in? do you drag the tbl onto the tbl2calx.exe or do you do some command line stuff?


tbl2calx.exe is a command line tool running in you cmd window of windows. to use it you start cmd and navigate to the directory where you have tbl2calx.exe.

Then you type in the command prompt tbl2calx ladybug60.tbl and the result will be a ladybug60.calx in the same directory.

Now, carefull, that resulting .calx is useless in chem2 so make sure you backup your original one beforehand!

Aries_Turbo
08-12-2008, 09:29 PM
oh ok. thanks.

on my old win 98 machine i could just drag and drop and it kinda worked. :)
not in Chem2 though.

MopàrBCN
08-14-2008, 10:00 PM
Hi, there is a new release out (1.0.1.9)

New Features:

Now you can compare 2 Table Files as well as CalX Files.

This makes the use of tbl2Calx obsolete and spares you from guarding your chem 2 calx files in a safe place.

In fact I would recomend using .tbl files instead of calx files because the .tbl files are more complete then the calx.

Solved issues:

1. The fuel tables get compared as well
2. A number of bugs in the older version are solved
3. Better explaination of the comparison results

Known issues:

Right now I am not aware of any problems. However, when you compare .tbl files the calibration summary is not correct. So ignore the injector and Map Information.

I would like feedback! I have some plans with the tool myself - however, feedback would motivate me to share.

Have fun!

MopàrBCN
08-15-2008, 07:02 AM
Hi,

I just want to give a quick guide on how to work with the comparison data produced by CalX Compare:

In below image you see highlighted PumpingEfficiency differences between two versions of my current cal. The comparison was made against the previous build of my actual build.

http://img514.imageshack.us/img514/3029/ccchz6.jpg

Now, how to work with this:

If you have a look at the columns fDiffType and fDifference you see that the difference found is type "Value" so that means the Value of a specific point is different between both cals.

The column fDifference now points us to where in our source we can find the difference:

To make this easy to understand let's look at the first highlighted row:

The column fDifference says "<> at Pos. 2, 4 (Slope)". Then we have the column "fValueMain" with "7" and the Column "fValueComparison" with "E"

Since here we compare a Table, important for us are the coordinates (2, 4) in the fDifference Column.

So here this means the difference can be found in the second Data Point in the 4th byte:

To visualise this here are the 2 complete tables and the difference at 2, 4 is highlighted red (for reference, the other differences are marked green):

Main ; PumpingEfficiency (PEFTBL)
1 2 3 4
0 .byte 0x0a
1 .byte 0x10, 0x55, 0x00, 0x00
2 .byte 0x1b, 0x55, 0x00, 0x07
3 .byte 0x3f, 0x56, 0x00, 0xaa
4 .byte 0x4b, 0x5e, 0x00, 0x86
5 .byte 0x60, 0x69, 0x00, 0x08
6 .byte 0x7d, 0x6a, 0xff, 0x9a
7 .byte 0x96, 0x60, 0xff, 0x28
8 .byte 0xa3, 0x55, 0xff, 0x0b
9 .byte 0xbb, 0x3e, 0x00, 0x00
10 .byte 0xcf, 0x3e


Comp ; PumpingEfficiency (PEFTBL)
1 2 3 4
0 .byte 0x0a
1 .byte 0x10, 0x55, 0x00, 0x00
2 .byte 0x1b, 0x55, 0x00, 0x0e
3 .byte 0x3f, 0x57, 0x00, 0x95
4 .byte 0x4b, 0x5e, 0xff, 0xeb
5 .byte 0x57, 0x5d, 0x00, 0x50
6 .byte 0x7d, 0x69, 0xff, 0xa4
7 .byte 0x96, 0x60, 0xff, 0x28
8 .byte 0xa3, 0x55, 0xfe, 0xf6
9 .byte 0xbb, 0x3c, 0xff, 0x80
10 .byte 0xcf, 0x32

And this is, how this difference looks in Chem2:
http://img380.imageshack.us/img380/3236/chempc7.jpg

This is the basis on how CalX Compare works.

Aries_Turbo
08-15-2008, 11:13 AM
cool. ill have to try it out.

Brian

risen
08-15-2008, 11:35 AM
I'm going to give it a shot on my T-LM cals vs bb60 this weekend to see how it works on LM cals.

quantum
08-15-2008, 11:55 AM
Wow this is nice. I was using Mirkes.de tiny hexer to find differences.

MopàrBCN
08-15-2008, 10:14 PM
Now, one interesting comparison is as well to load your .tbl file of your current cal and compare this against you .calx file of your current cal. You'll be amazed how much there is you can not edit in chem2 due to this.

So one further enhancement I am working on is to give an intuitive interface to enhance your calx files for using with chem2.

In total with the next release (in a couple of days) I am planing to add the following features and would feel this a good moment to through in anything you'd like to see:

1. Direct Call to Chem2 - This is normally done in a few seconds but to do it right I would like to allow to generate cuality calx files to call with chem2. There is no point if you are discovering differences you'd like to even out when you are comparing with .tbl files and that very data is not available in calx. Chem2 on the other hand is the ideal tool since it allows me to load a cal from the command line

2. Drill down approach to differences between cals. I found that working with the tool I tend to open Chem to visualise the difference. Also I find, the initial list can be quite long when you have only propably have only 3 different tables. So my approach will be to only list the objects with differences and allow you drill into those for more details. Also I will use grafics to show the differences, with an option to display the source code of an object.

3. This option propably later, but I definetly will introduce comparison projects. The advantage would be that the program internally organises the comparison and allows you to store those for future reference allowing to add comments etc. That way this tool get's a bit closer to a cal project tool, allowing to call chem as an editor directly, automatically keeping track of changes and allowing to comment on those.

So any Ideas on top of this will be welcome.

MopàrBCN
08-17-2008, 07:11 AM
New Version Released. Now 2.0.0.1 - Still Beta - Download in Post #1

Basically I have started implementing the changes in above post.

The biggest change is the way to display Data, either from comparison or from the calibrations used in the comparison.

Tables are now shown graphically.

The Calibration objects are organised in a treeview. If you compare calx you can include the logical groups in your treeview.

NOTE: Graphing is still way from being exact. All the scaling / inverse values etc. is not taken care off. So it is basically at this stage an idea to see how data differs.
I guess I will take some days to get this right.

More will come...

http://img368.imageshack.us/img368/8357/calcompyv6.jpg

cordes
08-18-2008, 03:48 PM
It still doesn't work for me. I tried to get several calx files, and several tbl files to load, but there is always an error when I hit compare, and I am forced to continue which causes the program to not do anything, or quit which closes the program.

MopàrBCN
08-19-2008, 01:32 AM
Hi,

Hi, could you paste the error here? There should be a Details button on the Error Message where you just can highlight the error text and copy it (ctrl-c) and paste it here. That would help!

2 more questions:

1. You do have the binary in the same directory as the .tbl file?
The program needs in total 4 files, the main Table/Calx and Binary and the Comparison Table/Calx and Binary. Once you point the program to a .tbl/.calx file it assumes that the corresponding binary is in the same directory using the same name.
Each Table and Binary Pair needs to share the same Filename as well. Example: MyCalibration.tbl and MyCalibration.bin

2. Would you mind uploading me an example of those files you can not load? I so far only tested with Ladybug and Turbonator Files. With Ladybug I still have an issue with the CalX File.

cordes
08-19-2008, 11:17 AM
Here is the error



See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
at ct.turbo.calxcompare.Chem2.InitClass()
at ct.turbo.calxcompare.Chem2..ctor()
at ct.turbo.calxcompare.CalXcomPare.SetChemDs()
at ct.turbo.calxcompare.CalXcomPare.Button3_Click(Obj ect sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
ct.turbo.calxcompare
Assembly Version: 2.0.0.1
Win32 Version: 2.0.0.1
CodeBase: file:///C:/Program%20Files/cals/tools/ct.turbo.calxcompare.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.



I just can't get it to do anything, but that usually just means that it is my fault.

MopàrBCN
08-19-2008, 12:27 PM
Got it, it is my fault!!

I use VS 2008 but was sure that I targeted the .NET 2.0 Framework. However, I don't. Basically I check now how much trouble there will be changing this (I doubt I use anything specific to the 3.5 Framework)

Anyway, I am currently already preparing the next release, since there are still bugs in the current release, after all with the graphing. So I may not do anything about this issue until later this evening or even tomorrow, depending how much there is left to do.

I will keep you posted!

MopàrBCN
08-19-2008, 12:35 PM
Ok, checked it out, it is NO problem limiting the project the .NET Framework 2.0. So this will be done with the next release (to come soon)

I am sorry for this!!

cordes
08-19-2008, 01:19 PM
No problem. I appreciate all the work.

MopàrBCN
08-23-2008, 05:53 PM
Quick Update:

There was a lot more work in my upgrade plans then I initially planned.

So there are still some more days to wait I think. However, for those who actually like version control etc. the next release will bear some surprises!!

Just to keep you informed...