This commit is contained in:
rusefillc 2022-10-15 10:54:09 -04:00
parent bda7183b9c
commit 69d9ad2270
16 changed files with 0 additions and 304 deletions

View File

@ -1 +0,0 @@
ts2c

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<buildFile url="file://$PROJECT_DIR$/build.xml" />
</component>
</project>

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View File

@ -1,3 +0,0 @@
<component name="CopyrightManager">
<settings default="" />
</component>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/ts2c.iml" filepath="$PROJECT_DIR$/ts2c.iml" />
</modules>
</component>
</project>

View File

@ -1,22 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="TS2C ignitionTable" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="com.rusefi.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="MAIN_CLASS_NAME" value="com.rusefi.TS2C" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="currenttune.msq ignitionLoadBins ignitionRpmBins ignitionTable" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="ts2c" />
<envs />
<method />
</configuration>
</component>

View File

@ -1,22 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="TS2C veTable" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="com.rusefi.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="MAIN_CLASS_NAME" value="com.rusefi.TS2C" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="currenttune.msq veLoadBins veRpmBins veTable" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="ts2c" />
<envs />
<method />
</configuration>
</component>

View File

@ -1,5 +0,0 @@
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="svn" />
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

View File

@ -1,24 +0,0 @@
<project default="jar">
<target name="clean">
<delete dir="build"/>
</target>
<target name="compile">
<mkdir dir="build/classes"/>
<javac destdir="build/classes" classpath="lib/junit.jar:lib/annotations.jar">
<src path="src/main/java"/>
</javac>
</target>
<target name="jar" depends="compile">
<mkdir dir="build/jar"/>
<jar destfile="../ts2c.jar" basedir="build/classes">
<manifest>
<attribute name="Main-Class" value="com.rusefi.TS2C"/>
</manifest>
<zipfileset dir="build/classes" includes="**/*.class"/>
</jar>
</target>
</project>

View File

@ -1,53 +0,0 @@
0.0
6.6599731
13.3299561
20.0
26.6599121
33.3300781
40.0
46.6601563
53.3300781
60.0
66.6601563
73.3300781
80.0
86.6601563
93.3300781
100.0
800.0
1213.328125
1626.65625
2040.0
2453.34375
2866.65625
3280.0
3693.34375
4106.6875
4520.0
4933.3125
5346.6875
5760.0
6173.3125
6586.6875
7000.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0

View File

@ -1,3 +0,0 @@
Looks like this folder is dead, TS2C was moved to rusefi console project?
TODO: decide what to do with this folder

View File

@ -1,104 +0,0 @@
package com.rusefi;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Andrey Belomutskiy, (c) 2012-2015
* 6/29/2015
*/
public class OBD2C {
// 1 Psi = 6.89475729 Kilopascals
static double PSI_2_KPA = 6.89475729;
static int RPM_COUNT = 16;
static int LOAD_COUNT = 16;
static Bucket[][] buckets = new Bucket[RPM_COUNT][LOAD_COUNT];
public static void main(String[] args) throws IOException {
for (int rpmIndex = 0; rpmIndex < RPM_COUNT; rpmIndex++)
for (int loadIndex = 0; loadIndex < LOAD_COUNT; loadIndex++) {
buckets[rpmIndex][loadIndex] = new Bucket();
}
fillLoadBins(TS2C.loadBins);
loadRpmBins(TS2C.rpmBins);
String fileName = "datalog.csv";
BufferedReader reader = new BufferedReader(new FileReader(fileName));
String line;
while ((line = reader.readLine()) != null)
processLine(line);
BufferedWriter w = new BufferedWriter(new FileWriter("output.c"));
TS2C.writeTable(w, new TS2C.ValueSource() {
@Override
public float getValue(int loadIndex, int rpmIndex) {
return buckets[rpmIndex][loadIndex].getValue();
}
}, "OBD2C");
}
private static void loadRpmBins(float[] rpmBins) {
for (int i =0;i< rpmBins.length;i++) {
rpmBins[i] = 800 + (7000 - 800) * i / (rpmBins.length - 1);
}
System.out.println("rpm bins: " + Arrays.toString(rpmBins));
}
private static void fillLoadBins(float[] loadBins) {
for (int i = 0; i < loadBins.length; i++)
loadBins[i] = (float) (100.0 * i / (loadBins.length - 1));
System.out.println("load bins: " + Arrays.toString(loadBins));
}
private static void processLine(String line) {
String[] values = line.split(",");
double map = Double.parseDouble(values[1]) * PSI_2_KPA;
double advance = Double.parseDouble(values[3]);
double rpm = Double.parseDouble(values[5]);
System.out.println("map=" + map + ", advance=" + advance + ", rpm=" + rpm);
int rpmIndex = (int) ((rpm - 800) / ((7000 - 800) / 16));
int loadIndex = (int) (map / (100 / 16));
if (rpmIndex >= RPM_COUNT)
rpmIndex = RPM_COUNT - 1;
if (loadIndex >= LOAD_COUNT)
loadIndex = LOAD_COUNT - 1;
System.out.println("rpm index: " + rpmIndex + ", loadIndex=" + loadIndex);
buckets[rpmIndex][loadIndex].addValue(advance);
}
static class Bucket {
List<Double> values = new ArrayList<Double>();
public void addValue(double advance) {
values.add(advance);
}
public float getValue() {
if (values.isEmpty())
return -100;
double total = 0;
for (double v : values)
total += v;
return (float) (total / values.size());
}
}
}

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>