mirror of https://github.com/rusefi/rusefi.git
only:minor improvement - do not rewrite file after each fragment
This commit is contained in:
parent
6cb7bc8c33
commit
a45493eaad
|
@ -256,6 +256,7 @@ public class LiveDataProcessor {
|
||||||
wrapContent(lazyFile, sdCardFieldsConsumer.getBody());
|
wrapContent(lazyFile, sdCardFieldsConsumer.getBody());
|
||||||
lazyFile.close();
|
lazyFile.close();
|
||||||
|
|
||||||
|
dataLogConsumer.endFile();
|
||||||
outputValueConsumer.endFile();
|
outputValueConsumer.endFile();
|
||||||
|
|
||||||
GetConfigValueConsumer.writeStringToFile(STATE_DICTIONARY_FACTORY_JAVA, stateDictionaryGenerator.getCompleteClass(), fileFactory);
|
GetConfigValueConsumer.writeStringToFile(STATE_DICTIONARY_FACTORY_JAVA, stateDictionaryGenerator.getCompleteClass(), fileFactory);
|
||||||
|
|
|
@ -54,7 +54,10 @@ public class DataLogConsumer implements ConfigurationConsumer {
|
||||||
String content = iterator.getContent();
|
String content = iterator.getContent();
|
||||||
tsWriter.append(content);
|
tsWriter.append(content);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void endFile() throws IOException {
|
||||||
writeStringToFile(fileName, tsWriter);
|
writeStringToFile(fileName, tsWriter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class StateDictionaryGeneratorTest {
|
||||||
TestFileCaptor captor = new TestFileCaptor();
|
TestFileCaptor captor = new TestFileCaptor();
|
||||||
LiveDataProcessor liveDataProcessor = new LiveDataProcessor("test", fileName -> new StringReader(""), captor);
|
LiveDataProcessor liveDataProcessor = new LiveDataProcessor("test", fileName -> new StringReader(""), captor);
|
||||||
liveDataProcessor.handleYaml(data);
|
liveDataProcessor.handleYaml(data);
|
||||||
assertEquals(9, captor.fileCapture.size());
|
assertEquals("number of outputs", 10, captor.fileCapture.size());
|
||||||
|
|
||||||
assertEquals(" stateDictionary.register(live_data_e.LDS_output_channels, TsOutputs.VALUES, \"status_loop\");\n" +
|
assertEquals(" stateDictionary.register(live_data_e.LDS_output_channels, TsOutputs.VALUES, \"status_loop\");\n" +
|
||||||
" stateDictionary.register(live_data_e.LDS_fuel_computer, FuelComputer.VALUES, \"fuel_computer\");\n", liveDataProcessor.stateDictionaryGenerator.content.toString());
|
" stateDictionary.register(live_data_e.LDS_fuel_computer, FuelComputer.VALUES, \"fuel_computer\");\n", liveDataProcessor.stateDictionaryGenerator.content.toString());
|
||||||
|
|
Loading…
Reference in New Issue