Pages: [1] 2
Author Topic: Map pack to XDF converter  (Read 26726 times)
prj
Hero Member
*****

Karma: +1072/-480
Offline Offline

Posts: 6035


« on: January 26, 2012, 05:30:43 AM »

I wrote a map pack -> xdf converter.
Doesn't support the newer map packs (yet), but possibly will be added in the future.

Usage is:
java -jar xdf-generator.jar <mappack file>

This will print out the XDF definition to stdout.
If you would like it in a file, redirect the output, like so:
java -jar xdf-generator.jar mymappack.kp > mydefinition.xdf

xdf-generator.jar is attached.
One of the shortcomings I am aware of, is that you will have to set "image size" manually in XDF header properties for now. For 1mb files, that'll be 100000.
----
For developers:
The source is located here: https://github.com/prj/me7-tools
You will need java6 and maven to build it.

The source has two modules right now - ols-parser, which parses the map pack to java objects, and xdf-generator, which uses the first module to actually emit the XDF.
ols-parser is very similar to nyet's. xdf-generator is completely different, as it emits XML based TunerPro definitions and uses JAXB and annotations for XML output.

Feel free to use, re-use and contribute.
« Last Edit: January 29, 2012, 09:17:23 PM by prj » Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
julex
Hero Member
*****

Karma: +79/-4
Offline Offline

Posts: 923


« Reply #1 on: January 26, 2012, 08:11:35 AM »

awesome!

now if we had a full m-box OLS file, it would complete the quest.
Logged
professor
Sr. Member
****

Karma: +25/-0
Offline Offline

Posts: 409



« Reply #2 on: January 26, 2012, 12:03:50 PM »

Thank you for sharing this!

I see that NMAX, NMAXDV, TEMIN and many others conversion shows wrong values.
kp file was created from WinOls 1.226.
« Last Edit: January 26, 2012, 12:05:56 PM by professor » Logged

Seat Ibiza MK4 Cupra 1.8t 20V, stg3.
"Those 1.8T 20V machines are really tough" ©
carlossus
Sr. Member
****

Karma: +38/-0
Offline Offline

Posts: 394

Leon Curpa Stg1+


« Reply #3 on: January 26, 2012, 12:08:39 PM »

Thank you!

I assume this...

"Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.simontuffs.onejar.Boot.run(Boot.java:340)
        at com.simontuffs.onejar.Boot.main(Boot.java:166)
Caused by: java.lang.IllegalStateException: Tried to read string of length 52428
8 at 614
        at com.prj.tuning.mappack.util.BinaryUtil.readString(BinaryUtil.java:15)

        at com.prj.tuning.mappack.map.PMap.fromBuffer(PMap.java:27)
        at com.prj.tuning.mappack.Project.parse(Project.java:42)
        at com.prj.tuning.xdf.KpToXdf.main(KpToXdf.java:15)
        ... 6 more"

...is because it doesn't like v1.5 map packs?
Logged
prj
Hero Member
*****

Karma: +1072/-480
Offline Offline

Posts: 6035


« Reply #4 on: January 26, 2012, 12:43:08 PM »

Thank you for sharing this!

I see that NMAX, NMAXDV, TEMIN and many others conversion shows wrong values.
kp file was created from WinOls 1.226.
Thanks, I will take a look at what is wrong.

Thank you!

I assume this...

"Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.simontuffs.onejar.Boot.run(Boot.java:340)
        at com.simontuffs.onejar.Boot.main(Boot.java:166)
Caused by: java.lang.IllegalStateException: Tried to read string of length 52428
8 at 614
        at com.prj.tuning.mappack.util.BinaryUtil.readString(BinaryUtil.java:15)

        at com.prj.tuning.mappack.map.PMap.fromBuffer(PMap.java:27)
        at com.prj.tuning.mappack.Project.parse(Project.java:42)
        at com.prj.tuning.xdf.KpToXdf.main(KpToXdf.java:15)
        ... 6 more"

...is because it doesn't like v1.5 map packs?


Yeah, that's the reason, I haven't added support for 1.5 yet.
« Last Edit: January 26, 2012, 12:46:01 PM by prj » Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
prj
Hero Member
*****

Karma: +1072/-480
Offline Offline

Posts: 6035


« Reply #5 on: January 26, 2012, 04:39:57 PM »

I see that NMAX, NMAXDV, TEMIN and many others conversion shows wrong values.
kp file was created from WinOls 1.226.

Found the problem.
I was doing the LSB/MSB code and verifying it on the LAMFA table axis.
However, LAMFA table axis has incorrect definition in 551G map pack. It's LoHi, while it should be HiLo.
So my logic was inverse.

I have fixed it now.

Find attached the new file. Will update 1st post as well.
Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
Tony@NefMoto
Administrator
Hero Member
*****

Karma: +132/-4
Offline Offline

Posts: 1389


2001.5 Audi S4 Stage 3


« Reply #6 on: January 26, 2012, 06:23:14 PM »

 Grin Thanks for contributing.
Logged

Remember you have to log in if you want to see the file attachments!
Info or questions, please add to the wiki: http://www.nefariousmotorsports.com/wiki
Follow NefMoto developments on Twitter: http://twitter.com/nefmoto
professor
Sr. Member
****

Karma: +25/-0
Offline Offline

Posts: 409



« Reply #7 on: January 27, 2012, 12:48:06 AM »

prj as far i as i see it its ok now.

Very nice work and thank you  Smiley

edit: So far KRKTE is wrong. FKKVS too. If i found something else i ll post it.
« Last Edit: January 27, 2012, 01:52:35 AM by professor » Logged

Seat Ibiza MK4 Cupra 1.8t 20V, stg3.
"Those 1.8T 20V machines are really tough" ©
prj
Hero Member
*****

Karma: +1072/-480
Offline Offline

Posts: 6035


« Reply #8 on: January 27, 2012, 02:32:17 AM »

Grin Thanks for contributing.
Just getting started Wink

prj as far i as i see it its ok now.

Very nice work and thank you  Smiley

edit: So far KRKTE is wrong. FKKVS too. If i found something else i ll post it.
This was because floats were printed out wrong and because precision data was not parsed.
I have corrected both problems.

Find attached the new binary, first post will be updated as well.
Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
professor
Sr. Member
****

Karma: +25/-0
Offline Offline

Posts: 409



« Reply #9 on: January 27, 2012, 02:50:42 AM »

Nice fixed.
Logged

Seat Ibiza MK4 Cupra 1.8t 20V, stg3.
"Those 1.8T 20V machines are really tough" ©
prj
Hero Member
*****

Karma: +1072/-480
Offline Offline

Posts: 6035


« Reply #10 on: January 27, 2012, 03:21:50 AM »

Nice fixed.
Cool, if there's anything else you find, let me know.
And thanks for testing Smiley
Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
prj
Hero Member
*****

Karma: +1072/-480
Offline Offline

Posts: 6035


« Reply #11 on: January 29, 2012, 09:16:53 PM »

Fixed:
* Map rotation for large maps, single axis maps
* Missing axes for single axis maps
* Duplicate axes. If axis maps are already present in map pack, do not generate new ones
* Capped precision to two decimal places, as TunerPro gets lots of visualization problems otherwise

Binary attached...
Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
tobz
Full Member
***

Karma: +3/-1
Offline Offline

Posts: 60


« Reply #12 on: January 30, 2012, 12:13:28 PM »

I tried using your converter with a map pack released by Argdub for 06A906032HS.  It errored out on reading, and when I checked the headers, it has a string in there for WinOls 5.00... which doesn't make sense since, as far as I know, there is no version 5.0 for WinOls.

How do I, or how do you, definitively determine what version of WinOls a map pack is from?  The map pack in question is attached.
Logged
prj
Hero Member
*****

Karma: +1072/-480
Offline Offline

Posts: 6035


« Reply #13 on: January 30, 2012, 12:25:52 PM »

I saw you fork my repo.
I have no idea how to determine the version...

My .kp's also say that it's WinOls 5.0, yet it reads them fine.
I think they changed the format in a newer version.

I think all the classes that represent objects within the .kp need to be made abstract with an abstract method "fromBuffer".
Then "fromBuffer" should be implemented in various onese
And I guess just try them in succession, until one is successful at parsing...

Have to analyze the binary format of the newer map packs. Probably a good idea to create a simple map pack (or import nyet's sample map pack), then export it from a newer OLS version and check for differences.
Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
nyet
Administrator
Hero Member
*****

Karma: +607/-168
Offline Offline

Posts: 12268


WWW
« Reply #14 on: January 30, 2012, 01:19:48 PM »

FWIW, my attempts at finding a foolproof way to detect .kp version all failed Sad

EVC is made up of a bunch of asshats. What do you expect? They want to make using anything but EVC tools impossible.

Gee, i love proprietary software.
Logged

ME7.1 tuning guide
ECUx Plot
ME7Sum checksum
Trim heatmap tool

Please do not ask me for tunes. I'm here to help people make their own.

Do not PM me technical questions! Please, ask all questions on the forums! Doing so will ensure the next person with the same issue gets the opportunity to learn from your ex
Pages: [1] 2
  Print  
 
Jump to:  

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