manual sync

This commit is contained in:
rusefi 2017-02-20 17:24:52 -05:00
parent a7a4027b6f
commit 4c579dd817
73 changed files with 11097 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1 @@
configuration_definition

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<buildFile url="file://$PROJECT_DIR$/build.xml" />
</component>
</project>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View File

@ -0,0 +1,5 @@
<component name="CopyrightManager">
<settings default="">
<module2copyright />
</settings>
</component>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>

View File

@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="junit">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/junit.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="SvnBranchConfigurationManager">
<option name="mySupportsUserInfoFilter" value="true" />
</component>
</project>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/configuration_definition.iml" filepath="$PROJECT_DIR$/configuration_definition.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,5 @@
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>

View File

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="svn" />
</component>
</project>

View File

@ -0,0 +1,631 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" readonly="true" id="23a933dc-84b9-48da-9226-979089fc6725" name="Default" comment="" />
<ignored path="configuration_definition.iws" />
<ignored path=".idea/workspace.xml" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="DaemonCodeAnalyzer">
<disable_hints />
</component>
<component name="DebuggerManager">
<breakpoint_any default_suspend_policy="SuspendAll" default_condition_enabled="true">
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="REMOVE_AFTER_HIT" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
<option name="SUSPEND" value="true" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="true" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="REMOVE_AFTER_HIT" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
<option name="SUSPEND" value="true" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="true" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
</breakpoint_any>
<ui_properties default_suspend_policy="SuspendAll" default_condition_enabled="true" />
<line_breakpoints default_suspend_policy="SuspendAll" default_condition_enabled="true" />
<breakpoint_rules />
<ui_properties />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
<favorites_list name="configuration_definition" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="ConfigDefinition.java" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/com/rusefi/ConfigDefinition.java">
<provider selected="true" editor-type-id="text-editor">
<state line="100" column="4" selection-start="3040" selection-end="3040" vertical-scroll-proportion="0.7525773" vertical-offset="1335" max-vertical-offset="2397">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ConfigStructure.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/com/rusefi/ConfigStructure.java">
<provider selected="true" editor-type-id="text-editor">
<state line="7" column="10" selection-start="107" selection-end="107" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="323">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ConfigField.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/com/rusefi/ConfigField.java">
<provider selected="true" editor-type-id="text-editor">
<state line="3" column="25" selection-start="28" selection-end="50" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1224">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ConfigDefinitionTest.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/com/rusefi/test/ConfigDefinitionTest.java">
<provider selected="true" editor-type-id="text-editor">
<state line="24" column="33" selection-start="660" selection-end="665" vertical-scroll-proportion="0.0" vertical-offset="46" max-vertical-offset="544">
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindManager">
<FindUsagesManager>
<setting name="OPEN_NEW_TAB" value="false" />
</FindUsagesManager>
</component>
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
<option value="$PROJECT_DIR$/src/ConfigDefiniton.java" />
<option value="$PROJECT_DIR$/src/com/rusefi/ConfigDefiniton.java" />
<option value="$PROJECT_DIR$/src/com/rusefi/test/ConfigDefinitionTest.java" />
<option value="$PROJECT_DIR$/src/com/rusefi/ConfigField.java" />
<option value="$PROJECT_DIR$/src/com/rusefi/ConfigStructure.java" />
<option value="$PROJECT_DIR$/src/com/rusefi/ConfigDefinition.java" />
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="-8" />
<option name="y" value="-8" />
<option name="width" value="1136" />
<option name="height" value="679" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectReloadState">
<option name="STATE" value="0" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="configuration_definition" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="configuration_definition" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="configuration_definition" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="configuration_definition" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="configuration_definition" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="rusefi" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="configuration_definition" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="configuration_definition" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="rusefi" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="test" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="PackagesPane" />
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="GoToClass.includeLibraries" value="false" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="MemberChooser.sorted" value="false" />
<property name="MemberChooser.showClasses" value="true" />
<property name="MemberChooser.copyJavadoc" value="false" />
<property name="LayoutCode.rearrangeEntriesJava" value="false" />
<property name="recentsLimit" value="5" />
<property name="dynamic.classpath" value="false" />
<property name="restartRequiresConfirmation" value="true" />
<property name="FullScreen" value="false" />
</component>
<component name="RecentsManager">
<key name="MoveClassesOrPackagesDialog.RECENTS_KEY">
<recent name="com.rusefi" />
</key>
</component>
<component name="RunManager" selected="Application.ConfigDefinition">
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin" singleton="true">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<method />
</configuration>
<configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
<module name="" />
<option name="TESTING_TYPE" value="0" />
<option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
<option name="METHOD_NAME" value="" />
<option name="CLASS_NAME" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="TARGET_SELECTION_MODE" value="EMULATOR" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<option name="USE_COMMAND_LINE" value="true" />
<option name="COMMAND_LINE" value="" />
<option name="WIPE_USER_DATA" value="false" />
<option name="DISABLE_BOOT_ANIMATION" value="false" />
<option name="NETWORK_SPEED" value="full" />
<option name="NETWORK_LATENCY" value="none" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method />
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<module name="" />
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<method />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application">
<module name="" />
<option name="ACTIVITY_CLASS" value="" />
<option name="MODE" value="default_activity" />
<option name="DEPLOY" value="true" />
<option name="ARTIFACT_NAME" value="" />
<option name="TARGET_SELECTION_MODE" value="EMULATOR" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<option name="USE_COMMAND_LINE" value="true" />
<option name="COMMAND_LINE" value="" />
<option name="WIPE_USER_DATA" value="false" />
<option name="DISABLE_BOOT_ANIMATION" value="false" />
<option name="NETWORK_SPEED" value="full" />
<option name="NETWORK_LATENCY" value="none" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<method />
</configuration>
<configuration default="false" name="ConfigDefinition" type="Application" factoryName="Application" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="com.rusefi.ConfigDefinition" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="../../firmware" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="configuration_definition" />
<envs />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="false" name="ConfigDefinitionTest.testComment" type="JUnit" factoryName="JUnit" nameIsGenerated="true">
<module name="configuration_definition" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="com.rusefi.test" />
<option name="MAIN_CLASS_NAME" value="com.rusefi.test.ConfigDefinitionTest" />
<option name="METHOD_NAME" value="testComment" />
<option name="TEST_OBJECT" value="method" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<list size="2">
<item index="0" class="java.lang.String" itemvalue="Application.ConfigDefinition" />
<item index="1" class="java.lang.String" itemvalue="JUnit.ConfigDefinitionTest.testComment" />
</list>
<configuration name="&lt;template&gt;" type="WebApp" default="true" selected="false">
<Host>localhost</Host>
<Port>5050</Port>
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false" />
<component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="true" SSL_PROTOCOLS="all">
<option name="USER" value="" />
<option name="PASSWORD" value="" />
<option name="mySSHConnectionTimeout" value="30000" />
<option name="mySSHReadTimeout" value="30000" />
<option name="LAST_MERGED_REVISION" />
<option name="MERGE_DRY_RUN" value="false" />
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
<option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
<option name="FORCE_UPDATE" value="false" />
<option name="IGNORE_EXTERNALS" value="false" />
<configuration useDefault="false">C:\Users\Andrey\AppData\Roaming\Subversion</configuration>
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
<supportedVersion>125</supportedVersion>
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="23a933dc-84b9-48da-9226-979089fc6725" name="Default" comment="" />
<created>1421079183278</created>
<updated>1421079183278</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1136" height="679" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.36641222" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24953617" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.5458015" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3293556" sideWeight="0.49778435" order="9" side_tool="true" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24446085" sideWeight="0.46897376" order="3" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32824427" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32824427" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24211502" sideWeight="0.41793892" order="1" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="12" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24211502" sideWeight="0.58206105" order="0" side_tool="false" content_ui="combo" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.5019084" sideWeight="0.4970458" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="JetGradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="6" side_tool="false" content_ui="combo" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
<option name="myTodoPanelSettings">
<TodoPanelSettings />
</option>
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/com/rusefi/ConfigDefinition.java">
<provider selected="true" editor-type-id="text-editor">
<state line="117" column="42" selection-start="3625" selection-end="3625" vertical-scroll-proportion="0.0" vertical-offset="1923" max-vertical-offset="2431">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/rusefi/test/ConfigDefinitionTest.java">
<provider selected="true" editor-type-id="text-editor">
<state line="17" column="65" selection-start="493" selection-end="493" vertical-scroll-proportion="0.0" vertical-offset="153" max-vertical-offset="442">
<folding />
</state>
</provider>
</entry>
<entry file="jar://C:/Program Files/Java/jdk1.7.0_51/src.zip!/java/lang/NumberFormatException.java">
<provider selected="true" editor-type-id="text-editor">
<state line="64" column="0" selection-start="1283" selection-end="1283" vertical-scroll-proportion="0.0" vertical-offset="1088" max-vertical-offset="1241">
<folding />
</state>
</provider>
</entry>
<entry file="jar://C:/Program Files/Java/jdk1.7.0_51/src.zip!/java/lang/Integer.java">
<provider selected="true" editor-type-id="text-editor">
<state line="503" column="0" selection-start="18293" selection-end="18293" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="21250">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/rusefi/ConfigDefinition.java">
<provider selected="true" editor-type-id="text-editor">
<state line="108" column="17" selection-start="3251" selection-end="3251" vertical-scroll-proportion="0.0" vertical-offset="1669" max-vertical-offset="2295">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://C:/Program Files/Java/jdk1.7.0_51/src.zip!/java/lang/NumberFormatException.java">
<provider selected="true" editor-type-id="text-editor">
<state line="64" column="0" selection-start="1283" selection-end="1283" vertical-scroll-proportion="0.0" vertical-offset="1088" max-vertical-offset="1241">
<folding />
</state>
</provider>
</entry>
<entry file="jar://C:/Program Files/Java/jdk1.7.0_51/src.zip!/java/lang/Integer.java">
<provider selected="true" editor-type-id="text-editor">
<state line="503" column="0" selection-start="18293" selection-end="18293" vertical-scroll-proportion="0.0" vertical-offset="8551" max-vertical-offset="21250">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/rusefi/ConfigDefinition.java">
<provider selected="true" editor-type-id="text-editor">
<state line="108" column="17" selection-start="3251" selection-end="3251" vertical-scroll-proportion="0.0" vertical-offset="1669" max-vertical-offset="2295">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://C:/Program Files/Java/jdk1.7.0_51/src.zip!/java/lang/NumberFormatException.java">
<provider selected="true" editor-type-id="text-editor">
<state line="64" column="0" selection-start="1283" selection-end="1283" vertical-scroll-proportion="0.0" vertical-offset="1088" max-vertical-offset="1241">
<folding />
</state>
</provider>
</entry>
<entry file="jar://C:/Program Files/Java/jdk1.7.0_51/src.zip!/java/lang/Integer.java">
<provider selected="true" editor-type-id="text-editor">
<state line="503" column="0" selection-start="18293" selection-end="18293" vertical-scroll-proportion="0.0" vertical-offset="8551" max-vertical-offset="21250">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/rusefi/ConfigDefinition.java">
<provider selected="true" editor-type-id="text-editor">
<state line="11" column="61" selection-start="293" selection-end="293" vertical-scroll-proportion="0.0" vertical-offset="51" max-vertical-offset="1581">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://C:/Program Files/Java/jdk1.7.0_51/src.zip!/java/lang/NumberFormatException.java">
<provider selected="true" editor-type-id="text-editor">
<state line="64" column="0" selection-start="1283" selection-end="1283" vertical-scroll-proportion="0.0" vertical-offset="538" max-vertical-offset="850">
<folding />
</state>
</provider>
</entry>
<entry file="jar://C:/Program Files/Java/jdk1.7.0_51/src.zip!/java/lang/Integer.java">
<provider selected="true" editor-type-id="text-editor">
<state line="503" column="0" selection-start="18293" selection-end="18293" vertical-scroll-proportion="0.0" vertical-offset="8056" max-vertical-offset="20859">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/rusefi/test/ConfigDefinitionTest.java">
<provider selected="true" editor-type-id="text-editor">
<state line="24" column="33" selection-start="660" selection-end="665" vertical-scroll-proportion="0.0" vertical-offset="46" max-vertical-offset="544">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/rusefi/ConfigField.java">
<provider selected="true" editor-type-id="text-editor">
<state line="3" column="25" selection-start="28" selection-end="50" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1156">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/rusefi/ConfigStructure.java">
<provider selected="true" editor-type-id="text-editor">
<state line="7" column="10" selection-start="107" selection-end="107" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="323">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/rusefi/ConfigDefinition.java">
<provider selected="true" editor-type-id="text-editor">
<state line="100" column="4" selection-start="3040" selection-end="3040" vertical-scroll-proportion="0.7525773" vertical-offset="1335" max-vertical-offset="2397">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>

View File

@ -0,0 +1,24 @@
<project default="jar">
<target name="clean">
<delete dir="build"/>
</target>
<target name="compile">
<mkdir dir="build/classes"/>
<javac destdir="build/classes" classpath="lib/junit.jar:lib/annotations.jar">
<src path="src"/>
</javac>
</target>
<target name="jar" depends="compile">
<mkdir dir="build/jar"/>
<jar destfile="../ConfigDefinition.jar" basedir="build/classes">
<manifest>
<attribute name="Main-Class" value="com.rusefi.ConfigDefinition"/>
</manifest>
<zipfileset dir="build/classes" includes="**/*.class"/>
</jar>
</target>
</project>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$APPLICATION_HOME_DIR$/lib/junit-4.10.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="junit" level="project" />
</component>
</module>

Binary file not shown.

View File

@ -0,0 +1,27 @@
package com.rusefi;
/**
* (c) Andrey Belomutskiy
* 6/4/2015.
*/
public class BitState {
private int bitIndex;
public void incrementBitIndex(ConfigField cf, ConfigField next) {
if (!cf.isBit) {
bitIndex = 0;
return;
}
bitIndex++;
if (bitIndex == 32)
throw new IllegalStateException("todo: too many bits, not supported");
}
public void reset() {
bitIndex = 0;
}
public int get() {
return bitIndex;
}
}

View File

@ -0,0 +1,349 @@
package com.rusefi;
import java.io.*;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Stack;
/**
* (c) Andrey Belomutskiy
* 1/12/15
*/
@SuppressWarnings("StringConcatenationInsideStringBufferAppend")
public class ConfigDefinition {
private static final String INPUT_FILE_NAME = "rusefi_config.txt";
private static final String MESSAGE = "was generated automatically by ConfigDefinition.jar based on " + INPUT_FILE_NAME + " " + new Date();
private static final String TS_FILE_INPUT_NAME = "rusefi.input";
private static final String TS_FILE_OUTPUT_NAME = "rusefi.ini";
private static final String STRUCT_NO_PREFIX = "struct_no_prefix ";
private static final String STRUCT = "struct ";
private static final String END_STRUCT = "end_struct";
private static final String CUSTOM = "custom";
private static final String DEFINE = "#define";
private static final String BIT = "bit";
private static final String CONFIG_DEFINITION_START = "CONFIG_DEFINITION_START";
private static final String CONFIG_DEFINITION_END = "CONFIG_DEFINITION_END";
private static final String ROM_RAIDER_XML = "rusefi.xml";
private static final String ENGINE_CONFIGURATION_GENERATED_STRUCTURES_H = "engine_configuration_generated_structures.h";
private static final String FIELDS_JAVA = "models/src/com/rusefi/config/Fields.java";
private static int totalTsSize;
private static Stack<ConfigStructure> stack = new Stack<>();
public static Map<String, ConfigStructure> structures = new HashMap<>();
public static Map<String, String> tsCustomLine = new HashMap<>();
public static Map<String, Integer> tsCustomSize = new HashMap<>();
public static StringBuilder settingContextHelp = new StringBuilder();
public static void main(String[] args) throws IOException {
if (args.length != 4) {
System.out.println("Please specify path to '" + INPUT_FILE_NAME + "' file, path to " + TS_FILE_INPUT_NAME +
" and destination folder");
return;
}
String inputPath = args[0];
String tsPath = args[1];
String headerDestinationFolder = args[2];
String javaConsolePath = args[3];
String fullFileName = inputPath + File.separator + INPUT_FILE_NAME;
System.out.println("Reading from " + fullFileName);
String destCHeader = headerDestinationFolder + File.separator + ENGINE_CONFIGURATION_GENERATED_STRUCTURES_H;
System.out.println("Writing C header to " + destCHeader);
BufferedWriter cHeader = new BufferedWriter(new FileWriter(destCHeader));
BufferedReader br = new BufferedReader(new FileReader(fullFileName));
CharArrayWriter tsWriter = new CharArrayWriter();
CharArrayWriter javaFieldsWriter = new CharArrayWriter();
processFile(br, cHeader, tsWriter, javaFieldsWriter);
BufferedWriter javaFields = new BufferedWriter(new FileWriter(javaConsolePath + File.separator + FIELDS_JAVA));
javaFields.write("package com.rusefi.config;\r\n\r\n");
javaFields.write("// this file " + MESSAGE + "\r\n");
javaFields.write("public class Fields {\r\n");
javaFields.write(VariableRegistry.INSTANCE.getJavaConstants());
javaFields.write(javaFieldsWriter.toString());
javaFields.write("}\r\n");
javaFields.close();
BufferedWriter tsHeader = writeTunerStudioFile(tsPath, tsWriter.toString());
if (!stack.isEmpty())
throw new IllegalStateException("Unclosed structure: " + stack.peek().name);
cHeader.close();
tsHeader.close();
VariableRegistry.INSTANCE.writeNumericsToFile(headerDestinationFolder);
writeTsSizeForJavaConsole(totalTsSize, javaConsolePath);
processTextTemplate(inputPath + File.separator + ROM_RAIDER_XML, javaConsolePath + File.separator + ROM_RAIDER_XML);
}
private static BufferedWriter writeTunerStudioFile(String tsPath, String fieldsSection) throws IOException {
TsFileContent tsContent = readTsFile(tsPath);
System.out.println("Got " + tsContent.getPrefix().length() + "/" + tsContent.getPostfix().length() + " of " + TS_FILE_INPUT_NAME);
BufferedWriter tsHeader = new BufferedWriter(new FileWriter(tsPath + File.separator + TS_FILE_OUTPUT_NAME));
tsHeader.write(tsContent.getPrefix());
tsHeader.write("; " + CONFIG_DEFINITION_START + "\r\n");
tsHeader.write("; this section " + MESSAGE + "\r\n\r\n");
tsHeader.write("pageSize = " + totalTsSize + "\r\n");
tsHeader.write("page = 1\r\n");
tsHeader.write(fieldsSection);
if (settingContextHelp.length() > 0) {
tsHeader.write("[SettingContextHelp]\r\n");
tsHeader.write(settingContextHelp.toString() + "\r\n\r\n");
}
tsHeader.write("; " + CONFIG_DEFINITION_END + "\r\n");
tsHeader.write(tsContent.getPostfix());
return tsHeader;
}
private static void processTextTemplate(String inputFileName, String outputFileName) throws IOException {
File inputFile = new File(inputFileName);
File outputFile = new File(outputFileName);
BufferedReader fr = new BufferedReader(new FileReader(inputFile));
FileWriter fw = new FileWriter(outputFile);
String line;
while ((line = fr.readLine()) != null) {
line = VariableRegistry.INSTANCE.processLine(line);
fw.write(line + "\r\n");
}
fw.close();
}
// todo: re-implement using VariableRegistry and a template?
private static void writeTsSizeForJavaConsole(int totalTsSize, String javaConsoleIoFolderPath) throws IOException {
String fileName = javaConsoleIoFolderPath +
File.separator + "io" +
File.separator + "src" +
File.separator + "com" +
File.separator + "rusefi" +
File.separator + "TsPageSize.java";
File f = new File(fileName);
System.out.println("Writing for console to " + fileName);
FileWriter fw = new FileWriter(f);
fw.write("package com.rusefi;\r\n\r\n");
fw.write("public interface TsPageSize {\r\n");
fw.write(" int IMAGE_SIZE = " + totalTsSize + ";\n");
fw.write("}\n");
fw.close();
}
private static TsFileContent readTsFile(String tsPath) throws IOException {
BufferedReader r = new BufferedReader(new FileReader(tsPath + File.separator + TS_FILE_INPUT_NAME));
StringBuilder prefix = new StringBuilder();
StringBuilder postfix = new StringBuilder();
boolean isBeforeStartTag = true;
boolean isAfterEndTag = false;
String line;
while ((line = r.readLine()) != null) {
if (line.contains(CONFIG_DEFINITION_START)) {
isBeforeStartTag = false;
continue;
}
if (line.contains(CONFIG_DEFINITION_END)) {
isAfterEndTag = true;
continue;
}
if (isBeforeStartTag)
prefix.append(line + "\r\n");
if (isAfterEndTag)
postfix.append(VariableRegistry.INSTANCE.processLine(line) + "\r\n");
}
r.close();
return new TsFileContent(prefix.toString(), postfix.toString());
}
private static void processFile(BufferedReader br, BufferedWriter cHeader, Writer tsHeader, CharArrayWriter javaFieldsWriter) throws IOException {
String line;
String message = "// this section " + MESSAGE + "\r\n";
cHeader.write(message);
cHeader.write("// begin\r\n");
cHeader.write("#ifndef ENGINE_CONFIGURATION_GENERATED_H_\r\n");
cHeader.write("#define ENGINE_CONFIGURATION_GENERATED_H_\r\n");
cHeader.write("#include \"rusefi_types.h\"\n");
while ((line = br.readLine()) != null) {
line = line.trim();
line = line.replaceAll("\\s+", " ");
/**
* we should ignore empty lines and comments
*/
if (line.length() == 0 || line.startsWith("!"))
continue;
if (line.startsWith(STRUCT)) {
handleStartStructure(line.substring(STRUCT.length()), true);
} else if (line.startsWith(STRUCT_NO_PREFIX)) {
handleStartStructure(line.substring(STRUCT_NO_PREFIX.length()), false);
} else if (line.startsWith(END_STRUCT)) {
handleEndStruct(cHeader, tsHeader, javaFieldsWriter);
} else if (line.startsWith(BIT)) {
line = line.substring(BIT.length() + 1).trim();
String bitName;
String comment;
if (!line.contains(";")) {
bitName = line;
comment = "";
} else {
int index = line.indexOf(";");
bitName = line.substring(0, index);
comment = line.substring(index + 1);
}
ConfigField bitField = new ConfigField(bitName, comment, true, null, null, 0, null, false);
stack.peek().addBoth(bitField);
} else if (startsWithToken(line, CUSTOM)) {
line = line.substring(CUSTOM.length() + 1).trim();
int index = line.indexOf(' ');
String name = line.substring(0, index);
line = line.substring(index).trim();
index = line.indexOf(' ');
String customSize = line.substring(0, index);
String tunerStudioLine = line.substring(index).trim();
tunerStudioLine = VariableRegistry.INSTANCE.processLine(tunerStudioLine);
int size;
try {
size = Integer.parseInt(customSize);
} catch (NumberFormatException e) {
throw new IllegalStateException("Size in " + line);
}
tsCustomSize.put(name, size);
tsCustomLine.put(name, tunerStudioLine);
} else {
processLine(line);
}
}
cHeader.write("#endif\r\n");
cHeader.write("// end\r\n");
cHeader.write(message);
}
private static boolean startsWithToken(String line, String token) {
return line.startsWith(token + " ") || line.startsWith(token + "\t");
}
private static void handleStartStructure(String line, boolean withPrefix) {
String name;
String comment;
if (line.contains(" ")) {
int index = line.indexOf(' ');
name = line.substring(0, index);
comment = line.substring(index + 1).trim();
} else {
name = line;
comment = null;
}
ConfigStructure structure = new ConfigStructure(name, comment, withPrefix);
stack.push(structure);
System.out.println("Starting structure " + structure.name);
}
private static void handleEndStruct(Writer cHeader, Writer tsHeader, CharArrayWriter javaFieldsWriter) throws IOException {
if (stack.isEmpty())
throw new IllegalStateException("Unexpected end_struct");
ConfigStructure structure = stack.pop();
System.out.println("Ending structure " + structure.name);
structure.addAlignmentFill();
ConfigDefinition.structures.put(structure.name, structure);
structure.headerWrite(cHeader);
if (stack.isEmpty()) {
totalTsSize = structure.writeTunerStudio("", tsHeader, 0);
tsHeader.write("; total TS size = " + totalTsSize + "\r\n");
VariableRegistry.INSTANCE.register("TOTAL_CONFIG_SIZE", totalTsSize);
structure.writeJavaFields("", javaFieldsWriter, 0);
}
}
private static void processLine(String line) throws IOException {
/**
* for example
* #define CLT_CURVE_SIZE 16
*/
if (startsWithToken(line, DEFINE)) {
processDefine(line.substring(DEFINE.length()).trim());
return;
}
ConfigField cf = ConfigField.parse(line);
if (cf == null)
throw new IllegalStateException("Cannot parse line [" + line + "]");
if (stack.isEmpty())
throw new IllegalStateException(cf.name + ": Not enclosed in a struct");
ConfigStructure structure = stack.peek();
if (cf.isIterate) {
structure.addC(cf);
for (int i = 1; i <= cf.arraySize; i++) {
ConfigField element = new ConfigField(cf.name + i, cf.comment, false, null,
cf.type, 1, cf.tsInfo, false);
structure.addTs(element);
}
} else {
structure.addBoth(cf);
}
}
public static String getComment(String comment, int currentOffset) {
return "\t/**\r\n" + packComment(comment, "\t") + "\t * offset " + currentOffset + "\r\n\t */\r\n";
}
public static String packComment(String comment, String linePrefix) {
if (comment == null)
return "";
if (comment.trim().isEmpty())
return "";
String result = "";
for (String line : comment.split("\\\\n")) {
result += linePrefix + " * " + line + "\r\n";
}
return result;
}
public static int getSize(String s) {
if (VariableRegistry.INSTANCE.intValues.containsKey(s))
return VariableRegistry.INSTANCE.intValues.get(s);
return Integer.parseInt(s);
}
private static void processDefine(String line) {
int index = line.indexOf(' ');
String name;
if (index == -1) {
name = line;
line = "";
} else {
name = line.substring(0, index);
line = line.substring(index).trim();
}
VariableRegistry.INSTANCE.register(name, line);
}
}

View File

@ -0,0 +1,257 @@
package com.rusefi;
import com.rusefi.test.ConfigDefinitionTest;
import java.io.IOException;
import java.io.Writer;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* This is an immutable model of an individual field
* (c) Andrey Belomutskiy
* 1/15/15
*/
public class ConfigField {
public static final ConfigField VOID = new ConfigField(null, null, false, null, null, 1, null, false);
private static final String typePattern = "([\\w\\d_]+)(\\[([\\w\\d]+)(\\s([\\w\\d]+))?\\])?";
private static final String namePattern = "[[\\w\\d\\s_]]+";
private static final String commentPattern = ";([^;]*)";
private static final Pattern FIELD = Pattern.compile(typePattern + "\\s(" + namePattern + ")(" + commentPattern + ")?(;(.*))?");
private static final Set<String> javaEnums = new HashSet<>();
private static final String BOOLEAN_TYPE = "bool";
public static final int LENGTH = 24;
private static final char TS_COMMENT_TAG = '+';
/**
* field name without structure name
* @see #writeJavaFields prefix parameter for structure name
*/
public final String name;
public final String comment;
public final boolean isBit;
public final String arraySizeAsText;
public final String type;
public final int arraySize;
public final String tsInfo;
public final int elementSize;
/**
* this property of array expands field into a bunch of variables like field1 field2 field3 etc
*/
public final boolean isIterate;
public ConfigField(String name, String comment, boolean isBit, String arraySizeAsText, String type,
int arraySize, String tsInfo, boolean isIterate) {
this.name = name;
this.comment = comment;
this.isBit = isBit;
this.arraySizeAsText = arraySizeAsText;
this.type = type;
if (type == null) {
elementSize = 0;
} else {
elementSize = TypesHelper.getElementSize(type);
}
this.arraySize = arraySize;
this.tsInfo = tsInfo;
this.isIterate = isIterate;
}
/**
* @see ConfigDefinitionTest#testParseLine()
*/
public static ConfigField parse(String line) {
Matcher matcher = FIELD.matcher(line);
if (!matcher.matches())
return null;
String name = matcher.group(6);
String comment = matcher.group(8);
String type = matcher.group(1);
int arraySize;
String arraySizeAsText;
if (matcher.group(3) != null) {
arraySizeAsText = matcher.group(3);
arraySize = ConfigDefinition.getSize(arraySizeAsText);
} else {
arraySize = 1;
arraySizeAsText = null;
}
String tsInfo = matcher.group(10);
boolean isIterate = "iterate".equalsIgnoreCase(matcher.group(5));
ConfigField field = new ConfigField(name, comment, false, arraySizeAsText, type, arraySize,
tsInfo, isIterate);
System.out.println("type " + type);
System.out.println("name " + name);
System.out.println("comment " + comment);
return field;
}
int getSize(ConfigField next) {
if (isBit && next.isBit)
return 0;
if (isBit)
return 4;
return elementSize * arraySize;
}
String getHeaderText(int currentOffset, int bitIndex) {
if (isBit) {
String comment = "\t/**\r\n" + ConfigDefinition.packComment(getCommentContent(), "\t") + "\toffset " + currentOffset + " bit " + bitIndex + " */\r\n";
return comment + "\t" + BOOLEAN_TYPE + " " + name + " : 1;\r\n";
}
String cEntry = ConfigDefinition.getComment(getCommentContent(), currentOffset);
if (arraySize == 1) {
// not an array
cEntry += "\t" + type + " " + name + ";\r\n";
} else {
cEntry += "\t" + type + " " + name + "[" + arraySizeAsText + "];\n";
}
return cEntry;
}
@Override
public String toString() {
return "ConfigField{" +
"name='" + name + '\'' +
", type='" + type + '\'' +
", arraySize=" + arraySize +
", elementSize=" + elementSize +
'}';
}
public int writeTunerStudio(String prefix, Writer tsHeader, int tsPosition, ConfigField next, int bitIndex) throws IOException {
String nameWithPrefix = prefix + name;
VariableRegistry.INSTANCE.register(nameWithPrefix + "_offset", tsPosition);
ConfigStructure cs = ConfigDefinition.structures.get(type);
if (cs != null) {
String extraPrefix = cs.withPrefix ? name + "_" : "";
return cs.writeTunerStudio(prefix + extraPrefix, tsHeader, tsPosition);
}
if (isBit) {
tsHeader.write("\t" + addTabsUpTo(nameWithPrefix, LENGTH));
tsHeader.write("= bits, U32, ");
tsHeader.write("\t" + tsPosition + ", [");
tsHeader.write(bitIndex + ":" + bitIndex);
tsHeader.write("], \"false\", \"true\"");
tsHeader.write("\r\n");
tsPosition += getSize(next);
return tsPosition;
}
if (ConfigDefinition.tsCustomLine.containsKey(type)) {
String bits = ConfigDefinition.tsCustomLine.get(type);
tsHeader.write("\t" + addTabsUpTo(nameWithPrefix, LENGTH));
int size = ConfigDefinition.tsCustomSize.get(type);
// tsHeader.headerWrite("\t" + size + ",");
// tsHeader.headerWrite("\t" + tsPosition + ",");
bits = bits.replaceAll("@OFFSET@", "" + tsPosition);
tsHeader.write("\t = " + bits);
tsPosition += size;
} else if (tsInfo == null) {
tsHeader.write(";skipping " + prefix + name + " offset " + tsPosition);
tsPosition += arraySize * elementSize;
} else if (arraySize != 1) {
tsHeader.write("\t" + addTabsUpTo(nameWithPrefix, LENGTH) + "\t\t= array, ");
tsHeader.write(TypesHelper.convertToTs(type) + ",");
tsHeader.write("\t" + tsPosition + ",");
tsHeader.write("\t[" + arraySize + "],");
tsHeader.write("\t" + tsInfo);
tsPosition += arraySize * elementSize;
} else {
tsHeader.write("\t" + addTabsUpTo(nameWithPrefix, LENGTH) + "\t\t= scalar, ");
tsHeader.write(TypesHelper.convertToTs(type) + ",");
tsHeader.write("\t" + tsPosition + ",");
tsHeader.write("\t" + tsInfo);
tsPosition += arraySize * elementSize;
}
tsHeader.write("\r\n");
return tsPosition;
}
private String addTabsUpTo(String name, int length) {
StringBuilder result = new StringBuilder(name);
int currentLength = name.length();
while (currentLength < length) {
result.append("\t");
currentLength += 4;
}
return result.toString();
}
public int writeJavaFields(String prefix, Writer javaFieldsWriter, int tsPosition, ConfigField next, int bitIndex) throws IOException {
ConfigStructure cs = ConfigDefinition.structures.get(type);
if (cs != null) {
String extraPrefix = cs.withPrefix ? name + "_" : "";
return cs.writeJavaFields(prefix + extraPrefix, javaFieldsWriter, tsPosition);
}
String nameWithPrefix = prefix + name;
if (comment != null && comment.startsWith(TS_COMMENT_TAG + "")) {
ConfigDefinition.settingContextHelp.append("\t" + nameWithPrefix + " = \"" + getCommentContent() + "\"\r\n");
}
if (isBit) {
writeJavaFieldName(javaFieldsWriter, nameWithPrefix, tsPosition);
javaFieldsWriter.append("FieldType.BIT, " + bitIndex + ");\r\n");
tsPosition += getSize(next);
return tsPosition;
}
if (arraySize != 1) {
// todo: array support
} else if (TypesHelper.isFloat(type)) {
writeJavaFieldName(javaFieldsWriter, nameWithPrefix, tsPosition);
javaFieldsWriter.write("FieldType.FLOAT);\r\n");
} else {
String enumOptions = VariableRegistry.INSTANCE.get(type + "_enum");
if (enumOptions != null && !javaEnums.contains(type)) {
javaEnums.add(type);
javaFieldsWriter.write("\tpublic static final String[] " + type + " = {" + enumOptions + "};\r\n");
}
writeJavaFieldName(javaFieldsWriter, nameWithPrefix, tsPosition);
javaFieldsWriter.write("FieldType.INT");
if (enumOptions != null) {
javaFieldsWriter.write(", " + type);
}
javaFieldsWriter.write(");\r\n");
}
tsPosition += arraySize * elementSize;
return tsPosition;
}
private void writeJavaFieldName(Writer javaFieldsWriter, String nameWithPrefix, int tsPosition) throws IOException {
javaFieldsWriter.write("\tpublic static final Field ");
javaFieldsWriter.write(nameWithPrefix.toUpperCase());
javaFieldsWriter.write(" = Field.create(\"" + nameWithPrefix.toUpperCase() + "\", "
+ tsPosition + ", ");
}
public String getCommentContent() {
if (comment == null || comment.isEmpty())
return comment;
return comment.charAt(0) == TS_COMMENT_TAG ? comment.substring(1) : comment;
}
}

View File

@ -0,0 +1,117 @@
package com.rusefi;
import java.io.CharArrayWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
/**
* (c) Andrey Belomutskiy
* 1/15/15
*/
public class ConfigStructure {
public static final String UINT8_T = "uint8_t";
public final String name;
private final String comment;
public final boolean withPrefix;
/**
* We have two different collections because if 'array iterate' feature which is handled differently
* in C and TS
*/
private final List<ConfigField> cFields = new ArrayList<>();
private final List<ConfigField> tsFields = new ArrayList<>();
private int currentOffset;
public int totalSize;
BitState bitState = new BitState();
public ConfigStructure(String name, String comment, boolean withPrefix) {
this.name = name;
this.comment = comment;
this.withPrefix = withPrefix;
}
public void addAlignmentFill() {
bitState.reset();
/**
* we make alignment decision based on C fields since we expect interation and non-iteration fields
* to match in size
*/
for (int i = 0; i < cFields.size(); i++) {
ConfigField cf = cFields.get(i);
ConfigField next = i == cFields.size() - 1 ? ConfigField.VOID : cFields.get(i + 1);
bitState.incrementBitIndex(cf, next);
totalSize += cf.getSize(next);
}
int fillSize = totalSize % 4 == 0 ? 0 : 4 - (totalSize % 4);
if (fillSize != 0) {
ConfigField fill = new ConfigField("alignmentFill", "need 4 byte alignment", false,
"" + fillSize,
UINT8_T, fillSize, null, false);
addBoth(fill);
}
totalSize += fillSize;
}
/**
* This method writes a C header version of a data structure
*/
public void headerWrite(Writer cHeader) throws IOException {
if (comment != null) {
cHeader.write("/**\r\n" + ConfigDefinition.packComment(comment, "") + "\r\n*/\r\n");
}
cHeader.write("typedef struct {\r\n");
bitState.reset();
for (int i = 0; i < cFields.size(); i++) {
ConfigField cf = cFields.get(i);
cHeader.write(cf.getHeaderText(currentOffset, bitState.get()));
ConfigField next = i == cFields.size() - 1 ? ConfigField.VOID : cFields.get(i + 1);
bitState.incrementBitIndex(cf, next);
currentOffset += cf.getSize(next);
}
cHeader.write("\t/** total size " + currentOffset + "*/\r\n");
cHeader.write("} " + name + ";\r\n\r\n");
}
public int writeTunerStudio(String prefix, Writer tsHeader, int tsPosition) throws IOException {
FieldIterator fieldIterator = new FieldIterator();
for (int i = 0; i < tsFields.size(); i++) {
ConfigField next = i == tsFields.size() - 1 ? ConfigField.VOID : tsFields.get(i + 1);
ConfigField cf = tsFields.get(i);
tsPosition = cf.writeTunerStudio(prefix, tsHeader, tsPosition, next, fieldIterator.bitState.get());
fieldIterator.bitState.incrementBitIndex(cf, next);
}
return tsPosition;
}
public int writeJavaFields(String prefix, Writer javaFieldsWriter, int tsPosition) throws IOException {
FieldIterator fieldIterator = new FieldIterator();
for (int i = 0; i < tsFields.size(); i++) {
ConfigField next = i == tsFields.size() - 1 ? ConfigField.VOID : tsFields.get(i + 1);
ConfigField cf = tsFields.get(i);
tsPosition = cf.writeJavaFields(prefix, javaFieldsWriter, tsPosition, next, fieldIterator.bitState.get());
fieldIterator.bitState.incrementBitIndex(cf, next);
}
return tsPosition;
}
public void addBoth(ConfigField cf) {
cFields.add(cf);
tsFields.add(cf);
}
public void addC(ConfigField cf) {
cFields.add(cf);
}
public void addTs(ConfigField cf) {
tsFields.add(cf);
}
}

View File

@ -0,0 +1,10 @@
package com.rusefi;
/**
* (c) Andrey Belomutskiy
* 6/4/2015.
*/
public class FieldIterator {
public BitState bitState = new BitState();
}

View File

@ -0,0 +1,22 @@
package com.rusefi;
/**
* 1/31/2015
*/
public class TsFileContent {
private final String prefix;
private final String postfix;
public TsFileContent(String prefix, String postfix) {
this.prefix = prefix;
this.postfix = postfix;
}
public String getPrefix() {
return prefix;
}
public String getPostfix() {
return postfix;
}
}

View File

@ -0,0 +1,39 @@
package com.rusefi;
/**
* 1/22/15
*/
public class TypesHelper {
public static int getElementSize(String type) {
if (type == null)
throw new NullPointerException("type");
if (ConfigDefinition.structures.containsKey(type))
return ConfigDefinition.structures.get(type).totalSize;
if (ConfigDefinition.tsCustomSize.containsKey(type))
return ConfigDefinition.tsCustomSize.get(type);
if (type.equals(ConfigStructure.UINT8_T))
return 1;
if (type.equals("int16_t") || type.equals("uint16_t")) {
return 2;
}
return 4;
}
static String convertToTs(String type) {
if (isFloat(type))
return "F32";
if ("uint32_t".equals(type))
return "U32";
if ("int32_t".equals(type) || "int".equals(type))
return "S32";
if ("int16_t".equals(type))
return "S16";
if ("uint16_t".equals(type))
return "U16";
return type;
}
public static boolean isFloat(String type) {
return "float".equals(type) || type.equalsIgnoreCase("angle_t");
}
}

View File

@ -0,0 +1,85 @@
package com.rusefi;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* 3/30/2015
*/
public class VariableRegistry extends TreeMap<String, String> {
public static final VariableRegistry INSTANCE = new VariableRegistry();
private final Pattern VAR = Pattern.compile("(@@(.*?)@@)");
public Map<String, Integer> intValues = new HashMap<>();
private final StringBuilder cNumbericDefinitions = new StringBuilder();
private final StringBuilder javaNumbericDefinitions = new StringBuilder();
private VariableRegistry() {
super(String.CASE_INSENSITIVE_ORDER);
}
public String processLine(String line) {
Matcher m;
while ((m = VAR.matcher(line)).find()) {
String key = m.group(2);
// key =
if (!containsKey(key))
throw new IllegalStateException("No such variable: " + key);
String s = get(key);
line = m.replaceFirst(s);
}
return line;
}
public void register(String var, String value) {
System.out.println("Registering " + var + " as " + value);
put(var, value);
tryToRegisterAsInteger(var, value);
}
@SuppressWarnings("StringConcatenationInsideStringBufferAppend")
private void tryToRegisterAsInteger(String var, String value) {
try {
int intValue = Integer.parseInt(value);
System.out.println("key [" + var + "] value: " + intValue);
if (intValues.containsKey(var))
throw new IllegalStateException("Not allowed to redefine: " + var);
intValues.put(var, intValue);
cNumbericDefinitions.append("#define " + var + " " + intValue + "\r\n");
javaNumbericDefinitions.append("\tpublic static final int " + var + " = " + intValue + ";\r\n");
} catch (NumberFormatException e) {
System.out.println("Not an integer: " + value);
}
}
public void register(String var, int i) {
register(var, Integer.toString(i));
register(var + "_hex", Integer.toString(i, 16));
}
public void writeNumericsToFile(String headerDestinationFolder) throws IOException {
String fileName = headerDestinationFolder + File.separator + "rusefi_generated.h";
System.out.println("Writing to " + fileName);
BufferedWriter cHeader = new BufferedWriter(new FileWriter(fileName));
cHeader.write(cNumbericDefinitions.toString());
cHeader.close();
}
public String getJavaConstants() {
return javaNumbericDefinitions.toString();
}
}

View File

@ -0,0 +1,70 @@
package com.rusefi.test;
import com.rusefi.ConfigDefinition;
import com.rusefi.ConfigField;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
/**
* (c) Andrey Belomutskiy
* 1/15/15
*/
public class ConfigDefinitionTest {
@Test
public void testComment() {
assertEquals("", ConfigDefinition.packComment("", "\t"));
assertEquals("\t * abc\r\n", ConfigDefinition.packComment("abc", "\t"));
assertEquals("\t * abc\r\n" +
"\t * vbn\r\n", ConfigDefinition.packComment("abc\\nvbn", "\t"));
}
@Test
public void testParseLine() {
assertNull(ConfigField.parse("int"));
{
ConfigField cf = ConfigField.parse("int field");
assertEquals(cf.type, "int");
assertEquals("Name", cf.name, "field");
}
{
ConfigField cf = ConfigField.parse("int_4 fie4_ld");
assertEquals(cf.type, "int_4");
assertEquals(cf.name, "fie4_ld");
}
{
ConfigField cf = ConfigField.parse("int_8 fi_eld;comm_;ts");
assertEquals(cf.type, "int_8");
assertEquals(cf.name, "fi_eld");
assertEquals("Comment", cf.comment, "comm_");
assertEquals(cf.tsInfo, "ts");
}
{
ConfigField cf = ConfigField.parse("int[3 iterate] field");
assertEquals(cf.type, "int");
assertEquals(cf.arraySize, 3);
assertTrue("isIterate", cf.isIterate);
}
{
ConfigField cf = ConfigField.parse("int16_t crankingRpm;This,. value controls what RPM values we consider 'cranking' (any RPM below 'crankingRpm')\\nAnything above 'crankingRpm' would be 'running'");
assertEquals(cf.name, "crankingRpm");
assertEquals(cf.arraySize, 1);
assertEquals(cf.type, "int16_t");
}
{
ConfigField cf = ConfigField.parse("MAP_sensor_config_s map");
assertEquals(cf.name, "map");
assertEquals(cf.arraySize, 1);
assertEquals(cf.type, "MAP_sensor_config_s");
}
{
ConfigField cf = ConfigField.parse("MAP_sensor_config_s map;@see hasMapSensor\\n@see isMapAveragingEnabled");
assertEquals(cf.name, "map");
assertEquals(cf.arraySize, 1);
assertEquals(cf.type, "MAP_sensor_config_s");
assertEquals(cf.comment, "@see hasMapSensor\\n@see isMapAveragingEnabled");
}
}
}

View File

@ -0,0 +1,23 @@
package com.rusefi.test;
import com.rusefi.VariableRegistry;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* 3/30/2015
*/
public class VariableRegistryTest {
@Test
public void testReplace() {
VariableRegistry.INSTANCE.clear();
VariableRegistry.INSTANCE.register("var", 256);
assertEquals("256", VariableRegistry.INSTANCE.processLine("@@var@@"));
assertEquals("ab256", VariableRegistry.INSTANCE.processLine("ab@@var@@"));
assertEquals("ab256cd", VariableRegistry.INSTANCE.processLine("ab@@var@@cd"));
assertEquals("aa256qwe100fff", VariableRegistry.INSTANCE.processLine("aa@@var@@qwe@@var_hex@@fff"));
}
}

BIN
java_tools/enum2string.jar Normal file

Binary file not shown.

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="SvnBranchConfigurationManager">
<option name="mySupportsUserInfoFilter" value="true" />
</component>
</project>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/enum_to_string.iml" filepath="$PROJECT_DIR$/enum_to_string.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="svn" />
</component>
</project>

View File

@ -0,0 +1,441 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" readonly="true" id="ad719350-c1ab-4bf9-bdd6-c566b8ae1052" name="Default" comment="" />
<ignored path="enum_to_string.iws" />
<ignored path=".idea/workspace.xml" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="DaemonCodeAnalyzer">
<disable_hints />
</component>
<component name="DebuggerManager">
<breakpoint_any default_suspend_policy="SuspendAll" default_condition_enabled="true">
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="REMOVE_AFTER_HIT" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
<option name="SUSPEND" value="true" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="true" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="REMOVE_AFTER_HIT" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
<option name="SUSPEND" value="true" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="true" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
</breakpoint_any>
<ui_properties default_suspend_policy="SuspendAll" default_condition_enabled="true" />
<breakpoint_rules />
<ui_properties />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
<favorites_list name="enum_to_string" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="EnumToString.java" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/com/rusefi/EnumToString.java">
<provider selected="true" editor-type-id="text-editor">
<state line="14" column="5" selection-start="310" selection-end="310" vertical-scroll-proportion="0.2521739" vertical-offset="180" max-vertical-offset="782">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="State.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/com/rusefi/State.java">
<provider selected="true" editor-type-id="text-editor">
<state line="6" column="12" selection-start="78" selection-end="78" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="255">
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindManager">
<FindUsagesManager>
<setting name="OPEN_NEW_TAB" value="false" />
</FindUsagesManager>
</component>
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
<option value="$PROJECT_DIR$/src/com/rusefi/State.java" />
<option value="$PROJECT_DIR$/src/com/rusefi/EnumToString.java" />
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="1" />
<option name="y" value="1" />
<option name="width" value="958" />
<option name="height" value="561" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectReloadState">
<option name="STATE" value="0" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
</navigator>
<panes>
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="enum_to_string" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="enum_to_string" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="enum_to_string" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="enum_to_string" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="enum_to_string" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="rusefi" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="GoToClass.includeLibraries" value="false" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="MemberChooser.sorted" value="false" />
<property name="MemberChooser.showClasses" value="true" />
<property name="MemberChooser.copyJavadoc" value="false" />
<property name="LayoutCode.rearrangeEntriesJava" value="false" />
<property name="recentsLimit" value="5" />
<property name="dynamic.classpath" value="false" />
</component>
<component name="RunManager" selected="Application.EnumToString">
<configuration default="false" name="EnumToString" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="com.rusefi.EnumToString" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="enum_to_string" />
<envs />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin" singleton="true">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<method />
</configuration>
<configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
<module name="" />
<option name="TESTING_TYPE" value="0" />
<option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
<option name="METHOD_NAME" value="" />
<option name="CLASS_NAME" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="TARGET_SELECTION_MODE" value="EMULATOR" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<option name="USE_COMMAND_LINE" value="true" />
<option name="COMMAND_LINE" value="" />
<option name="WIPE_USER_DATA" value="false" />
<option name="DISABLE_BOOT_ANIMATION" value="false" />
<option name="NETWORK_SPEED" value="full" />
<option name="NETWORK_LATENCY" value="none" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method />
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<module name="" />
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<method />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application">
<module name="" />
<option name="ACTIVITY_CLASS" value="" />
<option name="MODE" value="default_activity" />
<option name="DEPLOY" value="true" />
<option name="ARTIFACT_NAME" value="" />
<option name="TARGET_SELECTION_MODE" value="EMULATOR" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<option name="USE_COMMAND_LINE" value="true" />
<option name="COMMAND_LINE" value="" />
<option name="WIPE_USER_DATA" value="false" />
<option name="DISABLE_BOOT_ANIMATION" value="false" />
<option name="NETWORK_SPEED" value="full" />
<option name="NETWORK_LATENCY" value="none" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<method />
</configuration>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="Application.EnumToString" />
</list>
<recent_temporary>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="Application.EnumToString" />
</list>
</recent_temporary>
<configuration name="&lt;template&gt;" type="WebApp" default="true" selected="false">
<Host>localhost</Host>
<Port>5050</Port>
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false" />
<component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="true" SSL_PROTOCOLS="all">
<option name="USER" value="" />
<option name="PASSWORD" value="" />
<option name="mySSHConnectionTimeout" value="30000" />
<option name="mySSHReadTimeout" value="30000" />
<option name="LAST_MERGED_REVISION" />
<option name="MERGE_DRY_RUN" value="false" />
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
<option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
<option name="FORCE_UPDATE" value="false" />
<option name="IGNORE_EXTERNALS" value="false" />
<configuration useDefault="false">C:\Users\Andrey\AppData\Roaming\Subversion</configuration>
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
<supportedVersion>125</supportedVersion>
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="ad719350-c1ab-4bf9-bdd6-c566b8ae1052" name="Default" comment="" />
<created>1412594532442</created>
<updated>1412594532442</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="1" y="1" width="958" height="561" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24953617" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.5458015" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3293556" sideWeight="0.49778435" order="9" side_tool="true" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24446085" sideWeight="0.46897376" order="3" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32824427" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32824427" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24666667" sideWeight="0.4140625" order="1" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="12" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24666667" sideWeight="0.58203125" order="0" side_tool="false" content_ui="combo" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.36945814" sideWeight="0.4970458" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="JetGradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.36641222" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="6" side_tool="false" content_ui="combo" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
<option name="myTodoPanelSettings">
<TodoPanelSettings />
</option>
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/com/rusefi/State.java">
<provider selected="true" editor-type-id="text-editor">
<state line="6" column="12" selection-start="78" selection-end="78" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="255">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/rusefi/EnumToString.java">
<provider selected="true" editor-type-id="text-editor">
<state line="14" column="5" selection-start="310" selection-end="310" vertical-scroll-proportion="0.2521739" vertical-offset="180" max-vertical-offset="782">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>

View File

@ -0,0 +1,24 @@
<project default="jar">
<target name="clean">
<delete dir="build"/>
</target>
<target name="compile">
<mkdir dir="build/classes"/>
<javac destdir="build/classes" classpath="lib/junit.jar:lib/annotations.jar">
<src path="src"/>
</javac>
</target>
<target name="jar" depends="compile">
<mkdir dir="build/jar"/>
<jar destfile="../enum2string.jar" basedir="build/classes">
<manifest>
<attribute name="Main-Class" value="com.rusefi.EnumToString"/>
</manifest>
<zipfileset dir="build/classes" includes="**/*.class"/>
</jar>
</target>
</project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,121 @@
package com.rusefi;
import java.io.*;
import java.util.Set;
import java.util.TreeSet;
/**
* (c) Andrey Belomutskiy
* <p/>
* 10/6/14
*/
@SuppressWarnings("StringConcatenationInsideStringBufferAppend")
public class EnumToString {
private final static Set<String> currentValues = new TreeSet<String>();
private final static StringBuilder result = new StringBuilder();
private final static StringBuilder header = new StringBuilder();
public static void main(String[] args) throws IOException {
if (args.length != 1) {
System.out.println("Please specify one parameter: path to firmware folder");
return;
}
String path = args[0];
header.append("#ifndef _A_H_HEADER_\r\n");
header.append("#define _A_H_HEADER_\r\n");
process(path + File.separator + "controllers/algo/io_pins.h");
process(path + File.separator + "controllers/algo/rusefi_enums.h");
header.append("#endif /*_A_H_HEADER_ */\r\n");
writeResult("auto_generated_enums");
}
private static void writeResult(String outFileName) throws IOException {
BufferedWriter bw = new BufferedWriter(new FileWriter(outFileName + ".cpp"));
bw.write(result.toString());
bw.close();
bw = new BufferedWriter(new FileWriter(outFileName + ".h"));
bw.write(header.toString());
bw.close();
}
private static void process(String inFileName) throws IOException {
BufferedReader reader;
String header = "// auto-generated from" + inFileName + "\r\n" +
"// by enum2string.jar tool\r\n\r\n";
result.append(header);
EnumToString.header.append(header);
boolean isInsideEnum = false;
File f = new File(inFileName);
System.out.println("Reading from " + inFileName);
String simpleFileName = f.getName();
result.append("#include \"main.h\"\r\n");
result.append("#include \"" + simpleFileName + "\"\r\n");
EnumToString.header.append("#include \"" + simpleFileName + "\"\r\n");
reader = new BufferedReader(new FileReader(inFileName));
String line;
while ((line = reader.readLine()) != null) {
line = line.replaceAll("\\s+", "");
if (line.startsWith("typedefenum{")) {
System.out.println("Entering enum");
currentValues.clear();
isInsideEnum = true;
} else if (line.startsWith("}") && line.endsWith(";")) {
isInsideEnum = false;
line = line.substring(1, line.length() - 1);
System.out.println("Ending enum " + line);
result.append(makeCode(line));
EnumToString.header.append(getMethodSignature(line) + ";\r\n");
} else {
line = line.replaceAll("//.+", "");
if (isInsideEnum) {
if (line.matches("[a-zA-Z_$][a-zA-Z\\d_$]*[\\=a-zA-Z\\d_*]*,?")) {
line = line.replace(",", "");
int index = line.indexOf('=');
if (index != -1)
line = line.substring(0, index);
System.out.println("Line " + line);
currentValues.add(line);
}
}
}
}
}
private static String makeCode(String enumName) {
StringBuilder sb = new StringBuilder();
sb.append(getMethodSignature(enumName) + "{\r\n");
sb.append("switch(value) {\r\n");
for (String e : currentValues) {
sb.append("case " + e + ":\r\n");
sb.append(" return \"" + e + "\";\r\n");
}
sb.append(" }\r\n");
sb.append(" return NULL;\r\n");
sb.append("}\r\n");
return sb.toString();
}
private static String getMethodSignature(String enumName) {
return "const char *get" + capitalize(enumName) + "(" + enumName + " value)";
}
private static String capitalize(String enumName) {
return Character.toUpperCase(enumName.charAt(0)) + enumName.substring(1);
}
}

View File

@ -0,0 +1,9 @@
package com.rusefi;
/**
* (c) Andrey Belomutskiy
* 10/6/14
*/
public enum State {
ENUM
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
package com.rusefi.pcb;
import java.util.List;
/**
* (c) Andrey Belomutskiy
* 5/30/2014
*/
public class AddNetNode extends PcbNode {
public AddNetNode(String nodeName, int i, List<Object> children) {
super(nodeName, i, children);
}
}

View File

@ -0,0 +1,31 @@
package com.rusefi.pcb.test;
import com.rusefi.pcb.PointNode;
import junit.framework.Assert;
import org.junit.Test;
/**
* (c) Andrey Belomutskiy
* 5/28/2014
*/
public class PointNodeTest {
private static final double EPS = 0.0000001;
@Test
public void testTurn() {
PointNode x10y50 = new PointNode(10, 50);
PointNode angle270 = new PointNode(0, 0, 270);
Assert.assertEquals("270 x", angle270.translate(x10y50).x, 50.0, EPS);
Assert.assertEquals(angle270.translate(x10y50).y, -10.0, EPS);
PointNode angle180 = new PointNode(0, 0, 180);
Assert.assertEquals("180 x", angle180.translate(x10y50).x, -10.0, EPS);
Assert.assertEquals("180 y", angle180.translate(x10y50).y, -50.0, EPS);
PointNode angle90 = new PointNode(0, 0, 90);
Assert.assertEquals(angle90.translate(x10y50).x, -50.0, EPS);
Assert.assertEquals(angle90.translate(x10y50).y, 10.0, EPS);
}
}

View File

@ -0,0 +1 @@
serial_tester

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View File

@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="" />
</component>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>

View File

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="jssc">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/jssc.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/jssc-2.6.0-src.jar!/src" />
</SOURCES>
</library>
</component>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="SvnBranchConfigurationManager">
<option name="mySupportsUserInfoFilter" value="true" />
</component>
</project>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/serial_tester.iml" filepath="$PROJECT_DIR$/serial_tester.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,5 @@
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>

View File

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="svn" />
</component>
</project>

View File

@ -0,0 +1,573 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" readonly="true" id="af0c0072-7712-4fdf-bd27-fbcbaee2e3af" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$" />
</list>
<ignored path="serial_tester.iws" />
<ignored path=".idea/workspace.xml" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="DaemonCodeAnalyzer">
<disable_hints />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
<favorites_list name="serial_tester" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="DataListener.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/com/rusefi/io/DataListener.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="255">
<caret line="9" column="0" selection-start-line="9" selection-start-column="0" selection-end-line="9" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="SerialPortReader.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/com/rusefi/io/serial/SerialPortReader.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="799">
<caret line="2" column="0" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="TwoWayTester.java" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/com/rusefi/io/TwoWayTester.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.5872727" vertical-offset="340" max-vertical-offset="1207">
<caret line="39" column="44" selection-start-line="39" selection-start-column="44" selection-end-line="39" selection-end-column="44" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#461#633#0" expanded="true" />
<element signature="e#622#623#0" expanded="true" />
<element signature="e#2039#2040#0" expanded="true" />
<element signature="e#2076#2077#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="SerialPort.java" pinned="false" current="false" current-in-tab="false">
<entry file="jar://$PROJECT_DIR$/lib/jssc-2.6.0-src.jar!/src/jssc/SerialPort.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="5652" max-vertical-offset="21522">
<caret line="372" column="19" selection-start-line="372" selection-start-column="19" selection-end-line="372" selection-end-column="19" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindManager">
<FindUsagesManager>
<setting name="OPEN_NEW_TAB" value="true" />
</FindUsagesManager>
</component>
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
<option value="$PROJECT_DIR$/src/com/rusefi/io/DataListener.java" />
<option value="$PROJECT_DIR$/src/com/rusefi/io/SerialPortReader.java" />
<option value="$PROJECT_DIR$/src/com/rusefi/io/serial/SerialPortReader.java" />
<option value="$PROJECT_DIR$/src/com/rusefi/io/TwoWayTester.java" />
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="-9" />
<option name="y" value="-9" />
<option name="width" value="1698" />
<option name="height" value="1020" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectReloadState">
<option name="STATE" value="0" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
</navigator>
<panes>
<pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="serial_tester" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="serial_tester" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="serial_tester" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="serial_tester" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="serial_tester" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="io" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="serial_tester" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="serial_tester" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="io" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="serial" />
<option name="myItemType" value="com.android.tools.idea.gradle.projectView.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="GoToClass.includeLibraries" value="false" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="MemberChooser.sorted" value="false" />
<property name="MemberChooser.showClasses" value="true" />
<property name="MemberChooser.copyJavadoc" value="false" />
<property name="options.lastSelected" value="project.propVCSSupport.Mappings" />
<property name="options.splitter.main.proportions" value="0.3" />
<property name="options.splitter.details.proportions" value="0.2" />
<property name="options.searchVisible" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/lib/jssc.jar!/" />
<property name="project.structure.last.edited" value="Libraries" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.0" />
<property name="LayoutCode.rearrangeEntriesJava" value="false" />
<property name="recentsLimit" value="5" />
<property name="dynamic.classpath" value="false" />
</component>
<component name="RecentsManager">
<key name="MoveClassesOrPackagesDialog.RECENTS_KEY">
<recent name="com.rusefi.io.serial" />
</key>
</component>
<component name="RunManager" selected="Application.TwoWayTester">
<configuration default="false" name="TwoWayTester" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="com.rusefi.io.TwoWayTester" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="serial_tester" />
<envs />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<method />
</configuration>
<configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
<module name="" />
<option name="TESTING_TYPE" value="0" />
<option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
<option name="METHOD_NAME" value="" />
<option name="CLASS_NAME" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="TARGET_SELECTION_MODE" value="EMULATOR" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<option name="USE_COMMAND_LINE" value="true" />
<option name="COMMAND_LINE" value="" />
<option name="WIPE_USER_DATA" value="false" />
<option name="DISABLE_BOOT_ANIMATION" value="false" />
<option name="NETWORK_SPEED" value="full" />
<option name="NETWORK_LATENCY" value="none" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="FILTER_LOGCAT_AUTOMATICALLY" value="true" />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method />
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<module name="" />
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<method />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application">
<module name="" />
<option name="ACTIVITY_CLASS" value="" />
<option name="MODE" value="default_activity" />
<option name="DEPLOY" value="true" />
<option name="ARTIFACT_NAME" value="" />
<option name="TARGET_SELECTION_MODE" value="EMULATOR" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<option name="USE_COMMAND_LINE" value="true" />
<option name="COMMAND_LINE" value="" />
<option name="WIPE_USER_DATA" value="false" />
<option name="DISABLE_BOOT_ANIMATION" value="false" />
<option name="NETWORK_SPEED" value="full" />
<option name="NETWORK_LATENCY" value="none" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="FILTER_LOGCAT_AUTOMATICALLY" value="true" />
<method />
</configuration>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="Application.TwoWayTester" />
</list>
<recent_temporary>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="Application.TwoWayTester" />
</list>
</recent_temporary>
<configuration name="&lt;template&gt;" type="WebApp" default="true" selected="false">
<Host>localhost</Host>
<Port>5050</Port>
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false" />
<component name="SvnConfiguration" cleanupOnStartRun="true">
<configuration>C:\Users\pc\AppData\Roaming\Subversion</configuration>
<supportedVersion>125</supportedVersion>
</component>
<component name="SvnFileUrlMappingImpl">
<option name="myMappingRoots">
<list>
<SvnCopyRootSimple>
<option name="myVcsRoot" value="C:\stuff\rusefi_sourceforge\java_tools\serial_tester" />
<option name="myCopyRoot" value="C:\stuff\rusefi_sourceforge\java_tools\serial_tester" />
</SvnCopyRootSimple>
</list>
</option>
<option name="myMoreRealMappingRoots">
<list>
<SvnCopyRootSimple>
<option name="myVcsRoot" value="C:\stuff\rusefi_sourceforge\java_tools\serial_tester" />
<option name="myCopyRoot" value="C:\stuff\rusefi_sourceforge\java_tools\serial_tester" />
</SvnCopyRootSimple>
</list>
</option>
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="af0c0072-7712-4fdf-bd27-fbcbaee2e3af" name="Default" comment="" />
<created>1403223601980</created>
<updated>1403223601980</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="-9" y="-9" width="1698" height="1020" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32988507" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32988507" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
<option name="myTodoPanelSettings">
<TodoPanelSettings />
</option>
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/com/rusefi/io/DataListener.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="255">
<caret line="9" column="0" selection-start-line="9" selection-start-column="0" selection-end-line="9" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/rusefi/io/serial/SerialPortReader.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="799">
<caret line="2" column="0" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/lib/jssc-2.6.0-src.jar!/src/jssc/SerialPort.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="5652" max-vertical-offset="21522">
<caret line="372" column="19" selection-start-line="372" selection-start-column="19" selection-end-line="372" selection-end-column="19" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/rusefi/io/TwoWayTester.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.5872727" vertical-offset="340" max-vertical-offset="1207">
<caret line="39" column="44" selection-start-line="39" selection-start-column="44" selection-end-line="39" selection-end-column="44" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#461#633#0" expanded="true" />
<element signature="e#622#623#0" expanded="true" />
<element signature="e#2039#2040#0" expanded="true" />
<element signature="e#2076#2077#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ArtifactsStructureConfigurable.UI">
<settings>
<artifact-editor />
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="FacetStructureConfigurable.UI">
<settings>
<last-edited>No facets are configured</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>1.7</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ModuleStructureConfigurable.UI">
<settings>
<last-edited>serial_tester</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<last-edited>jssc</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="jssc" level="project" />
</component>
</module>

View File

@ -0,0 +1,9 @@
package com.rusefi.io;
/**
* @author Andrey Belomutskiy
* 3/3/14
*/
public interface DataListener {
void onStringArrived(String string);
}

View File

@ -0,0 +1,88 @@
package com.rusefi.io;
import com.rusefi.io.serial.SerialPortReader;
import jssc.SerialPort;
import jssc.SerialPortException;
public class TwoWayTester {
// private static final int BAUD_RATE = 38400;
private static final int BAUD_RATE = 115200;
public static final String TEST_LINE = "a0123456789b0123456789c0123456789d0123456789e0123456789f0123456789g0123456789h0123456789d0123456789";
// public static final String TEST_LINE = "a0123456789b0123456789";
public static final DataListener VOID = new DataListener() {
@Override
public void onStringArrived(String string) {
// nothing is expected to arrive
}
};
public static void main(String[] args) throws SerialPortException, InterruptedException {
if(args.length<1) {
System.out.println("Parameter expected");
}
String port1 = args[0];
String port2 = "COM25";
DataListener listener = new DataListener() {
int counter;
StringBuffer sb = new StringBuffer();
@Override
public void onStringArrived(String string) {
sb.append(string);
if (sb.length() < TEST_LINE.length()) {
logLine("Partial");
return;
}
String l = sb.substring(0, TEST_LINE.length());
if (!l.equalsIgnoreCase(TEST_LINE)) {
logLine("WOW " + l);
logLine("not " + TEST_LINE);
int index = sb.indexOf(TEST_LINE.charAt(0) + "", 1);
if (index != -1)
sb.delete(0, index);
} else {
logLine("Ok " + counter++);
sb.delete(0, TEST_LINE.length());
}
}
};
//SerialPort in = open(port2, listener);
SerialPort out = open(port1, listener);
while (true) {
out.writeString(TEST_LINE);
//Thread.sleep(50);
}
}
public static SerialPort open(String port, DataListener listener) throws SerialPortException {
SerialPort serialPort = new SerialPort(port);
logLine("Opening " + port + " @ " + BAUD_RATE);
boolean opened = serialPort.openPort();//Open serial port
if (!opened)
logLine("not opened");
serialPort.setParams(BAUD_RATE, 8, 1, 0);//Set params.
int mask = SerialPort.MASK_RXCHAR;
//Set the prepared mask
serialPort.setEventsMask(mask);
serialPort.addEventListener(new SerialPortReader(serialPort, listener));
return serialPort;
}
private static void logLine(String s) {
System.out.println(s);
}
}

View File

@ -0,0 +1,41 @@
package com.rusefi.io.serial;
import com.rusefi.io.DataListener;
import jssc.SerialPort;
import jssc.SerialPortEvent;
import jssc.SerialPortEventListener;
import jssc.SerialPortException;
/**
* Date: 12/25/12
* (c) Andrey Belomutskiy
*/
public class SerialPortReader implements SerialPortEventListener {
private SerialPort serialPort;
private DataListener listener;
public SerialPortReader(SerialPort serialPort, DataListener listener) {
this.serialPort = serialPort;
this.listener = listener;
}
public void serialEvent(SerialPortEvent spe) {
if (spe.isRXCHAR() || spe.isRXFLAG()) {
try {
handleRx(spe);
} catch (SerialPortException e) {
e.printStackTrace(System.err);
}
}
}
private void handleRx(SerialPortEvent spe) throws SerialPortException {
if (spe.getEventValue() > 0) {
byte[] buffer = serialPort.readBytes(spe.getEventValue());
String str = new String(buffer);
listener.onStringArrived(str);
// System.out.println("arrived [" + str + "]");
}
}
}

BIN
java_tools/ts2c.jar Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
ts2c

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<buildFile url="file://$PROJECT_DIR$/build.xml" />
</component>
</project>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View File

@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="" />
</component>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="SvnBranchConfigurationManager">
<option name="mySupportsUserInfoFilter" value="true" />
</component>
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/ts2c.iml" filepath="$PROJECT_DIR$/ts2c.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,22 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="TS2C ignitionTable" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="com.rusefi.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="MAIN_CLASS_NAME" value="com.rusefi.TS2C" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="currenttune.msq ignitionLoadBins ignitionRpmBins ignitionTable" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="ts2c" />
<envs />
<method />
</configuration>
</component>

View File

@ -0,0 +1,22 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="TS2C veTable" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="com.rusefi.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="MAIN_CLASS_NAME" value="com.rusefi.TS2C" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="currenttune.msq veLoadBins veRpmBins veTable" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="ts2c" />
<envs />
<method />
</configuration>
</component>

View File

@ -0,0 +1,5 @@
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="svn" />
</component>
</project>

View File

@ -0,0 +1,424 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" readonly="true" id="5a651876-ad8f-4169-b8d4-7242b22c8ad3" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/runConfigurations" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/runConfigurations/TS2C.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/com/rusefi/TS2C.java" afterPath="$PROJECT_DIR$/src/com/rusefi/TS2C.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
</list>
<ignored path="ts2c.iws" />
<ignored path=".idea/workspace.xml" />
<ignored path="$PROJECT_DIR$/out/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
<favorites_list name="ts2c" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="TS2C.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/com/rusefi/TS2C.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="29" column="78" selection-start-line="29" selection-start-column="34" selection-end-line="29" selection-end-column="78" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="GradleLocalSettings">
<option name="externalProjectsViewState">
<projects_view />
</option>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/src/com/rusefi/TS2C.java" />
</list>
</option>
</component>
<component name="NamedScopeManager">
<order />
</component>
<component name="ProjectFrameBounds">
<option name="x" value="-9" />
<option name="y" value="-9" />
<option name="width" value="1458" />
<option name="height" value="870" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
</navigator>
<panes>
<pane id="PackagesPane" />
<pane id="Scratches" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="ts2c" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="ts2c" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="ts2c" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="ts2c" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="ts2c" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="rusefi" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="GoToClass.includeLibraries" value="false" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="MemberChooser.sorted" value="false" />
<property name="MemberChooser.showClasses" value="true" />
<property name="MemberChooser.copyJavadoc" value="false" />
<property name="FullScreen" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="recentsLimit" value="5" />
<property name="restartRequiresConfirmation" value="true" />
<property name="dynamic.classpath" value="false" />
</component>
<component name="RunManager" selected="Application.TS2C">
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<method />
</configuration>
<configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application">
<module name="" />
<option name="ACTIVITY_CLASS" value="" />
<option name="MODE" value="default_activity" />
<option name="DEPLOY" value="true" />
<option name="ARTIFACT_NAME" value="" />
<option name="TARGET_SELECTION_MODE" value="EMULATOR" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<option name="USE_COMMAND_LINE" value="true" />
<option name="COMMAND_LINE" value="" />
<option name="WIPE_USER_DATA" value="false" />
<option name="DISABLE_BOOT_ANIMATION" value="false" />
<option name="NETWORK_SPEED" value="full" />
<option name="NETWORK_LATENCY" value="none" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="FILTER_LOGCAT_AUTOMATICALLY" value="true" />
<method />
</configuration>
<configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
<module name="" />
<option name="TESTING_TYPE" value="0" />
<option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
<option name="METHOD_NAME" value="" />
<option name="CLASS_NAME" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="TARGET_SELECTION_MODE" value="EMULATOR" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<option name="USE_COMMAND_LINE" value="true" />
<option name="COMMAND_LINE" value="" />
<option name="WIPE_USER_DATA" value="false" />
<option name="DISABLE_BOOT_ANIMATION" value="false" />
<option name="NETWORK_SPEED" value="full" />
<option name="NETWORK_LATENCY" value="none" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="FILTER_LOGCAT_AUTOMATICALLY" value="true" />
<method />
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<module />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<method />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list />
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<method />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="JarApplication" factoryName="JAR Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<envs />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="Application.TS2C" />
</list>
</component>
<component name="ShelveChangesManager" show_recycled="false" />
<component name="SvnConfiguration" cleanupOnStartRun="true">
<configuration>C:\Users\user\AppData\Roaming\Subversion</configuration>
<supportedVersion>125</supportedVersion>
</component>
<component name="SvnFileUrlMappingImpl">
<option name="myMappingRoots">
<list>
<SvnCopyRootSimple>
<option name="myVcsRoot" value="C:\stuff\rusefi_sourceforge\java_tools\ts2c" />
<option name="myCopyRoot" value="C:\stuff\rusefi_sourceforge\java_tools\ts2c" />
</SvnCopyRootSimple>
<SvnCopyRootSimple>
<option name="myVcsRoot" value="C:\stuff\rusefi_sourceforge\java_tools\ts2c\.idea" />
<option name="myCopyRoot" value="C:\stuff\rusefi_sourceforge\java_tools\ts2c\.idea" />
</SvnCopyRootSimple>
</list>
</option>
<option name="myMoreRealMappingRoots">
<list>
<SvnCopyRootSimple>
<option name="myVcsRoot" value="C:\stuff\rusefi_sourceforge\java_tools\ts2c" />
<option name="myCopyRoot" value="C:\stuff\rusefi_sourceforge\java_tools\ts2c" />
</SvnCopyRootSimple>
</list>
</option>
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="5a651876-ad8f-4169-b8d4-7242b22c8ad3" name="Default" comment="" />
<created>1419656802510</created>
<option name="number" value="Default" />
<updated>1419656802510</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="-9" y="-9" width="1458" height="870" extended-state="0" />
<editor active="false" />
<layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.62083334" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32916668" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
<watches-manager />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
<buildFile url="file://$PROJECT_DIR$/build.xml">
<targetFilters>
<filter targetName="clean" isVisible="false" />
<filter targetName="compile" isVisible="false" />
<filter targetName="jar" isVisible="false" />
</targetFilters>
<expanded value="true" />
</buildFile>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/com/rusefi/TS2C.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/rusefi/TS2C.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/com/rusefi/TS2C.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="29" column="78" selection-start-line="29" selection-start-column="34" selection-end-line="29" selection-end-column="78" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>

24
java_tools/ts2c/build.xml Normal file
View File

@ -0,0 +1,24 @@
<project default="jar">
<target name="clean">
<delete dir="build"/>
</target>
<target name="compile">
<mkdir dir="build/classes"/>
<javac destdir="build/classes" classpath="lib/junit.jar:lib/annotations.jar">
<src path="src"/>
</javac>
</target>
<target name="jar" depends="compile">
<mkdir dir="build/jar"/>
<jar destfile="../ts2c.jar" basedir="build/classes">
<manifest>
<attribute name="Main-Class" value="com.rusefi.TS2C"/>
</manifest>
<zipfileset dir="build/classes" includes="**/*.class"/>
</jar>
</target>
</project>

53
java_tools/ts2c/input.txt Normal file
View File

@ -0,0 +1,53 @@
0.0
6.6599731
13.3299561
20.0
26.6599121
33.3300781
40.0
46.6601563
53.3300781
60.0
66.6601563
73.3300781
80.0
86.6601563
93.3300781
100.0
800.0
1213.328125
1626.65625
2040.0
2453.34375
2866.65625
3280.0
3693.34375
4106.6875
4520.0
4933.3125
5346.6875
5760.0
6173.3125
6586.6875
7000.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0
12.0 12.0 12.0 26.0 29.0 31.0 31.0 38.0 40.0 40.0 40.0 42.0 42.0 42.0 42.0 42.0

View File

@ -0,0 +1,104 @@
package com.rusefi;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Andrey Belomutskiy, (c) 2012-2015
* 6/29/2015
*/
public class OBD2C {
// 1 Psi = 6.89475729 Kilopascals
static double PSI_2_KPA = 6.89475729;
static int RPM_COUNT = 16;
static int LOAD_COUNT = 16;
static Bucket[][] buckets = new Bucket[RPM_COUNT][LOAD_COUNT];
public static void main(String[] args) throws IOException {
for (int rpmIndex = 0; rpmIndex < RPM_COUNT; rpmIndex++)
for (int loadIndex = 0; loadIndex < LOAD_COUNT; loadIndex++) {
buckets[rpmIndex][loadIndex] = new Bucket();
}
fillLoadBins(TS2C.loadBins);
loadRpmBins(TS2C.rpmBins);
String fileName = "datalog.csv";
BufferedReader reader = new BufferedReader(new FileReader(fileName));
String line;
while ((line = reader.readLine()) != null)
processLine(line);
BufferedWriter w = new BufferedWriter(new FileWriter("output.c"));
TS2C.writeTable(w, new TS2C.ValueSource() {
@Override
public float getValue(int loadIndex, int rpmIndex) {
return buckets[rpmIndex][loadIndex].getValue();
}
}, "OBD2C");
}
private static void loadRpmBins(float[] rpmBins) {
for (int i =0;i< rpmBins.length;i++) {
rpmBins[i] = 800 + (7000 - 800) * i / (rpmBins.length - 1);
}
System.out.println("rpm bins: " + Arrays.toString(rpmBins));
}
private static void fillLoadBins(float[] loadBins) {
for (int i = 0; i < loadBins.length; i++)
loadBins[i] = (float) (100.0 * i / (loadBins.length - 1));
System.out.println("load bins: " + Arrays.toString(loadBins));
}
private static void processLine(String line) {
String[] values = line.split(",");
double map = Double.parseDouble(values[1]) * PSI_2_KPA;
double advance = Double.parseDouble(values[3]);
double rpm = Double.parseDouble(values[5]);
System.out.println("map=" + map + ", advance=" + advance + ", rpm=" + rpm);
int rpmIndex = (int) ((rpm - 800) / ((7000 - 800) / 16));
int loadIndex = (int) (map / (100 / 16));
if (rpmIndex >= RPM_COUNT)
rpmIndex = RPM_COUNT - 1;
if (loadIndex >= LOAD_COUNT)
loadIndex = LOAD_COUNT - 1;
System.out.println("rpm index: " + rpmIndex + ", loadIndex=" + loadIndex);
buckets[rpmIndex][loadIndex].addValue(advance);
}
static class Bucket {
List<Double> values = new ArrayList<Double>();
public void addValue(double advance) {
values.add(advance);
}
public float getValue() {
if (values.isEmpty())
return -100;
double total = 0;
for (double v : values)
total += v;
return (float) (total / values.size());
}
}
}

11
java_tools/ts2c/ts2c.iml Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>