mirror of https://github.com/rusefi/rusefi.git
technical debt note
This commit is contained in:
parent
b40ee5e3bc
commit
2d9f7450d7
|
@ -30,10 +30,10 @@ public class SdCardFieldsGeneratorTest {
|
|||
"\tuint16_t autoscale speedToRpmRatio;@@GAUGE_NAME_GEAR_RATIO@@;\"value\",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0\n" +
|
||||
"end_struct";
|
||||
|
||||
processAndAssert(test, "\t{engine->outputChannels.internalMcuTemperature, \"internalMcuTemperature\", \"\", 0},\n" +
|
||||
"\t{engine->outputChannels.RPMValue, \"hello\", \"RPM\", 2, \"myCategory\"},\n" +
|
||||
"\t{engine->outputChannels.rpmAcceleration, \"dRPM\", \"RPM/s\", 2},\n" +
|
||||
"\t{engine->outputChannels.speedToRpmRatio, \"ra\", \"value\", 0},\n" +
|
||||
processAndAssert(test, "\t{test->reference.internalMcuTemperature, \"internalMcuTemperature\", \"\", 0},\n" +
|
||||
"\t{test->reference.RPMValue, \"hello\", \"RPM\", 2, \"myCategory\"},\n" +
|
||||
"\t{test->reference.rpmAcceleration, \"dRPM\", \"RPM/s\", 2},\n" +
|
||||
"\t{test->reference.speedToRpmRatio, \"ra\", \"value\", 0},\n" +
|
||||
"", actor, false);
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class SdCardFieldsGeneratorTest {
|
|||
processAndAssert("struct_no_prefix output_channels_s\n" +
|
||||
"uint16_t autoscale RPMValue;feee;\"RPM\",1, 0, 0, 8000, 2\n" +
|
||||
"bit sd_logging_internal\n" +
|
||||
"end_struct", "\t{engine->outputChannels.RPMValue, \"feee\", \"RPM\", 2},\n", readerState -> {
|
||||
"end_struct", "\t{test->reference.RPMValue, \"feee\", \"RPM\", 2},\n", readerState -> {
|
||||
|
||||
}, false);
|
||||
}
|
||||
|
@ -51,10 +51,10 @@ public class SdCardFieldsGeneratorTest {
|
|||
public void array() {
|
||||
processAndAssert("struct_no_prefix output_channels_s\n" +
|
||||
"uint16_t[4 iterate] recentErrorCode;;\"error\", 1, 0, 0, 0, 0\n" +
|
||||
"end_struct", "\t{engine->outputChannels.recentErrorCode[0], \"recentErrorCode 1\", \"error\", 0},\n" +
|
||||
"\t{engine->outputChannels.recentErrorCode[1], \"recentErrorCode 2\", \"error\", 0},\n" +
|
||||
"\t{engine->outputChannels.recentErrorCode[2], \"recentErrorCode 3\", \"error\", 0},\n" +
|
||||
"\t{engine->outputChannels.recentErrorCode[3], \"recentErrorCode 4\", \"error\", 0},\n", readerState -> {
|
||||
"end_struct", "\t{test->reference.recentErrorCode[0], \"recentErrorCode 1\", \"error\", 0},\n" +
|
||||
"\t{test->reference.recentErrorCode[1], \"recentErrorCode 2\", \"error\", 0},\n" +
|
||||
"\t{test->reference.recentErrorCode[2], \"recentErrorCode 3\", \"error\", 0},\n" +
|
||||
"\t{test->reference.recentErrorCode[3], \"recentErrorCode 4\", \"error\", 0},\n", readerState -> {
|
||||
|
||||
}, false);
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ public class SdCardFieldsGeneratorTest {
|
|||
"\tpid_status_s[2 iterate] vvtStatus\n" +
|
||||
"\tpid_status_s alternatorStatus\n" +
|
||||
"end_struct",
|
||||
"\t{engine->outputChannels->alternatorStatus.pTerm, \"alternatorStatus.pTerm\", \"\", 2},\n",
|
||||
"\t{test->reference->alternatorStatus.pTerm, \"alternatorStatus.pTerm\", \"\", 2},\n",
|
||||
readerState -> {
|
||||
|
||||
}, true);
|
||||
|
|
|
@ -248,7 +248,7 @@ public class LiveDataProcessor {
|
|||
}
|
||||
enumContent.append("} live_data_e;\n");
|
||||
|
||||
LazyFile lazyFile = fileFactory.create("console/binary_log/log_fields_generated.h");
|
||||
LazyFile lazyFile = fileFactory.create(SdCardFieldsContent.SD_CARD_OUTPUT_FILE_NAME);
|
||||
SdCardFieldsContent.wrapContent(lazyFile, sdCardFieldsConsumer.getBody());
|
||||
lazyFile.close();
|
||||
|
||||
|
|
|
@ -8,10 +8,16 @@ import java.io.IOException;
|
|||
|
||||
import static com.rusefi.output.JavaSensorsConsumer.quote;
|
||||
|
||||
/**
|
||||
* here we tell the firmware what to log on SD card how
|
||||
*
|
||||
* @see DataLogConsumer
|
||||
*/
|
||||
public class SdCardFieldsContent {
|
||||
public static final String SD_CARD_OUTPUT_FILE_NAME = "console/binary_log/log_fields_generated.h";
|
||||
private final StringBuilder body = new StringBuilder();
|
||||
|
||||
public String home = "engine->outputChannels";
|
||||
public String home = "test->reference"; // technical debt: default value is only used by unit tests
|
||||
public String conditional;
|
||||
public Boolean isPtr = false;
|
||||
|
||||
|
|
Loading…
Reference in New Issue