This commit is contained in:
rusefi 2014-04-22 17:15:49 -05:00
parent 30956bf9ea
commit 70cfbbe538
239 changed files with 13931 additions and 0 deletions

1
java_console/.idea/.name Normal file
View File

@ -0,0 +1 @@
java_console

View File

@ -0,0 +1,7 @@
<?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,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="?*.properties" />
<entry name="?*.xml" />
<entry name="?*.gif" />
<entry name="?*.png" />
<entry name="?*.jpeg" />
<entry name="?*.jpg" />
<entry name="?*.html" />
<entry name="?*.dtd" />
<entry name="?*.tld" />
<entry name="?*.ftl" />
</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,7 @@
<component name="ProjectDictionaryState">
<dictionary name="andrey">
<words>
<w>belomutskiy</w>
</words>
</dictionary>
</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,13 @@
<component name="libraryTable">
<library name="SteelSeries">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/SteelSeries-3.9.30.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/trident-6.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/SteelSeries-Swing-master.zip!/SteelSeries-Swing-master/src/test/java" />
<root url="jar://$PROJECT_DIR$/lib/SteelSeries-Swing-master.zip!/SteelSeries-Swing-master/src/main/java" />
</SOURCES>
</library>
</component>

View File

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

View File

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="batik">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/batik" />
<root url="file://$PROJECT_DIR$/lib/batik" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://$PROJECT_DIR$/lib/batik" recursive="false" />
</library>
</component>

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,11 @@
<component name="libraryTable">
<library name="junit">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/junit.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/junit-src.jar!/" />
</SOURCES>
</library>
</component>

View File

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

View File

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

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectResources">
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
</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="myConfigurationMap">
<map>
<entry key="$PROJECT_DIR$">
<value>
<SvnBranchConfiguration>
<option name="trunkUrl" value="https://subversion.assembla.com/svn/rusefi/trunk/java_console" />
</SvnBranchConfiguration>
</value>
</entry>
</map>
</option>
<option name="mySupportsUserInfoFilter" value="true" />
</component>
</project>

View File

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

View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="AutoTest" type="Application" factoryName="Application" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="com.rusefi.AutoTest" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<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="autotest" />
<envs />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@ -0,0 +1,27 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Launcher" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="com.irnems.Launcher" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<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="ui" />
<envs />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile ">
<option name="myExternalizedOptions" value="&#13;&#10;additional-options2=onexit\=snapshot&#13;&#10;" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Launcher 29001" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="com.irnems.Launcher" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="29001" />
<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="ui" />
<envs />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@ -0,0 +1,27 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Launcher COM10" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="com.irnems.Launcher" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="COM10" />
<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="ui" />
<envs />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile ">
<option name="myExternalizedOptions" value="&#13;&#10;additional-options2=onexit\=snapshot&#13;&#10;" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@ -0,0 +1,27 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Launcher COM11" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="com.irnems.Launcher" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="COM11" />
<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="ui" />
<envs />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile ">
<option name="myExternalizedOptions" value="&#13;&#10;additional-options2=onexit\=snapshot&#13;&#10;" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@ -0,0 +1,22 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Launcher COM7" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="com.irnems.Launcher" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="COM7" />
<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="ui" />
<envs />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<ConfigurationWrapper RunnerId="Debug" />
<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,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,940 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" readonly="true" id="2539dd74-4d25-4ef8-9e8d-c2848cd2c223" name="Default" comment="wave mode control">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/libraries/batik.xml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/ui/src/com/irnems/ui/FuelMap.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/ui/src/com/irnems/ui/Launcher.java" afterPath="$PROJECT_DIR$/ui/src/com/irnems/ui/Launcher.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/ui/ui.iml" afterPath="$PROJECT_DIR$/ui/ui.iml" />
</list>
<list id="6c1ea617-8ce6-4a25-9951-31baa322d436" name="n4" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
</list>
<ignored path="java_console.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>
<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="SUSPEND_POLICY" value="SuspendAll" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="false" />
<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="SUSPEND_POLICY" value="SuspendAll" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="false" />
<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>
<breakpoint_rules />
<ui_properties />
</component>
<component name="FavoritesManager">
<favorites_list name="java_console" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="Launcher.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/ui/src/com/irnems/ui/Launcher.java">
<provider selected="true" editor-type-id="text-editor">
<state line="36" column="41" selection-start="1086" selection-end="1086" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="FuelMap.java" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/ui/src/com/irnems/ui/FuelMap.java">
<provider selected="true" editor-type-id="text-editor">
<state line="34" column="36" selection-start="998" selection-end="998" vertical-scroll-proportion="1.1267056">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="AdcPanel.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/ui/src/com/irnems/ui/AdcPanel.java">
<provider selected="true" editor-type-id="text-editor">
<state line="37" column="43" selection-start="1153" selection-end="1167" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="JSurfacePanel.java" pinned="false" current="false" current-in-tab="false">
<entry file="jar://$PROJECT_DIR$/lib/surfaceplotter-2.0.1-sources.jar!/net/ericaro/surfaceplotter/JSurfacePanel.java">
<provider selected="true" editor-type-id="text-editor">
<state line="235" column="0" selection-start="5091" selection-end="5091" vertical-scroll-proportion="0.0">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="JSurface.java" pinned="false" current="false" current-in-tab="false">
<entry file="jar://$PROJECT_DIR$/lib/surfaceplotter-2.0.1-sources.jar!/net/ericaro/surfaceplotter/surface/JSurface.java">
<provider selected="true" editor-type-id="text-editor">
<state line="116" column="11" selection-start="5208" selection-end="5208" vertical-scroll-proportion="0.0">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="SurfaceModel.java" pinned="false" current="false" current-in-tab="false">
<entry file="jar://$PROJECT_DIR$/lib/surfaceplotter-2.0.1-sources.jar!/net/ericaro/surfaceplotter/surface/SurfaceModel.java">
<provider selected="true" editor-type-id="text-editor">
<state line="36" column="17" selection-start="2532" selection-end="2532" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="DefaultSurfaceModel.java" pinned="false" current="false" current-in-tab="false">
<entry file="jar://$PROJECT_DIR$/lib/surfaceplotter-2.0.1-sources.jar!/net/ericaro/surfaceplotter/DefaultSurfaceModel.java">
<provider selected="true" editor-type-id="text-editor">
<state line="15" column="81" selection-start="533" selection-end="533" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="WaveInfoPanel.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/ui/src/com/irnems/ui/WaveInfoPanel.java">
<provider selected="true" editor-type-id="text-editor">
<state line="35" column="30" selection-start="1037" selection-end="1037" vertical-scroll-proportion="0.0">
<folding>
<element signature="imports" 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-0.9-source.jar!/src/jssc/SerialPort.java">
<provider selected="true" editor-type-id="text-editor">
<state line="361" column="87" selection-start="12593" selection-end="12593" vertical-scroll-proportion="0.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$/io/src/com/irnems/SerialPortReader.java">
<provider selected="true" editor-type-id="text-editor">
<state line="35" column="4" selection-start="1044" selection-end="1044" vertical-scroll-proportion="0.0">
<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$/io/src/com/irnems/T2.java" />
<option value="$PROJECT_DIR$/io/src/com/irnems/Test.java" />
<option value="$PROJECT_DIR$/ui/src/com/irnems/ui/ResponseBuffer.java" />
<option value="$PROJECT_DIR$/io/src/com/irnems/SerialPortReader.java" />
<option value="$PROJECT_DIR$/ui/src/com/irnems/ui/RpmModel.java" />
<option value="$PROJECT_DIR$/ui/src/com/irnems/ui/test/RpmModelTest.java" />
<option value="$PROJECT_DIR$/ui/src/com/irnems/ui/SerialIO.java" />
<option value="$PROJECT_DIR$/ui/src/com/irnems/ui/AdcModel.java" />
<option value="$PROJECT_DIR$/ui/src/com/irnems/ui/AdcPanel.java" />
<option value="$PROJECT_DIR$/ui/src/com/irnems/ui/BooleanInputsModel.java" />
<option value="$PROJECT_DIR$/ui/src/com/irnems/ui/EngineState.java" />
<option value="$PROJECT_DIR$/ui/src/com/irnems/ui/RpmPanel.java" />
<option value="$PROJECT_DIR$/ui/src/com/irnems/ui/WaveInfoPanel.java" />
<option value="$PROJECT_DIR$/ui/src/com/irnems/ui/Launcher.java" />
<option value="$PROJECT_DIR$/ui/src/com/irnems/ui/FuelMap.java" />
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="-4" />
<option name="y" value="-4" />
<option name="width" value="1408" />
<option name="height" value="998" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
<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="PackagesPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="java_console" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewProjectNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="java_console" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="java_console" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="ui" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="java_console" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="ui" />
<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="ui" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="java_console" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="io" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="java_console" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="io" />
<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="irnems" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="Scope">
<subPane subId="Project Files">
<PATH>
<PATH_ELEMENT USER_OBJECT="Root">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="project.structure.last.edited" value="Libraries" />
<property name="OverrideImplement.combined" value="true" />
<property name="project.structure.proportion" value="0.15" />
<property name="options.splitter.main.proportions" value="0.3" />
<property name="recentsLimit" value="5" />
<property name="MemberChooser.sorted" value="false" />
<property name="options.lastSelected" value="fileTemplates" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="MemberChooser.copyJavadoc" value="false" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="MemberChooser.showClasses" value="true" />
<property name="GoToClass.includeLibraries" value="false" />
<property name="dynamic.classpath" value="false" />
<property name="options.splitter.details.proportions" value="0.2" />
<property name="options.searchVisible" value="true" />
</component>
<component name="RecentsManager">
<key name="MoveMembersDialog.RECENTS_KEY">
<recent name="com.irnems.ui.SerialIO" />
<recent name="com.irnems.ui.AdcModel" />
</key>
<key name="CreateClassDialog.RecentsKey">
<recent name="com.irnems.ui" />
</key>
</component>
<component name="RunManager" selected="Application.Launcher">
<configuration default="false" name="Test" type="Application" factoryName="Application" temporary="true">
<option name="MAIN_CLASS_NAME" value="com.irnems.Test" />
<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="io" />
<envs />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="false" name="Launcher" type="Application" factoryName="Application" temporary="true">
<option name="MAIN_CLASS_NAME" value="com.irnems.ui.Launcher" />
<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="ui" />
<envs />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="false" name="RpmModelTest.testRpmSmoothing" type="JUnit" factoryName="JUnit" temporary="true">
<module name="ui" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="com.irnems.ui.test" />
<option name="MAIN_CLASS_NAME" value="com.irnems.ui.test.RpmModelTest" />
<option name="METHOD_NAME" value="testRpmSmoothing" />
<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>
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m" />
<option name="PROGRAM_PARAMETERS" />
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</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>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Maven.BeforeRunTask" enabled="false" />
</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>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</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>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</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>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</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>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<list size="3">
<item index="0" class="java.lang.String" itemvalue="Application.Test" />
<item index="1" class="java.lang.String" itemvalue="Application.Launcher" />
<item index="2" class="java.lang.String" itemvalue="JUnit.RpmModelTest.testRpmSmoothing" />
</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">
<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="DETECT_NESTED_COPIES" value="true" />
<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:\Documents and Settings\andrey\Application Data\Subversion</configuration>
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
<supportedVersion>125</supportedVersion>
</component>
<component name="SvnFileUrlMappingImpl">
<option name="myMappingRoots">
<list>
<SvnCopyRootSimple>
<option name="myVcsRoot" value="C:\stuff\rusefi\java_console" />
<option name="myCopyRoot" value="C:\stuff\rusefi\java_console" />
</SvnCopyRootSimple>
<SvnCopyRootSimple>
<option name="myVcsRoot" value="C:\stuff\rusefi\java_console\.idea" />
<option name="myCopyRoot" value="C:\stuff\rusefi\java_console\.idea" />
</SvnCopyRootSimple>
<SvnCopyRootSimple>
<option name="myVcsRoot" value="C:\stuff\rusefi\java_console\io" />
<option name="myCopyRoot" value="C:\stuff\rusefi\java_console\io" />
</SvnCopyRootSimple>
<SvnCopyRootSimple>
<option name="myVcsRoot" value="C:\stuff\rusefi\java_console\ui" />
<option name="myCopyRoot" value="C:\stuff\rusefi\java_console\ui" />
</SvnCopyRootSimple>
</list>
</option>
<option name="myMoreRealMappingRoots">
<list>
<SvnCopyRootSimple>
<option name="myVcsRoot" value="C:\stuff\rusefi\java_console" />
<option name="myCopyRoot" value="C:\stuff\rusefi\java_console" />
</SvnCopyRootSimple>
</list>
</option>
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="2539dd74-4d25-4ef8-9e8d-c2848cd2c223" name="Default" comment="" />
<changelist id="6c1ea617-8ce6-4a25-9951-31baa322d436" name="n4" comment="" />
<created>1356459468906</created>
<updated>1356459468906</updated>
</task>
<task id="LOCAL-00001" summary="UI initial version">
<created>1356461237109</created>
<updated>1356461237109</updated>
</task>
<task id="LOCAL-00002" summary="RPM is getting closer">
<created>1356490198156</created>
<updated>1356490198156</updated>
</task>
<task id="LOCAL-00004" summary="RPM smoothing">
<created>1356664975109</created>
<updated>1356664975109</updated>
</task>
<task id="LOCAL-00005" summary="adc controls">
<created>1357444107186</created>
<updated>1357444107186</updated>
</task>
<task id="LOCAL-00006" summary="adc controls">
<created>1357445392108</created>
<updated>1357445392108</updated>
</task>
<task id="LOCAL-00007" summary="save adc to file">
<created>1357493181093</created>
<updated>1357493181093</updated>
</task>
<task id="LOCAL-00008" summary="separate tab for ADC controls">
<created>1357574412109</created>
<updated>1357574412109</updated>
</task>
<task id="LOCAL-00009" summary="controlling RPM emulation">
<created>1357583175109</created>
<updated>1357583175109</updated>
</task>
<task id="LOCAL-00010" summary="wave info output">
<created>1357786563484</created>
<updated>1357786563484</updated>
</task>
<task id="LOCAL-00011" summary="baro sensor ADC">
<created>1357824706109</created>
<updated>1357824706109</updated>
</task>
<task id="LOCAL-00012" summary="boolean inputs">
<created>1358190320109</created>
<updated>1358190320109</updated>
</task>
<task id="LOCAL-00013" summary="boolean inputs value names">
<created>1358205975109</created>
<updated>1358205975109</updated>
</task>
<task id="LOCAL-00014" summary="wave mode control">
<created>1358212757093</created>
<updated>1358212757093</updated>
</task>
<option name="localTasksCounter" value="15" />
<servers />
</component>
<component name="ToolWindowManager">
<frame x="-4" y="-4" width="1408" height="998" extended-state="6" />
<editor active="false" />
<layout>
<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="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="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="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3293556" 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="4" 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.398568" 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="7" 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="2" 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.3293556" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.3293556" sideWeight="0.5" order="7" 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.2422452" sideWeight="0.27326968" 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="3" 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.2422452" sideWeight="0.3890215" 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.3293556" 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="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="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="5" 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="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
<option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_NEW_TODO" value="false" />
<option name="myTodoPanelSettings">
<value>
<are-packages-shown value="false" />
<are-modules-shown value="false" />
<flatten-packages value="false" />
<is-autoscroll-to-source value="false" />
</value>
</option>
<option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
<option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
<option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
<option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
<option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
<option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
<option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
<option name="ENABLE_BACKGROUND_PROCESSES" value="false" />
<option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
<option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
<option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
<option name="DEFAULT_PATCH_EXTENSION" value="patch" />
<option name="SHORT_DIFF_HORISONTALLY" value="true" />
<option name="SHORT_DIFF_EXTRA_LINES" value="2" />
<option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
<option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
<option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
<option name="CREATE_PATCH_EXPAND_DETAILS_DEFAULT" value="true" />
<option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
<option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
<option name="LAST_COMMIT_MESSAGE" value="wave mode control" />
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
<option name="ACTIVE_VCS_NAME" />
<option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
<option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
<option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
<option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
<MESSAGE value="UI initial version" />
<MESSAGE value="RPM is getting closer" />
<MESSAGE value="RPM smoothing" />
<MESSAGE value="adc controls" />
<MESSAGE value="save adc to file" />
<MESSAGE value="separate tab for ADC controls" />
<MESSAGE value="controlling RPM emulation" />
<MESSAGE value="wave info output" />
<MESSAGE value="baro sensor ADC" />
<MESSAGE value="boolean inputs" />
<MESSAGE value="boolean inputs value names" />
<MESSAGE value="wave mode control" />
</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$/ui/src/com/irnems/ui/RpmPanel.java">
<provider selected="true" editor-type-id="text-editor">
<state line="59" column="53" selection-start="2070" selection-end="2115" vertical-scroll-proportion="0.0" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ui/src/com/irnems/ui/AdcModel.java">
<provider selected="true" editor-type-id="text-editor">
<state line="46" column="22" selection-start="1268" selection-end="1268" vertical-scroll-proportion="0.0" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ui/src/com/irnems/ui/BooleanInputsModel.java">
<provider selected="true" editor-type-id="text-editor">
<state line="33" column="37" selection-start="1081" selection-end="1081" vertical-scroll-proportion="0.0" />
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/lib/jssc-0.9-source.jar!/src/jssc/SerialPort.java">
<provider selected="true" editor-type-id="text-editor">
<state line="361" column="87" selection-start="12593" selection-end="12593" vertical-scroll-proportion="0.0" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/io/src/com/irnems/SerialPortReader.java">
<provider selected="true" editor-type-id="text-editor">
<state line="35" column="4" selection-start="1044" selection-end="1044" vertical-scroll-proportion="0.0" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ui/src/com/irnems/ui/WaveInfoPanel.java">
<provider selected="true" editor-type-id="text-editor">
<state line="35" column="30" selection-start="1037" selection-end="1037" vertical-scroll-proportion="0.0">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/lib/surfaceplotter-2.0.1.jar!/net/ericaro/surfaceplotter/JSurfacePanel.class">
<provider selected="true" editor-type-id="text-editor">
<state line="18" column="68" selection-start="903" selection-end="903" vertical-scroll-proportion="-10.52">
<folding />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/lib/surfaceplotter-2.0.1.jar!/net/ericaro/surfaceplotter/surface/SurfaceModel.class">
<provider selected="true" editor-type-id="text-editor">
<state line="5" column="17" selection-start="176" selection-end="176" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/lib/surfaceplotter-2.0.1-sources.jar!/net/ericaro/surfaceplotter/DefaultSurfaceModel.java">
<provider selected="true" editor-type-id="text-editor">
<state line="15" column="81" selection-start="533" selection-end="533" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/lib/surfaceplotter-2.0.1-sources.jar!/net/ericaro/surfaceplotter/surface/SurfaceModel.java">
<provider selected="true" editor-type-id="text-editor">
<state line="36" column="17" selection-start="2532" selection-end="2532" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/lib/surfaceplotter-2.0.1-sources.jar!/net/ericaro/surfaceplotter/surface/JSurface.java">
<provider selected="true" editor-type-id="text-editor">
<state line="116" column="11" selection-start="5208" selection-end="5208" vertical-scroll-proportion="0.0">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://C:/Program Files/Java/jdk1.7.0_07/src.zip!/java/awt/event/ActionListener.java">
<provider selected="true" editor-type-id="text-editor">
<state line="49" column="16" selection-start="975" selection-end="975" vertical-scroll-proportion="0.7017544">
<folding />
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/lib/surfaceplotter-2.0.1-sources.jar!/net/ericaro/surfaceplotter/JSurfacePanel.java">
<provider selected="true" editor-type-id="text-editor">
<state line="235" column="0" selection-start="5091" selection-end="5091" vertical-scroll-proportion="0.0">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ui/src/com/irnems/ui/AdcPanel.java">
<provider selected="true" editor-type-id="text-editor">
<state line="37" column="43" selection-start="1153" selection-end="1167" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ui/src/com/irnems/ui/Launcher.java">
<provider selected="true" editor-type-id="text-editor">
<state line="36" column="41" selection-start="1086" selection-end="1086" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ui/src/com/irnems/ui/FuelMap.java">
<provider selected="true" editor-type-id="text-editor">
<state line="34" column="36" selection-start="998" selection-end="998" vertical-scroll-proportion="1.1267056">
<folding>
<element signature="imports" 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>ui</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectJDKs.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="ProjectLibrariesConfigurable.UI">
<settings>
<last-edited>surfaceplotter</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

View File

@ -0,0 +1,14 @@
<?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" module-name="io" />
<orderEntry type="module" module-name="models" />
</component>
</module>

View File

@ -0,0 +1,150 @@
package com.rusefi;
import com.irnems.FileLog;
import com.irnems.core.Sensor;
import com.irnems.core.SensorCentral;
import com.rusefi.io.LinkManager;
import com.rusefi.io.tcp.TcpConnector;
import com.rusefi.waves.RevolutionLog;
import com.rusefi.waves.WaveChart;
import com.rusefi.waves.WaveChartParser;
import com.rusefi.waves.WaveReport;
import java.util.List;
import java.util.concurrent.*;
import static com.rusefi.IoUtil.*;
import static com.rusefi.TestingUtils.assertCloseEnough;
import static com.rusefi.TestingUtils.assertTrue;
import static com.rusefi.waves.WaveReport.isCloseEnough;
/**
* rusEfi firmware simulator functional test suite
* <p/>
* java -cp rusefi_console.jar com.rusefi.AutoTest
*
* @author Andrey Belomutskiy
* 3/5/14
*/
public class AutoTest {
public static void main(String[] args) throws InterruptedException {
FileLog.SIMULATOR_CONSOLE.start();
FileLog.MAIN.start();
try {
runTest();
} finally {
ExecHelper.destroy();
}
FileLog.MAIN.logLine("*******************************************************************************");
FileLog.MAIN.logLine("************************************ Looks good! *****************************");
FileLog.MAIN.logLine("*******************************************************************************");
System.exit(0);
}
private static void runTest() throws InterruptedException {
if (!TcpConnector.getAvailablePorts().isEmpty())
throw new IllegalStateException("Port already binded on startup?");
ExecHelper.startSimulator();
// FileLog.rlog("Waiting for TCP port...");
// for (int i = 0; i < 180; i++) {
// if (!TcpConnector.getAvailablePorts().isEmpty())
// break;
// Thread.sleep(1000);
// }
// if (TcpConnector.getAvailablePorts().isEmpty())
// throw new IllegalStateException("Did we start it?");
// /**
// * If we open a connection just to validate that the process has started, we are getting
// * weird issues with the second - actual connection
// */
// FileLog.rlog("Time for simulator to close the port...");
// Thread.sleep(3000);
//
// FileLog.rlog("Got a TCP port! Connecting...");
LinkManager.start("" + TcpConnector.DEFAULT_PORT);
/**
* TCP connector is blocking
*/
LinkManager.open();
FileLog.rlog("Let's give it some time to start...");
final CountDownLatch startup = new CountDownLatch(1);
SensorCentral.AdcListener listener = new SensorCentral.AdcListener() {
@Override
public void onAdcUpdate(SensorCentral model, double value) {
startup.countDown();
}
};
long waitStart = System.currentTimeMillis();
SensorCentral.getInstance().addListener(Sensor.RPM, listener);
startup.await(5, TimeUnit.SECONDS);
SensorCentral.getInstance().removeListener(Sensor.RPM, listener);
FileLog.MAIN.logLine("Got first signal in " + (System.currentTimeMillis() - waitStart));
mainTestBody();
}
private static void mainTestBody() throws InterruptedException {
changeRpm(500);
changeRpm(2000);
String chartLine = getNextWaveChart();
WaveChart chart = WaveChartParser.unpackToMap(chartLine);
StringBuilder revolutions = chart.get(RevolutionLog.TOP_DEAD_CENTER_MESSAGE);
if (revolutions.length() == 0)
throw new IllegalStateException("Empty revolutions in " + chartLine);
RevolutionLog revolutionLog = RevolutionLog.parseRevolutions(revolutions);
assertWave(chart, revolutionLog, WaveChart.INJECTOR_1, 0.33, 238.75);
assertWave(chart, revolutionLog, WaveChart.INJECTOR_2, 0.33, 53.04);
assertWave(chart, revolutionLog, WaveChart.INJECTOR_3, 0.33, 417.04);
assertWave(chart, revolutionLog, WaveChart.INJECTOR_4, 0.33, 594.04);
assertWave(chart, revolutionLog, WaveChart.SPARK_1, 0.41, 53.05, 238.75, 417.72, 594.84);
}
private static void assertWave(WaveChart chart, RevolutionLog revolutionLog, String key, double width, double... expectedAngles) {
StringBuilder events = chart.get(key);
assertTrue("Events not null for " + key, events != null);
List<WaveReport.UpDown> wr = WaveReport.parse(events.toString());
assertTrue("waves for " + key, !wr.isEmpty());
for (WaveReport.UpDown ud : wr) {
double angleByTime = revolutionLog.getCrankAngleByTime(ud.upTime);
assertCloseEnough("angle for " + key, angleByTime, expectedAngles);
assertCloseEnough("width for " + key, ud.getDutyCycle(revolutionLog), width);
}
}
private static void changeRpm(final int rpm) throws InterruptedException {
sendCommand("rpm " + rpm);
final CountDownLatch rpmLatch = new CountDownLatch(1);
SensorCentral.AdcListener listener = new SensorCentral.AdcListener() {
@Override
public void onAdcUpdate(SensorCentral model, double value) {
double actualRpm = SensorCentral.getInstance().getValue(Sensor.RPM);
if (isCloseEnough(rpm, actualRpm))
rpmLatch.countDown();
}
};
SensorCentral.getInstance().addListener(Sensor.RPM, listener);
rpmLatch.await(5, TimeUnit.SECONDS);
SensorCentral.getInstance().removeListener(Sensor.RPM, listener);
double actualRpm = SensorCentral.getInstance().getValue(Sensor.RPM);
if (!isCloseEnough(rpm, actualRpm))
throw new IllegalStateException("rpm change did not happen");
}
}

View File

@ -0,0 +1,81 @@
package com.rusefi;
import com.irnems.FileLog;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* 3/18/14
* (c) Andrey Belomutskiy
*/
public class ExecHelper {
private static final String SIMULATOR_COMMAND = "../win32_functional_tests/build/rusefi_simulator.exe";
static Process simulatorProcess;
private static void runSimulator() {
Thread.currentThread().setName("Main simulation");
try {
FileLog.rlog("Binary size: " + new File(SIMULATOR_COMMAND).length());
FileLog.rlog("Executing " + SIMULATOR_COMMAND);
ExecHelper.simulatorProcess = Runtime.getRuntime().exec(SIMULATOR_COMMAND);
FileLog.rlog("simulatorProcess: " + ExecHelper.simulatorProcess);
BufferedReader input =
new BufferedReader(new InputStreamReader(ExecHelper.simulatorProcess.getInputStream()));
new Thread(createErrorStreamEcho()).start();
String line;
while ((line = input.readLine()) != null) {
System.out.println("from console: " + line);
FileLog.SIMULATOR_CONSOLE.logLine(line);
}
FileLog.rlog("exitValue: " + simulatorProcess.exitValue());
System.out.println("end of console");
input.close();
} catch (Exception err) {
throw new IllegalStateException(err);
}
}
private static Runnable createErrorStreamEcho() {
return new Runnable() {
@Override
public void run() {
BufferedReader err =
new BufferedReader(new InputStreamReader(ExecHelper.simulatorProcess.getErrorStream()));
String errLine;
try {
while ((errLine = err.readLine()) != null) {
System.out.println("from err: " + errLine);
FileLog.SIMULATOR_CONSOLE.logLine(errLine);
}
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
};
}
static void destroy() {
if (simulatorProcess != null) {
FileLog.rlog("Destroying sub-process...");
simulatorProcess.destroy();
}
}
public static void startSimulator() {
new Thread(new Runnable() {
@Override
public void run() {
runSimulator();
}
}, "simulator process").start();
}
}

View File

@ -0,0 +1,51 @@
package com.rusefi;
import com.irnems.core.EngineState;
import com.rusefi.io.CommandQueue;
import com.rusefi.io.InvocationConfirmationListener;
import com.rusefi.io.LinkManager;
import com.rusefi.waves.WaveReport;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
/**
* @author Andrey Belomutskiy
* 3/19/14.
*/
public class IoUtil {
static void sendCommand(String command) throws InterruptedException {
final CountDownLatch responseLatch = new CountDownLatch(1);
CommandQueue.getInstance().write(command, CommandQueue.DEFAULT_TIMEOUT, new InvocationConfirmationListener() {
@Override
public void onCommandConfirmation() {
responseLatch.countDown();
}
});
responseLatch.await(20, TimeUnit.SECONDS);
}
static String getNextWaveChart() throws InterruptedException {
getWaveChart();
// we want to wait for the 2nd chart to see same same RPM across the whole chart
return getWaveChart();
}
private static String getWaveChart() throws InterruptedException {
final CountDownLatch waveChartLatch = new CountDownLatch(1);
final AtomicReference<String> result = new AtomicReference<String>();
LinkManager.engineState.registerStringValueAction(WaveReport.WAVE_CHART, new EngineState.ValueCallback<String>() {
@Override
public void onUpdate(String value) {
waveChartLatch.countDown();
result.set(value);
}
});
waveChartLatch.await(5, TimeUnit.SECONDS);
LinkManager.engineState.removeAction(WaveReport.WAVE_CHART);
return result.get();
}
}

View File

@ -0,0 +1,29 @@
package com.rusefi;
import java.util.Arrays;
import static com.rusefi.waves.WaveReport.isCloseEnough;
/**
* @author Andrey Belomutskiy
* 3/19/14.
*/
public class TestingUtils {
static void assertTrue(String msg, boolean b) {
if (!b)
throw new IllegalStateException("Not true: " + msg);
}
static void assertCloseEnough(String msg, double current, double... expectations) {
for (double expected : expectations) {
if (isCloseEnough(expected, current))
return;
}
throw new IllegalStateException(msg + ": Got " + current + " while expecting " + Arrays.toString(expectations));
}
static void assertTrue(boolean b) {
if (!b)
throw new IllegalStateException("Not true");
}
}

74
java_console/build.xml Normal file
View File

@ -0,0 +1,74 @@
<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/jssc.jar:lib/SteelSeries-3.9.30.jar:lib/annotations.jar:lib/miglayout-4.0.jar:lib/surfaceplotter-2.0.1.jar">
<src path="autotest/src"/>
<src path="io/src"/>
<src path="models/src"/>
<src path="ui/src"/>
</javac>
<junit fork="no"
maxmemory="512m"
printsummary="yes"
haltonfailure="yes">
<jvmarg value="-ea"/>
<jvmarg value="-XX:+HeapDumpOnOutOfMemoryError"/>
<formatter type="brief"/>
<classpath path="build/classes:lib/junit.jar:lib/SteelSeries-3.9.30.jar"/>
<batchtest todir="build">
<fileset dir="autotest/src" includes="**/test/**/*Test.java"/>
<fileset dir="io/src" includes="**/test/**/*Test.java"/>
<fileset dir="models/src" includes="**/test/**/*Test.java"/>
<fileset dir="ui/src" includes="**/test/**/*Test.java"/>
</batchtest>
</junit>
</target>
<target name="jar" depends="compile">
<mkdir dir="build/jar"/>
<jar destfile="../java_console_binary/rusefi_console.jar" basedir="build/classes">
<manifest>
<attribute name="Main-Class" value="com.irnems.Launcher"/>
</manifest>
<zipfileset src="lib/SteelSeries-3.9.30.jar" includes="**/*.class"/>
<zipfileset src="lib/trident-6.2.jar" includes="**/*.class"/>
<zipfileset src="lib/jssc.jar" includes="**/*.class **/*.so **/*.dll **/*.jnilib"/>
<zipfileset src="lib/annotations.jar" includes="**/*.class"/>
<zipfileset src="lib/miglayout-4.0.jar" includes="**/*.class"/>
<zipfileset src="lib/surfaceplotter-2.0.1.jar" includes="**/*.class **/*.properties"/>
<zipfileset src="lib/batik/batik-svggen.jar" includes="**/*.class"/>
<zipfileset src="lib/batik/batik-awt-util.jar" includes="**/*.class"/>
<zipfileset src="lib/batik/batik-util.jar" includes="**/*.class"/>
<zipfileset dir="build/classes" includes="**/*.class"/>
</jar>
</target>
<target name="run" depends="jar">
<java jar="../java_console_binary/rusefi_console.jar" fork="true"/>
</target>
<target name="autotest" depends="jar">
<java classpath="../java_console_binary/rusefi_console.jar" classname="com.rusefi.AutoTest" failonerror="true">
</java>
</target>
</project>

16
java_console/io/io.iml Normal file
View File

@ -0,0 +1,16 @@
<?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" />
<orderEntry type="library" name="annotations" level="project" />
<orderEntry type="library" name="junit" level="project" />
<orderEntry type="module" module-name="models" />
</component>
</module>

View File

@ -0,0 +1,85 @@
package com.irnems;
import com.rusefi.io.LinkManager;
import org.jetbrains.annotations.Nullable;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* 6/30/13
* (c) Andrey Belomutskiy
*/
public enum FileLog {
MAIN,
SIMULATOR_CONSOLE;
private static final String DIR = "out/";
@Nullable
private OutputStream fileLog; // null if not opened yet or already closed
private FileLog() {
}
public void start() {
try {
fileLog = openLog();
} catch (FileNotFoundException e) {
throw new IllegalStateException(e);
}
}
private FileOutputStream openLog() throws FileNotFoundException {
if (LinkManager.onlyUI)
return null;
String date = getDate();
createFolderIfNeeded();
String fileName = DIR + name() + "_rfi_report_" + date + ".csv";
rlog("Writing to " + fileName);
return new FileOutputStream(fileName, true);
}
private static void createFolderIfNeeded() {
File dir = new File(DIR);
if (dir.exists())
return;
boolean created = dir.mkdirs();
if (!created)
throw new IllegalStateException("Failed to create " + DIR + " folder");
}
public static String getDate() {
return new SimpleDateFormat("yyyy-MM-dd HH_mm").format(new Date());
}
public synchronized void logLine(String fullLine) {
if (fileLog == null)
return;
try {
fileLog.write((fullLine + "\r\n").getBytes());
fileLog.flush();
System.out.println(fullLine);
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
public synchronized void close() {
if (fileLog == null)
return; // already closed
try {
rlog("Closing file...");
fileLog.close();
fileLog = null;
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
public static void rlog(String msg) {
System.out.println("r " + msg);
}
}

View File

@ -0,0 +1,62 @@
package com.irnems.file;
import com.irnems.FileLog;
import com.irnems.core.EngineState;
import com.irnems.models.Point3D;
import com.irnems.models.XYData;
import java.util.HashMap;
import java.util.Map;
/**
* 7/18/13
* (c) Andrey Belomutskiy
*/
public class BaseMap {
public static void main(String[] args) {
loadData("a.csv", "maf", "af");
}
public static XYData loadData(String filename, final String key, final String value) {
FileLog.rlog("Loading from " + filename);
FileLog.rlog("Loading " + key + ">" + value);
final XYData data = new XYData();
EngineState.EngineStateListener listener = new EngineState.EngineStateListenerImpl() {
Map<String, String> values = new HashMap<String, String>();
@Override
public void onKeyValue(String key, String value) {
values.put(key, value);
}
@Override
public void afterLine(String fullLine) {
if (values.containsKey("rpm") && values.containsKey(key)) {
process(values);
}
values.clear();
}
private void process(Map<String, String> values) {
int rpm = (int) Double.parseDouble(values.get("rpm"));
double k = Double.parseDouble(values.get(key));
String valueString = values.get(value);
if (valueString == null)
throw new NullPointerException("No value for: " + value);
float v = Float.parseFloat(valueString);
data.addPoint(new Point3D(rpm, k, v));
}
};
EngineState engineState = new EngineState(listener);
engineState.registerStringValueAction("wave_chart", new EngineState.ValueCallback<String>() {
@Override
public void onUpdate(String value) {
}
});
FileUtils.readFile2(filename, engineState);
//return AverageData.average(data, 8);
return data;
}
}

View File

@ -0,0 +1,45 @@
package com.irnems.file;
import com.irnems.core.EngineState;
import java.io.*;
import java.util.List;
/**
* Date: 3/8/13
* (c) Andrey Belomutskiy
*/
public class FileUtils {
static void readFile(String filename, EngineState.EngineStateListener listener) {
readFile2(filename, new EngineState(listener));
}
public static void readFile2(String filename, EngineState engineState) {
BufferedReader reader;
try {
reader = new BufferedReader(new FileReader(filename));
String line;
while ((line = reader.readLine()) != null) {
String packed = EngineState.packString(line);
engineState.append(packed + "\r\n");
}
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
public static void saveList(String filename, List<Double> values) {
try {
BufferedWriter w = new BufferedWriter(new FileWriter(filename));
for (Double v : values)
w.write(v + "\r\n");
w.close();
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
}

View File

@ -0,0 +1,91 @@
package com.irnems.file;
import com.irnems.models.XYData;
import com.irnems.models.XYDataReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
/**
* @author Andrey Belomutskiy
* 3/27/13
*/
public class TableGenerator {
public static void main(String[] args) throws IOException {
XYData data = XYDataReader.readFile("in.csv");
writeAsC(data, "ad_", "advance_map.c");
}
public static void writeAsC(XYData data, String prefix, String fileName) {
try {
doWrite(data, prefix, fileName);
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
private static void doWrite(XYData data, String prefix, String fileName) throws IOException {
List<Double> rpms = new ArrayList<Double>(data.getXSet());
BufferedWriter out = new BufferedWriter(new FileWriter(fileName));
out.write("#include \"thermistors.h\"\n\n\n");
writeArray(rpms, out, prefix + "rpm");
Set<Double> mafs = data.getYAxis(rpms.get(0)).getYs();
ArrayList<Double> yArray = new ArrayList<Double>(mafs);
writeArray(yArray, out, prefix + "maf");
out.write("static float " + prefix + "table[" + rpms.size() + "][" + mafs.size() + "] = {\n");
boolean isFirstX = true;
int indexX = 0;
for (double x : data.getXSet()) {
if (!isFirstX)
out.write(",\n");
isFirstX = false;
out.write("{");
int indexY = 0;
for (double y : mafs) {
if (indexY == 0)
out.write("/*" + indexX + " rpm=" + rpms.get(indexX) + "*/");
if (indexY > 0)
out.write(", ");
out.write("/*" + indexY + " " + yArray.get(indexY) + "*/" + data.getValue(x, y));
indexY++;
}
out.write("}");
indexX++;
}
out.write("\n};\n");
out.close();
}
private static void writeArray(List<Double> rpms, BufferedWriter out, String title) throws IOException {
out.write("#define " + title.toUpperCase() + "_COUNT " + rpms.size() + "\n");
outputDoubles(rpms, out, title);
}
private static void outputDoubles(List<Double> values, BufferedWriter out, String title) throws IOException {
out.write("static float " + title + "_table[] = {");
for (int i = 0; i < values.size(); i++) {
if (i > 0)
out.write(", ");
out.write("/*" + i + "*/ " + values.get(i));
}
out.write("};\n\n");
}
}

View File

@ -0,0 +1,147 @@
package com.rusefi.io;
import com.irnems.core.MessagesCentral;
import org.jetbrains.annotations.NotNull;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
/**
* This class keeps re-sending a command till a proper confirmation is received
* <p/>
* Date: 1/7/13
* (c) Andrey Belomutskiy
*/
@SuppressWarnings("FieldCanBeLocal")
public class CommandQueue {
private static final String CONFIRMATION_PREFIX = "confirmation_";
public static final int DEFAULT_TIMEOUT = 300;
private final Object lock = new Object();
private String latestConfirmation;
private static final CommandQueue instance = new CommandQueue();
private final BlockingQueue<MethodInvocation> pendingCommands = new LinkedBlockingQueue<MethodInvocation>();
private final Runnable runnable = new Runnable() {
@SuppressWarnings("InfiniteLoopStatement")
@Override
public void run() {
MessagesCentral.getInstance().postMessage(CommandQueue.class, "SerialIO started");
while (true) {
try {
sendPendingCommand();
} catch (InterruptedException e) {
e.printStackTrace();
throw new IllegalStateException(e);
}
}
}
};
/**
* this method is always invoked on 'Commands Queue' thread {@link #runnable}
*
* @throws InterruptedException
*/
private void sendPendingCommand() throws InterruptedException {
/**
* here we block in case there is no command to send
*/
@NotNull
final MethodInvocation command = pendingCommands.take();
// got a command? let's send it!
sendCommand(command);
}
/**
* this method keeps retrying till a confirmation is received
*/
private void sendCommand(final MethodInvocation pair) throws InterruptedException {
int counter = 0;
latestConfirmation = null;
String command = pair.getText();
while (!command.equals(latestConfirmation)) {
counter++;
LinkManager.send(command);
synchronized (lock) {
lock.wait(pair.getTimeout());
}
}
if (command.equals(latestConfirmation))
pair.listener.onCommandConfirmation();
if (counter != 1)
MessagesCentral.getInstance().postMessage(CommandQueue.class, "Took " + counter + " attempts");
}
private CommandQueue() {
new Thread(runnable, "Commands Queue").start();
final MessagesCentral mc = MessagesCentral.getInstance();
mc.addListener(new MessagesCentral.MessageListener() {
@Override
public void onMessage(Class clazz, String message) {
if (message.startsWith(CONFIRMATION_PREFIX))
handleConfirmationMessage(message, mc);
}
});
}
private void handleConfirmationMessage(String message, MessagesCentral mc) {
String confirmation = message.substring(CONFIRMATION_PREFIX.length());
int index = confirmation.indexOf(":");
if (index < 0) {
mc.postMessage(CommandQueue.class, "Broken confirmation: " + confirmation);
return;
}
int length = Integer.parseInt(confirmation.substring(index + 1));
if (length != index) {
mc.postMessage(CommandQueue.class, "Broken confirmation length: " + confirmation);
return;
}
latestConfirmation = confirmation.substring(0, length);
mc.postMessage(CommandQueue.class, "got valid conf! " + latestConfirmation);
synchronized (lock) {
lock.notifyAll();
}
}
public static CommandQueue getInstance() {
return instance;
}
public void write(String command) {
write(command, DEFAULT_TIMEOUT);
}
public void write(String command, int timeout) {
write(command, timeout, InvocationConfirmationListener.VOID);
}
/**
* Non-blocking command request
*/
public void write(String command, int timeout, InvocationConfirmationListener listener) {
pendingCommands.add(new MethodInvocation(command, timeout, listener));
}
static class MethodInvocation {
private final String text;
private final int timeout;
private final InvocationConfirmationListener listener;
MethodInvocation(String text, int timeout, InvocationConfirmationListener listener) {
this.text = text;
this.timeout = timeout;
this.listener = listener;
}
public String getText() {
return text;
}
public int getTimeout() {
return timeout;
}
}
}

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,15 @@
package com.rusefi.io;
/**
* 3/8/14
* (c) Andrey Belomutskiy
*/
public interface InvocationConfirmationListener {
InvocationConfirmationListener VOID = new InvocationConfirmationListener() {
@Override
public void onCommandConfirmation() {
}
};
void onCommandConfirmation();
}

View File

@ -0,0 +1,13 @@
package com.rusefi.io;
/**
* @author Andrey Belomutskiy
* 3/3/14
*/
public interface LinkConnector {
void connect();
void send(String command) throws InterruptedException;
void restart();
}

View File

@ -0,0 +1,67 @@
package com.rusefi.io;
import com.irnems.FileLog;
import com.irnems.core.EngineState;
import com.rusefi.io.serial.SerialConnector;
import com.rusefi.io.tcp.TcpConnector;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
/**
* @author Andrey Belomutskiy
* 3/3/14
*/
public class LinkManager {
public final static Executor IO_EXECUTOR = Executors.newSingleThreadExecutor(new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
Thread t = new Thread(r);
t.setName("IO executor thread");
t.setDaemon(true); // need daemon thread so that COM thread is also daemon
return t;
}
});
public static EngineState engineState = new EngineState(new EngineState.EngineStateListenerImpl() {
@Override
public void beforeLine(String fullLine) {
FileLog.rlog("SerialManager.beforeLine: " + fullLine);
FileLog.MAIN.logLine(fullLine);
}
});
public static boolean onlyUI = false;
private static LinkConnector connector;
public static void start(String port) {
if (TcpConnector.isTcpPort(port)) {
connector = new TcpConnector(port);
} else {
connector = new SerialConnector(port);
}
}
public static void open() {
if (connector == null)
throw new NullPointerException("connector");
connector.connect();
}
public static void stop() {
// connector.stop();
}
public static void send(String command) throws InterruptedException {
if (connector == null)
throw new NullPointerException("connector");
connector.send(encodeCommand(command));
}
private static String encodeCommand(String command) {
return "sec!" + command.length() + "!" + command;
}
public static void restart() {
connector.restart();
}
}

View File

@ -0,0 +1,119 @@
package com.rusefi.io.serial;
import com.irnems.FileLog;
import com.irnems.core.EngineState;
import com.irnems.core.MessagesCentral;
import com.rusefi.io.CommandQueue;
import com.rusefi.io.DataListener;
import jssc.SerialPort;
import jssc.SerialPortException;
import org.jetbrains.annotations.Nullable;
/**
* This class holds the reference to the actual Serial port object
* <p/>
* 7/25/13
* (c) Andrey Belomutskiy
*/
class PortHolder {
// private static final int BAUD_RATE = 8 * 115200;// 921600;
// private static final int BAUD_RATE = 2 * 115200;
private static final int BAUD_RATE = 115200;
private static final int SECOND = 1000;
private static final int MINUTE = 60 * SECOND;
private static PortHolder instance = new PortHolder();
private final Object portLock = new Object();
public static long startedAt = System.currentTimeMillis();
private PortHolder() {
}
@Nullable
private SerialPort serialPort;
void openPort(String port, final EngineState es) {
MessagesCentral.getInstance().postMessage(SerialManager.class, "Opening port: " + port);
if (port == null)
return;
open(port, new DataListener() {
public void onStringArrived(String string) {
// jTextAreaIn.append(string);
es.append(string);
}
});
}
public boolean open(String port, DataListener listener) {
SerialPort serialPort = new SerialPort(port);
try {
FileLog.rlog("Opening " + port + " @ " + BAUD_RATE);
boolean opened = serialPort.openPort();//Open serial port
if (!opened)
FileLog.rlog("opened: " + 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));
} catch (SerialPortException e) {
FileLog.rlog("ERROR " + e.getMessage());
return false;
}
try {
Thread.sleep(200);
} catch (InterruptedException e) {
throw new IllegalStateException(e);
}
synchronized (portLock) {
this.serialPort = serialPort;
portLock.notifyAll();
}
return true;
}
public void close() {
synchronized (portLock) {
if (serialPort != null) {
try {
serialPort.closePort();
serialPort = null;
} catch (SerialPortException e) {
FileLog.rlog("Error while closing: " + e);
} finally {
portLock.notifyAll();
}
}
}
}
/**
* this method blocks till a connection is available
*/
public void packAndSend(String command) throws InterruptedException {
FileLog.rlog("Sending [" + command + "]");
MessagesCentral.getInstance().postMessage(CommandQueue.class, "Sending [" + command + "]");
long now = System.currentTimeMillis();
synchronized (portLock) {
while (serialPort == null) {
if (System.currentTimeMillis() - now > 3 * MINUTE)
MessagesCentral.getInstance().postMessage(PortHolder.class, "Looks like connection is gone :(");
portLock.wait(MINUTE);
}
// we are here only when serialPort!=null, that means we have a connection
try {
serialPort.writeString(command + "\r\n");
} catch (SerialPortException e) {
throw new IllegalStateException(e);
}
}
}
public static PortHolder getInstance() {
return instance;
}
}

View File

@ -0,0 +1,28 @@
package com.rusefi.io.serial;
import com.rusefi.io.LinkConnector;
/**
* @author Andrey Belomutskiy
* 3/3/14
*/
public class SerialConnector implements LinkConnector {
public SerialConnector(String serialPort) {
SerialManager.port = serialPort;
}
@Override
public void connect() {
SerialManager.scheduleOpening();
}
@Override
public void restart() {
SerialManager.restart();
}
@Override
public void send(String command) throws InterruptedException {
PortHolder.getInstance().packAndSend(command);
}
}

View File

@ -0,0 +1,74 @@
package com.rusefi.io.serial;
import com.irnems.FileLog;
import com.irnems.core.MessagesCentral;
import com.rusefi.io.LinkManager;
/**
* 7/9/13
* (c) Andrey Belomutskiy
*/
class SerialManager {
public static String port;
private static boolean closed;
public static void scheduleOpening() {
FileLog.rlog("scheduleOpening");
LinkManager.IO_EXECUTOR.execute(new Runnable() {
@Override
public void run() {
FileLog.rlog("scheduleOpening>openPort");
PortHolder.getInstance().openPort(port, LinkManager.engineState);
}
});
}
public static void restart() {
LinkManager.IO_EXECUTOR.execute(new Runnable() {
@Override
public void run() {
MessagesCentral.getInstance().postMessage(SerialManager.class, "Restarting serial IO");
if (closed)
return;
PortHolder.getInstance().close();
PortHolder.getInstance().openPort(port, LinkManager.engineState);
}
});
}
/*
static String[] findSerialPorts() {
List<String> result = new ArrayList<String>();
Enumeration<CommPortIdentifier> portEnum = CommPortIdentifier.getPortIdentifiers();
while (portEnum.hasMoreElements()) {
CommPortIdentifier portIdentifier = portEnum.nextElement();
System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()));
if (portIdentifier.getPortType() == CommPortIdentifier.PORT_SERIAL)
result.add(portIdentifier.getName());
}
return result.toArray(new String[result.size()]);
}
static String getPortTypeName(int portType) {
switch (portType) {
case CommPortIdentifier.PORT_I2C:
return "I2C";
case CommPortIdentifier.PORT_PARALLEL:
return "Parallel";
case CommPortIdentifier.PORT_RAW:
return "Raw";
case CommPortIdentifier.PORT_RS485:
return "RS485";
case CommPortIdentifier.PORT_SERIAL:
return "Serial";
default:
return "unknown type";
}
}
*/
// public static void close() {
// closed = true;
// SerialIO.getInstance().stop();
// }
}

View File

@ -0,0 +1,44 @@
package com.rusefi.io.serial;
import com.irnems.FileLog;
import com.rusefi.io.DataListener;
import jssc.SerialPort;
import jssc.SerialPortEvent;
import jssc.SerialPortEventListener;
import jssc.SerialPortException;
/**
* Date: 12/25/12
* (c) Andrey Belomutskiy
*/
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);
}
} else {
FileLog.rlog("SerialPortReader serialEvent " + spe);
}
}
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 + "]");
}
}
}

View File

@ -0,0 +1,102 @@
package com.rusefi.io.tcp;
import com.irnems.FileLog;
import com.rusefi.io.LinkConnector;
import com.rusefi.io.LinkManager;
import java.io.*;
import java.net.Socket;
import java.util.Collection;
import java.util.Collections;
/**
* @author Andrey Belomutskiy
* 3/3/14
*/
public class TcpConnector implements LinkConnector {
public final static int DEFAULT_PORT = 29001;
public static final String LOCALHOST = "localhost";
private final int port;
private BufferedWriter writer;
public TcpConnector(String port) {
this.port = getTcpPort(port);
}
public static boolean isTcpPort(String port) {
try {
getTcpPort(port);
return true;
} catch (NumberFormatException e) {
return false;
}
}
public static int getTcpPort(String port) {
return Integer.parseInt(port);
}
/**
* this implementation is blocking
*/
@Override
public void connect() {
FileLog.rlog("Connecting to " + port);
BufferedInputStream stream;
try {
Socket socket = new Socket(LOCALHOST, port);
writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
stream = new BufferedInputStream(socket.getInputStream());
} catch (IOException e) {
throw new IllegalStateException("Failed to connect to simulator", e);
}
final BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
LinkManager.IO_EXECUTOR.execute(new Runnable() {
@Override
public void run() {
Thread.currentThread().setName("TCP connector loop");
FileLog.rlog("Running TCP connection loop");
while (true) {
try {
String line = reader.readLine();
LinkManager.engineState.append(line + "\r\n");
} catch (IOException e) {
System.err.println("End of connection");
return;
}
}
}
});
}
@Override
public void restart() {
// FileLog.rlog("Restarting on " + port);
}
@Override
public void send(String command) throws InterruptedException {
FileLog.rlog("Writing " + command);
try {
writer.write(command + "\r\n");
writer.flush();
} catch (IOException e) {
System.err.println("err in send");
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
public static Collection<? extends String> getAvailablePorts() {
try {
Socket s = new Socket(LOCALHOST, DEFAULT_PORT);
s.close();
return Collections.singletonList("" + DEFAULT_PORT);
} catch (IOException e) {
System.out.println("Connection refused in getAvailablePorts(): simulator not running");
return Collections.emptyList();
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,86 @@
xml-commons/java/external/LICENSE.dom-documentation.txt $Id: LICENSE.dom-documentation.txt 201084 2002-12-09 16:15:21Z vhardy $
This license came from: http://www.w3.org/Consortium/Legal/copyright-documents-19990405
W3C® DOCUMENT NOTICE AND LICENSE
Copyright © 1994-2001 World
Wide Web Consortium, <a href="http://www.w3.org/">World
Wide Web Consortium</a>, (<a href=
"http://www.lcs.mit.edu/">Massachusetts Institute of
Technology</a>, <a href="http://www.inria.fr/">Institut National de
Recherche en Informatique et en Automatique</a>, <a href=
"http://www.keio.ac.jp/">Keio University</a>). All Rights Reserved.
http://www.w3.org/Consortium/Legal/
Public documents on the W3C site are provided by the copyright
holders under the following license. The software or Document Type
Definitions (DTDs) associated with W3C specifications are governed
by the Software Notice. By using and/or copying this document, or the
W3C document from which this statement is linked, you (the
licensee) agree that you have read, understood, and will comply
with the following terms and conditions:
Permission to use, copy, and distribute the contents of this
document, or the W3C document from which this statement is linked,
in any medium for any purpose and without fee or royalty is hereby
granted, provided that you include the following on ALL
copies of the document, or portions thereof, that you use:
A link or URL to the original W3C document.
The pre-existing copyright notice of the original author, or if
it doesn't exist, a notice of the form: "Copyright © [$date-of-document] World Wide Web
Consortium, (Massachusetts
Institute of Technology, Institut National de Recherche en Informatique et en
Automatique, Keio
University). All Rights Reserved.
http://www.w3.org/Consortium/Legal/" (Hypertext is preferred, but a
textual representation is permitted.)
If it exists, the STATUS of the W3C document.
When space permits, inclusion of the full text of this NOTICE
should be provided. We request that authorship
attribution be provided in any software, documents, or other items
or products that you create pursuant to the implementation of the
contents of this document, or any portion thereof.
No right to create modifications or derivatives of W3C documents
is granted pursuant to this license. However, if additional
requirements (documented in the Copyright
FAQ) are satisfied, the right to create modifications or
derivatives is sometimes granted by the W3C to individuals
complying with those requirements.
THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO
REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT
NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS
OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE
IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY
PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT,
SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE
DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS
THEREOF.
The name and trademarks of copyright holders may NOT be used in
advertising or publicity pertaining to this document or its
contents without specific, written prior permission. Title to
copyright in this document will at all times remain with copyright
holders.
----------------------------------------------------------------------------
This formulation of W3C's notice and license became active on
April 05 1999 so as to account for the treatment of DTDs, schema's and
bindings. See the older formulation for the policy prior to this date.
Please see
our Copyright FAQ for common questions
about using materials from our site, including specific terms and
conditions for packages like libwww, Amaya, and Jigsaw.
Other questions about this notice can be directed to site-policy@w3.org.
webmaster
(last updated by reagle on 1999/04/99.)

View File

@ -0,0 +1,74 @@
xml-commons/java/external/LICENSE.dom-software.txt $Id: LICENSE.dom-software.txt 201084 2002-12-09 16:15:21Z vhardy $
This license came from: http://www.w3.org/Consortium/Legal/copyright-software-19980720
W3C® SOFTWARE NOTICE AND LICENSE
Copyright © 1994-2001 World
Wide Web Consortium, <a href="http://www.w3.org/">World
Wide Web Consortium</a>, (<a href=
"http://www.lcs.mit.edu/">Massachusetts Institute of
Technology</a>, <a href="http://www.inria.fr/">Institut National de
Recherche en Informatique et en Automatique</a>, <a href=
"http://www.keio.ac.jp/">Keio University</a>). All Rights Reserved.
http://www.w3.org/Consortium/Legal/
This W3C work (including software, documents, or other related
items) is being provided by the copyright holders under the
following license. By obtaining, using and/or copying this work,
you (the licensee) agree that you have read, understood, and will
comply with the following terms and conditions:
Permission to use, copy, modify, and distribute this software
and its documentation, with or without modification,  for any
purpose and without fee or royalty is hereby granted, provided that
you include the following on ALL copies of the software and
documentation or portions thereof, including modifications, that
you make:
The full text of this NOTICE in a location viewable to users of
the redistributed or derivative work.
Any pre-existing intellectual property disclaimers, notices, or
terms and conditions. If none exist, a short notice of the
following form (hypertext is preferred, text is permitted) should
be used within the body of any redistributed or derivative code:
"Copyright © [$date-of-software] World Wide Web Consortium, (Massachusetts Institute of
Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University). All Rights Reserved.
http://www.w3.org/Consortium/Legal/"
Notice of any changes or modifications to the W3C files,
including the date changes were made. (We recommend you provide
URIs to the location from which the code is derived.)
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND
COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE
USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD
PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT,
SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE
SOFTWARE OR DOCUMENTATION.
The name and trademarks of copyright holders may NOT be used in
advertising or publicity pertaining to the software without
specific, written prior permission. Title to copyright in this
software and any associated documentation will at all times remain
with copyright holders.
____________________________________
This formulation of W3C's notice and license became active on
August 14 1998 so as to improve compatibility with GPL. This
version ensures that W3C software licensing terms are no more
restrictive than GPL and consequently W3C software may be
distributed in GPL packages. See the older formulation for the
policy prior to this date. Please see our Copyright FAQ for common
questions about using materials from
our site, including specific terms and conditions for packages like
libwww, Amaya, and Jigsaw.
Other questions about this notice can be
directed to site-policy@w3.org.
webmaster
(last updated $Date: 2002-12-10 03:15:21 +1100 (Tue, 10 Dec 2002) $)

View File

@ -0,0 +1,890 @@
This distribution includes a binary distribution of Mozilla Rhino 1.6 release 5
plus one patch.
You can get the unpatched 1.6R5 release of Rhino from the following URL:
ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_6R5.zip
To obtain the source code for the 1.6R5 release of Rhino, issue the following
commands:
cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot \
co -D2006-11-20 mozilla/js/rhino
The patch is available here:
https://bugzilla.mozilla.org/attachment.cgi?id=288467
which is attached to this bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=367627
Rhino is licensed under both the MPL (Mozilla Public License) 1.1 and the
GPL (GNU General Public License) 2.0, which are duplicated below.
The Rhino jar also includes four classes:
org.mozilla.javascript.tools.debugger.downloaded.AbstractCellEditor.java
org.mozilla.javascript.tools.debugger.downloaded.JTreeTable.java
org.mozilla.javascript.tools.debugger.downloaded.TreeTableModel.java
org.mozilla.javascript.tools.debugger.downloaded.TreeTableModelAdapter.java
Which come from:
http://java.sun.com/products/jfc/tsc/articles/treetable2
Under the following license:
Code sample
License
Copyright 1994-2006 Sun Microsystems, Inc. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistribution of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistribution in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
Neither the name of Sun Microsystems, Inc. or the names of
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
This software is provided "AS IS," without a warranty of any kind. ALL
EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
You acknowledge that this software is not designed, licensed or
intended for use in the design, construction, operation or maintenance
of any nuclear facility.
==============================================================================
MOZILLA PUBLIC LICENSE
Version 1.1
---------------
1. Definitions.
1.0.1. "Commercial Use" means distribution or otherwise making the
Covered Code available to a third party.
1.1. "Contributor" means each entity that creates or contributes to
the creation of Modifications.
1.2. "Contributor Version" means the combination of the Original
Code, prior Modifications used by a Contributor, and the Modifications
made by that particular Contributor.
1.3. "Covered Code" means the Original Code or Modifications or the
combination of the Original Code and Modifications, in each case
including portions thereof.
1.4. "Electronic Distribution Mechanism" means a mechanism generally
accepted in the software development community for the electronic
transfer of data.
1.5. "Executable" means Covered Code in any form other than Source
Code.
1.6. "Initial Developer" means the individual or entity identified
as the Initial Developer in the Source Code notice required by Exhibit
A.
1.7. "Larger Work" means a work which combines Covered Code or
portions thereof with code not governed by the terms of this License.
1.8. "License" means this document.
1.8.1. "Licensable" means having the right to grant, to the maximum
extent possible, whether at the time of the initial grant or
subsequently acquired, any and all of the rights conveyed herein.
1.9. "Modifications" means any addition to or deletion from the
substance or structure of either the Original Code or any previous
Modifications. When Covered Code is released as a series of files, a
Modification is:
A. Any addition to or deletion from the contents of a file
containing Original Code or previous Modifications.
B. Any new file that contains any part of the Original Code or
previous Modifications.
1.10. "Original Code" means Source Code of computer software code
which is described in the Source Code notice required by Exhibit A as
Original Code, and which, at the time of its release under this
License is not already Covered Code governed by this License.
1.10.1. "Patent Claims" means any patent claim(s), now owned or
hereafter acquired, including without limitation, method, process,
and apparatus claims, in any patent Licensable by grantor.
1.11. "Source Code" means the preferred form of the Covered Code for
making modifications to it, including all modules it contains, plus
any associated interface definition files, scripts used to control
compilation and installation of an Executable, or source code
differential comparisons against either the Original Code or another
well known, available Covered Code of the Contributor's choice. The
Source Code can be in a compressed or archival form, provided the
appropriate decompression or de-archiving software is widely available
for no charge.
1.12. "You" (or "Your") means an individual or a legal entity
exercising rights under, and complying with all of the terms of, this
License or a future version of this License issued under Section 6.1.
For legal entities, "You" includes any entity which controls, is
controlled by, or is under common control with You. For purposes of
this definition, "control" means (a) the power, direct or indirect,
to cause the direction or management of such entity, whether by
contract or otherwise, or (b) ownership of more than fifty percent
(50%) of the outstanding shares or beneficial ownership of such
entity.
2. Source Code License.
2.1. The Initial Developer Grant.
The Initial Developer hereby grants You a world-wide, royalty-free,
non-exclusive license, subject to third party intellectual property
claims:
(a) under intellectual property rights (other than patent or
trademark) Licensable by Initial Developer to use, reproduce,
modify, display, perform, sublicense and distribute the Original
Code (or portions thereof) with or without Modifications, and/or
as part of a Larger Work; and
(b) under Patents Claims infringed by the making, using or
selling of Original Code, to make, have made, use, practice,
sell, and offer for sale, and/or otherwise dispose of the
Original Code (or portions thereof).
(c) the licenses granted in this Section 2.1(a) and (b) are
effective on the date Initial Developer first distributes
Original Code under the terms of this License.
(d) Notwithstanding Section 2.1(b) above, no patent license is
granted: 1) for code that You delete from the Original Code; 2)
separate from the Original Code; or 3) for infringements caused
by: i) the modification of the Original Code or ii) the
combination of the Original Code with other software or devices.
2.2. Contributor Grant.
Subject to third party intellectual property claims, each Contributor
hereby grants You a world-wide, royalty-free, non-exclusive license
(a) under intellectual property rights (other than patent or
trademark) Licensable by Contributor, to use, reproduce, modify,
display, perform, sublicense and distribute the Modifications
created by such Contributor (or portions thereof) either on an
unmodified basis, with other Modifications, as Covered Code
and/or as part of a Larger Work; and
(b) under Patent Claims infringed by the making, using, or
selling of Modifications made by that Contributor either alone
and/or in combination with its Contributor Version (or portions
of such combination), to make, use, sell, offer for sale, have
made, and/or otherwise dispose of: 1) Modifications made by that
Contributor (or portions thereof); and 2) the combination of
Modifications made by that Contributor with its Contributor
Version (or portions of such combination).
(c) the licenses granted in Sections 2.2(a) and 2.2(b) are
effective on the date Contributor first makes Commercial Use of
the Covered Code.
(d) Notwithstanding Section 2.2(b) above, no patent license is
granted: 1) for any code that Contributor has deleted from the
Contributor Version; 2) separate from the Contributor Version;
3) for infringements caused by: i) third party modifications of
Contributor Version or ii) the combination of Modifications made
by that Contributor with other software (except as part of the
Contributor Version) or other devices; or 4) under Patent Claims
infringed by Covered Code in the absence of Modifications made by
that Contributor.
3. Distribution Obligations.
3.1. Application of License.
The Modifications which You create or to which You contribute are
governed by the terms of this License, including without limitation
Section 2.2. The Source Code version of Covered Code may be
distributed only under the terms of this License or a future version
of this License released under Section 6.1, and You must include a
copy of this License with every copy of the Source Code You
distribute. You may not offer or impose any terms on any Source Code
version that alters or restricts the applicable version of this
License or the recipients' rights hereunder. However, You may include
an additional document offering the additional rights described in
Section 3.5.
3.2. Availability of Source Code.
Any Modification which You create or to which You contribute must be
made available in Source Code form under the terms of this License
either on the same media as an Executable version or via an accepted
Electronic Distribution Mechanism to anyone to whom you made an
Executable version available; and if made available via Electronic
Distribution Mechanism, must remain available for at least twelve (12)
months after the date it initially became available, or at least six
(6) months after a subsequent version of that particular Modification
has been made available to such recipients. You are responsible for
ensuring that the Source Code version remains available even if the
Electronic Distribution Mechanism is maintained by a third party.
3.3. Description of Modifications.
You must cause all Covered Code to which You contribute to contain a
file documenting the changes You made to create that Covered Code and
the date of any change. You must include a prominent statement that
the Modification is derived, directly or indirectly, from Original
Code provided by the Initial Developer and including the name of the
Initial Developer in (a) the Source Code, and (b) in any notice in an
Executable version or related documentation in which You describe the
origin or ownership of the Covered Code.
3.4. Intellectual Property Matters
(a) Third Party Claims.
If Contributor has knowledge that a license under a third party's
intellectual property rights is required to exercise the rights
granted by such Contributor under Sections 2.1 or 2.2,
Contributor must include a text file with the Source Code
distribution titled "LEGAL" which describes the claim and the
party making the claim in sufficient detail that a recipient will
know whom to contact. If Contributor obtains such knowledge after
the Modification is made available as described in Section 3.2,
Contributor shall promptly modify the LEGAL file in all copies
Contributor makes available thereafter and shall take other steps
(such as notifying appropriate mailing lists or newsgroups)
reasonably calculated to inform those who received the Covered
Code that new knowledge has been obtained.
(b) Contributor APIs.
If Contributor's Modifications include an application programming
interface and Contributor has knowledge of patent licenses which
are reasonably necessary to implement that API, Contributor must
also include this information in the LEGAL file.
(c) Representations.
Contributor represents that, except as disclosed pursuant to
Section 3.4(a) above, Contributor believes that Contributor's
Modifications are Contributor's original creation(s) and/or
Contributor has sufficient rights to grant the rights conveyed by
this License.
3.5. Required Notices.
You must duplicate the notice in Exhibit A in each file of the Source
Code. If it is not possible to put such notice in a particular Source
Code file due to its structure, then You must include such notice in a
location (such as a relevant directory) where a user would be likely
to look for such a notice. If You created one or more Modification(s)
You may add your name as a Contributor to the notice described in
Exhibit A. You must also duplicate this License in any documentation
for the Source Code where You describe recipients' rights or ownership
rights relating to Covered Code. You may choose to offer, and to
charge a fee for, warranty, support, indemnity or liability
obligations to one or more recipients of Covered Code. However, You
may do so only on Your own behalf, and not on behalf of the Initial
Developer or any Contributor. You must make it absolutely clear than
any such warranty, support, indemnity or liability obligation is
offered by You alone, and You hereby agree to indemnify the Initial
Developer and every Contributor for any liability incurred by the
Initial Developer or such Contributor as a result of warranty,
support, indemnity or liability terms You offer.
3.6. Distribution of Executable Versions.
You may distribute Covered Code in Executable form only if the
requirements of Section 3.1-3.5 have been met for that Covered Code,
and if You include a notice stating that the Source Code version of
the Covered Code is available under the terms of this License,
including a description of how and where You have fulfilled the
obligations of Section 3.2. The notice must be conspicuously included
in any notice in an Executable version, related documentation or
collateral in which You describe recipients' rights relating to the
Covered Code. You may distribute the Executable version of Covered
Code or ownership rights under a license of Your choice, which may
contain terms different from this License, provided that You are in
compliance with the terms of this License and that the license for the
Executable version does not attempt to limit or alter the recipient's
rights in the Source Code version from the rights set forth in this
License. If You distribute the Executable version under a different
license You must make it absolutely clear that any terms which differ
from this License are offered by You alone, not by the Initial
Developer or any Contributor. You hereby agree to indemnify the
Initial Developer and every Contributor for any liability incurred by
the Initial Developer or such Contributor as a result of any such
terms You offer.
3.7. Larger Works.
You may create a Larger Work by combining Covered Code with other code
not governed by the terms of this License and distribute the Larger
Work as a single product. In such a case, You must make sure the
requirements of this License are fulfilled for the Covered Code.
4. Inability to Comply Due to Statute or Regulation.
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Code due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description
must be included in the LEGAL file described in Section 3.4 and must
be included with all distributions of the Source Code. Except to the
extent prohibited by statute or regulation, such description must be
sufficiently detailed for a recipient of ordinary skill to be able to
understand it.
5. Application of this License.
This License applies to code to which the Initial Developer has
attached the notice in Exhibit A and to related Covered Code.
6. Versions of the License.
6.1. New Versions.
Netscape Communications Corporation ("Netscape") may publish revised
and/or new versions of the License from time to time. Each version
will be given a distinguishing version number.
6.2. Effect of New Versions.
Once Covered Code has been published under a particular version of the
License, You may always continue to use it under the terms of that
version. You may also choose to use such Covered Code under the terms
of any subsequent version of the License published by Netscape. No one
other than Netscape has the right to modify the terms applicable to
Covered Code created under this License.
6.3. Derivative Works.
If You create or use a modified version of this License (which you may
only do in order to apply it to code which is not already Covered Code
governed by this License), You must (a) rename Your license so that
the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
"MPL", "NPL" or any confusingly similar phrase do not appear in your
license (except to note that your license differs from this License)
and (b) otherwise make it clear that Your version of the license
contains terms which differ from the Mozilla Public License and
Netscape Public License. (Filling in the name of the Initial
Developer, Original Code or Contributor in the notice described in
Exhibit A shall not of themselves be deemed to be modifications of
this License.)
7. DISCLAIMER OF WARRANTY.
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
8. TERMINATION.
8.1. This License and the rights granted hereunder will terminate
automatically if You fail to comply with terms herein and fail to cure
such breach within 30 days of becoming aware of the breach. All
sublicenses to the Covered Code which are properly granted shall
survive any termination of this License. Provisions which, by their
nature, must remain in effect beyond the termination of this License
shall survive.
8.2. If You initiate litigation by asserting a patent infringement
claim (excluding declatory judgment actions) against Initial Developer
or a Contributor (the Initial Developer or Contributor against whom
You file such action is referred to as "Participant") alleging that:
(a) such Participant's Contributor Version directly or indirectly
infringes any patent, then any and all rights granted by such
Participant to You under Sections 2.1 and/or 2.2 of this License
shall, upon 60 days notice from Participant terminate prospectively,
unless if within 60 days after receipt of notice You either: (i)
agree in writing to pay Participant a mutually agreeable reasonable
royalty for Your past and future use of Modifications made by such
Participant, or (ii) withdraw Your litigation claim with respect to
the Contributor Version against such Participant. If within 60 days
of notice, a reasonable royalty and payment arrangement are not
mutually agreed upon in writing by the parties or the litigation claim
is not withdrawn, the rights granted by Participant to You under
Sections 2.1 and/or 2.2 automatically terminate at the expiration of
the 60 day notice period specified above.
(b) any software, hardware, or device, other than such Participant's
Contributor Version, directly or indirectly infringes any patent, then
any rights granted to You by such Participant under Sections 2.1(b)
and 2.2(b) are revoked effective as of the date You first made, used,
sold, distributed, or had made, Modifications made by that
Participant.
8.3. If You assert a patent infringement claim against Participant
alleging that such Participant's Contributor Version directly or
indirectly infringes any patent where such claim is resolved (such as
by license or settlement) prior to the initiation of patent
infringement litigation, then the reasonable value of the licenses
granted by such Participant under Sections 2.1 or 2.2 shall be taken
into account in determining the amount or value of any payment or
license.
8.4. In the event of termination under Sections 8.1 or 8.2 above,
all end user license agreements (excluding distributors and resellers)
which have been validly granted by You or any distributor hereunder
prior to termination shall survive termination.
9. LIMITATION OF LIABILITY.
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
10. U.S. GOVERNMENT END USERS.
The Covered Code is a "commercial item," as that term is defined in
48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
software" and "commercial computer software documentation," as such
terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
all U.S. Government End Users acquire Covered Code with only those
rights set forth herein.
11. MISCELLANEOUS.
This License represents the complete agreement concerning subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. This License shall be governed by
California law provisions (except to the extent applicable law, if
any, provides otherwise), excluding its conflict-of-law provisions.
With respect to disputes in which at least one party is a citizen of,
or an entity chartered or registered to do business in the United
States of America, any litigation relating to this License shall be
subject to the jurisdiction of the Federal Courts of the Northern
District of California, with venue lying in Santa Clara County,
California, with the losing party responsible for costs, including
without limitation, court costs and reasonable attorneys' fees and
expenses. The application of the United Nations Convention on
Contracts for the International Sale of Goods is expressly excluded.
Any law or regulation which provides that the language of a contract
shall be construed against the drafter shall not apply to this
License.
12. RESPONSIBILITY FOR CLAIMS.
As between Initial Developer and the Contributors, each party is
responsible for claims and damages arising, directly or indirectly,
out of its utilization of rights under this License and You agree to
work with Initial Developer and Contributors to distribute such
responsibility on an equitable basis. Nothing herein is intended or
shall be deemed to constitute any admission of liability.
13. MULTIPLE-LICENSED CODE.
Initial Developer may designate portions of the Covered Code as
"Multiple-Licensed". "Multiple-Licensed" means that the Initial
Developer permits you to utilize portions of the Covered Code under
Your choice of the NPL or the alternative licenses, if any, specified
by the Initial Developer in the file described in Exhibit A.
EXHIBIT A -Mozilla Public License.
``The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
The Original Code is ______________________________________.
The Initial Developer of the Original Code is ________________________.
Portions created by ______________________ are Copyright (C) ______
_______________________. All Rights Reserved.
Contributor(s): ______________________________________.
Alternatively, the contents of this file may be used under the terms
of the _____ license (the "[___] License"), in which case the
provisions of [______] License are applicable instead of those
above. If you wish to allow use of your version of this file only
under the terms of the [____] License and not to allow others to use
your version of this file under the MPL, indicate your decision by
deleting the provisions above and replace them with the notice and
other provisions required by the [___] License. If you do not delete
the provisions above, a recipient may use your version of this file
under either the MPL or the [___] License."
[NOTE: The text of this Exhibit A may differ slightly from the text of
the notices in the Source Code files of the Original Code. You should
use the text of this Exhibit A rather than the text found in the
Original Code Source Code for Your Modifications.]
==============================================================================
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
==============================================================================

View File

@ -0,0 +1,2 @@
The pdf-transcoder.jar file is licensed under the Apache License 2.0, which
can be found in the distribution root directory in the LICENSE file.

View File

@ -0,0 +1,23 @@
xml-commons/java/external/LICENSE.sax.txt $Id: LICENSE.sax.txt 201084 2002-12-09 16:15:21Z vhardy $
This license came from: http://www.megginson.com/SAX/copying.html
However please note future versions of SAX may be covered
under http://saxproject.org/?selected=pd
This page is now out of date -- see the new SAX site at
http://www.saxproject.org/ for more up-to-date
releases and other information. Please change your bookmarks.
SAX2 is Free!
I hereby abandon any property rights to SAX 2.0 (the Simple API for
XML), and release all of the SAX 2.0 source code, compiled code, and
documentation contained in this distribution into the Public Domain.
SAX comes with NO WARRANTY or guarantee of fitness for any
purpose.
David Megginson, david@megginson.com
2000-05-05

View File

@ -0,0 +1,2 @@
The xalan-2.6.0.jar file is licensed under the Apache License 2.0, which
can be found in the distribution root directory in the LICENSE file.

View File

@ -0,0 +1,60 @@
The xerces_2_5_0.jar file comes from the Apache Xerces project
(http://xmlapache.org/dist/xerces-j/), and is licensed under the
Apache Software License, Version 1.1, which is reproduced below.
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, International
* Business Machines, Inc., http://www.ibm.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/

View File

@ -0,0 +1,23 @@
This distribution includes a binary distribution of Mozilla Rhino 1.6 release 5
plus one patch.
You can get the unpatched 1.6R5 release of Rhino from the following URL:
ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_6R5.zip
To obtain the source code for the 1.6R5 release of Rhino, issue the following
commands:
cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot \
co -D2006-11-20 mozilla/js/rhino
The patch is available here:
https://bugzilla.mozilla.org/attachment.cgi?id=288467
which is attached to this bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=367627
Rhino is licensed under both the MPL (Mozilla Public License) 1.1 and the
GPL (GNU General Public License) 2.0, which are in the LICENSE.js.txt file.

View File

@ -0,0 +1,8 @@
The pdf-transcoder.jar file is built from the Apache FOP project
(http://xmlgraphics.apache.org/fop), version 0.94.
This is only needed if you want to transcode to PDF, otherwise it can
be removed.
The pdf-transcoder.jar file is licensed under the Apache License 2.0, which
can be found in the distribution root directory in the LICENSE file.

View File

@ -0,0 +1,4 @@
The xalan-2.6.0.jar file comes from the Apache Xalan project
(http://xml.apache.org/xalan-j/), and is licensed under the
Apache License 2.0, which can be found in the distribution root directory
in the LICENSE file.

View File

@ -0,0 +1,4 @@
The xerces_2_5_0.jar file comes from the Apache Xerces project
(http://xml.apache.org/dist/xerces-j/), and is licensed under the
Apache Software License, Version 1.1, which is in the
LICENSE.xerces_2_5_0.txt file.

View File

@ -0,0 +1,19 @@
This distribution includes xml-apis-ext.jar from the XML Commons External
1.3.04 binary distribution, which can also be obtained from:
http://xml.apache.org/mirrors.cgi
Source code is available from the XML Commons web site:
http://xml.apache.org/commons/
xml-apis-ext.jar contains:
- SAC 1.3
- SMIL Java bindings
- SVG 1.1 Java bindings
SAC 1.3, the SMIL Java bindings and the SVG 1.1 Java bindings are licensed
under the W3C Software License. Related documentation is licensed under the
W3C Document License. See LICENSE.dom-software.txt and
LICENSE.dom-documentation.txt.

View File

@ -0,0 +1,30 @@
This distribution includes xml-apis.jar from the XML Commons External
1.3.04 binary distribution, which can also be obtained from:
http://xml.apache.org/mirrors.cgi
Source code is available from the XML Commons web site:
http://xml.apache.org/commons/
xml-apis.jar contains:
- DOM Level 2 Events
- DOM Level 2 HTML
- DOM Level 2 Style
- DOM Level 2 Traversal and Range
- DOM Level 2 Views
- DOM Level 3 Core
- DOM Level 3 Load and Save
- DOM Level 3 XPath
- JAXP 1.3 (JSR 206)
- SAX
All DOM code is licensed under the W3C Software License, and DOM documentation
under the W3C Document License. See LICENSE.dom-software.txt and
LICENSE.dom-documentation.txt.
The JAXP 1.3 code is licensed under the Apache Software License 2.0, which is
in the LICENSE in the root directory of this distribution.
SAX is public domain. See LICENSE.sax.txt.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,87 @@
#!/bin/bash
# -----------------------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# make-squiggle-app.sh
#
# Creates a Mac OS X application bundle for Squiggle, then opens a Finder
# window for the current directory so that the user can drag the icon
# into their desired installation location (probably /Applications).
#
# $Id$
# -----------------------------------------------------------------------------
trap 'echo Error creating application bundle.; exit 1' ERR
cd `dirname "$0"`/..
APP=Squiggle.app
CON=$APP/Contents
MAC=$CON/MacOS
RES=$CON/Resources
[ -e $APP ] && echo $APP already exists: please move it out of the way before running this script. && exit 1
echo Creating $APP in `pwd`...
mkdir $APP $CON $MAC $RES
cat >$CON/Info.plist <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>Squiggle</string>
<key>CFBundleVersion</key>
<string>1.7+r608262</string>
<key>CFBundleShortVersionString</key>
<string>1.7+r608262</string>
<key>CFBundleIconFile</key>
<string>Squiggle.icns</string>
<key>CFBundleIdentifier</key>
<string>org.apache.batik</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Squiggle</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2008 Apache Software Foundation. All Rights Reserved.</string>
</dict>
</plist>
EOF
cat >$MAC/Squiggle <<EOF
#!/bin/sh
JAVA=/usr/bin/java
[ -e "$JAVA_HOME/bin/java" ] && JAVA="$JAVA_HOME/bin/java"
"$JAVA" -Dcom.apple.mrj.application.apple.menu.about.name=Squiggle -jar "\`dirname \$0\`/../Resources/batik-squiggle.jar"
EOF
chmod a+x $MAC/Squiggle
cp -r *.jar lib extensions $RES/
mv $RES/lib/Squiggle.icns $RES/
echo Done.
open .

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
java_console/lib/jssc.jar Normal file

Binary file not shown.

Binary file not shown.

BIN
java_console/lib/junit.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,25 @@
<?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="annotations" level="project" />
<orderEntry type="library" name="junit" level="project" />
<orderEntry type="library" name="SteelSeries" level="project" />
<orderEntry type="module" module-name="io" />
</component>
</module>

View File

@ -0,0 +1,492 @@
package com.irnems;
import org.jetbrains.annotations.NotNull;
import java.text.FieldPosition;
import java.text.NumberFormat;
import java.util.*;
public final class Histograms {
private static final String SQL_STATEMENT = "SQL-statement";
public static final double H_ACCURACY = 0.05;
public static final int BOUND_LENGTH = (int) (Math.log(Long.MAX_VALUE) / Math.log(1.0 + H_ACCURACY));
public static final long LONG_MAX_INT = 0x7fffffffffffffffL;
public static final double H_CONFIDENCE = 0.8;
public static final int SBI_SIZE = 1000;
// ======= Initialization =======
private final HashMap<String, StatisticsGroup> total_stats = new HashMap<String, StatisticsGroup>();
private final long start_time = System.currentTimeMillis();
public final ThreadLocal<LocalStats> local_stats = new ThreadLocal<LocalStats>() {
@Override
protected LocalStats initialValue() {
return new LocalStats();
}
};
private final HashSet<LocalStats> all_local_stats = new HashSet<LocalStats>();
private long last_dump = System.currentTimeMillis();
/**
* this method updates totals & resets snapshot
* todo: get rid of TOS 'Profiler' and make this method protected?
*
* @see #getCurrentStatistics()
*/
@NotNull
public List<String> dumpStats() {
Collection<StatisticsGroup> values = takeAndResetSnapshot();
List<StatisticsGroup> al = new ArrayList<StatisticsGroup>();
al.addAll(values);
synchronized (total_stats) {
for (StatisticsGroup source : values) {
String type = source.type + ".TOTAL";
StatisticsGroup dest = total_stats.get(type);
if (dest == null)
total_stats.put(type, dest = new StatisticsGroup(type));
dest.add(source);
}
al.addAll(total_stats.values());
}
return sortAndAddTimes(al);
}
/**
* this method displays currently gathered histogram without affecting state
*
* @see #dumpStats()
*/
@NotNull
public List<String> getCurrentStatistics() {
Collection<StatisticsGroup> snapshot = getCurrentSnapshot();
return sortAndAddTimes(new ArrayList<StatisticsGroup>(snapshot));
}
private List<String> sortAndAddTimes(List<StatisticsGroup> al) {
Collections.sort(al, new Comparator<StatisticsGroup>() {
public int compare(StatisticsGroup o1, StatisticsGroup o2) {
return o1.type.compareTo(o2.type);
}
});
long time = System.currentTimeMillis();
List<String> result = new ArrayList<String>();
for (StatisticsGroup sg : al)
result.add(toString(sg, time - (sg.type.endsWith(".TOTAL") ? start_time : last_dump)));
last_dump = time;
return result;
}
// ========= Internal Data Structures ========
/**
* Accuracy of histogram - the ratio of bar width to its value.
*/
/**
* Confidence interval to be printed together with min/max interval.
*/
/**
* Confidence quantity bounds for logging.
*/
private final double[] confidence_bounds;
/**
* Confidence interval separators for logging.
*/
private final String[] confidence_separators;
/**
* Bounds of histogram bars. Bar number 'i' covers interval
* from bounds[i] inclusive to bounds[i + 1] exclusive.
*/
private final long[] bounds;
/**
* Index for direct access to intervals with small bounds.
*/
private final int[] small_bounds_index;
/**
* Construct new instance of profiler with specified parameters.
*/
public Histograms() {
confidence_bounds = new double[]{0.5 - H_CONFIDENCE * 0.5, 0.5, 0.5 + H_CONFIDENCE * 0.5};
confidence_separators = new String[]{"(", " [", "-", "-", "] ", ")"};
FileLog.rlog("BOUND_LENGTH=" + BOUND_LENGTH);
bounds = new long[BOUND_LENGTH];
bounds[0] = 0;
for (int i = 1; i < BOUND_LENGTH; i++) {
long prev = bounds[i - 1];
long next = prev + (long) ((double) prev * H_ACCURACY);
if (next == prev) // Ensure minimum step for small numbers.
next = prev + 1;
if (next < prev) // Overflow over Long.MAX_VALUE occurred.
next = LONG_MAX_INT;
bounds[i] = next;
}
bounds[BOUND_LENGTH - 1] = LONG_MAX_INT;
small_bounds_index = new int[SBI_SIZE];
for (int i = 0, j = 0; j < SBI_SIZE; i++)
while (j < bounds[i + 1] && j < SBI_SIZE)
small_bounds_index[j++] = i;
}
/**
* Returns histogram index for specified value.
*/
public int getIndex(long value) {
if (value < 0)
return 0;
if (value < small_bounds_index.length)
return small_bounds_index[(int) value];
int l = small_bounds_index[small_bounds_index.length - 1];
int r = bounds.length - 1;
while (l < r) {
int m = (l + r) >> 1;
if (bounds[m] > value)
r = m - 1;
else if (bounds[m + 1] <= value)
l = m + 1;
else
return m;
}
return l;
}
public static final class LocalStats {
public HashMap<ValueType, StatisticsGroup> stats; // Type -> StatisticsGroup
}
/**
* Adds specified samples to statistics.
*/
public void addValue(ValueType t, String name, long value) {
String type = t.getName();
if (value < 0)
value = 0;
int index = getIndex(value);
LocalStats ls = local_stats.get();
boolean create;
create = ls.stats == null;
if (create)
ls.stats = new HashMap<ValueType, StatisticsGroup>();
StatisticsGroup sg = ls.stats.get(t);
if (sg == null)
ls.stats.put(t, sg = new StatisticsGroup(type));
sg.add(name, index, value);
if (create)
synchronized (all_local_stats) {
all_local_stats.add(ls);
}
}
/**
* returns current statistics without resetting anything
*/
private Collection<StatisticsGroup> getCurrentSnapshot() {
List<LocalStats> lss = getLocalStats(false);
HashMap<String, StatisticsGroup> snapshot = new HashMap<String, StatisticsGroup>();
for (LocalStats ls : lss) {
// in case of a snapshot without reset, we have to merge under the lock
mergeStats(snapshot, ls.stats);
}
return snapshot.values();
}
/**
* Returns snapshot of all gathered statistics and clears them in process.
*/
private Collection<StatisticsGroup> takeAndResetSnapshot() {
List<LocalStats> lss = getLocalStats(true);
HashMap<String, StatisticsGroup> snapshot = new HashMap<String, StatisticsGroup>();
for (LocalStats ls : lss) {
HashMap<ValueType, StatisticsGroup> stats;
stats = ls.stats;
/**
* we will re-register this LocalStats on next #add() invocation
* @see #add(String, String, int, long)
*/
ls.stats = null;
mergeStats(snapshot, stats);
}
return snapshot.values();
}
private static void mergeStats(HashMap<String, StatisticsGroup> snapshot, HashMap<ValueType, StatisticsGroup> stats) {
if (stats != null)
for (StatisticsGroup source : stats.values()) {
StatisticsGroup dest = snapshot.get(source.type);
if (dest == null)
snapshot.put(source.type, source);
else
dest.add(source);
}
}
private List<LocalStats> getLocalStats(boolean reset) {
List<LocalStats> lss;
synchronized (all_local_stats) {
lss = new ArrayList<LocalStats>(all_local_stats);
if (reset)
all_local_stats.clear();
}
return lss;
}
/**
* Sorts specified statistics of specified statistics group for logging.
*/
private static void sortStatistics(StatisticsGroup sg, Statistics[] sts) {
final boolean use_total = sg.type.startsWith(SQL_STATEMENT);
Arrays.sort(sts, new Comparator<Statistics>() {
public int compare(Statistics st1, Statistics st2) {
if (use_total && st1.total_value != st2.total_value)
return st1.total_value < st2.total_value ? -1 : 1;
return st1.name.compareTo(st2.name);
}
});
}
// ========== Formatting Methods ==========
private static final double[] multipliers = {1.0, 10.0, 100.0};
private final NumberFormat formatter = NumberFormat.getNumberInstance();
private final FieldPosition field = new FieldPosition(0);
/**
* Formats specified value into specified string buffer. Not thread-safe.
*/
private StringBuffer format(double d, StringBuffer sb) {
int i = Math.abs(d) < 9.995 ? 2 : Math.abs(d) < 99.95 ? 1 : 0;
formatter.setMinimumFractionDigits(0);
formatter.setMaximumFractionDigits(i);
return formatter.format(Math.floor(d * multipliers[i] + 0.5) / multipliers[i], sb, field);
}
/**
* Appends header for specified statistics group for logging.
*/
private void appendHeader(StringBuffer sb, StatisticsGroup sg, long duration) {
double time = duration;
String time_scale = "ms";
if (time >= 24 * 3600 * 1000 * 0.995) {
time /= 24.0 * 3600.0 * 1000.0;
time_scale = "days";
} else if (time >= 3600 * 1000 * 0.995) {
time /= 3600.0 * 1000.0;
time_scale = "hours";
} else if (time >= 60 * 1000 * 0.995) {
time /= 60.0 * 1000.0;
time_scale = "min";
} else if (time >= 1000 * 0.995) {
time /= 1000.0;
time_scale = "sec";
}
sb.append(sg.type).append(" statistics for ");
format(time, sb).append(time_scale).append(" with ");
format(H_ACCURACY * 100.0, sb).append("% accuracy and ");
format(H_CONFIDENCE * 100.0, sb).append("% confidence:");
}
/**
* Appends specified statistics (main part) for logging.
*/
public void appendStatistics(StringBuffer sb, Statistics st, List<Long> report) {
format(st.total_value, sb).append(" / ").append(st.total_count).append(" = ");
format((double) st.total_value / (double) st.total_count, sb);
if (st.total_count < 0) {
sb.append("Total count is less then ZERO!\n");
return;
}
if (st.total_count <= 5) {
// There are too little samples for statistics.
sb.append(" are");
for (int j = 0; j < st.histogram.length; j++)
for (int k = 0; k < st.histogram[j]; k++) {
sb.append(' ');
format((bounds[j] + bounds[j + 1]) / 2, sb);
}
return;
}
// Print full min/confidence/max statistics.
sb.append(" in ").append(confidence_separators[0]);
int min = 0;
while (st.histogram[min] == 0)
min++;
// 'min' is index of interval with min sample.
format(bounds[min], sb).append(confidence_separators[1]);
report.add(bounds[min]);
long acc = 0;
// 'acc' is accumulated number of samples in [0, min - 1].
for (int j = 0; j < confidence_bounds.length; j++) {
long k = (long) Math.floor((double) st.total_count * confidence_bounds[j]);
// Always drop at least 1 'non-confident' sample...
if (k == 0)
k = 1;
if (k == st.total_count)
k = st.total_count - 1;
// 'k' is desired number of samples.
while (acc + st.histogram[min] < k)
acc += st.histogram[min++];
if (k < st.total_count / 2) // Converge to median (from left).
while (acc + st.histogram[min] <= k)
acc += st.histogram[min++];
// Now: acc <= k <= acc + st.histogram[min]
// And desired number of samples is within [min, min + 1)
double d = bounds[min];
if (acc != k)
d += (double) (bounds[min + 1] - 1 - bounds[min]) *
(double) (k - acc) /
(double) st.histogram[min];
format(d, sb).append(confidence_separators[j + 2]);
report.add((long)d);
}
int max = st.histogram.length - 1;
while (st.histogram[max] == 0)
max--;
// 'max' is index of interval with max sample.
long maxValue = bounds[max + 1] - 1;
format(maxValue, sb).append(confidence_separators[5]);
report.add(maxValue);
}
/**
* Formats specified statistics group for logging.
*/
private String toString(StatisticsGroup sg, long duration) {
StringBuffer sb = new StringBuffer(100 + sg.data.size() * 100);
appendHeader(sb, sg, duration);
Statistics[] sts = sg.data.values().toArray(new Statistics[sg.data.size()]);
sortStatistics(sg, sts);
for (Statistics st : sts) {
appendStatistics(sb, st, new ArrayList<Long>());
}
return sb.toString();
}
// ========== Internal Classes ==========
/**
* Performance statistics for single operation.
*/
public static class Statistics {
private static final long[] EMPTY_HISTOGRAM = new long[0];
public final String name;
public long total_value;
public long total_count;
public long[] histogram;
private Statistics(String name) {
this.name = name;
this.histogram = EMPTY_HISTOGRAM;
}
private Statistics(Statistics st) {
this.name = st.name;
this.total_value = st.total_value;
this.total_count = st.total_count;
this.histogram = st.histogram.length == 0 ? EMPTY_HISTOGRAM : st.histogram.clone();
}
public void add(int index, int count, long value) {
total_value += value;
total_count += count;
if (index >= histogram.length) {
int new_length = Math.max(histogram.length, 10);
while (index >= new_length)
new_length = new_length << 1;
long[] new_histogram = new long[new_length];
System.arraycopy(histogram, 0, new_histogram, 0, histogram.length);
histogram = new_histogram;
}
histogram[index] += count;
}
public void add(Statistics st) {
total_value += st.total_value;
total_count += st.total_count;
long[] hist = st.histogram;
if (histogram.length < st.histogram.length) {
hist = histogram;
histogram = st.histogram.clone();
}
for (int i = hist.length; --i >= 0; )
histogram[i] += hist[i];
}
}
/**
* Group of statistics of the same type.
*/
@SuppressWarnings("ForLoopReplaceableByForEach")
public static class StatisticsGroup {
public final String type;
public final HashMap<String, Statistics> data; // Maps statistics name (String) to Statistics.
private StatisticsGroup(String type) {
this.type = type;
this.data = new HashMap<String, Statistics>();
}
public void add(String name, int index, long value) {
Statistics st = data.get(name);
if (st == null)
data.put(name, st = new Statistics(name));
st.add(index, 1, value);
}
public void add(StatisticsGroup sg) {
for (Iterator<Statistics> it = sg.data.values().iterator(); it.hasNext(); ) {
Statistics source = it.next();
Statistics dest = data.get(source.name);
if (dest == null)
data.put(source.name, new Statistics(source));
else
dest.add(source);
}
}
}
/**
* The type of a value.
*/
public enum ValueType {
INVOCATION("Invocation");
/**
* Value type that is used to mean a method call.
*/
private final String name;
/**
* Gets the name of this {@link ValueType}.
*
* @return the name.
*/
public String getName() {
return name;
}
ValueType(String name) {
this.name = name;
}
}
}

View File

@ -0,0 +1,48 @@
package com.irnems;
import com.irnems.models.MafValue;
import com.irnems.models.RpmValue;
/**
* @author Andrey Belomutskiy
* 1/29/13
*/
public class ReportLine {
private final int time;
private final MafValue maf;
private final RpmValue rpm;
private final int wave;
public ReportLine(int time, MafValue maf, RpmValue rpm, int wave) {
this.time = time;
this.maf = maf;
this.rpm = rpm;
this.wave = wave;
}
public int getTime() {
return time;
}
public MafValue getMaf() {
return maf;
}
public RpmValue getRpm() {
return rpm;
}
public int getWave() {
return wave;
}
@Override
public String toString() {
return "ReportLine{" +
"time=" + time +
", maf=" + maf +
", rpm=" + rpm +
", wave=" + wave +
'}';
}
}

Some files were not shown because too many files have changed in this diff Show More