progress
This commit is contained in:
parent
c64efdf862
commit
2d901f8106
|
@ -68,7 +68,7 @@ public class UsagesReader {
|
||||||
}
|
}
|
||||||
|
|
||||||
private int handleYaml(Map<String, Object> data, EntryHandler _handler) throws IOException {
|
private int handleYaml(Map<String, Object> data, EntryHandler _handler) throws IOException {
|
||||||
JavaSensorsConsumer javaSensorsConsumer = new JavaSensorsConsumer(0);
|
JavaSensorsConsumer javaSensorsConsumer = new JavaSensorsConsumer();
|
||||||
|
|
||||||
EntryHandler handler = new EntryHandler() {
|
EntryHandler handler = new EntryHandler() {
|
||||||
|
|
||||||
|
|
|
@ -10,10 +10,6 @@ public class JavaSensorsConsumer implements ConfigurationConsumer {
|
||||||
|
|
||||||
private final StringBuilder sb = new StringBuilder();
|
private final StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
public JavaSensorsConsumer(int sensorTsPosition) {
|
|
||||||
this.sensorTsPosition = sensorTsPosition;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startFile() {
|
public void startFile() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import java.io.*;
|
||||||
public class OutputsSectionConsumer implements ConfigurationConsumer {
|
public class OutputsSectionConsumer implements ConfigurationConsumer {
|
||||||
private final String tsOutputsSectionFileName;
|
private final String tsOutputsSectionFileName;
|
||||||
private final TsOutput tsOutput;
|
private final TsOutput tsOutput;
|
||||||
|
public int sensorTsPosition;
|
||||||
|
|
||||||
public OutputsSectionConsumer(String tsOutputsSectionFileName) {
|
public OutputsSectionConsumer(String tsOutputsSectionFileName) {
|
||||||
this.tsOutputsSectionFileName = tsOutputsSectionFileName;
|
this.tsOutputsSectionFileName = tsOutputsSectionFileName;
|
||||||
|
@ -24,7 +25,7 @@ public class OutputsSectionConsumer implements ConfigurationConsumer {
|
||||||
public void handleEndStruct(ReaderState readerState, ConfigStructure structure) throws IOException {
|
public void handleEndStruct(ReaderState readerState, ConfigStructure structure) throws IOException {
|
||||||
System.out.println("handleEndStruct");
|
System.out.println("handleEndStruct");
|
||||||
|
|
||||||
tsOutput.run(readerState, structure, 0);
|
sensorTsPosition = tsOutput.run(readerState, structure, sensorTsPosition);
|
||||||
|
|
||||||
if (readerState.stack.isEmpty()) {
|
if (readerState.stack.isEmpty()) {
|
||||||
if (tsOutputsSectionFileName != null) {
|
if (tsOutputsSectionFileName != null) {
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class JavaSensorsConsumerTest {
|
||||||
"\tuint8_t vehicleSpeedKph\n" +
|
"\tuint8_t vehicleSpeedKph\n" +
|
||||||
"\tint8_t autoscale internalMcuTemperature;mcu;\"deg C\",1, 0, 0, 0, 0\n" +
|
"\tint8_t autoscale internalMcuTemperature;mcu;\"deg C\",1, 0, 0, 0, 0\n" +
|
||||||
"end_struct\n";
|
"end_struct\n";
|
||||||
JavaSensorsConsumer javaSensorsConsumer = new JavaSensorsConsumer(0);
|
JavaSensorsConsumer javaSensorsConsumer = new JavaSensorsConsumer();
|
||||||
state.readBufferedReader(outputChannels, javaSensorsConsumer);
|
state.readBufferedReader(outputChannels, javaSensorsConsumer);
|
||||||
|
|
||||||
assertEquals("RPMValue(\"hello\", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 4, 1.0, 0.0, 8000.0, \"RPM\"),\n" +
|
assertEquals("RPMValue(\"hello\", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 4, 1.0, 0.0, 8000.0, \"RPM\"),\n" +
|
||||||
|
|
Loading…
Reference in New Issue