Merge branch 'master' into live-data-2021

# Conflicts:
#	java_console/io/src/main/java/com/rusefi/ldmp/StateDictionary.java
This commit is contained in:
rusefillc 2021-10-14 19:10:31 -04:00
commit da3519015f
79 changed files with 488 additions and 418 deletions

View File

@ -1,4 +1,4 @@
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on hellen_cypress_gen_config.bat integration/rusefi_config.txt Thu Oct 14 04:52:21 UTC 2021
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on hellen_cypress_gen_config.bat integration/rusefi_config.txt Thu Oct 14 23:05:35 UTC 2021
// by class com.rusefi.output.CHeaderConsumer
// begin
#pragma once
@ -4370,4 +4370,4 @@ struct persistent_config_s {
};
// end
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on hellen_cypress_gen_config.bat integration/rusefi_config.txt Thu Oct 14 04:52:21 UTC 2021
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on hellen_cypress_gen_config.bat integration/rusefi_config.txt Thu Oct 14 23:05:35 UTC 2021

View File

@ -1074,17 +1074,6 @@
#define launchTimingRetard_offset 320
#define launchTimingRpmRange_offset 1036
#define launchTpsTreshold_offset 1056
#define LDS_AC_STATE 12
#define LDS_ALTERNATOR_PID_STATE_INDEX 9
#define LDS_CJ125_PID_STATE_INDEX 10
#define LDS_ENGINE_STATE_INDEX 3
#define LDS_ETB_PID_STATE_INDEX 7
#define LDS_FUEL_TRIM_STATE_INDEX 4
#define LDS_IDLE_PID_STATE_INDEX 8
#define LDS_SPEED_DENSITY_STATE_INDEX 2
#define LDS_TPS_TPS_ENEICHMENT_STATE_INDEX 5
#define LDS_TRIGGER_CENTRAL_STATE_INDEX 6
#define LDS_TRIGGER_STATE_STATE_INDEX 11
#define LE_COMMAND_LENGTH 200
#define linear_sensor_s_size 20
#define LIS302DLCsPin_offset 2043
@ -1313,8 +1302,8 @@
#define showHumanReadableWarning_offset 976
#define showSdCardWarning_offset 76
#define SIGNATURE_BOARD hellen_cypress
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 3733484042
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 460594285
#define silentTriggerError_offset 1464
#define slowAdcAlpha_offset 2088
#define sparkDwellRpmBins_offset 332
@ -1676,7 +1665,7 @@
#define ts_show_spi true
#define ts_show_trigger_comparator false
#define ts_show_tunerstudio_port true
#define TS_SIGNATURE "rusEFI 2021.10.14.hellen_cypress.3733484042"
#define TS_SIGNATURE "rusEFI 2021.10.15.hellen_cypress.460594285"
#define TS_SINGLE_WRITE_COMMAND 'W'
#define TS_SINGLE_WRITE_COMMAND_char W
#define TS_TEST_COMMAND 't'

View File

@ -87,7 +87,7 @@ static void setupDefaultSensorInputs() {
engineConfiguration->iat.adcChannel = H144_IN_IAT;
engineConfiguration->auxTempSensor1.adcChannel = H144_IN_O2S2;
// engineConfiguration->auxTempSensor1.adcChannel = H144_IN_O2S2;
engineConfiguration->auxTempSensor2.adcChannel = EFI_ADC_NONE;
}

View File

@ -1,4 +1,4 @@
#define MAIN_HELP_URL "https://rusefi.com/s/hellen121nissan"
#define MAIN_HELP_URL "https://rusefi.com/s/hellen154hyuindai"
#define ts_show_hip9011 false
#define ts_show_cj125 false

View File

@ -1,4 +1,4 @@
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on kinetis_gen_config.bat integration/rusefi_config.txt Thu Oct 14 04:52:19 UTC 2021
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on kinetis_gen_config.bat integration/rusefi_config.txt Thu Oct 14 23:05:32 UTC 2021
// by class com.rusefi.output.CHeaderConsumer
// begin
#pragma once
@ -4364,4 +4364,4 @@ struct persistent_config_s {
};
// end
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on kinetis_gen_config.bat integration/rusefi_config.txt Thu Oct 14 04:52:19 UTC 2021
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on kinetis_gen_config.bat integration/rusefi_config.txt Thu Oct 14 23:05:32 UTC 2021

View File

@ -1055,17 +1055,6 @@
#define launchTimingRetard_offset 320
#define launchTimingRpmRange_offset 1036
#define launchTpsTreshold_offset 1056
#define LDS_AC_STATE 12
#define LDS_ALTERNATOR_PID_STATE_INDEX 9
#define LDS_CJ125_PID_STATE_INDEX 10
#define LDS_ENGINE_STATE_INDEX 3
#define LDS_ETB_PID_STATE_INDEX 7
#define LDS_FUEL_TRIM_STATE_INDEX 4
#define LDS_IDLE_PID_STATE_INDEX 8
#define LDS_SPEED_DENSITY_STATE_INDEX 2
#define LDS_TPS_TPS_ENEICHMENT_STATE_INDEX 5
#define LDS_TRIGGER_CENTRAL_STATE_INDEX 6
#define LDS_TRIGGER_STATE_STATE_INDEX 11
#define LE_COMMAND_LENGTH 200
#define linear_sensor_s_size 20
#define LIS302DLCsPin_offset 2043
@ -1294,8 +1283,8 @@
#define showHumanReadableWarning_offset 976
#define showSdCardWarning_offset 76
#define SIGNATURE_BOARD kin
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 556646134
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 3838955665
#define silentTriggerError_offset 1464
#define slowAdcAlpha_offset 2088
#define sparkDwellRpmBins_offset 332
@ -1657,7 +1646,7 @@
#define ts_show_spi true
#define ts_show_trigger_comparator true
#define ts_show_tunerstudio_port true
#define TS_SIGNATURE "rusEFI 2021.10.14.kin.556646134"
#define TS_SIGNATURE "rusEFI 2021.10.15.kin.3838955665"
#define TS_SINGLE_WRITE_COMMAND 'W'
#define TS_SINGLE_WRITE_COMMAND_char W
#define TS_TEST_COMMAND 't'

View File

@ -1,4 +1,4 @@
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on config/boards/subaru_eg33/config/gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:24 UTC 2021
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on config/boards/subaru_eg33/config/gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:37 UTC 2021
// by class com.rusefi.output.CHeaderConsumer
// begin
#pragma once
@ -4370,4 +4370,4 @@ struct persistent_config_s {
};
// end
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on config/boards/subaru_eg33/config/gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:24 UTC 2021
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on config/boards/subaru_eg33/config/gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:37 UTC 2021

View File

@ -1074,17 +1074,6 @@
#define launchTimingRetard_offset 320
#define launchTimingRpmRange_offset 1036
#define launchTpsTreshold_offset 1056
#define LDS_AC_STATE 12
#define LDS_ALTERNATOR_PID_STATE_INDEX 9
#define LDS_CJ125_PID_STATE_INDEX 10
#define LDS_ENGINE_STATE_INDEX 3
#define LDS_ETB_PID_STATE_INDEX 7
#define LDS_FUEL_TRIM_STATE_INDEX 4
#define LDS_IDLE_PID_STATE_INDEX 8
#define LDS_SPEED_DENSITY_STATE_INDEX 2
#define LDS_TPS_TPS_ENEICHMENT_STATE_INDEX 5
#define LDS_TRIGGER_CENTRAL_STATE_INDEX 6
#define LDS_TRIGGER_STATE_STATE_INDEX 11
#define LE_COMMAND_LENGTH 200
#define linear_sensor_s_size 20
#define LIS302DLCsPin_offset 2043
@ -1314,8 +1303,8 @@
#define showHumanReadableWarning_offset 976
#define showSdCardWarning_offset 76
#define SIGNATURE_BOARD subaru_eg33_f7
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 159269561
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 3431083230
#define silentTriggerError_offset 1464
#define slowAdcAlpha_offset 2088
#define sparkDwellRpmBins_offset 332
@ -1677,7 +1666,7 @@
#define ts_show_spi true
#define ts_show_trigger_comparator false
#define ts_show_tunerstudio_port false
#define TS_SIGNATURE "rusEFI 2021.10.14.subaru_eg33_f7.159269561"
#define TS_SIGNATURE "rusEFI 2021.10.15.subaru_eg33_f7.3431083230"
#define TS_SINGLE_WRITE_COMMAND 'W'
#define TS_SINGLE_WRITE_COMMAND_char W
#define TS_TEST_COMMAND 't'

View File

@ -230,25 +230,25 @@ static void onlineApplyWorkingCopyBytes(uint32_t offset, int count) {
// is negligable comparing with the IO costs?
}
static const void * getStructAddr(int structId) {
static const void * getStructAddr(live_data_e structId) {
switch (structId) {
case LDS_ENGINE_STATE_INDEX:
case LDS_ENGINE:
return static_cast<engine_state2_s*>(&engine->engineState);
case LDS_FUEL_TRIM_STATE_INDEX:
case LDS_FUEL_TRIM:
return static_cast<wall_fuel_state*>(&engine->injectionEvents.elements[0].wallFuel);
case LDS_TRIGGER_CENTRAL_STATE_INDEX:
case LDS_TRIGGER_CENTRAL:
return static_cast<trigger_central_s*>(&engine->triggerCentral);
case LDS_TRIGGER_STATE_STATE_INDEX:
case LDS_TRIGGER_STATE:
return static_cast<trigger_state_s*>(&engine->triggerCentral.triggerState);
case LDS_AC_STATE:
case LDS_AC_CONTROL:
return static_cast<ac_control_s*>(&engine->acState);
#if EFI_ELECTRONIC_THROTTLE_BODY
case LDS_ETB_PID_STATE_INDEX:
case LDS_ETB_PID:
return engine->etbControllers[0]->getPidState();
#endif /* EFI_ELECTRONIC_THROTTLE_BODY */
#ifndef EFI_IDLE_CONTROL
case LDS_IDLE_PID_STATE_INDEX:
case LDS_IDLE_PID:
return static_cast<pid_state_s*>(getIdlePid());
#endif /* EFI_IDLE_CONTROL */
@ -265,7 +265,7 @@ static const void * getStructAddr(int structId) {
static void handleGetStructContent(TsChannelBase* tsChannel, int structId, int size) {
tsState.readPageCommandsCounter++;
const void *addr = getStructAddr(structId);
const void *addr = getStructAddr((live_data_e)structId);
if (addr == nullptr) {
// todo: add warning code - unexpected structId
return;

View File

@ -0,0 +1,22 @@
/**
* @file live_data_ids.h
*
* Live Documentation Structure
* these indexes are used by custom protocol command TS_GET_STRUCT
*/
#pragma once
typedef enum {
LDS_SPEED_DENSITY,
LDS_ENGINE,
LDS_FUEL_TRIM,
LDS_TPS_TPS_ENRICHMENT,
LDS_TRIGGER_CENTRAL,
LDS_ETB_PID,
LDS_IDLE_PID,
LDS_ALTERNATOR_PID,
LDS_CJ125_PID,
LDS_TRIGGER_STATE,
LDS_AC_CONTROL
} live_data_e;

View File

@ -12,6 +12,7 @@
#include "efifeatures.h"
#include "obd_error_codes.h"
#include "live_data_ids.h"
#include "rusefi_generated.h"
// we do not want to start the search for header from current folder so we use brackets here
// https://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename

View File

@ -1,4 +1,4 @@
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:16 UTC 2021
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:30 UTC 2021
// by class com.rusefi.output.CHeaderConsumer
// begin
#pragma once
@ -4370,4 +4370,4 @@ struct persistent_config_s {
};
// end
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:16 UTC 2021
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:30 UTC 2021

View File

@ -1,4 +1,4 @@
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:16 UTC 2021
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:30 UTC 2021
// by class com.rusefi.output.FileFsioSettingsConsumer
FSIO_SETTING_ACIDLEEXTRAOFFSET = 1000,

View File

@ -1,4 +1,4 @@
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:16 UTC 2021
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:30 UTC 2021
// by class com.rusefi.output.FileFsioSettingsConsumer
case FSIO_SETTING_ACIDLEEXTRAOFFSET:

View File

@ -1,4 +1,4 @@
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:16 UTC 2021
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:30 UTC 2021
// by class com.rusefi.output.FileFsioSettingsConsumer
static LENameOrdinalPair leacIdleExtraOffset(FSIO_SETTING_ACIDLEEXTRAOFFSET, "cfg_acIdleExtraOffset");

View File

@ -1,4 +1,4 @@
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:16 UTC 2021
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:30 UTC 2021
// by class com.rusefi.output.FileFsioSettingsConsumer
case FSIO_SETTING_ACIDLEEXTRAOFFSET:

View File

@ -1074,17 +1074,6 @@
#define launchTimingRetard_offset 320
#define launchTimingRpmRange_offset 1036
#define launchTpsTreshold_offset 1056
#define LDS_AC_STATE 12
#define LDS_ALTERNATOR_PID_STATE_INDEX 9
#define LDS_CJ125_PID_STATE_INDEX 10
#define LDS_ENGINE_STATE_INDEX 3
#define LDS_ETB_PID_STATE_INDEX 7
#define LDS_FUEL_TRIM_STATE_INDEX 4
#define LDS_IDLE_PID_STATE_INDEX 8
#define LDS_SPEED_DENSITY_STATE_INDEX 2
#define LDS_TPS_TPS_ENEICHMENT_STATE_INDEX 5
#define LDS_TRIGGER_CENTRAL_STATE_INDEX 6
#define LDS_TRIGGER_STATE_STATE_INDEX 11
#define LE_COMMAND_LENGTH 200
#define linear_sensor_s_size 20
#define LIS302DLCsPin_offset 2043
@ -1313,8 +1302,8 @@
#define showHumanReadableWarning_offset 976
#define showSdCardWarning_offset 76
#define SIGNATURE_BOARD all
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 2633279962
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 1493747645
#define silentTriggerError_offset 1464
#define slowAdcAlpha_offset 2088
#define sparkDwellRpmBins_offset 332
@ -1676,7 +1665,7 @@
#define ts_show_spi true
#define ts_show_trigger_comparator false
#define ts_show_tunerstudio_port true
#define TS_SIGNATURE "rusEFI 2021.10.14.all.2633279962"
#define TS_SIGNATURE "rusEFI 2021.10.15.all.1493747645"
#define TS_SINGLE_WRITE_COMMAND 'W'
#define TS_SINGLE_WRITE_COMMAND_char W
#define TS_TEST_COMMAND 't'

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD all
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 2633279962
#define TS_SIGNATURE "rusEFI 2021.10.14.all.2633279962"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 1493747645
#define TS_SIGNATURE "rusEFI 2021.10.15.all.1493747645"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD atlas
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 2633279962
#define TS_SIGNATURE "rusEFI 2021.10.14.atlas.2633279962"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 1493747645
#define TS_SIGNATURE "rusEFI 2021.10.15.atlas.1493747645"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD f429-discovery
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 2633279962
#define TS_SIGNATURE "rusEFI 2021.10.14.f429-discovery.2633279962"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 1493747645
#define TS_SIGNATURE "rusEFI 2021.10.15.f429-discovery.1493747645"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD frankenso_na6
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 3871800371
#define TS_SIGNATURE "rusEFI 2021.10.14.frankenso_na6.3871800371"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 591041108
#define TS_SIGNATURE "rusEFI 2021.10.15.frankenso_na6.591041108"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD hellen-nb1
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 254168507
#define TS_SIGNATURE "rusEFI 2021.10.14.hellen-nb1.254168507"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 3403293660
#define TS_SIGNATURE "rusEFI 2021.10.15.hellen-nb1.3403293660"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD hellen121nissan
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 386265496
#define TS_SIGNATURE "rusEFI 2021.10.14.hellen121nissan.386265496"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 3539574783
#define TS_SIGNATURE "rusEFI 2021.10.15.hellen121nissan.3539574783"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD hellen121vag
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 3474475420
#define TS_SIGNATURE "rusEFI 2021.10.14.hellen121vag.3474475420"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 182724603
#define TS_SIGNATURE "rusEFI 2021.10.15.hellen121vag.182724603"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD hellen128
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 1257550090
#define TS_SIGNATURE "rusEFI 2021.10.14.hellen128.1257550090"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 2399723373
#define TS_SIGNATURE "rusEFI 2021.10.15.hellen128.2399723373"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD hellen154hyundai
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 2629550267
#define TS_SIGNATURE "rusEFI 2021.10.14.hellen154hyundai.2629550267"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 1525846990
#define TS_SIGNATURE "rusEFI 2021.10.15.hellen154hyundai.1525846990"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD hellen72
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 4200712701
#define TS_SIGNATURE "rusEFI 2021.10.14.hellen72.4200712701"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 1067296666
#define TS_SIGNATURE "rusEFI 2021.10.15.hellen72.1067296666"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD hellen88bmw
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 1786008887
#define TS_SIGNATURE "rusEFI 2021.10.14.hellen88bmw.1786008887"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 2944940880
#define TS_SIGNATURE "rusEFI 2021.10.15.hellen88bmw.2944940880"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD hellenNA6
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 1782497334
#define TS_SIGNATURE "rusEFI 2021.10.14.hellenNA6.1782497334"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 2948771409
#define TS_SIGNATURE "rusEFI 2021.10.15.hellenNA6.2948771409"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD hellen_cypress
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 3733484042
#define TS_SIGNATURE "rusEFI 2021.10.14.hellen_cypress.3733484042"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 460594285
#define TS_SIGNATURE "rusEFI 2021.10.15.hellen_cypress.460594285"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD kin
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 556646134
#define TS_SIGNATURE "rusEFI 2021.10.14.kin.556646134"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 3838955665
#define TS_SIGNATURE "rusEFI 2021.10.15.kin.3838955665"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD mre_f4
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 342146638
#define TS_SIGNATURE "rusEFI 2021.10.14.mre_f4.342146638"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 3516452905
#define TS_SIGNATURE "rusEFI 2021.10.15.mre_f4.3516452905"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD mre_f7
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 342146638
#define TS_SIGNATURE "rusEFI 2021.10.14.mre_f7.342146638"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 3516452905
#define TS_SIGNATURE "rusEFI 2021.10.15.mre_f7.3516452905"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD prometheus_405
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 3424546876
#define TS_SIGNATURE "rusEFI 2021.10.14.prometheus_405.3424546876"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 165813851
#define TS_SIGNATURE "rusEFI 2021.10.15.prometheus_405.165813851"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD prometheus_469
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 3424546876
#define TS_SIGNATURE "rusEFI 2021.10.14.prometheus_469.3424546876"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 165813851
#define TS_SIGNATURE "rusEFI 2021.10.15.prometheus_469.165813851"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD proteus_f4
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 3031651869
#define TS_SIGNATURE "rusEFI 2021.10.14.proteus_f4.3031651869"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 1901017210
#define TS_SIGNATURE "rusEFI 2021.10.15.proteus_f4.1901017210"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD proteus_f7
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 3031651869
#define TS_SIGNATURE "rusEFI 2021.10.14.proteus_f7.3031651869"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 1901017210
#define TS_SIGNATURE "rusEFI 2021.10.15.proteus_f7.1901017210"

View File

@ -3,6 +3,6 @@
//
#define SIGNATURE_BOARD subaru_eg33_f7
#define SIGNATURE_DATE 2021.10.14
#define SIGNATURE_HASH 159269561
#define TS_SIGNATURE "rusEFI 2021.10.14.subaru_eg33_f7.159269561"
#define SIGNATURE_DATE 2021.10.15
#define SIGNATURE_HASH 3431083230
#define TS_SIGNATURE "rusEFI 2021.10.15.subaru_eg33_f7.3431083230"

View File

@ -4,6 +4,8 @@ echo "This batch files reads rusefi_enums.h and produces auto_generated_enums.*
rm gen_enum_to_string.log
java -DSystemOut.name=gen_java_enum -cp ../java_tools/enum2string.jar com.rusefi.ToJavaEnum -enumInputFile controllers/algo/live_data_ids.h -outputPath ../java_console/io/src/main/java/com/rusefi/enums
java -DSystemOut.name=gen_enum_to_string \
-jar ../java_tools/enum2string.jar \
-outputPath controllers/algo \

View File

@ -23,23 +23,25 @@ static CCM_OPTIONAL FunctionalSensor aux2(SensorType::AuxTemp2, MS2NT(10));
static FuncPair fclt, fiat, faux1, faux2;
void validateThermistorConfig(thermistor_conf_s& cfg) {
static void validateThermistorConfig(const char *msg, thermistor_conf_s& cfg) {
if (cfg.tempC_1 >= cfg.tempC_2 ||
cfg.tempC_2 >= cfg.tempC_3) {
firmwareError(OBD_Engine_Coolant_Temperature_Circuit_Malfunction, "Invalid thermistor configuration: please check that temperatures are in the ascending order %f %f %f",
firmwareError(OBD_Engine_Coolant_Temperature_Circuit_Malfunction, "Invalid thermistor %s configuration: please check that temperatures are in the ascending order %f %f %f",
msg,
cfg.tempC_1,
cfg.tempC_2,
cfg.tempC_3);
}
}
static SensorConverter& configureTempSensorFunction(thermistor_conf_s& cfg, FuncPair& p, bool isLinear) {
static SensorConverter& configureTempSensorFunction(const char *msg,
thermistor_conf_s& cfg, FuncPair& p, bool isLinear) {
if (isLinear) {
p.linear.configure(cfg.resistance_1, cfg.tempC_1, cfg.resistance_2, cfg.tempC_2, -50, 250);
return p.linear;
} else /* sensor is thermistor */ {
validateThermistorConfig(cfg);
validateThermistorConfig(msg, cfg);
p.thermistor.get<resist>().configure(5.0f, cfg.bias_resistor);
p.thermistor.get<therm>().configure(cfg);
@ -48,7 +50,8 @@ static SensorConverter& configureTempSensorFunction(thermistor_conf_s& cfg, Func
}
}
void configTherm(FunctionalSensor &sensor,
static void configTherm(const char *msg,
FunctionalSensor &sensor,
FuncPair &p,
ThermistorConf &config,
bool isLinear) {
@ -58,10 +61,11 @@ void configTherm(FunctionalSensor &sensor,
}
// Configure the conversion function for this sensor
sensor.setFunction(configureTempSensorFunction(config.config, p, isLinear));
sensor.setFunction(configureTempSensorFunction(msg, config.config, p, isLinear));
}
static void configureTempSensor(FunctionalSensor &sensor,
static void configureTempSensor(const char *msg,
FunctionalSensor &sensor,
FuncPair &p,
ThermistorConf &config,
bool isLinear) {
@ -72,7 +76,7 @@ static void configureTempSensor(FunctionalSensor &sensor,
return;
}
configTherm(sensor, p, config, isLinear);
configTherm(msg, sensor, p, config, isLinear);
// Register & subscribe
AdcSubscription::SubscribeSensor(sensor, channel, 2);
@ -81,23 +85,27 @@ static void configureTempSensor(FunctionalSensor &sensor,
void initThermistors(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
if (!CONFIG(consumeObdSensors)) {
configureTempSensor(clt,
configureTempSensor("clt",
clt,
fclt,
CONFIG(clt),
CONFIG(useLinearCltSensor));
configureTempSensor(iat,
configureTempSensor("iat",
iat,
fiat,
CONFIG(iat),
CONFIG(useLinearIatSensor));
}
configureTempSensor(aux1,
configureTempSensor("aux1",
aux1,
faux1,
CONFIG(auxTempSensor1),
false);
configureTempSensor(aux2,
configureTempSensor("aux2",
aux2,
faux2,
CONFIG(auxTempSensor2),
false);

View File

@ -1750,22 +1750,6 @@ end_struct
#define MOCK_PPS_POSITION_COMMAND "mock_pps_position"
#define MOCK_PPS_VOLTAGE_COMMAND "mock_pps_voltage"
! Live Documentation Structure
#define LDS_SPEED_DENSITY_STATE_INDEX 2
#define LDS_ENGINE_STATE_INDEX 3
#define LDS_FUEL_TRIM_STATE_INDEX 4
#define LDS_TPS_TPS_ENEICHMENT_STATE_INDEX 5
#define LDS_TRIGGER_CENTRAL_STATE_INDEX 6
#define LDS_ETB_PID_STATE_INDEX 7
#define LDS_IDLE_PID_STATE_INDEX 8
#define LDS_ALTERNATOR_PID_STATE_INDEX 9
#define LDS_CJ125_PID_STATE_INDEX 10
#define LDS_TRIGGER_STATE_STATE_INDEX 11
#define LDS_AC_STATE 12
#define GAUGE_NAME_VERSION "firmware"
#define GAUGE_NAME_UPTIME "Uptime"
#define GAUGE_NAME_TRG_ERR "trg err"

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.all.2633279962"
signature = "rusEFI 2021.10.15.all.1493747645"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.all.2633279962" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.all.1493747645" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:16 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:30 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.atlas.2633279962"
signature = "rusEFI 2021.10.15.atlas.1493747645"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.atlas.2633279962" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.atlas.1493747645" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:14 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:27 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.f429-discovery.2633279962"
signature = "rusEFI 2021.10.15.f429-discovery.1493747645"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.f429-discovery.2633279962" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.f429-discovery.1493747645" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:51:32 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:04:43 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.frankenso_na6.3871800371"
signature = "rusEFI 2021.10.15.frankenso_na6.591041108"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.frankenso_na6.3871800371" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.frankenso_na6.591041108" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:00 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:14 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.hellen-nb1.254168507"
signature = "rusEFI 2021.10.15.hellen-nb1.3403293660"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.hellen-nb1.254168507" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.hellen-nb1.3403293660" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:51:50 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:03 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.hellen121nissan.386265496"
signature = "rusEFI 2021.10.15.hellen121nissan.3539574783"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.hellen121nissan.386265496" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.hellen121nissan.3539574783" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:51:39 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:04:51 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.hellen121vag.3474475420"
signature = "rusEFI 2021.10.15.hellen121vag.182724603"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.hellen121vag.3474475420" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.hellen121vag.182724603" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:51:37 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:04:48 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.hellen128.1257550090"
signature = "rusEFI 2021.10.15.hellen128.2399723373"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.hellen128.1257550090" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.hellen128.2399723373" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:51:34 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:04:45 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.hellen154hyundai.2629550267"
signature = "rusEFI 2021.10.15.hellen154hyundai.1525846990"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.hellen154hyundai.2629550267" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.hellen154hyundai.1525846990" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:51:42 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:04:54 UTC 2021
pageSize = 20000
page = 1
@ -5121,7 +5121,7 @@ cmd_set_engine_type_default = "Z\x00\x31\x00\x00"
panel = allTriggerDebug
help = helpGeneral, "rusEFI General Help"
webHelp = "https://rusefi.com/s/hellen121nissan"
webHelp = "https://rusefi.com/s/hellen154hyuindai"
text = "<img src='https://rusefi.com/style/logo_100.gif'>"
dialog = vrThreshold1, "VR 1 Threshold"

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.hellen72.4200712701"
signature = "rusEFI 2021.10.15.hellen72.1067296666"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.hellen72.4200712701" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.hellen72.1067296666" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:51:47 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:00 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.hellen88bmw.1786008887"
signature = "rusEFI 2021.10.15.hellen88bmw.2944940880"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.hellen88bmw.1786008887" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.hellen88bmw.2944940880" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:51:44 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:04:57 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.hellenNA6.1782497334"
signature = "rusEFI 2021.10.15.hellenNA6.2948771409"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.hellenNA6.1782497334" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.hellenNA6.2948771409" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:51:52 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:05 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.hellen_cypress.3733484042"
signature = "rusEFI 2021.10.15.hellen_cypress.460594285"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.hellen_cypress.3733484042" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.hellen_cypress.460594285" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on hellen_cypress_gen_config.bat integration/rusefi_config.txt Thu Oct 14 04:52:21 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on hellen_cypress_gen_config.bat integration/rusefi_config.txt Thu Oct 14 23:05:35 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.kin.556646134"
signature = "rusEFI 2021.10.15.kin.3838955665"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.kin.556646134" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.kin.3838955665" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on kinetis_gen_config.bat integration/rusefi_config.txt Thu Oct 14 04:52:19 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on kinetis_gen_config.bat integration/rusefi_config.txt Thu Oct 14 23:05:32 UTC 2021
pageSize = 19972
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.mre_f4.342146638"
signature = "rusEFI 2021.10.15.mre_f4.3516452905"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.mre_f4.342146638" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.mre_f4.3516452905" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:51:57 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:11 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.mre_f7.342146638"
signature = "rusEFI 2021.10.15.mre_f7.3516452905"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.mre_f7.342146638" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.mre_f7.3516452905" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:51:55 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:08 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.prometheus_405.3424546876"
signature = "rusEFI 2021.10.15.prometheus_405.165813851"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.prometheus_405.3424546876" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.prometheus_405.165813851" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:05 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:19 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.prometheus_469.3424546876"
signature = "rusEFI 2021.10.15.prometheus_469.165813851"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.prometheus_469.3424546876" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.prometheus_469.165813851" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:03 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:16 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.proteus_f4.3031651869"
signature = "rusEFI 2021.10.15.proteus_f4.1901017210"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.proteus_f4.3031651869" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.proteus_f4.1901017210" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:11 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:24 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.proteus_f7.3031651869"
signature = "rusEFI 2021.10.15.proteus_f7.1901017210"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.proteus_f7.3031651869" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.proteus_f7.1901017210" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:08 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:22 UTC 2021
pageSize = 20000
page = 1

View File

@ -33,12 +33,12 @@ enable2ndByteCanID = false
[MegaTune]
; https://rusefi.com/forum/viewtopic.php?p=36201#p36201
signature = "rusEFI 2021.10.14.subaru_eg33_f7.159269561"
signature = "rusEFI 2021.10.15.subaru_eg33_f7.3431083230"
[TunerStudio]
queryCommand = "S"
versionInfo = "V" ; firmwave version for title bar.
signature = "rusEFI 2021.10.14.subaru_eg33_f7.159269561" ; signature is expected to be 7 or more characters.
signature = "rusEFI 2021.10.15.subaru_eg33_f7.3431083230" ; signature is expected to be 7 or more characters.
[Constants]
; new packet serial format with CRC
@ -77,7 +77,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on config/boards/subaru_eg33/config/gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:24 UTC 2021
; this section was generated automatically by rusEFI tool ConfigDefinition.jar based on config/boards/subaru_eg33/config/gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:37 UTC 2021
pageSize = 20000
page = 1

View File

@ -0,0 +1,18 @@
package com.rusefi.enums;
//auto-generated by ToJavaEnum.java
public enum live_data_e {
LDS_SPEED_DENSITY,
LDS_ENGINE,
LDS_FUEL_TRIM,
LDS_TPS_TPS_ENRICHMENT,
LDS_TRIGGER_CENTRAL,
LDS_ETB_PID,
LDS_IDLE_PID,
LDS_ALTERNATOR_PID,
LDS_CJ125_PID,
LDS_TRIGGER_STATE,
LDS_AC_CONTROL,
}

View File

@ -1,73 +1,46 @@
package com.rusefi.ldmp;
import com.rusefi.config.Field;
import com.rusefi.config.generated.*;
import com.rusefi.ui.livedocs.LiveDataContext;
import com.rusefi.config.generated.EngineState;
import com.rusefi.config.generated.PidState;
import com.rusefi.config.generated.TriggerCentral;
import com.rusefi.config.generated.TriggerState;
import com.rusefi.enums.live_data_e;
import org.jetbrains.annotations.NotNull;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
public enum StateDictionary {
INSTANCE;
public static final int NONE = -1;
private final Map<Integer, Field[]> map = new HashMap<>();
private Map<live_data_e, Field[]> map = new HashMap<>();
StateDictionary() {
register(Fields.LDS_SPEED_DENSITY_STATE_INDEX, EngineState.VALUES); // 2
register(Fields.LDS_ENGINE_STATE_INDEX, EngineState.VALUES); // 3
register(Fields.LDS_FUEL_TRIM_STATE_INDEX, EngineState.VALUES);
register(Fields.LDS_TPS_TPS_ENEICHMENT_STATE_INDEX, EngineState.VALUES); // 5
register(Fields.LDS_TRIGGER_CENTRAL_STATE_INDEX, TriggerCentral.VALUES);
register(Fields.LDS_ETB_PID_STATE_INDEX, PidState.VALUES); // 7
register(Fields.LDS_IDLE_PID_STATE_INDEX, PidState.VALUES);
// LDS_ALTERNATOR_PID_STATE_INDEX
// LDS_CJ125_PID_STATE_INDEX
register(Fields.LDS_TRIGGER_STATE_STATE_INDEX, TriggerState.VALUES); // 11
register(Fields.LDS_AC_STATE, AcControl.VALUES); // 12
register(live_data_e.LDS_SPEED_DENSITY, EngineState.VALUES); // 2
register(live_data_e.LDS_ENGINE, EngineState.VALUES); // 3
register(live_data_e.LDS_FUEL_TRIM, EngineState.VALUES);
register(live_data_e.LDS_TPS_TPS_ENRICHMENT, EngineState.VALUES); // 5
register(live_data_e.LDS_TRIGGER_CENTRAL, TriggerCentral.VALUES);
register(live_data_e.LDS_ETB_PID, PidState.VALUES); // 7
register(live_data_e.LDS_IDLE_PID, PidState.VALUES);
// LDS_ALTERNATOR_PID
// LDS_CJ125_PID
register(live_data_e.LDS_TRIGGER_STATE, TriggerState.VALUES); // 11
register(live_data_e.LDS_AC_STATE, AcControl.VALUES); // 12
}
private void register(int ldsIndex, Field[] values) {
private void register(live_data_e ldsIndex, Field[] values) {
map.put(ldsIndex, values);
}
public Field[] getValue(String state) {
String indexFieldName = getContextIndexFieldName(state);
LiveDataContext indexValue = getStateContext(indexFieldName);
return getFields(indexFieldName, indexValue);
}
@NotNull
public Field[] getFields(String indexFieldName, LiveDataContext indexValue) {
Field[] result = map.get(indexValue.getId());
public Field[] getFields(live_data_e indexFieldName) {
Field[] result = map.get(indexFieldName);
if (result == null) {
throw new IllegalStateException("Nothing for " + indexFieldName + "/" + indexValue);
throw new IllegalStateException("Nothing for " + indexFieldName);
}
return result;
}
@NotNull
public static String getContextIndexFieldName(String state) {
return "LDS_" + state.toUpperCase() + "_STATE_INDEX";
}
public static LiveDataContext getStateContext(String contextIndexFieldName) {
java.lang.reflect.Field field;
try {
field = Fields.class.getField(contextIndexFieldName);
} catch (NoSuchFieldException e) {
throw new IllegalStateException(e);
}
Objects.requireNonNull(field, "Field " + contextIndexFieldName);
int indexValue;
try {
indexValue = (int) field.get(null);
} catch (IllegalAccessException e) {
throw new IllegalStateException(e);
}
return new LiveDataContext(indexValue);
}
}

View File

@ -1,40 +0,0 @@
package com.rusefi.ui.livedocs;
import java.util.Objects;
/**
* Type-safe unique structure identifier
* <p>
* Andrey Belomutskiy, (c) 2013-2020
*/
public class LiveDataContext {
private final int id;
public LiveDataContext(int id) {
this.id = id;
}
public int getId() {
return id;
}
@Override
public String toString() {
return "LiveDataContext{" +
"id=" + id +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
LiveDataContext stateId = (LiveDataContext) o;
return id == stateId.id;
}
@Override
public int hashCode() {
return Objects.hash(id);
}
}

View File

@ -1,15 +1,16 @@
package com.rusefi.ui.livedocs;
import com.rusefi.binaryprotocol.BinaryProtocol;
import com.rusefi.enums.live_data_e;
/**
* Andrey Belomutskiy, (c) 2013-2020
*/
public abstract class LiveDocHolder {
private final LiveDataContext id;
private final live_data_e id;
private final RefreshActionsMap actions;
public LiveDocHolder(LiveDataContext id, RefreshActionsMap actions) {
public LiveDocHolder(live_data_e id, RefreshActionsMap actions) {
this.id = id;
this.actions = actions;
}
@ -18,14 +19,14 @@ public abstract class LiveDocHolder {
return actions;
}
public void update(BinaryProtocol binaryProtocol, LiveDataContext context, byte[] response) {
public void update(BinaryProtocol binaryProtocol, live_data_e context, byte[] response) {
for (RefreshActions action : actions.getActions().get(context))
action.refresh(binaryProtocol, response);
}
public abstract boolean isVisible();
public LiveDataContext getId() {
public live_data_e getId() {
return id;
}

View File

@ -3,6 +3,7 @@ package com.rusefi.ui.livedocs;
import com.rusefi.binaryprotocol.BinaryProtocol;
import com.rusefi.config.Field;
import com.rusefi.config.generated.Fields;
import com.rusefi.enums.live_data_e;
import com.rusefi.ldmp.StateDictionary;
import java.util.ArrayList;
@ -28,21 +29,20 @@ public enum LiveDocsRegistry {
for (LiveDocHolder holder : liveDocs) {
boolean visible = holder.isVisible();
if (visible) {
for (LiveDataContext context : holder.getActions().getActions().keySet()) {
for (live_data_e context : holder.getActions().getActions().keySet()) {
refresh(binaryProtocol, holder, context);
}
}
}
}
private void refresh(BinaryProtocol binaryProtocol, LiveDocHolder holder, LiveDataContext context) {
int liveDocRequestId = context.getId();
Field[] values = StateDictionary.INSTANCE.getFields("refresh", context);
private void refresh(BinaryProtocol binaryProtocol, LiveDocHolder holder, live_data_e context) {
Field[] values = StateDictionary.INSTANCE.getFields(context);
int size = Field.getStructureSize(values);
byte[] packet = new byte[5];
packet[0] = Fields.TS_GET_STRUCT;
putShort(packet, 1, swap16(liveDocRequestId)); // offset
putShort(packet, 1, swap16(context.ordinal())); // offset
putShort(packet, 3, swap16(size));
byte[] responseWithCode = binaryProtocol.executeCommand(packet, "get LiveDoc");

View File

@ -1,26 +1,28 @@
package com.rusefi.ui.livedocs;
import com.rusefi.enums.live_data_e;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class RefreshActionsMap {
private final Map<LiveDataContext, List<RefreshActions>> actions = new HashMap<>();
private final Map<live_data_e, List<RefreshActions>> actions = new HashMap<>();
public void put(LiveDataContext context, RefreshActions refreshAction) {
public void put(live_data_e context, RefreshActions refreshAction) {
actions.putIfAbsent(context, new ArrayList<>());
actions.get(context).add(refreshAction);
}
public void addAll(RefreshActionsMap actions) {
for (Map.Entry<LiveDataContext, List<RefreshActions>> e : actions.actions.entrySet()) {
for (Map.Entry<live_data_e, List<RefreshActions>> e : actions.actions.entrySet()) {
for (RefreshActions action : e.getValue())
put(e.getKey(), action);
}
}
public Map<LiveDataContext, List<RefreshActions>> getActions() {
public Map<live_data_e, List<RefreshActions>> getActions() {
return actions;
}
}

View File

@ -1,6 +1,6 @@
package com.rusefi.config.generated;
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 04:52:16 UTC 2021
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh integration/rusefi_config.txt Thu Oct 14 23:05:30 UTC 2021
// by class com.rusefi.output.FileJavaFieldsConsumer
import com.rusefi.config.*;
@ -1042,17 +1042,6 @@ public class Fields {
public static final int launchTimingRetard_offset = 320;
public static final int launchTimingRpmRange_offset = 1036;
public static final int launchTpsTreshold_offset = 1056;
public static final int LDS_AC_STATE = 12;
public static final int LDS_ALTERNATOR_PID_STATE_INDEX = 9;
public static final int LDS_CJ125_PID_STATE_INDEX = 10;
public static final int LDS_ENGINE_STATE_INDEX = 3;
public static final int LDS_ETB_PID_STATE_INDEX = 7;
public static final int LDS_FUEL_TRIM_STATE_INDEX = 4;
public static final int LDS_IDLE_PID_STATE_INDEX = 8;
public static final int LDS_SPEED_DENSITY_STATE_INDEX = 2;
public static final int LDS_TPS_TPS_ENEICHMENT_STATE_INDEX = 5;
public static final int LDS_TRIGGER_CENTRAL_STATE_INDEX = 6;
public static final int LDS_TRIGGER_STATE_STATE_INDEX = 11;
public static final int LE_COMMAND_LENGTH = 200;
public static final int linear_sensor_s_size = 20;
public static final int LIS302DLCsPin_offset = 2043;
@ -1263,6 +1252,7 @@ public class Fields {
public static final int servoOutputPins8_offset = 3147;
public static final int showHumanReadableWarning_offset = 976;
public static final int showSdCardWarning_offset = 76;
public static final int SIGNATURE_HASH = 1493747645;
public static final int silentTriggerError_offset = 1464;
public static final int slowAdcAlpha_offset = 2088;
public static final int sparkDwellRpmBins_offset = 332;
@ -1573,7 +1563,7 @@ public class Fields {
public static final int TS_RESPONSE_UNDERRUN = 0x80;
public static final int TS_RESPONSE_UNRECOGNIZED_COMMAND = 0x83;
public static final char TS_SET_LOGGER_SWITCH = 'l';
public static final String TS_SIGNATURE = "rusEFI 2021.10.14.all.2633279962";
public static final String TS_SIGNATURE = "rusEFI 2021.10.15.all.1493747645";
public static final char TS_SINGLE_WRITE_COMMAND = 'W';
public static final char TS_TEST_COMMAND = 't';
public static final int TT_TT_1_16 = 50;

View File

@ -1,6 +1,6 @@
<roms>
<!-- was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh Thu Oct 14 04:52:18 UTC 2021 -->
<!-- was generated automatically by rusEFI tool ConfigDefinition.jar based on gen_config.sh Thu Oct 14 23:05:32 UTC 2021 -->
<rom>
<romid>

View File

@ -229,7 +229,7 @@ public class ConfigDefinition {
if (!enumInputFiles.isEmpty()) {
for (String ef : enumInputFiles) {
state.enumsReader.process(".", ef);
state.enumsReader.read(".", ef);
}
SystemOut.println(state.enumsReader.getEnums() + " total enumsReader");

View File

@ -16,7 +16,7 @@ public class ConfigDefinitionTest {
@Test
public void testEnumIntoType() throws IOException {
EnumsReader enumsReader = new EnumsReader();
enumsReader.process(FIRMWARE, "controllers/algo/rusefi_enums.h");
enumsReader.read(FIRMWARE, "controllers/algo/rusefi_enums.h");
VariableRegistry variableRegistry = new VariableRegistry();

Binary file not shown.

View File

@ -14,8 +14,8 @@ import java.util.*;
*/
@SuppressWarnings("StringConcatenationInsideStringBufferAppend")
public class EnumToString {
private final static StringBuilder cppFileContent = new StringBuilder();
private final static StringBuilder includesSection = new StringBuilder();
private final StringBuilder cppFileContent = new StringBuilder();
private final StringBuilder includesSection = new StringBuilder();
private final static StringBuilder bothFilesHeader = new StringBuilder("// by enum2string.jar tool " +
"on " + new Date() + "\n" +
@ -26,59 +26,40 @@ public class EnumToString {
private final static StringBuilder headerFileContent = new StringBuilder();
private final static String KEY_INPUT_PATH = "-enumInputPath";
public final static String KEY_ENUM_INPUT_FILE = "-enumInputFile";
private final static String KEY_OUTPUT = "-outputPath";
private final static String KEY_OUTPUT_FILE = "-generatedFile";
private static String fileSuffix = "enums";
public static void main(String[] args) throws IOException {
if (args.length < 4) {
SystemOut.println("Please specify at least\n\n" +
KEY_ENUM_INPUT_FILE + "XXX\n" +
KEY_OUTPUT + "XXX\n"
);
return;
}
InvokeReader invokeReader = new InvokeReader(args).invoke();
String outputPath = invokeReader.getOutputPath();
String inputPath = ".";
String outputPath = null;
EnumsReader enumsReader = new EnumsReader();
for (int i = 0; i < args.length - 1; i += 2) {
String key = args[i];
if (key.equals(KEY_INPUT_PATH)) {
inputPath = Objects.requireNonNull(args[i + 1], KEY_INPUT_PATH);
} else if (key.equals(KEY_ENUM_INPUT_FILE)) {
String headerInputFile = args[i + 1];
consumeFile(enumsReader, inputPath, headerInputFile);
} else if (key.equals(KEY_OUTPUT_FILE)) {
fileSuffix = args[i + 1];
} else if (key.equals(KEY_OUTPUT)) {
outputPath = args[i + 1];
}
EnumToString state = new EnumToString();
for (String inputFile : invokeReader.getInputFiles()) {
state.consumeFile(enumsReader, invokeReader.getInputPath(), inputFile);
}
headerFileContent.append("#pragma once\n");
outputData(enumsReader);
state.outputData(enumsReader);
cppFileContent.insert(0, bothFilesHeader.toString());
state.cppFileContent.insert(0, bothFilesHeader.toString());
cppFileContent.insert(0, includesSection);
headerFileContent.insert(0, includesSection);
state.cppFileContent.insert(0, state.includesSection);
headerFileContent.insert(0, state.includesSection);
SystemOut.println("includesSection:\n" + includesSection + "end of includesSection\n");
SystemOut.println("includesSection:\n" + state.includesSection + "end of includesSection\n");
cppFileContent.insert(0, "#include \"global.h\"\n");
state.cppFileContent.insert(0, "#include \"global.h\"\n");
headerFileContent.insert(0, bothFilesHeader.toString());
new File(outputPath).mkdirs();
writeCppAndHeaderFiles(outputPath + File.separator + "auto_generated_" +
fileSuffix);
state.writeCppAndHeaderFiles(outputPath + File.separator + "auto_generated_" +
InvokeReader.fileSuffix);
SystemOut.close();
}
private static void writeCppAndHeaderFiles(String outFileName) throws IOException {
private void writeCppAndHeaderFiles(String outFileName) throws IOException {
LazyFile bw = new LazyFile(outFileName + ".cpp");
bw.write(cppFileContent.toString());
bw.close();
@ -88,19 +69,18 @@ public class EnumToString {
bw.close();
}
private static void consumeFile(EnumsReader enumsReader, String inputPath, String headerInputFileName) throws IOException {
public void consumeFile(EnumsReader enumsReader, String inputPath, String headerInputFileName) throws IOException {
Objects.requireNonNull(inputPath, "inputPath");
File f = new File(inputPath + File.separator + headerInputFileName);
SystemOut.println("Reading enums from " + headerInputFileName);
String simpleFileName = f.getName();
bothFilesHeader.insert(0, "// " + LazyFile.LAZY_FILE_TAG + " from " + simpleFileName + " ");
bothFilesHeader.insert(0, "// " + LazyFile.LAZY_FILE_TAG + " from " + f.getName() + " ");
includesSection.append("#include \"" + simpleFileName + "\"\n");
enumsReader.process(new FileReader(f));
includesSection.append("#include \"" + f.getName() + "\"\n");
enumsReader.read(new FileReader(f));
}
public static void outputData(EnumsReader enumsReader) {
public EnumToString outputData(EnumsReader enumsReader) {
SystemOut.println("Preparing output for " + enumsReader.getEnums().size() + " enums\n");
for (Map.Entry<String, Map<String, Value>> e : enumsReader.getEnums().entrySet()) {
@ -109,10 +89,7 @@ public class EnumToString {
headerFileContent.append(getMethodSignature(enumName) + ";\n");
}
SystemOut.println("EnumToString: " + headerFileContent.length() + " bytes of content\n");
}
public static void clear() {
cppFileContent.setLength(0);
return this;
}
private static String makeCode(String enumName, Collection<Value> values) {
@ -141,7 +118,8 @@ public class EnumToString {
return Character.toUpperCase(enumName.charAt(0)) + enumName.substring(1);
}
public static String getCppFileContent() {
public String getCppFileContent() {
return cppFileContent.toString();
}
}

View File

@ -3,27 +3,38 @@ package com.rusefi;
import com.rusefi.enum_reader.Value;
import com.rusefi.util.SystemOut;
import org.jetbrains.annotations.NotNull;
import java.io.*;
import java.util.Map;
import java.util.TreeMap;
import java.util.*;
public class EnumsReader {
private final Map<String, Value> currentValues = new TreeMap<>();
private final Map<String, Map<String, Value>> enums = new TreeMap<>();
@NotNull
static List<Value> getSortedByOrder(Map<String, Value> brain_pin_e) {
Set<Value> byOrdinal = new TreeSet<>(Comparator.comparingInt(Value::getIntValue));
byOrdinal.addAll(brain_pin_e.values());
return new ArrayList<>(byOrdinal);
}
public Map<String /*enum name*/, Map<String/*enum member*/, Value>> getEnums() {
return enums;
}
public void process(String path, String fileName) throws IOException {
process(new FileReader(path + File.separator + fileName));
public EnumsReader read(String path, String fileName) throws IOException {
return read(new FileReader(path + File.separator + fileName));
}
public void process(Reader in) throws IOException {
public EnumsReader read(Reader in) throws IOException {
boolean isInsideEnum = false;
BufferedReader reader = new BufferedReader(in);
String line;
boolean withAutoValue = false;
while ((line = reader.readLine()) != null) {
line = removeSpaces(line);
@ -31,11 +42,15 @@ public class EnumsReader {
if (line.startsWith("typedefenum{") || line.startsWith("typedefenum__attribute__")) {
SystemOut.println(" EnumsReader: Entering enum");
currentValues.clear();
withAutoValue = false;
isInsideEnum = true;
} else if (line.startsWith("}") && line.endsWith(";")) {
isInsideEnum = false;
line = line.substring(1, line.length() - 1);
SystemOut.println(" EnumsReader: Ending enum " + line + " found " + currentValues.size() + " values");
SystemOut.println(" EnumsReader: Ending enum " + line + " found " + currentValues.size() + " values");
if (withAutoValue)
validateValues(currentValues);
enums.put(line, new TreeMap<>(currentValues));
} else {
if (isInsideEnum) {
@ -46,6 +61,9 @@ public class EnumsReader {
if (index != -1) {
value = line.substring(index + 1);
line = line.substring(0, index);
} else {
value = Integer.toString(currentValues.size());
withAutoValue = true;
}
SystemOut.println(" EnumsReader: Line " + line);
currentValues.put(line, new Value(line, value));
@ -55,6 +73,15 @@ public class EnumsReader {
}
}
}
return this;
}
private void validateValues(Map<String, Value> currentValues) {
for (Map.Entry<String, Value> entry : currentValues.entrySet()) {
int v = entry.getValue().getIntValue();
if (v < 0 || v >= currentValues.size())
throw new IllegalStateException("Unexpected " + entry);
}
}
private static String removeSpaces(String line) {

View File

@ -0,0 +1,62 @@
package com.rusefi;
import com.rusefi.util.SystemOut;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
class InvokeReader {
private final static String KEY_INPUT_PATH = "-enumInputPath";
private final static String KEY_OUTPUT = "-outputPath";
private final static String KEY_OUTPUT_FILE = "-generatedFile";
public static String fileSuffix = "enums";
private String[] args;
private String outputPath;
private List<String> inputFiles = new ArrayList<>();
private String inputPath = ".";
public InvokeReader(String... args) {
if (args.length < 4) {
SystemOut.println("Please specify at least\n\n" +
EnumToString.KEY_ENUM_INPUT_FILE + "XXX\n" +
KEY_OUTPUT + "XXX\n"
);
System.exit(-1);
}
this.args = args;
}
public String getInputPath() {
return inputPath;
}
public String getOutputPath() {
return outputPath;
}
public List<String> getInputFiles() {
return inputFiles;
}
public InvokeReader invoke() throws IOException {
outputPath = null;
for (int i = 0; i < args.length - 1; i += 2) {
String key = args[i];
if (key.equals(KEY_INPUT_PATH)) {
inputPath = Objects.requireNonNull(args[i + 1], KEY_INPUT_PATH);
} else if (key.equals(EnumToString.KEY_ENUM_INPUT_FILE)) {
String headerInputFile = args[i + 1];
inputFiles.add(headerInputFile);
} else if (key.equals(KEY_OUTPUT_FILE)) {
fileSuffix = args[i + 1];
} else if (key.equals(KEY_OUTPUT)) {
outputPath = args[i + 1];
}
}
return this;
}
}

View File

@ -0,0 +1,52 @@
package com.rusefi;
import com.rusefi.enum_reader.Value;
import com.rusefi.util.SystemOut;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;
import java.util.Map;
public class ToJavaEnum {
public static void main(String[] args) throws IOException {
InvokeReader invokeReader = new InvokeReader(args).invoke();
String outputPath = invokeReader.getOutputPath();
EnumsReader enumsReader = new EnumsReader();
for (String inputFile : invokeReader.getInputFiles()) {
File f = new File(invokeReader.getInputPath() + File.separator + inputFile);
SystemOut.println("Reading enums from " + f);
enumsReader.read(new FileReader(f));
}
for (Map.Entry<String /*enum name*/, Map<String/*enum member*/, Value>> e : enumsReader.getEnums().entrySet()) {
String java = generate(e.getKey(), e.getValue());
String fullFileName = outputPath + File.separator + e.getKey() + ".java";
BufferedWriter br = new BufferedWriter(new FileWriter(fullFileName));
br.write(java);
br.close();
}
}
public static String generate(String key, Map<String, Value> values) {
StringBuilder sb = new StringBuilder("package com.rusefi.enums;\n");
sb.append("//auto-generated by ToJavaEnum.java\n\n\n\n");
sb.append("public enum " + key + " {\n");
List<Value> sorted = EnumsReader.getSortedByOrder(values);
for (Value value : sorted) {
sb.append("\t" + value.getName() + ",\n");
}
sb.append("}\n");
return sb.toString();
}
}

View File

@ -1,24 +1,24 @@
package com.rusefi;
import com.rusefi.enum_reader.Value;
import org.junit.Test;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static com.rusefi.EnumsReader.isKeyValueLine;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class EnumToStringTest {
public static EnumsReader process(Reader reader) throws IOException {
EnumsReader enumsReader = new EnumsReader();
enumsReader.process(reader);
EnumToString.outputData(enumsReader);
return enumsReader;
public static EnumToString process(EnumsReader enumsReader) {
EnumToString enumToString = new EnumToString();
enumToString.outputData(enumsReader);
return enumToString;
}
@Test
@ -34,13 +34,14 @@ public class EnumToStringTest {
@Test
public void parseEnum() throws IOException {
EnumToString.clear();
EnumsReader enumsReader = process(new StringReader(
final StringReader reader = new StringReader(
"typedef enum {\n" +
"\tGPIO_UNASSIGNED = 0,\n" +
"\tGPIO_INVALID = 1,\n" +
"\tGPIO_HEX = 0xA1,\n" +
"}brain_pin_e; // hello"));
"}brain_pin_e; // hello");
EnumsReader enumsReader = new EnumsReader().read(reader);
EnumToString enumToString = process(enumsReader);
List<Value> values = new ArrayList<>(enumsReader.getEnums().get("brain_pin_e").values());
assertEquals(3, values.size());
@ -62,17 +63,18 @@ public class EnumToStringTest {
" return \"GPIO_UNASSIGNED\";\n" +
" }\n" +
" return NULL;\n" +
"}\n", EnumToString.getCppFileContent());
"}\n", enumToString.getCppFileContent());
}
@Test
public void parsePackedEnum() throws IOException {
EnumToString.clear();
process(new StringReader(
final StringReader reader = new StringReader(
"typedef enum __attribute__ ((__packed__)) {\n" +
"\tGPIO_UNASSIGNED = 0,\n" +
"\tGPIO_INVALID = 1,\n" +
"} brain_pin_e ;"));
"} brain_pin_e ;");
EnumsReader enumsReader = new EnumsReader().read(reader);
EnumToString enumToString = process(enumsReader);
assertEquals("const char *getBrain_pin_e(brain_pin_e value){\n" +
"switch(value) {\n" +
"case GPIO_INVALID:\n" +
@ -81,6 +83,38 @@ public class EnumToStringTest {
" return \"GPIO_UNASSIGNED\";\n" +
" }\n" +
" return NULL;\n" +
"}\n", EnumToString.getCppFileContent());
"}\n", enumToString.getCppFileContent());
}
@Test
public void parseEnumWithoutExplicitValues() throws IOException {
final StringReader reader = new StringReader(
"typedef enum {\n" +
"\tGPIO_UNASSIGNED,\n" +
"\tGPIO_INVALID,\n" +
"\tGPIO_HEX,\n" +
"}brain_pin_e; // hello");
EnumsReader enumsReader = new EnumsReader().read(reader);
Map<String, Value> brain_pin_e = enumsReader.getEnums().get("brain_pin_e");
assertEquals(2, brain_pin_e.get("GPIO_HEX").getIntValue());
List<Value> listByOrdinal = EnumsReader.getSortedByOrder(brain_pin_e);
assertEquals(0, listByOrdinal.get(0).getIntValue());
for (Map.Entry<String /*enum name*/, Map<String/*enum member*/, Value>> e : enumsReader.getEnums().entrySet()) {
String a = new ToJavaEnum().generate(e.getKey(), e.getValue());
assertEquals("package com.rusefi.enums;\n" +
"//auto-generated by ToJavaEnum.java\n" +
"\n" +
"\n" +
"\n" +
"public enum brain_pin_e {\n" +
"\tGPIO_UNASSIGNED,\n" +
"\tGPIO_INVALID,\n" +
"\tGPIO_HEX,\n" +
"}\n", a);
}
}
}