mirror of https://github.com/rusefi/rusefi.git
only: Mazda Miata NB2 default tune #4038
This commit is contained in:
parent
af9935ba0e
commit
bf68919fd6
|
@ -4,7 +4,6 @@ import com.devexperts.logging.Logging;
|
|||
import com.opensr5.ini.DialogModel;
|
||||
import com.opensr5.ini.IniFileModel;
|
||||
import com.rusefi.*;
|
||||
import com.rusefi.config.generated.Fields;
|
||||
import com.rusefi.core.preferences.storage.Node;
|
||||
import com.rusefi.enums.engine_type_e;
|
||||
import com.rusefi.tune.xml.Constant;
|
||||
|
@ -40,26 +39,21 @@ import static com.rusefi.tools.tune.WriteSimulatorConfiguration.INI_FILE_FOR_SIM
|
|||
* <p>
|
||||
* see <a href="https://github.com/rusefi/rusefi/wiki/Canned-Tune-Process">...</a>
|
||||
*/
|
||||
public class TuneCanTool {
|
||||
public class TuneCanTool implements TuneCanToolConstants {
|
||||
private static final Logging log = getLogging(TuneCanTool.class);
|
||||
private static final String REPORTS_OUTPUT_FOLDER = "generated/canned-tunes";
|
||||
|
||||
public static final String SRC_TEST_RESOURCES = "src/test/resources/";
|
||||
private static final String FOLDER = "generated";
|
||||
public static final String SIMULATED_PREFIX = FOLDER + File.separator + "simulator_tune";
|
||||
public static final String TUNE_FILE_SUFFIX = ".msq";
|
||||
public static final String DEFAULT_TUNE = SIMULATED_PREFIX + TUNE_FILE_SUFFIX;
|
||||
private static final String workingFolder = "downloaded_tunes";
|
||||
|
||||
private static IniFileModel ini;
|
||||
protected static IniFileModel ini;
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ini = new IniFileModel().readIniFile(INI_FILE_FOR_SIMULATOR);
|
||||
if (ini == null)
|
||||
throw new IllegalStateException("Not found " + INI_FILE_FOR_SIMULATOR);
|
||||
|
||||
RootHolder.ROOT = "../firmware/";
|
||||
|
||||
// writeDiffBetweenLocalTuneFileAndDefaultTune("example.msq");
|
||||
|
||||
|
@ -67,10 +61,6 @@ public class TuneCanTool {
|
|||
// "C:\\stuff\\i\\canam-2022-short\\canam-progress-pnp-dec-29.msq", "comment");
|
||||
|
||||
|
||||
processREOtune(1507, engine_type_e.HELLEN_154_HYUNDAI_COUPE_BK2, "COUPE-BK2");
|
||||
processREOtune(1576, engine_type_e.HYUNDAI_PB, "PB");
|
||||
processREOtune(1591, engine_type_e.BMW_M52, "M52");
|
||||
// processREOtune(1490, Fields.engine_type_e_MRE_M111, "m111-alex");
|
||||
// handle("Mitsubicha", 1258);
|
||||
// handle("Scion-1NZ-FE", 1448);
|
||||
// handle("4g93", 1425);
|
||||
|
@ -80,7 +70,7 @@ public class TuneCanTool {
|
|||
/**
|
||||
* @see WriteSimulatorConfiguration
|
||||
*/
|
||||
private static void processREOtune(int tuneId, engine_type_e engineType, String key) throws JAXBException, IOException {
|
||||
protected static void processREOtune(int tuneId, engine_type_e engineType, String key) throws JAXBException, IOException {
|
||||
// compare specific internet tune to total global default
|
||||
handle(key + "-comparing-against-global-defaults", tuneId, TuneCanTool.DEFAULT_TUNE);
|
||||
// compare same internet tune to default tune of specified engine type
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
package com.rusefi.tools.tune;
|
||||
|
||||
public interface TuneCanToolConstants {
|
||||
String SRC_TEST_RESOURCES = "src/test/resources/";
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.rusefi.tools.tune;
|
||||
|
||||
import com.opensr5.ini.IniFileModel;
|
||||
import com.rusefi.RootHolder;
|
||||
import com.rusefi.enums.engine_type_e;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
import java.io.IOException;
|
||||
|
||||
import static com.rusefi.tools.tune.WriteSimulatorConfiguration.INI_FILE_FOR_SIMULATOR;
|
||||
|
||||
public class TuneCanToolRunner extends TuneCanTool {
|
||||
static {
|
||||
ini = new IniFileModel().readIniFile(INI_FILE_FOR_SIMULATOR);
|
||||
if (ini == null)
|
||||
throw new IllegalStateException("Not found " + INI_FILE_FOR_SIMULATOR);
|
||||
RootHolder.ROOT = "../firmware/";
|
||||
}
|
||||
|
||||
|
||||
public static void runPopular() throws JAXBException, IOException {
|
||||
// while adding a line here make sure corresponding line is at rusEfiFunctionalTest.cpp
|
||||
// https://github.com/rusefi/rusefi/issues/4038
|
||||
processREOtune(985, engine_type_e.MAZDA_MIATA_NB2, "MazdaMiataNB2");
|
||||
processREOtune(1507, engine_type_e.HELLEN_154_HYUNDAI_COUPE_BK2, "COUPE-BK2");
|
||||
processREOtune(1576, engine_type_e.HYUNDAI_PB, "PB");
|
||||
processREOtune(1591, engine_type_e.BMW_M52, "M52");
|
||||
processREOtune(1490, engine_type_e.MRE_M111, "m111-alex");
|
||||
}
|
||||
}
|
|
@ -44,7 +44,7 @@ public class WriteSimulatorConfiguration {
|
|||
}) {
|
||||
writeSpecificEngineType(type);
|
||||
}
|
||||
TuneCanTool.main(args);
|
||||
TuneCanToolRunner.runPopular();
|
||||
} catch (Throwable e) {
|
||||
log.error("Unfortunately", e);
|
||||
System.exit(-1);
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.rusefi.tune;
|
|||
import com.opensr5.ini.IniFileModel;
|
||||
import com.rusefi.*;
|
||||
import com.rusefi.tools.tune.TuneCanTool;
|
||||
import com.rusefi.tools.tune.TuneCanToolConstants;
|
||||
import com.rusefi.tools.tune.TuneTools;
|
||||
import com.rusefi.tune.xml.Msq;
|
||||
import com.rusefi.tune.xml.Page;
|
||||
|
@ -19,7 +20,7 @@ public class LoadOlderTuneTest {
|
|||
Page dataPage = customOldTune.findPage();
|
||||
assertFalse(dataPage.constant.isEmpty());
|
||||
|
||||
Msq lessOldDefaultTune = Msq.readTune(TuneCanTool.SRC_TEST_RESOURCES + "simulator_tune-2023-06.xml");
|
||||
Msq lessOldDefaultTune = Msq.readTune(TuneCanToolConstants.SRC_TEST_RESOURCES + "simulator_tune-2023-06.xml");
|
||||
|
||||
IniFileModel ini = new IniFileModel().readIniFile(TuneReadWriteTest.TEST_INI);
|
||||
assertFalse(ini.fieldsInUiOrder.isEmpty());
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.opensr5.io.ConfigurationImageFile;
|
|||
import com.rusefi.binaryprotocol.MsqFactory;
|
||||
import com.rusefi.tools.tune.CurveData;
|
||||
import com.rusefi.tools.tune.TS2C;
|
||||
import com.rusefi.tools.tune.TuneCanTool;
|
||||
import com.rusefi.tools.tune.TuneCanToolConstants;
|
||||
import com.rusefi.tune.xml.Constant;
|
||||
import com.rusefi.tune.xml.Msq;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -20,7 +20,7 @@ import java.nio.file.Path;
|
|||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class TuneReadWriteTest {
|
||||
private static final String PATH = TuneCanTool.SRC_TEST_RESOURCES + "frankenso/";
|
||||
private static final String PATH = TuneCanToolConstants.SRC_TEST_RESOURCES + "frankenso/";
|
||||
static final String TUNE_NAME = PATH + "test-CurrentTune.msq";
|
||||
static final String TEST_INI = PATH + "test-mainController.ini";
|
||||
private static final String TEST_BINARY_FILE = PATH + "current_configuration.rusefi_binary";
|
||||
|
|
|
@ -55,6 +55,7 @@ endif
|
|||
# Pretend we are all different hardware so that all canned engine configs are included
|
||||
# [CannedTunes]
|
||||
USE_OPT += -DHW_HELLEN_HYUNDAI=1
|
||||
USE_OPT += -DHW_HELLEN_NB1=1
|
||||
USE_OPT += -DHW_HELLEN_NB2=1
|
||||
USE_OPT += -DHW_HELLEN=1
|
||||
USE_OPT += -DHW_PROTEUS=1
|
||||
|
|
|
@ -186,6 +186,10 @@ void rusEfiFunctionalTest(void) {
|
|||
for (auto const type : {
|
||||
engine_type_e::MRE_M111,
|
||||
engine_type_e::BMW_M52,
|
||||
engine_type_e::MAZDA_MIATA_NA6,
|
||||
engine_type_e::MAZDA_MIATA_NA94,
|
||||
engine_type_e::MAZDA_MIATA_NA96,
|
||||
engine_type_e::MAZDA_MIATA_NB1,
|
||||
engine_type_e::MAZDA_MIATA_NB2,
|
||||
engine_type_e::HONDA_K,
|
||||
engine_type_e::HELLEN_154_HYUNDAI_COUPE_BK1,
|
||||
|
|
Loading…
Reference in New Issue