mirror of https://github.com/rusefi/rusefi.git
Add custom board config, menu, tables https://github.com/rusefi/rusefi/issues/6352
This commit is contained in:
parent
6792783237
commit
8a6bc372a9
|
@ -2,10 +2,22 @@
|
||||||
COMMON_GEN_CONFIG_PREFIX=" -DSystemOut.name=logs/gen_config_${SHORT_BOARD_NAME} \
|
COMMON_GEN_CONFIG_PREFIX=" -DSystemOut.name=logs/gen_config_${SHORT_BOARD_NAME} \
|
||||||
-jar ../java_tools/configuration_definition/build/libs/config_definition-all.jar"
|
-jar ../java_tools/configuration_definition/build/libs/config_definition-all.jar"
|
||||||
|
|
||||||
BOARD_OPTIONS_FILE="${BOARD_DIR}/board_options.ini"
|
set_board_file() {
|
||||||
if [ ! -f $BOARD_OPTIONS_FILE ]; then
|
local var=$1
|
||||||
BOARD_OPTIONS_FILE="tunerstudio/empty_board_options.ini"
|
local file_path=$2
|
||||||
fi
|
local default_file="tunerstudio/empty_board_options.ini"
|
||||||
|
|
||||||
|
if [ ! -f "$file_path" ]; then
|
||||||
|
eval "$var=\"$default_file\""
|
||||||
|
else
|
||||||
|
eval "$var=\"$file_path\""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
set_board_file BOARD_CONFIG_FILE "${BOARD_DIR}/board_config.txt"
|
||||||
|
set_board_file BOARD_OPTIONS_FILE "${BOARD_DIR}/board_options.ini"
|
||||||
|
set_board_file BOARD_MENU_FILE "${BOARD_DIR}/board_menu.ini"
|
||||||
|
set_board_file BOARD_TABLES_FILE "${BOARD_DIR}/board_tables.ini"
|
||||||
|
|
||||||
COMMON_GEN_CONFIG="
|
COMMON_GEN_CONFIG="
|
||||||
-readfile OUTPUTS_SECTION_FROM_FILE console/binary/generated/output_channels.ini \
|
-readfile OUTPUTS_SECTION_FROM_FILE console/binary/generated/output_channels.ini \
|
||||||
|
@ -13,7 +25,10 @@ COMMON_GEN_CONFIG="
|
||||||
-readfile LIVE_DATA_MENU_FROM_FILE console/binary/generated/fancy_menu.ini \
|
-readfile LIVE_DATA_MENU_FROM_FILE console/binary/generated/fancy_menu.ini \
|
||||||
-readfile LIVE_DATA_PANELS_FROM_FILE console/binary/generated/fancy_content.ini \
|
-readfile LIVE_DATA_PANELS_FROM_FILE console/binary/generated/fancy_content.ini \
|
||||||
-readfile LIVE_DATA_GAUGES_FROM_FILE console/binary/generated/gauges.ini \
|
-readfile LIVE_DATA_GAUGES_FROM_FILE console/binary/generated/gauges.ini \
|
||||||
|
-readfile BOARD_CONFIG_FROM_FILE ${BOARD_CONFIG_FILE} \
|
||||||
-readfile BOARD_OPTIONS_FROM_FILE ${BOARD_OPTIONS_FILE} \
|
-readfile BOARD_OPTIONS_FROM_FILE ${BOARD_OPTIONS_FILE} \
|
||||||
|
-readfile BOARD_MENU_FROM_FILE ${BOARD_MENU_FILE} \
|
||||||
|
-readfile BOARD_TABLES_FROM_FILE ${BOARD_TABLES_FILE} \
|
||||||
-ts_destination tunerstudio \
|
-ts_destination tunerstudio \
|
||||||
-triggerInputFolder ../unit_tests \
|
-triggerInputFolder ../unit_tests \
|
||||||
-with_c_defines false \
|
-with_c_defines false \
|
||||||
|
|
|
@ -1988,6 +1988,8 @@ uint8_t[TCU_TABLE_WIDTH] tcu_shiftSpeed43;;"MPH", 1, 0, 0, 255, 0
|
||||||
|
|
||||||
float tcu_shiftTime;;"ms", 1, 0, 0, 3000, 0
|
float tcu_shiftTime;;"ms", 1, 0, 0, 3000, 0
|
||||||
|
|
||||||
|
@@BOARD_CONFIG_FROM_FILE@@
|
||||||
|
|
||||||
end_struct
|
end_struct
|
||||||
|
|
||||||
#define CMD_SET_SENSOR_MOCK "set_sensor_mock"
|
#define CMD_SET_SENSOR_MOCK "set_sensor_mock"
|
||||||
|
|
|
@ -900,6 +900,7 @@ curve = rangeMatrix, "Range Switch Input Matrix"
|
||||||
|
|
||||||
[TableEditor]
|
[TableEditor]
|
||||||
; table_id, map3d_id, "title", page
|
; table_id, map3d_id, "title", page
|
||||||
|
@@BOARD_TABLES_FROM_FILE@@
|
||||||
|
|
||||||
; move table into a panel? or find a way to add a link to https://rusefi.com/s/tpstps https://github.com/rusefi/rusefi/issues/5130
|
; move table into a panel? or find a way to add a link to https://rusefi.com/s/tpstps https://github.com/rusefi/rusefi/issues/5130
|
||||||
table = tpsTpsAccelTbl, tpsTpsAccelMap, "TPS/TPS Acceleration Extra Fuel(ms)", 1
|
table = tpsTpsAccelTbl, tpsTpsAccelMap, "TPS/TPS Acceleration Extra Fuel(ms)", 1
|
||||||
|
@ -2122,6 +2123,10 @@ menuDialog = main
|
||||||
subMenu = std_separator
|
subMenu = std_separator
|
||||||
subMenu = fancyHardwareDialog, "Fancy Hardware"@@if_ts_show_fancy_hardware
|
subMenu = fancyHardwareDialog, "Fancy Hardware"@@if_ts_show_fancy_hardware
|
||||||
subMenu = fancyOptionsDialog, "Fancy Options"@@if_ts_show_fancy_options
|
subMenu = fancyOptionsDialog, "Fancy Options"@@if_ts_show_fancy_options
|
||||||
|
|
||||||
|
@@BOARD_MENU_FROM_FILE@@
|
||||||
|
subMenu = std_separator
|
||||||
|
|
||||||
subMenu = tractionEtbTableTbl, "Traction Control ETB Drop"
|
subMenu = tractionEtbTableTbl, "Traction Control ETB Drop"
|
||||||
subMenu = tractionTimingTableTbl, "Traction Control Timing Adjustment"
|
subMenu = tractionTimingTableTbl, "Traction Control Timing Adjustment"
|
||||||
subMenu = tractionIgnitionSkipDialog, "Traction Control Skip Ignition"
|
subMenu = tractionIgnitionSkipDialog, "Traction Control Skip Ignition"
|
||||||
|
|
|
@ -33,6 +33,7 @@ public class ReaderStateImpl implements ReaderState {
|
||||||
private static final String END_STRUCT = "end_struct";
|
private static final String END_STRUCT = "end_struct";
|
||||||
private static final String STRUCT_NO_PREFIX = "struct_no_prefix ";
|
private static final String STRUCT_NO_PREFIX = "struct_no_prefix ";
|
||||||
private static final String STRUCT = "struct ";
|
private static final String STRUCT = "struct ";
|
||||||
|
private static final String VARIABLE_PREFIX = "@@";
|
||||||
// used to update other files
|
// used to update other files
|
||||||
private final List<String> inputFiles = new ArrayList<>();
|
private final List<String> inputFiles = new ArrayList<>();
|
||||||
private final Stack<ConfigStructureImpl> stack = new Stack<>();
|
private final Stack<ConfigStructureImpl> stack = new Stack<>();
|
||||||
|
@ -249,11 +250,22 @@ public class ReaderStateImpl implements ReaderState {
|
||||||
for (ConfigurationConsumer consumer : consumers)
|
for (ConfigurationConsumer consumer : consumers)
|
||||||
consumer.startFile();
|
consumer.startFile();
|
||||||
|
|
||||||
|
List<String> lines = new ArrayList<>();
|
||||||
|
String lineReaded;
|
||||||
|
while ((lineReaded = definitionReader.readLine()) != null) {
|
||||||
|
lineReaded = ToolUtil.trimLine(lineReaded);
|
||||||
|
if (lineReaded.startsWith(VARIABLE_PREFIX)) {
|
||||||
|
String lineExpanded = variableRegistry.applyVariables(lineReaded);
|
||||||
|
String sublines[] = lineExpanded.split("\\r?\\n");
|
||||||
|
lines.addAll(Arrays.asList(sublines));
|
||||||
|
} else {
|
||||||
|
lines.add(lineReaded);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int lineIndex = 0;
|
int lineIndex = 0;
|
||||||
String line;
|
for (final String line : lines) {
|
||||||
while ((line = definitionReader.readLine()) != null) {
|
|
||||||
lineIndex++;
|
lineIndex++;
|
||||||
line = ToolUtil.trimLine(line);
|
|
||||||
/**
|
/**
|
||||||
* we should ignore empty lines and comments
|
* we should ignore empty lines and comments
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue