TS project: hide all invalid entries #1505
This commit is contained in:
parent
e68c68a2b6
commit
e01a260552
|
@ -10,5 +10,6 @@
|
||||||
<orderEntry type="library" exported="" name="junit" level="project" />
|
<orderEntry type="library" exported="" name="junit" level="project" />
|
||||||
<orderEntry type="module" module-name="models" exported="" />
|
<orderEntry type="module" module-name="models" exported="" />
|
||||||
<orderEntry type="module" module-name="autoupdate" exported="" />
|
<orderEntry type="module" module-name="autoupdate" exported="" />
|
||||||
|
<orderEntry type="library" name="annotations" level="project" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
|
@ -0,0 +1,9 @@
|
||||||
|
<component name="libraryTable">
|
||||||
|
<library name="annotations">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$PROJECT_DIR$/../../java_console/lib/annotations.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</component>
|
|
@ -2,9 +2,12 @@
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectModuleManager">
|
<component name="ProjectModuleManager">
|
||||||
<modules>
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/../../java_console/autoupdate/autoupdate.iml" filepath="$PROJECT_DIR$/../../java_console/autoupdate/autoupdate.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/configuration_definition.iml" filepath="$PROJECT_DIR$/configuration_definition.iml" />
|
<module fileurl="file://$PROJECT_DIR$/configuration_definition.iml" filepath="$PROJECT_DIR$/configuration_definition.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/../enum_to_string/enum_to_string.iml" filepath="$PROJECT_DIR$/../enum_to_string/enum_to_string.iml" />
|
<module fileurl="file://$PROJECT_DIR$/../enum_to_string/enum_to_string.iml" filepath="$PROJECT_DIR$/../enum_to_string/enum_to_string.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/../../java_console/inifile/inifile.iml" filepath="$PROJECT_DIR$/../../java_console/inifile/inifile.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/../../java_console/logging/logging.iml" filepath="$PROJECT_DIR$/../../java_console/logging/logging.iml" />
|
<module fileurl="file://$PROJECT_DIR$/../../java_console/logging/logging.iml" filepath="$PROJECT_DIR$/../../java_console/logging/logging.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/../../java_console/models/models.iml" filepath="$PROJECT_DIR$/../../java_console/models/models.iml" />
|
||||||
</modules>
|
</modules>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -8,5 +8,7 @@
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="module" module-name="enum_to_string" exported="" />
|
<orderEntry type="module" module-name="enum_to_string" exported="" />
|
||||||
|
<orderEntry type="library" name="annotations" level="project" />
|
||||||
|
<orderEntry type="module" module-name="inifile" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
|
@ -1,5 +1,6 @@
|
||||||
package com.rusefi.output;
|
package com.rusefi.output;
|
||||||
|
|
||||||
|
import com.opensr5.ini.RawIniFile;
|
||||||
import com.rusefi.*;
|
import com.rusefi.*;
|
||||||
import com.rusefi.util.LazyFile;
|
import com.rusefi.util.LazyFile;
|
||||||
import com.rusefi.util.Output;
|
import com.rusefi.util.Output;
|
||||||
|
@ -60,6 +61,9 @@ public class TSProjectConsumer implements ConfigurationConsumer {
|
||||||
|
|
||||||
if (configField.getState().tsCustomLine.containsKey(configField.getType())) {
|
if (configField.getState().tsCustomLine.containsKey(configField.getType())) {
|
||||||
String bits = configField.getState().tsCustomLine.get(configField.getType());
|
String bits = configField.getState().tsCustomLine.get(configField.getType());
|
||||||
|
|
||||||
|
RawIniFile.Line line = new RawIniFile.Line(bits);
|
||||||
|
|
||||||
tsHeader.write("\t" + addTabsUpTo(nameWithPrefix, LENGTH));
|
tsHeader.write("\t" + addTabsUpTo(nameWithPrefix, LENGTH));
|
||||||
int size = configField.getState().tsCustomSize.get(configField.getType());
|
int size = configField.getState().tsCustomSize.get(configField.getType());
|
||||||
// tsHeader.headerWrite("\t" + size + ",");
|
// tsHeader.headerWrite("\t" + size + ",");
|
||||||
|
|
|
@ -4,13 +4,13 @@ import com.rusefi.ConfigField;
|
||||||
import com.rusefi.ReaderState;
|
import com.rusefi.ReaderState;
|
||||||
import com.rusefi.TypesHelper;
|
import com.rusefi.TypesHelper;
|
||||||
import com.rusefi.VariableRegistry;
|
import com.rusefi.VariableRegistry;
|
||||||
|
import com.rusefi.output.ConfigurationConsumer;
|
||||||
import com.rusefi.output.FsioSettingsConsumer;
|
import com.rusefi.output.FsioSettingsConsumer;
|
||||||
import com.rusefi.output.JavaFieldsConsumer;
|
import com.rusefi.output.JavaFieldsConsumer;
|
||||||
|
import com.rusefi.output.TSProjectConsumer;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.*;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.StringReader;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
|
@ -34,6 +34,23 @@ public class ConfigFieldParserTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCustomEnum() throws IOException {
|
||||||
|
String test = "struct pid_s\n" +
|
||||||
|
"#define ego_sensor_e_enum \"BPSX\", \"Innovate\", \"14Point7\"\n" +
|
||||||
|
"custom ego_sensor_e 4 bits, S32, @OFFSET@, [0:2], @@ego_sensor_e_enum@@\n" +
|
||||||
|
"ego_sensor_e afr_type;\n" +
|
||||||
|
"end_struct\n";
|
||||||
|
ReaderState state = new ReaderState();
|
||||||
|
BufferedReader reader = new BufferedReader(new StringReader(test));
|
||||||
|
|
||||||
|
CharArrayWriter writer = new CharArrayWriter();
|
||||||
|
TestTSProjectConsumer javaFieldsConsumer = new TestTSProjectConsumer(writer, "", state);
|
||||||
|
state.readBufferedReader(reader, Arrays.asList(javaFieldsConsumer));
|
||||||
|
assertEquals("\tafr_type\t\t\t\t\t = bits, S32, 0, [0:2], \"BPSX\", \"Innovate\", \"14Point7\"\n" +
|
||||||
|
"; total TS size = 4\n", new String(writer.toCharArray()));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void alignFourByteTypes() throws IOException {
|
public void alignFourByteTypes() throws IOException {
|
||||||
// we expect padding before each 4 byte field
|
// we expect padding before each 4 byte field
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.rusefi.test;
|
||||||
|
|
||||||
|
import com.rusefi.ReaderState;
|
||||||
|
import com.rusefi.output.TSProjectConsumer;
|
||||||
|
|
||||||
|
import java.io.CharArrayWriter;
|
||||||
|
|
||||||
|
public class TestTSProjectConsumer extends TSProjectConsumer {
|
||||||
|
public TestTSProjectConsumer(CharArrayWriter writer, String s, ReaderState state) {
|
||||||
|
super(writer, s, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void endFile() {
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue