CSV Map List -> WinOLS

Posts related to specific vehicles, or any other general tuning info.

CSV Map List -> WinOLS

Postby AndrewW » Wed Aug 14, 2019 6:17 pm

Hi,

I have a CSV list of maps/addresses which appears to have been exported from WinOLS (sample rows below), is there any way I can import this into a WinOLS project?

Thanks!

Code: Select all
Name;IdName;FolderName;Type;ViewMode;RWin;DataOrg;bReciprocal;bSigned;bDelta;bPercent;bOriginal;bOriginalValues;Columns;Rows;Radix;Comment;Precision;SkipBytes;Fieldvalues.Name;Fieldvalues.Unit;Fieldvalues.Factor;Fieldvalues.Offset;Fieldvalues.StartAddr;AxisX.Name;AxisX.IdName;AxisX.Unit;AxisX.Factor;AxisX.Offset;AxisX.Radix;AxisX.bBackwards;AxisX.bReciprocal;AxisX.bSigned;AxisX.Precision;AxisX.DataSrc;AxisX.DataHeader;AxisX.DataAddr;AxisX.DataOrg;AxisX.SignatureByte;AxisX.SkipBytes;AxisY.Name;AxisY.IdName;AxisY.Unit;AxisY.Factor;AxisY.Offset;AxisY.Radix;AxisY.bBackwards;AxisY.bReciprocal;AxisY.bSigned;AxisY.Precision;AxisY.DataSrc;AxisY.DataHeader;AxisY.DataAddr;AxisY.DataOrg;AxisY.SignatureByte;AxisY.SkipBytes
Hexdump;;Hexdump;eHexDump;eViewText;eBars;eByte;0;0;0;0;0;0;24;87382;16;;-1;0;-;-;1;0;$-2;-;;-;1;0;16;0;0;0;-1;eDataSrcNone;0;$0;eByte;0x-1;0;-;;-;1;0;16;0;0;0;-1;eDataSrcNone;0;$0;eByte;0x-1;0
Correction map for the PDT_DYN_DIF correction (ip_fac_pdt_dyn_dif_cor_2);;INSY_THR_Position_SP_CLC: ""THR_Position_SP_CLC"";eZweiInv;eViewText;eBars;eLoHi;0;0;0;0;0;0;6;8;10;;3;0;;-;0.000122070313;-0;$48B34;Engine speed- resolution 1rpm;n;rpm;1;-0;10;0;0;0;3;eRom;0;$468EE;eLoHi;0x-1;0;Difference between PDT and PDT_SP during transient condition;pdt_dyn_dif;hPa;0.082917524987;0.000000000003;10;0;0;0;3;eRom;0;$4693A;eLoHi;0x-1;0

AndrewW
Bronze
 
Posts: 26
Joined: Wed Jul 17, 2019 10:38 am
Location: Newcastle, UK

Re: CSV Map List -> WinOLS

Postby Shooting » Wed Aug 14, 2019 7:15 pm

AndrewW wrote:Hi,

I have a CSV list of maps/addresses which appears to have been exported from WinOLS (sample rows below), is there any way I can import this into a WinOLS project?

Thanks!

Code: Select all
Name;IdName;FolderName;Type;ViewMode;RWin;DataOrg;bReciprocal;bSigned;bDelta;bPercent;bOriginal;bOriginalValues;Columns;Rows;Radix;Comment;Precision;SkipBytes;Fieldvalues.Name;Fieldvalues.Unit;Fieldvalues.Factor;Fieldvalues.Offset;Fieldvalues.StartAddr;AxisX.Name;AxisX.IdName;AxisX.Unit;AxisX.Factor;AxisX.Offset;AxisX.Radix;AxisX.bBackwards;AxisX.bReciprocal;AxisX.bSigned;AxisX.Precision;AxisX.DataSrc;AxisX.DataHeader;AxisX.DataAddr;AxisX.DataOrg;AxisX.SignatureByte;AxisX.SkipBytes;AxisY.Name;AxisY.IdName;AxisY.Unit;AxisY.Factor;AxisY.Offset;AxisY.Radix;AxisY.bBackwards;AxisY.bReciprocal;AxisY.bSigned;AxisY.Precision;AxisY.DataSrc;AxisY.DataHeader;AxisY.DataAddr;AxisY.DataOrg;AxisY.SignatureByte;AxisY.SkipBytes
Hexdump;;Hexdump;eHexDump;eViewText;eBars;eByte;0;0;0;0;0;0;24;87382;16;;-1;0;-;-;1;0;$-2;-;;-;1;0;16;0;0;0;-1;eDataSrcNone;0;$0;eByte;0x-1;0;-;;-;1;0;16;0;0;0;-1;eDataSrcNone;0;$0;eByte;0x-1;0
Correction map for the PDT_DYN_DIF correction (ip_fac_pdt_dyn_dif_cor_2);;INSY_THR_Position_SP_CLC: ""THR_Position_SP_CLC"";eZweiInv;eViewText;eBars;eLoHi;0;0;0;0;0;0;6;8;10;;3;0;;-;0.000122070313;-0;$48B34;Engine speed- resolution 1rpm;n;rpm;1;-0;10;0;0;0;3;eRom;0;$468EE;eLoHi;0x-1;0;Difference between PDT and PDT_SP during transient condition;pdt_dyn_dif;hPa;0.082917524987;0.000000000003;10;0;0;0;3;eRom;0;$4693A;eLoHi;0x-1;0


This is not a .CSV output from WinOLS

wbr

User avatar
Shooting
Diamond
 
Posts: 1574
Joined: Thu Jan 12, 2017 11:43 am
Location: North Wales

Re: CSV Map List -> WinOLS

Postby AndrewW » Wed Aug 14, 2019 9:33 pm

Ok fair enough thanks, I found something earlier which made it appear as though it had been exported from a very early version of WinOLS but can’t seem to find anything now that I’m looking again.

Is anyone aware of any way to import map lists into WinOLS, I can manipulate the data however required.

The only way I can see is a .kp file and upon a quick look I don’t understand the encoding quite yet, and it varies quite a bit from what I’ve seen.

Thanks

AndrewW
Bronze
 
Posts: 26
Joined: Wed Jul 17, 2019 10:38 am
Location: Newcastle, UK

Re: CSV Map List -> WinOLS

Postby Shooting » Thu Aug 15, 2019 9:40 am

AndrewW wrote:Ok fair enough thanks, I found something earlier which made it appear as though it had been exported from a very early version of WinOLS but can’t seem to find anything now that I’m looking again.

Is anyone aware of any way to import map lists into WinOLS, I can manipulate the data however required.

The only way I can see is a .kp file and upon a quick look I don’t understand the encoding quite yet, and it varies quite a bit from what I’ve seen.

Thanks


.KP files are WinOLS mappacks, tho you can also use the .OLS file which contains the original tune too.

wbr

User avatar
Shooting
Diamond
 
Posts: 1574
Joined: Thu Jan 12, 2017 11:43 am
Location: North Wales

Re: CSV Map List -> WinOLS

Postby AndrewW » Thu Aug 15, 2019 9:44 am

I don’t have the original project, just the CSV, so I need to somehow import that into a fresh project.

I’m close to sorting it anyway, turns out it is WinOLS data however has probably been generated from a script rather than a built in export, I’m working on a little PHP script which will convert the CSV into a .winolsskript file so it can be executed on the project to re-import them so I’ll share that when it’s working properly.

AndrewW
Bronze
 
Posts: 26
Joined: Wed Jul 17, 2019 10:38 am
Location: Newcastle, UK

Re: CSV Map List -> WinOLS

Postby Shooting » Thu Aug 15, 2019 10:26 am

AndrewW wrote:I don’t have the original project, just the CSV, so I need to somehow import that into a fresh project.

I’m close to sorting it anyway, turns out it is WinOLS data however has probably been generated from a script rather than a built in export, I’m working on a little PHP script which will convert the CSV into a .winolsskript file so it can be executed on the project to re-import them so I’ll share that when it’s working properly.


Post the .CSV so we can see it

wbr

User avatar
Shooting
Diamond
 
Posts: 1574
Joined: Thu Jan 12, 2017 11:43 am
Location: North Wales

Re: CSV Map List -> WinOLS

Postby AndrewW » Thu Aug 15, 2019 1:45 pm

If anyone else is looking to so something similar this is the quick and dirty PHP script I wrote to translate the CSV into a WinOLS script. Copy and pasted the output and saved with the extension .winolsskript then drag and drop into the project window:

There's help in WinOLS around the script language if your data needs a bit manipulation like mine did

Code: Select all
<?php
$rows = array_map(function($v){return str_getcsv($v, ";");}, file("fileup/data.csv"));
$header = array_shift($rows);
$csv = [];
foreach($rows as $row)
{
    $csv[] = array_combine($header, $row);
}
$outString = "replace_mode absolute
begin_requires
end_requires
begin_executable" . "\r\n";
$counter = 0;
foreach($csv as $thisMap)
{
   $outString .= 'search KF' . $counter . ' eByte 0x00000 0 0% "?"' . "\r\n";
   $outString .= "begin_insert_map KF" . $counter . "\r\n";
   foreach($thisMap as $keyName => $keyValue)
   {
      $sanitised = str_replace('"',"",$keyValue);
      $sanitised = str_replace('$',"",$sanitised);
      if($keyName == "Feldwerte.StartAddr" || $keyName == "StuetzX.DataAddr" || $keyName == "StuetzY.DataAddr")
      {
         $sanitised = "0x" . $sanitised;
      }
      $outString .= 'set_map_property "' . $keyName . '" "' . $sanitised . '"'. "\r\n";
   }
   $outString .= "end_insert_map" . "\r\n";
   $counter++;
}
$outString .= "end_executable" . "\r\n";

echo $outString;
/*
//**Template**
replace_mode absolute
begin_requires
end_requires
begin_executable
search KF0 eByte 0x00000 0 0% "?"
begin_insert_map KF0
set_map_property "Name" "Hexdump"
set_map_property "IdName" ""
set_map_property "FolderName" "Hexdump"
set_map_property "Typ" "eHexDump"
set_map_property "ViewMode" "eViewText"
set_map_property "RWin" "eBars"
set_map_property "DataOrg" "eByte"
set_map_property "bKehrwert" "0"
set_map_property "bVorzeichen" "0"
set_map_property "bDelta" "0"
set_map_property "bProzent" "0"
set_map_property "bOriginal" "0"
set_map_property "bOriginalWerte" "0"
set_map_property "Spalten" "24"
set_map_property "Zeilen" "87382"
set_map_property "Radix" "16"
set_map_property "Kommentar" ""
set_map_property "Nachkommastellen" "-1"
set_map_property "Feldwerte.Name" "-"
set_map_property "Feldwerte.Einheit" "-"
set_map_property "Feldwerte.Faktor" "1"
set_map_property "Feldwerte.Offset" "0"
set_map_property "Feldwerte.StartAddr" "0x-2"
set_map_property "StuetzX.Name" "-"
set_map_property "StuetzX.Einheit" "-"
set_map_property "StuetzX.Faktor" "1"
set_map_property "StuetzX.Offset" "0"
set_map_property "StuetzX.Radix" "16"
set_map_property "StuetzX.bRueckwaerts" "0"
set_map_property "StuetzX.bKehrwert" "0"
set_map_property "StuetzX.bVorzeichen" "0"
set_map_property "StuetzX.Nachkommastellen" "-1"
set_map_property "StuetzX.DataSrc" "eDataSrcNone"
set_map_property "StuetzX.DataHeader" "0"
set_map_property "StuetzX.DataAddr" "0x0"
set_map_property "StuetzX.DataOrg" "eByte"
set_map_property "StuetzX.SignaturByte" "0x-1"
set_map_property "StuetzX.SkipBytes" "0"
set_map_property "StuetzY.Name" "-"
set_map_property "StuetzY.Einheit" "-"
set_map_property "StuetzY.Faktor" "1"
set_map_property "StuetzY.Offset" "0"
set_map_property "StuetzY.Radix" "16"
set_map_property "StuetzY.bRueckwaerts" "0"
set_map_property "StuetzY.bKehrwert" "0"
set_map_property "StuetzY.bVorzeichen" "0"
set_map_property "StuetzY.Nachkommastellen" "-1"
set_map_property "StuetzY.DataSrc" "eDataSrcNone"
set_map_property "StuetzY.DataHeader" "0"
set_map_property "StuetzY.DataAddr" "0x0"
set_map_property "StuetzY.DataOrg" "eByte"
set_map_property "StuetzY.SignaturByte" "0x-1"
set_map_property "StuetzY.SkipBytes" "0"
end_insert_map
end_executable
*/
?>

AndrewW
Bronze
 
Posts: 26
Joined: Wed Jul 17, 2019 10:38 am
Location: Newcastle, UK

Re: CSV Map List -> WinOLS

Postby jone » Thu Aug 15, 2019 2:16 pm

Hi,

Code: Select all
PHP Warning: file() has been disabled for security reasons in index.php on line 2 PHP Warning: array_map(): Argument #2 should be an array in index.php on line 2 PHP Warning: array_shift() expects parameter 1 to be array, null given in index.php on line 3 PHP Warning: Invalid argument supplied for foreach() in index.php on line 5 replace_mode absolute begin_requires end_requires begin_executable end_executable

User avatar
jone
Silver
 
Posts: 96
Joined: Thu Aug 25, 2016 8:06 pm
Location: my garage

Re: CSV Map List -> WinOLS

Postby AndrewW » Thu Aug 15, 2019 8:16 pm

The environment you’re running on either doesn’t have raw file access or the file() function has been disabled. I’d recommend just installing php and apache/iis on your local machine if you’re comfortable with that, or getting some decent hosting without the restrictions. Alternatively you could try to load the contents of the file via another method (fopen/file_get_contents etc) and see if there allowed

I could write a quick windows app to do the same operation however this script will likely only work for my file and is just intended to give an idea of how to do what I’ve done for anyone interested

AndrewW
Bronze
 
Posts: 26
Joined: Wed Jul 17, 2019 10:38 am
Location: Newcastle, UK

Re: CSV Map List -> WinOLS

Postby jone » Fri Aug 16, 2019 11:26 am

I'm ready to try quick windows app.

User avatar
jone
Silver
 
Posts: 96
Joined: Thu Aug 25, 2016 8:06 pm
Location: my garage

Next

Return to General tuning

Who is online

Users browsing this forum: No registered users and 4 guests