simulator crashes on any TS setting change fix #924

This commit is contained in:
rusefi 2019-09-09 20:49:16 -04:00
parent d26262eb9f
commit 34fb2c21e1
6 changed files with 19 additions and 13 deletions

View File

@ -655,6 +655,10 @@ void commonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S
initSensorChart();
#endif /* EFI_SENSOR_CHART */
#if EFI_IDLE_CONTROL
startIdleThread(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
#endif /* EFI_IDLE_CONTROL */
#if EFI_PROD_CODE || EFI_SIMULATOR
// todo: this is a mess, remove code duplication with simulator
initSettings();
@ -679,8 +683,6 @@ void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX)
addConsoleAction("analoginfo", printAnalogInfo);
commonInitEngineController(sharedLogger);
#if EFI_PROD_CODE
initPwmGenerator();
#endif
@ -770,10 +772,6 @@ void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX)
}
#endif /* EFI_ENGINE_CONTROL */
#if EFI_IDLE_CONTROL
startIdleThread(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
#endif /* EFI_IDLE_CONTROL */
if (engineConfiguration->externalKnockSenseAdc != EFI_ADC_NONE) {
addConsoleAction("knockinfo", getKnockInfo);
}
@ -816,6 +814,6 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0)
return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 20190905;
return 20190909;
}
#endif /* EFI_UNIT_TEST */

View File

@ -29,6 +29,8 @@ void Pid::initPidClass(pid_s *parameters) {
}
bool Pid::isSame(pid_s *parameters) const {
efiAssert(OBD_PCM_Processor_Fault, this->parameters != NULL, "PID::isSame invalid", false);
efiAssert(OBD_PCM_Processor_Fault, parameters != NULL, "PID::isSame NULL", false);
return this->parameters->pFactor == parameters->pFactor
&& this->parameters->iFactor == parameters->iFactor
&& this->parameters->dFactor == parameters->dFactor

View File

@ -1,6 +1,9 @@
package com.rusefi;
import com.opensr5.Logger;
import com.rusefi.binaryprotocol.BinaryProtocol;
import com.rusefi.binaryprotocol.BinaryProtocolHolder;
import com.rusefi.config.generated.Fields;
import com.rusefi.core.MessagesCentral;
import com.rusefi.core.Sensor;
@ -10,7 +13,6 @@ import com.rusefi.io.ConnectionStatus;
import com.rusefi.waves.EngineChart;
import com.rusefi.waves.EngineReport;
import static com.rusefi.TestingUtils.nextChart;
import static com.rusefi.IoUtil.sleep;
import static com.rusefi.TestingUtils.*;
import static com.rusefi.config.generated.Fields.MOCK_MAF_COMMAND;
@ -30,7 +32,7 @@ public class AutoTest {
static int currentEngineType;
private static String fatalError;
static void mainTestBody() {
static void mainTestBody() throws Exception {
MessagesCentral.getInstance().addListener(new MessagesCentral.MessageListener() {
@Override
public void onMessage(Class clazz, String message) {
@ -39,6 +41,10 @@ public class AutoTest {
}
});
BinaryProtocol bp = BinaryProtocolHolder.getInstance().get();
// let's make sure 'burn' command works since sometimes it does not
bp.burn(Logger.CONSOLE);
sendCommand("fl 1"); // just in case it was disabled
sendCommand(disableCommand(Fields.CMD_TRIGGER_HW_INPUT));
testCustomEngine();

View File

@ -2,7 +2,7 @@ package com.rusefi;
import com.rusefi.io.LinkManager;
import static com.rusefi.AutoTest.*;
import static com.rusefi.AutoTest.mainTestBody;
import static com.rusefi.Timeouts.SECOND;
/**
@ -57,7 +57,7 @@ public class RealHwTest {
return port;
}
private static void runRealHardwareTest(String port) {
private static void runRealHardwareTest(String port) throws Exception {
IoUtil.realHardwareConnect(port);
mainTestBody();
}

View File

@ -298,7 +298,7 @@ public class BinaryProtocol implements BinaryProtocolCommands {
}
}
private void burn(Logger logger) throws InterruptedException, EOFException, SerialPortException {
public void burn(Logger logger) throws InterruptedException, EOFException, SerialPortException {
if (!isBurnPending)
return;
logger.info("Need to burn");

View File

@ -48,7 +48,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
* @see EngineSnifferPanel
*/
public class Launcher {
public static final int CONSOLE_VERSION = 20190903;
public static final int CONSOLE_VERSION = 20190909;
public static final String INI_FILE_PATH = System.getProperty("ini_file_path", "..");
public static final String INPUT_FILES_PATH = System.getProperty("input_files_path", "..");
public static final String TOOLS_PATH = System.getProperty("tools_path", ".");