AnalogIn, DigitalIn, DigitalOut, Simulation, and Card classes all working correctly so far

This commit is contained in:
Patrick McDonagh
2017-02-01 14:24:35 -06:00
commit a7073aae9c
46 changed files with 2240 additions and 0 deletions

16
.idea/compiler.xml generated Normal file
View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="poc-java" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="poc-java" target="1.5" />
</bytecodeTargetLevel>
</component>
</project>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.googlecode.json-simple:json-simple:1.1.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: io.mraa:mraa:1.5.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/io/mraa/mraa/1.5.1/mraa-1.5.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/io/mraa/mraa/1.5.1/mraa-1.5.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/io/mraa/mraa/1.5.1/mraa-1.5.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: junit:junit:3.8.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/3.8.1/junit-3.8.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/3.8.1/junit-3.8.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/3.8.1/junit-3.8.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.mongodb:bson:3.4.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/mongodb/bson/3.4.2/bson-3.4.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/mongodb/bson/3.4.2/bson-3.4.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/mongodb/bson/3.4.2/bson-3.4.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.mongodb:mongodb-driver:3.4.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/mongodb/mongodb-driver/3.4.2/mongodb-driver-3.4.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/mongodb/mongodb-driver/3.4.2/mongodb-driver-3.4.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/mongodb/mongodb-driver/3.4.2/mongodb-driver-3.4.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.mongodb:mongodb-driver-core:3.4.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/mongodb/mongodb-driver-core/3.4.2/mongodb-driver-core-3.4.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/mongodb/mongodb-driver-core/3.4.2/mongodb-driver-core-3.4.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/mongodb/mongodb-driver-core/3.4.2/mongodb-driver-core-3.4.2-sources.jar!/" />
</SOURCES>
</library>
</component>

13
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
</component>
</project>

8
.idea/modules.xml generated Normal file
View File

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

583
.idea/workspace.xml generated Normal file
View File

@@ -0,0 +1,583 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="28cc251f-c94f-44ee-a66d-77aaab6e3483" name="Default" comment="" />
<ignored path="$PROJECT_DIR$/target/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="DigitalIn.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/DigitalIn.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="751">
<caret line="92" column="5" lean-forward="true" selection-start-line="38" selection-start-column="4" selection-end-line="92" selection-end-column="5" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="AnalogIn.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/AnalogIn.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="571">
<caret line="63" column="58" lean-forward="false" selection-start-line="63" selection-start-column="58" selection-end-line="63" selection-end-column="58" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1368#1369#0" expanded="true" />
<element signature="e#1405#1406#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="POC.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/POC.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
<caret line="6" column="0" lean-forward="false" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Simulation.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/Simulation.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="780">
<caret line="52" column="0" lean-forward="true" selection-start-line="52" selection-start-column="0" selection-end-line="52" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1403#1404#0" expanded="true" />
<element signature="e#1439#1440#0" expanded="true" />
<element signature="e#1480#1481#0" expanded="true" />
<element signature="e#1512#1513#0" expanded="true" />
<element signature="e#1549#1550#0" expanded="true" />
<element signature="e#1586#1587#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="DigitalOut.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/DigitalOut.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="691">
<caret line="76" column="30" lean-forward="true" selection-start-line="76" selection-start-column="30" selection-end-line="76" selection-end-column="30" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1109#1110#0" expanded="true" />
<element signature="e#1148#1149#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Well.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/Well.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="241">
<caret line="560" column="33" lean-forward="false" selection-start-line="560" selection-start-column="33" selection-end-line="560" selection-end-column="33" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
</list>
</option>
</component>
<component name="GradleLocalSettings">
<option name="externalProjectsViewState">
<projects_view />
</option>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/src/main/java/com/henrypump/poc/Well.java" />
<option value="$PROJECT_DIR$/pom.xml" />
<option value="$PROJECT_DIR$/src/main/java/com/henrypump/poc/DigitalOut.java" />
<option value="$PROJECT_DIR$/src/main/java/com/henrypump/poc/DigitalIn.java" />
<option value="$PROJECT_DIR$/src/main/java/com/henrypump/poc/AnalogIn.java" />
<option value="$PROJECT_DIR$/src/main/java/com/henrypump/poc/POC.java" />
<option value="$PROJECT_DIR$/src/main/java/com/henrypump/poc/Simulation.java" />
</list>
</option>
</component>
<component name="MavenImportPreferences">
<option name="importingSettings">
<MavenImportingSettings>
<option name="importAutomatically" value="true" />
</MavenImportingSettings>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="38" />
<option name="y" value="23" />
<option name="width" value="1870" />
<option name="height" value="962" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers ProjectPane="true" />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scratches" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="poc-java" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="External Libraries" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ExternalLibrariesNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="poc-java" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="poc-java" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="poc-java" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="poc-java" />
<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>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="poc-java" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="poc-java" />
<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="main" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="java" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="poc" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="Scope" />
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
</component>
<component name="RunManager">
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<predefined_log_file id="idea.log" enabled="true" />
<method />
</configuration>
<configuration default="true" type="AndroidRunConfigurationType" factoryName="Android App">
<module name="" />
<option name="DEPLOY" value="true" />
<option name="ARTIFACT_NAME" value="" />
<option name="PM_INSTALL_OPTIONS" value="" />
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
<option name="MODE" value="default_activity" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="PREFERRED_AVD" value="" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
<option name="FORCE_STOP_RUNNING_APP" value="true" />
<option name="DEBUGGER_TYPE" value="Java" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<Java />
<Profilers>
<option name="ENABLE_ADVANCED_PROFILING" value="true" />
<option name="GAPID_ENABLED" value="false" />
<option name="GAPID_DISABLE_PCS" value="false" />
<option name="SUPPORT_LIB_ENABLED" value="true" />
<option name="INSTRUMENTATION_ENABLED" value="true" />
</Profilers>
<option name="DEEP_LINK" value="" />
<option name="ACTIVITY_CLASS" value="" />
<method />
</configuration>
<configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
<module name="" />
<option name="TESTING_TYPE" value="0" />
<option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
<option name="METHOD_NAME" value="" />
<option name="CLASS_NAME" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="EXTRA_OPTIONS" value="" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="PREFERRED_AVD" value="" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
<option name="FORCE_STOP_RUNNING_APP" value="true" />
<option name="DEBUGGER_TYPE" value="Java" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<Java />
<Profilers>
<option name="ENABLE_ADVANCED_PROFILING" value="true" />
<option name="GAPID_ENABLED" value="false" />
<option name="GAPID_DISABLE_PCS" value="false" />
<option name="SUPPORT_LIB_ENABLED" value="true" />
<option name="INSTRUMENTATION_ENABLED" value="true" />
</Profilers>
<method />
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<module />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<method />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list />
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<method />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="JarApplication" factoryName="JAR Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<envs />
<method />
</configuration>
<configuration default="true" type="Java Scratch" factoryName="Java Scratch">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="SCRATCH_FILE_ID" value="0" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="JetRunConfigurationType" factoryName="Kotlin">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="poc-java" />
<envs />
<method />
</configuration>
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType" factoryName="Kotlin script">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="filePath" />
<option name="vmParameters" />
<option name="alternativeJrePath" />
<option name="programParameters" />
<option name="passParentEnvs" value="true" />
<option name="workingDirectory" />
<option name="isAlternativeJrePathEnabled" value="false" />
<envs />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="28cc251f-c94f-44ee-a66d-77aaab6e3483" name="Default" comment="" />
<created>1485905737979</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1485905737979</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="38" y="23" width="1870" height="962" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Nl-Palette" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" 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" show_stripe_button="true" weight="0.33" sideWeight="0.5" 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" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Properties" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24973261" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" 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="XDebuggerManager">
<breakpoint-manager />
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/Card.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="75">
<caret line="5" column="13" lean-forward="false" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/test/java/com/henrypump/poc/AppTest.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="9" column="13" lean-forward="false" selection-start-line="9" selection-start-column="13" selection-end-line="9" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="jar://$MAVEN_REPOSITORY$/io/mraa/mraa/1.5.1/mraa-1.5.1.jar!/mraa/IntelEdison.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285">
<caret line="22" column="36" lean-forward="false" selection-start-line="22" selection-start-column="36" selection-end-line="22" selection-end-column="36" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pom.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="450">
<caret line="30" column="45" lean-forward="false" selection-start-line="30" selection-start-column="45" selection-end-line="30" selection-end-column="45" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/Well.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="241">
<caret line="560" column="33" lean-forward="false" selection-start-line="560" selection-start-column="33" selection-end-line="560" selection-end-column="33" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/DigitalOut.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="691">
<caret line="76" column="30" lean-forward="true" selection-start-line="76" selection-start-column="30" selection-end-line="76" selection-end-column="30" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1109#1110#0" expanded="true" />
<element signature="e#1148#1149#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/DigitalIn.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="751">
<caret line="92" column="5" lean-forward="true" selection-start-line="38" selection-start-column="4" selection-end-line="92" selection-end-column="5" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/AnalogIn.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="571">
<caret line="63" column="58" lean-forward="false" selection-start-line="63" selection-start-column="58" selection-end-line="63" selection-end-column="58" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1368#1369#0" expanded="true" />
<element signature="e#1405#1406#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/POC.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
<caret line="6" column="0" lean-forward="false" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/Simulation.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="780">
<caret line="52" column="0" lean-forward="true" selection-start-line="52" selection-start-column="0" selection-end-line="52" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1403#1404#0" expanded="true" />
<element signature="e#1439#1440#0" expanded="true" />
<element signature="e#1480#1481#0" expanded="true" />
<element signature="e#1512#1513#0" expanded="true" />
<element signature="e#1549#1550#0" expanded="true" />
<element signature="e#1586#1587#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.henrypump.poc</groupId>
<artifactId>poc-java</artifactId>
<name>poc-java</name>
<version>1.0-SNAPSHOT</version>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer>
<mainClass>com.henrypump.poc.Well</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

20
poc-java.iml Normal file
View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
<orderEntry type="library" name="Maven: io.mraa:mraa:1.5.1" level="project" />
<orderEntry type="library" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" name="Maven: org.mongodb:mongodb-driver:3.4.2" level="project" />
<orderEntry type="library" name="Maven: org.mongodb:bson:3.4.2" level="project" />
<orderEntry type="library" name="Maven: org.mongodb:mongodb-driver-core:3.4.2" level="project" />
</component>
</module>

59
pom.xml Normal file
View File

@@ -0,0 +1,59 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.henrypump.poc</groupId>
<artifactId>poc-java</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>poc-java</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.mraa/mraa -->
<dependency>
<groupId>io.mraa</groupId>
<artifactId>mraa</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mongodb/mongo-java-driver -->
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver</artifactId>
<version>3.4.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.henrypump.poc.Well</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,76 @@
package com.henrypump.poc;
/**
* Created by patrickjmcd on 2/1/17.
*/
import mraa.Dir;
import mraa.Aio;
import mraa.mraa;
import mraa.Platform;
import mraa.Result;
import static java.lang.Thread.sleep;
public class AnalogIn {
private int channel;
private Aio gpioPin;
private double lastValue;
private double rawMin;
private double rawMax;
private double euMin;
private double euMax;
static {
try {
System.loadLibrary("mraajava");
} catch (UnsatisfiedLinkError e) {
System.err.println(
"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
e);
System.exit(1);
}
}
AnalogIn(int channel, double rawMin, double rawMax, double euMin, double euMax){
Platform platform = mraa.getPlatformType();
if (platform != Platform.INTEL_EDISON_FAB_C) {
System.err.println("Error: This program can only be run on edison");
System.exit(Result.ERROR_INVALID_PLATFORM.swigValue());
}
this.channel = channel;
this.gpioPin = new Aio(this.channel);
this.rawMax = rawMax;
this.rawMin = rawMin;
this.euMax = euMax;
this.euMin = euMin;
}
public long readRaw(){
return gpioPin.read();
}
public double readScaled(){
double pv = ((euMax - euMin)/(rawMax - rawMin)) * gpioPin.read() + (euMax - ((euMax - euMin)/(rawMax - rawMin)) * rawMax);
lastValue = pv;
return pv;
}
public static void main(String[] args){
System.out.println("Testing Analog Inputs Inputs...");
boolean forceEnd = false;
AnalogIn testIn0 = new AnalogIn(0, 0, 1020, 0, 4.6);
do {
try{
System.out.println("Raw = " + testIn0.readRaw());
System.out.println("Scaled = " + testIn0.readScaled());
sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
} while (!forceEnd);
}
}

View File

@@ -0,0 +1,13 @@
package com.henrypump.poc;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}

View File

@@ -0,0 +1,53 @@
package com.henrypump.poc;
/**
* Created by patrickjmcd on 1/31/17.
*/
public class Card {
// Card Points
private int maxPoints = 1500;
private double[] surfacePosition = new double[maxPoints];
private double[] downholePosition = new double[maxPoints];
private double[] surfaceLoad = new double[maxPoints];
private double[] downholeLoad = new double[maxPoints];
//Card
private int strokeNumber;
private LPPair surfacePositionMax;
public void setSurfacePosition(int i, double position){
this.surfacePosition[i] = position;
};
public void setDownholePosition(int i, double position){
this.downholePosition[i] = position;
};
public void setSurfaceLoad(int i, double load){
this.surfaceLoad[i] = load;
};
public void setDownholeLoad(int i, double load){
this.downholeLoad[i] = load;
};
public double[] getSurfacePosition() {
return this.surfacePosition;
}
public double[] getDownholePosition() {
return this.downholePosition;
}
public double[] getSurfaceLoad() {
return this.surfaceLoad;
}
public double[] getDownholeLoad() {
return this.downholeLoad;
}
public LPPair getSurfacePositionMax() {
return this.surfacePositionMax;
}
}

View File

@@ -0,0 +1,96 @@
package com.henrypump.poc;
/**
* Created by patrickjmcd on 1/31/17.
*/
/*
* Author: Brendan Le Foll <brendan.le.foll@intel.com>
* Author: Petre Eftime <petre.p.eftime@intel.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import mraa.Dir;
import mraa.Gpio;
import mraa.mraa;
import mraa.Platform;
import mraa.Result;
public class DigitalIn {
private int channel;
private Gpio gpioPin;
private int lastValue;
static {
try {
System.loadLibrary("mraajava");
} catch (UnsatisfiedLinkError e) {
System.err.println(
"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
e);
System.exit(1);
}
}
DigitalIn(int channel){
Platform platform = mraa.getPlatformType();
if (platform != Platform.INTEL_EDISON_FAB_C) {
System.err.println("Error: This program can only be run on edison");
System.exit(Result.ERROR_INVALID_PLATFORM.swigValue());
}
this.channel = channel;
this.gpioPin = new Gpio(this.channel);
gpioPin.dir(Dir.DIR_IN);
}
public int read(){
lastValue = gpioPin.read();
return lastValue;
}
public static void main(String[] args){
System.out.println("Testing Digital Inputs. Script will loop until ch8 and ch9 both equal 1");
boolean forceEnd = false;
DigitalIn testIn8 = new DigitalIn(8);
DigitalIn testIn9 = new DigitalIn(9);
DigitalOut testOut2 = new DigitalOut(2);
DigitalOut testOut3 = new DigitalOut(3);
int in8val, in9val;
do {
in8val = testIn8.read();
in9val = testIn9.read();
testOut2.write(in8val);
testOut3.write(in9val);
if (in8val == 1 && in9val == 1) forceEnd = true;
testOut2.write(0);
testOut3.write(0);
} while (!forceEnd);
}
}

View File

@@ -0,0 +1,84 @@
package com.henrypump.poc;
/**
* Created by patrickjmcd on 2/1/17.
*/
import mraa.Dir;
import mraa.Gpio;
import mraa.mraa;
import mraa.Platform;
import mraa.Result;
import static java.lang.Thread.sleep;
public class DigitalOut {
private int channel;
private Gpio gpioPin;
static {
try {
System.loadLibrary("mraajava");
} catch (UnsatisfiedLinkError e) {
System.err.println(
"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
e);
System.exit(1);
}
}
DigitalOut(int channel){
Platform platform = mraa.getPlatformType();
if (platform != Platform.INTEL_EDISON_FAB_C) {
System.err.println("Error: This program can only be run on edison");
System.exit(Result.ERROR_INVALID_PLATFORM.swigValue());
}
this.channel = channel;
this.gpioPin = new Gpio(this.channel);
gpioPin.dir(Dir.DIR_OUT);
}
public void write(int writeVal){
gpioPin.write(writeVal);
}
public static void main(String[] args){
try {
DigitalOut testOut2 = new DigitalOut(2);
testOut2.write(1);
sleep(500);
testOut2.write(0);
DigitalOut testOut3 = new DigitalOut(3);
testOut3.write(1);
sleep(500);
testOut3.write(0);
DigitalOut testOut4 = new DigitalOut(4);
testOut4.write(1);
sleep(500);
testOut4.write(0);
DigitalOut testOut5 = new DigitalOut(5);
testOut5.write(1);
sleep(500);
testOut5.write(0);
DigitalOut testOut6 = new DigitalOut(6);
testOut6.write(1);
sleep(500);
testOut6.write(0);
DigitalOut testOut7 = new DigitalOut(7);
testOut7.write(1);
sleep(500);
testOut7.write(0);
} catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
}
}

View File

@@ -0,0 +1,23 @@
package com.henrypump.poc;
/**
* Created by patrickjmcd on 1/31/17.
*/
public class LPPair {
private double position;
private double load;
public LPPair(double position, double load){
this.position = position;
this.load = load;
};
public double getPosition(){
return this.position;
};
public double getLoad(){
return this.load;
};
}

View File

@@ -0,0 +1,17 @@
package com.henrypump.poc;
/**
* Created by patrickjmcd on 1/31/17.
*/
public class LPStatus extends LPPair{
private int status;
public LPStatus(double position, double load, int status) {
super(position, load);
this.status = status;
}
public int getStatus() {
return status;
}
}

View File

@@ -0,0 +1,8 @@
package com.henrypump.poc;
/**
* Created by patrickjmcd on 2/1/17.
*/
public class POC {
}

View File

@@ -0,0 +1,72 @@
package com.henrypump.poc;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Created by patrickjmcd on 2/1/17.
*/
public class Simulation {
private double[] position = new double[1000];
private double[] load = new double[1000];
private int lastFilledIndex = 0;
private void parseCSV(String filename){
BufferedReader br = null;
String line = "";
String cvsSplitBy = ",";
int lineNum = 0;
try {
br = new BufferedReader(new FileReader(filename));
while ((line = br.readLine()) != null) {
// use comma as separator
String[] splitLine = line.split(cvsSplitBy);
position[lineNum] = Double.parseDouble(splitLine[0]);
load[lineNum] = Double.parseDouble(splitLine[1]);
lineNum++;
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (br != null) {
lastFilledIndex = lineNum - 1;
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
public double positionAtIndex(int ind){
return position[ind];
}
public double loadAtIndex(int ind){
return load[ind];
}
Simulation(String simFilePath){
parseCSV(simFilePath);
}
public static void main(String[] args){
Simulation sim = new Simulation(args[0]);
for(int i = 0; i <= sim.lastFilledIndex; i++){
System.out.println("Position: " + sim.positionAtIndex(i) + ", Load: "+ sim.loadAtIndex(i));
}
}
}

View File

@@ -0,0 +1,595 @@
package com.henrypump.poc;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import static java.lang.Math.exp;
import static java.lang.Math.pow;
import static java.lang.Math.sqrt;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Created by patrickjmcd on 1/31/17.
*/
public class Well {
private double[][] topPosArray = new double[10][100];
private double[][] topLoadArray = new double[10][100];
// CONSTANTS
private static double YM_STEEL = 30.5;
private static double YM_FIBERGLASS = 7.2;
private static final int BAD_STATUS = 0;
private static final int GOOD_STATUS = 0;
// USER INPUTS
private double dt;
private double tubingHeadPressure;
private double fluidGradient;
private double sbfriction;
private int numTapers;
private double tubingAnchorDepth;
private double pumpDiameter;
private double tubingID, tubingOD;
private double structuralRating;
private double[] c = new double[11];
private double[] rodLength = new double[11];
private double[] rodDiameter = new double[11];
private double[] rodYM = new double[11];
private double[] rodWeightPerFoot = new double[11];
// CALCULATED TAPER PARAMETERS
private int nT1; // should always be equal to number of tapers + 1
private double frictionEstimate;
private double theoreticalMaxFluidLoad;
private double[] a = new double[11];
private double[] area = new double[11];
private double[] pressure = new double[11];
private double[] buoyantForce = new double[11];
private double buoyantForceTotal;
private double[] stretch = new double[11];
private double[] weightData = new double[11];
private double weightDataTotal;
private double[] annularForceData = new double[11];
private double annularForceDataTotal;
private double[] force = new double[11];
private double[] alpha = new double[11];
private double[] xOverA = new double[11];
private double[] factor = new double[11];
private int[] lagIndex = new int[11];
private int[] lengthRequired = new int[11];
private int[] centerPoint = new int[11];
private double[] rodDepth = new double[11];
private double rodDepthTotal;
private double[] rodWeightAir = new double[11];
private double rodWeightAirTotal;
private double[] rodWeightFluid = new double[11];
private double rodWeightFluidTotal;
private double pumpArea;
private double tubingCrossSectionalArea;
// Intermediate Variables
private double loadBefore = 0.0;
private double loadAfter = 0.0;
private double loadBefore3 = 0.0;
private double loadAfter3 = 0.0;
private int[] count = new int[11];
private double sPositionPrevious;
public double getDt() {
return dt;
}
public void setDt(double dt) {
this.dt = dt;
}
public double getTubingHeadPressure() {
return tubingHeadPressure;
}
public void setTubingHeadPressure(double tubingHeadPressure) {
this.tubingHeadPressure = tubingHeadPressure;
}
public double getFluidGradient() {
return fluidGradient;
}
public void setFluidGradient(double fluidGradient) {
this.fluidGradient = fluidGradient;
}
public double getSbfriction() {
return sbfriction;
}
public void setSbfriction(double sbfriction) {
this.sbfriction = sbfriction;
}
public int getNumTapers() {
return numTapers;
}
public void setNumTapers(int numTapers) {
this.numTapers = numTapers;
}
public double getTubingAnchorDepth() {
return tubingAnchorDepth;
}
public void setTubingAnchorDepth(double tubingAnchorDepth) {
this.tubingAnchorDepth = tubingAnchorDepth;
}
public double getPumpDiameter() {
return pumpDiameter;
}
public void setPumpDiameter(double pumpDiameter) {
this.pumpDiameter = pumpDiameter;
this.pumpArea = pow(pumpDiameter, 2) * Math.PI;
}
public double getTubingID() {
return tubingID;
}
public void setTubingID(double tubingID) {
this.tubingID = tubingID;
this.tubingCrossSectionalArea = (Math.PI / 4) * (pow(this.tubingOD, 2) - pow(this.tubingID,2));
}
public double getTubingOD() {
return tubingOD;
}
public void setTubingOD(double tubingOD) {
this.tubingOD = tubingOD;
this.tubingCrossSectionalArea = (Math.PI / 4) * (pow(this.tubingOD, 2) - pow(tubingID,2));
}
public void setDampingFactor(int i, double c) {
this.c[i] = c;
}
public double getDampingFactor(int i){ return c[i]; }
public void setRodLength(int i, double rodLength) {
this.rodLength[i] = rodLength;
}
public double getRodLength(int i){ return rodLength[i]; }
public void setRodDiameter(int i, double rodDiameter) {
this.rodDiameter[i] = rodDiameter;
}
public double getRodDiameter(int i){ return rodDiameter[i]; }
public void setRodYM(int i, String material) {
if (material.toLowerCase().equals("steel")) rodYM[i] = YM_STEEL;
else if (material.toLowerCase().equals("fiberglass")) rodYM[i] = YM_FIBERGLASS;
}
public double getRodYM(int i){ return rodYM[i]; }
public String getRodMaterial(int i){
if(rodYM[i] == YM_STEEL)
return "steel";
if(rodYM[i] == YM_FIBERGLASS)
return "fiberglass";
return "unknown";
}
public double getStructuralRating() {
return structuralRating;
}
public void setStructuralRating(double structuralRating) {
this.structuralRating = structuralRating;
}
public static double lookupRodWeightPerFoot(double i_ym, double i_diam) {
double wtPerFt;
if (i_ym == YM_STEEL) {
if (i_diam <= 2 && i_diam > 1.75) {
wtPerFt = 10.7;
} else if (i_diam <= 1.75 && i_diam > 1.65) {
wtPerFt = 8.2;
} else if (i_diam <= 1.65 && i_diam > 1.5) {
wtPerFt = 7;
} else if (i_diam <= 1.5 && i_diam > 1.375) {
wtPerFt = 6;
} else if (i_diam <= 1.375 && i_diam > 1.125) {
wtPerFt = 5;
} else if (i_diam <= 1.125 && i_diam > 1) {
wtPerFt = 3.676;
} else if (i_diam <= 1 && i_diam > 0.875) {
wtPerFt = 2.904;
} else if (i_diam <= 0.875 && i_diam > 0.75) {
wtPerFt = 2.224;
} else if (i_diam <= 0.75 && i_diam > 0.625) {
wtPerFt = 1.634;
} else if (i_diam <= 0.625 && i_diam > 0.5) {
wtPerFt = 1.13;
} else if (i_diam <= 0.5) {
wtPerFt = 0.72;
} else {
wtPerFt = 0;
}
} else if (i_ym == YM_FIBERGLASS) {
if (i_diam <= 1.25 && i_diam > 1.125) {
wtPerFt = 1.2879;
} else if (i_diam <= 1.125 && i_diam > 1) {
wtPerFt = 1.09;
} else if (i_diam <= 1 && i_diam > 0.875) {
wtPerFt = 0.8188;
} else if (i_diam <= 0.875 && i_diam > 0.75) {
wtPerFt = 0.6108;
} else if (i_diam <= 0.75) {
wtPerFt = 0.484;
} else {
wtPerFt = 0;
}
} else {
wtPerFt = 0;
}
return wtPerFt;
};
public void parseJSONFile(String jsonFilename){
JSONParser parser = new JSONParser();
try {
Object obj = parser.parse(new FileReader(jsonFilename));
JSONObject well = (JSONObject) obj;
Object newDeltaT = well.get("deltaT");
if (newDeltaT != null) dt = (Double) newDeltaT;
Object newPumpDiameter = well.get("pumpDiameter");
if (newPumpDiameter != null) setPumpDiameter((Double) newPumpDiameter);
Object newFluidGradient = well.get("fluidGradient");
if (newFluidGradient != null) fluidGradient = (Double) newFluidGradient;
Object newTubingID = well.get("tubingID");
if (newTubingID != null) setTubingID((Double) newTubingID);
Object newTubingOD = well.get("tubingOD");
if (newTubingOD != null) setTubingOD((Double) newTubingOD);
Object newTubingAnchorDepth = well.get("tubingAnchorDepth");
if (newTubingAnchorDepth != null) tubingAnchorDepth = (Double) newTubingAnchorDepth;
Object newStructuralRating = well.get("structuralRating");
if (newStructuralRating != null) structuralRating = (Double) newStructuralRating;
Object newStuffingBoxFriction = well.get("stuffingBoxFriction");
if (newStuffingBoxFriction != null) setSbfriction((Double) newStuffingBoxFriction);
Object newTubingHeadPressure = well.get("tubingOD");
if (newTubingHeadPressure != null) setTubingOD((Double) newTubingHeadPressure);
JSONArray tapers = (JSONArray) well.get("tapers");
numTapers = tapers.size();
for (int i = 0; i < numTapers; i++){
int currentTaperNum = i + 1;
JSONObject taperObj = (JSONObject) tapers.get(i);
Object newLength = taperObj.get("length");
if (newLength != null) setRodLength(currentTaperNum, (Double) newLength);
Object newDiameter = taperObj.get("diameter");
if (newDiameter != null) setRodDiameter(currentTaperNum, (Double) newDiameter);
Object newMaterial = taperObj.get("material");
System.out.println("found material " + (String) newMaterial);
if (newMaterial != null) setRodYM(currentTaperNum, (String) newMaterial);
Object newDampingFactor = taperObj.get("dampingFactor");
if (newDampingFactor != null) setDampingFactor(currentTaperNum, (Double) newDampingFactor);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
}
}
public void printTapers(){
System.out.println("=== INPUT PARAMETERS ===");
System.out.println("DeltaT: " + getDt());
System.out.println("Fluid Gradient: " + getFluidGradient());
System.out.println("Pump Diameter: " + getPumpDiameter());
System.out.println("Stuffing Box Friction: " + getSbfriction());
System.out.println("Structural Rating: " + getStructuralRating());
System.out.println("Tubing Anchor Depth: " + getTubingAnchorDepth());
System.out.println("Tubing Head Pressure: " + getTubingHeadPressure());
System.out.println("Tubing ID: " + getTubingID());
System.out.println("Tubing OD: " + getTubingOD());
System.out.println("Number of Tapers: " + getNumTapers());
System.out.println("");
for(int i = 1; i <= numTapers; i++){
System.out.printf("=== Taper %d === \n", i);
System.out.println("Rod Length: " + getRodLength(i));
System.out.println("Rod Diameter: " + getRodDiameter(i));
System.out.println("Rod Damping Factor: " + getDampingFactor(i));
System.out.println("Rod Material: " + getRodMaterial(i));
System.out.println("Rod Young's Modulus: " + getRodYM(i));
System.out.println("");
}
};
public void updateTapers(){
nT1 = numTapers + 1;
// start by setting everything to 0
a[0] = 0.0;
area[0] = 0.0;
area[numTapers + 1] = 0.0;
pressure[0] = tubingHeadPressure;
buoyantForce[0] = 0.0;
stretch[0] = 0.0;
weightData[0] = 0.0;
annularForceData[0] = 0.0;
force[0] = 0.0;
alpha[0] = 0.0;
xOverA[0] = 0.0;
factor[0] = 0.0;
lagIndex[0] = 0;
lengthRequired[0] = 0;
centerPoint[0] = 0;
rodDepth[0] = 0.0;
rodWeightAir[0] = 0.0;
rodWeightFluid[0] = 0.0;
buoyantForceTotal = 0.0;
weightDataTotal = 0.0;
annularForceDataTotal = 0.0;
rodDepthTotal = 0.0;
rodWeightAirTotal = 0.0;
rodWeightFluidTotal = 0.0;
for(int i = 1; i < nT1; i++){
rodWeightPerFoot[i] = lookupRodWeightPerFoot(rodYM[i], rodDiameter[i]);
}
for (int area_i = 1; area_i < nT1; area_i++)
{
area[area_i] = (Math.PI / 4) * pow(rodDiameter[area_i], 2);
}
for (int i = 1; i < nT1; i++)
{
a[i] = 1000 * sqrt(32.2 * rodYM[i] * area[i] / rodWeightPerFoot[i]);
rodDepth[i] = rodDepth[i - 1] + rodLength[i];
pressure[i] = pressure[i - 1] + fluidGradient * rodLength[i];
buoyantForce[i] = pressure[i] * (area[i + 1] - area[i]);
rodWeightAir[i] = rodWeightPerFoot[i] * rodLength[i];
rodWeightFluid[i] = rodWeightAir[i] + buoyantForce[i];
}
for (int j = 1; j < nT1; j++)
{
for (int k = j + 1; k < nT1; k++)
{
weightData[j] += rodWeightAir[k]; // how much weight is felt on each taper
}
for (int l = j; l < numTapers; l++)
{
annularForceData[j] += -buoyantForce[l]; //buoyant force exerted on each taper
}
force[j] = (-area[numTapers] * pressure[numTapers]) + weightData[j] - annularForceData[j];
alpha[j] = (force[j] + rodWeightAir[j]) / (rodYM[j] * pow(10, 6) * area[j]);
stretch[j] = (stretch[j - 1] + (alpha[j] * rodLength[j])) - ((rodWeightPerFoot[j] * pow(rodLength[j], 2)) / (2 * rodYM[j] * pow(10, 6) * area[j]));
}
for (int m = 1; m < nT1; m++)
{
xOverA[m] = rodLength[m] / a[m];
lagIndex[m] = (int)(rodLength[m] / (a[m] * dt));
factor[m] = (xOverA[m] - lagIndex[m] * dt) / dt;
centerPoint[m] = lagIndex[m] + 2;
lengthRequired[m] = 2 * (lagIndex[m] + 1) + 1;
}
for (int t = 0; t < nT1; t++)
{
buoyantForceTotal += buoyantForce[t];
rodWeightAirTotal += rodWeightAir[t];
rodWeightFluidTotal += rodWeightFluid[t];
rodDepthTotal += rodLength[t];
annularForceDataTotal += annularForceData[t];
weightDataTotal += weightData[t];
}
theoreticalMaxFluidLoad = fluidGradient* rodDepthTotal* pumpArea;
frictionEstimate = 0.10 * rodDepthTotal;
}
private double position(int p)
//generate the downhole position of the given rod part
{
loadBefore = 0;
loadAfter = 0;
loadBefore3 = 0;
loadAfter3 = 0;
//Temporary Variables
double a1 = a[p];
double cd = c[p];
double fact = factor[p];
double rodLengthp = rodLength[p];
int lagInd = lagIndex[p];
double Y1 = rodYM[p] * pow(10, 6);
double A1 = area[p];
int centerOfArray = centerPoint[p];
int iBefore = centerOfArray - lagInd;
int iAfter = centerOfArray + lagInd;
double pumpPOS = 0;
//Do work
pumpPOS = exp((cd * rodLengthp) / (2 * a1)) * (topPosArray[p][iAfter] + fact * (topPosArray[p][ iAfter + 1] - topPosArray[p][iAfter]));
pumpPOS += exp(-(cd * rodLengthp) / (2 * a1)) * (topPosArray[p][iBefore] + fact * (topPosArray[p][iBefore - 1] - topPosArray[p][iBefore]));
pumpPOS = pumpPOS / 2;
double insideIntegral = 0;
int q = 1;
while (q < 2 * lagInd - 1)
{
insideIntegral += dt * (1 / (Y1 * A1)) * (exp(-(cd * (lagInd - q) * dt) / 2) * topLoadArray[p][iBefore + q]);
q++;
}
insideIntegral += 0.5 * dt * (1 / (Y1 * A1)) * (exp(-(cd * lagInd * dt) / 2) * topLoadArray[p][iBefore] + exp(-(cd * (-lagInd) * dt) / 2) * topLoadArray[p][iAfter]);
loadBefore = exp(-(cd * lagInd * dt) / 2) * topLoadArray[p][iBefore] + fact * (exp(-(cd * (lagInd + 1) * dt) / 2) * topLoadArray[p][iBefore - 1] - exp(-(cd * lagInd * dt) / 2) * topLoadArray[p][iBefore]);
loadAfter = exp(-(cd * (-lagInd) * dt) / 2) * topLoadArray[p][iAfter] + fact * (exp(-(cd * (-lagInd - 1) * dt) / 2) * topLoadArray[p][iAfter + 1] - exp(-(cd * (-lagInd) * dt) / 2) * topLoadArray[p][iAfter]);
insideIntegral += 0.5 * fact * dt * (1 / (Y1 * A1)) * (loadBefore + exp(-(cd * (lagInd) * dt) / 2) * topLoadArray[p][iBefore]);
insideIntegral += 0.5 * fact * dt * (1 / (Y1 * A1)) * (loadAfter + exp(-(cd * (-lagInd) * dt) / 2) * topLoadArray[p][iAfter]);
insideIntegral = 0.5 * a1 * insideIntegral;
pumpPOS += insideIntegral;
insideIntegral = 0;
int r = 1;
while (r < 2 * lagInd - 1)
{
insideIntegral += dt * (exp(-(cd * lagInd - r) * dt) / 2) * (topPosArray[p][iBefore + r]);
r++;
}
insideIntegral += 0.5 * dt * (exp(-(cd * lagInd * dt) / 2) * topPosArray[p][iBefore] + exp(-(cd * (-lagInd) * dt) / 2) * topPosArray[p][iAfter]);
loadBefore3 = exp(-(cd * (lagInd) * dt) / 2) * topPosArray[p][iBefore] + fact * (exp(-(cd * (lagInd + 1) * dt) / 2) * topPosArray[p][iBefore] - exp(-(cd * (lagInd) * dt) / 2) * topPosArray[p][iBefore]);
loadAfter3 = exp(-(cd * (-lagInd) * dt) / 2) * topPosArray[p][iAfter] + fact * (exp(-(cd * (-lagInd - 1) * dt) / 2) * topPosArray[p][iAfter] - exp(-(cd * (-lagInd) * dt) / 2) * topPosArray[p][iAfter]);
insideIntegral += 0.5 * fact * dt * (loadBefore3 + exp(-(cd * (lagInd) * dt) / 2) * topPosArray[p][iBefore]);
insideIntegral += 0.5 * fact * dt * (loadAfter3 + exp(-(cd * (-lagInd) * dt) / 2) * topPosArray[p][iAfter]);
insideIntegral = -((cd * rodLengthp) / 4) * (0.5 * (cd / (2 * a1))) * insideIntegral;
pumpPOS += insideIntegral;
//printf("Position: %f\n", pumpPOS);
return pumpPOS;
};
private double load(int s)
//calculate the downhole load of the given rod part
{
//temporary variables
double a1 = a[s];
double cd = c[s];
double rodLengths = rodLength[s];
int lagInd = lagIndex[s];
double Y1 = rodYM[s] * pow(10, 6);
double A1 = area[s];
int centerOfArray = centerPoint[s];
int iBefore = centerOfArray - lagInd;
int iAfter = centerOfArray + lagInd;
double pumpLOAD = 0;
pumpLOAD = 0.5 * (a1 / (Y1 * A1)) * (1 / a1) * (loadBefore + loadAfter);
pumpLOAD += -((cd * rodLengths) / 4) * (0.5 * (cd / (2 * a1))) * (1 / a1) * (loadBefore3 + loadAfter3);
double firstPart = 0;
double pointAfter = (topPosArray[s][iAfter + 1] - topPosArray[s][iAfter - 1]) / (2 * dt);
double pointBefore = (topPosArray[s][iBefore + 1] - topPosArray[s][iBefore - 1]) / (2 * dt);
firstPart = (exp((cd * rodLengths) / (2 * a1)) * pointAfter - exp(-(cd * rodLengths) / (2 * a1)) * pointBefore) / (2 * a1);
firstPart += (cd * exp((cd * rodLengths) / (2 * a1)) * topPosArray[s][iAfter] - cd * exp((-cd * rodLengths) / (2 * a1)) * topPosArray[s][iBefore]) / (4 * a1);
pumpLOAD = Y1 * A1 * (firstPart + pumpLOAD);
//printf("Load: %f\n", pumpLOAD);
return pumpLOAD;
};
public LPStatus calc(double sPosition, double sLoad){
boolean useShift = false;
int loadMult = 1;
int tapersAllowed = 1;
double dPosition = 0;
double dLoad = 0;
int status = BAD_STATUS;
for (int ii = 1; ii < lengthRequired[1] + 1; ii++)
{
topPosArray[1][ii - 1] = topPosArray[1][ii];
topLoadArray[1][ii - 1] = topLoadArray[1][ii];
}
topPosArray[1][lengthRequired[1]] = -(sPosition / 12); //stores current position in feet
if (sPosition > sPositionPrevious)
{
topLoadArray[1][lengthRequired[1]] = loadMult * (sLoad - rodWeightFluidTotal) - sbfriction;
}
else
{
topLoadArray[1][lengthRequired[1]] = loadMult * (sLoad - rodWeightFluidTotal) + sbfriction;
}
int j = 1;
while (j <= tapersAllowed)
{
count[j]++;
if (count[j] >= lengthRequired[j])
{
if ((j + 1) <= numTapers)
{
for (int jj = 2; jj < lengthRequired[j + 1] + 1; jj++)
{
topPosArray[j + 1][jj - 1] = topPosArray[j + 1][jj];
topLoadArray[j + 1][jj - 1] = topLoadArray[j + 1][jj];
}
topPosArray[j + 1][lengthRequired[j + 1]] = position(j);
topLoadArray[j + 1][lengthRequired[j + 1]] = load(j);
}
else
{
if (useShift)
{
dPosition = -12 * (position(j) + stretch[numTapers]);
}
else
{
dPosition = -12 * position(j);
}
dLoad = load(j) + force[numTapers];
status = GOOD_STATUS;
}
count[j]--;
tapersAllowed += 1;
if (tapersAllowed > numTapers)
{
tapersAllowed = numTapers;
}
}
j++;
}
LPStatus downholeValues = new LPStatus(dPosition, dLoad, status);
return downholeValues;
};
public static void main( String[] args ){
Well thisWell = new Well();
thisWell.parseJSONFile(args[0]);
// thisWell.parseJSONFile("/Users/patrickjmcd/Henry_Pump/poc-java/wellSetup.json");
thisWell.printTapers();
}
}

View File

@@ -0,0 +1,38 @@
package com.henrypump.poc;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}

225
surface_data.csv Normal file
View File

@@ -0,0 +1,225 @@
4.64,16672.381
4.659,16737.803
4.764,16782.326
4.938,16840.232
5.19,16883.494
5.496,16923.469
5.894,16959.471
6.374,16989.896
6.891,17013.334
7.454,17029.477
8.09,17039.424
8.834,17045.361
9.574,17049.744
10.369,17054.877
11.21,17062.381
12.148,17072.83
13.031,17086.168
14.041,17102.182
14.879,17121.842
15.645,17147.896
16.632,17185.137
17.864,17239.094
18.944,17313.938
20.164,17410.57
21.224,17525.693
22.325,17652.646
23.484,17783.574
24.684,17911.789
25.897,18033.344
26.885,18147.111
28.027,18253.877
29.365,18355.057
30.641,18451.98
31.763,18545.645
33.034,18636.889
34.261,18726.482
35.586,18815.236
36.722,18903.488
38.06,18991.074
39.072,19077.174
40.332,19160.645
41.453,19240.619
42.692,19317.031
43.838,19390.963
45.014,19464.404
46.173,19539.668
47.317,19618.697
48.467,19702.682
49.625,19792.195
50.668,19887.719
51.853,19989.891
52.996,20099.311
54.017,20215.732
55.133,20337.32
56.18,20460.592
57.241,20580.904
58.258,20693.855
59.289,20796.635
60.084,20888.838
60.845,20972.051
61.753,21049.012
62.706,21122.16
63.524,21192.703
64.444,21260.172
65.194,21322.939
66.039,21378.824
66.808,21425.791
67.538,21462.459
68.276,21488.197
68.846,21503.113
69.55,21507.861
70.297,21503.383
71.029,21491.074
71.751,21472.383
72.503,21448.83
73.093,21421.699
73.774,21391.834
74.376,21359.457
75.104,21324.482
75.625,21286.799
76.291,21246.74
76.876,21205.303
77.468,21163.947
78.098,21124.252
78.697,21087.281
79.345,21053.406
79.988,21022.221
80.594,20993.033
81.27,20965.166
81.896,20938.434
82.564,20913.268
83.265,20890.604
83.888,20871.619
84.556,20857.477
85.186,20849.084
85.864,20846.957
86.51,20851.316
87.162,20862.129
87.685,20879.09
88.186,20901.73
88.746,20929.258
89.417,20960.771
89.95,20995.289
90.54,21031.992
91.033,21070.367
91.552,21110.191
92.072,21151.301
92.583,21193.346
93.095,21235.52
93.455,21276.723
93.873,21315.705
94.374,21351.379
94.831,21383.021
95.226,21410.303
95.604,21433.039
95.913,21451.074
96.234,21464.061
96.5,21471.564
96.761,21472.99
96.964,21468
97.139,21456.709
97.295,21439.631
97.403,21418.006
97.486,21398.451
97.523,21367.055
97.524,21340.041
97.46,21317.926
97.369,21283.129
97.211,21251.475
97.024,21223.736
96.786,21185.479
96.474,21133.533
96.18,21084.486
95.812,21029.443
95.397,20968.041
94.855,20900.678
94.204,20869.2415
93.553,20837.805
92.915,20766.945
92.15,20706.842
91.541,20646.246
90.705,20585.289
89.986,20523.898
89.115,20462.1
88.422,20399.809
87.494,20336.934
86.655,20273.322
85.803,20208.801
84.822,20142.934
83.874,20075.289
82.799,20005.555
81.743,19933.865
80.603,19860.869
79.471,19787.252
78.329,19712.945
77.192,19636.195
75.934,19553.801
74.894,19462.336
73.566,19381.215
72.402,19270.275
71.108,19127.168
69.83,19004.096
68.522,18880.473
67.462,18756.268
66.519,18628.811
65.277,18494.354
63.888,18349.867
62.604,18226.49
61.243,18030.561
60.041,17861.422
58.685,17691.57
57.462,17524.723
56.186,17363.125
54.861,17207.604
53.747,17057.811
52.697,16913.043
51.434,16772.414
49.993,16635.408
48.743,16501.477
47.351,16370.187
46.177,16240.931
44.689,16113.276
43.5,15987.118
42.148,15862.771
41.034,15740.656
39.706,15644.551
38.486,15501.667
37.293,15381.678
36.021,15258.817
34.801,15132.413
33.599,15003.871
32.437,14876.461
31.236,14754.779
29.983,14664.868
28.794,14547.581
27.592,14469.979
26.408,14413.429
25.314,14379.121
24.097,14366.802
23.017,14374.891
21.85,14400.629
20.739,14440.64
19.554,14491.544
18.633,14550.2
17.751,14614.021
16.773,14681.21
15.64,14736.744
14.741,14808.233
13.679,14897.548
12.78,14975.478
11.935,15056.833
11.048,15141.636
10.209,15229.934
9.408,15303.563
8.798,15420.521
8.123,15525.71
7.458,15639.033
6.831,15760.201
6.347,15887.575
5.87,16018.198
5.502,16148.507
5.211,16274.701
4.961,16393.051
4.784,16500.121
4.662,16593.516
1 4.64 16672.381
2 4.659 16737.803
3 4.764 16782.326
4 4.938 16840.232
5 5.19 16883.494
6 5.496 16923.469
7 5.894 16959.471
8 6.374 16989.896
9 6.891 17013.334
10 7.454 17029.477
11 8.09 17039.424
12 8.834 17045.361
13 9.574 17049.744
14 10.369 17054.877
15 11.21 17062.381
16 12.148 17072.83
17 13.031 17086.168
18 14.041 17102.182
19 14.879 17121.842
20 15.645 17147.896
21 16.632 17185.137
22 17.864 17239.094
23 18.944 17313.938
24 20.164 17410.57
25 21.224 17525.693
26 22.325 17652.646
27 23.484 17783.574
28 24.684 17911.789
29 25.897 18033.344
30 26.885 18147.111
31 28.027 18253.877
32 29.365 18355.057
33 30.641 18451.98
34 31.763 18545.645
35 33.034 18636.889
36 34.261 18726.482
37 35.586 18815.236
38 36.722 18903.488
39 38.06 18991.074
40 39.072 19077.174
41 40.332 19160.645
42 41.453 19240.619
43 42.692 19317.031
44 43.838 19390.963
45 45.014 19464.404
46 46.173 19539.668
47 47.317 19618.697
48 48.467 19702.682
49 49.625 19792.195
50 50.668 19887.719
51 51.853 19989.891
52 52.996 20099.311
53 54.017 20215.732
54 55.133 20337.32
55 56.18 20460.592
56 57.241 20580.904
57 58.258 20693.855
58 59.289 20796.635
59 60.084 20888.838
60 60.845 20972.051
61 61.753 21049.012
62 62.706 21122.16
63 63.524 21192.703
64 64.444 21260.172
65 65.194 21322.939
66 66.039 21378.824
67 66.808 21425.791
68 67.538 21462.459
69 68.276 21488.197
70 68.846 21503.113
71 69.55 21507.861
72 70.297 21503.383
73 71.029 21491.074
74 71.751 21472.383
75 72.503 21448.83
76 73.093 21421.699
77 73.774 21391.834
78 74.376 21359.457
79 75.104 21324.482
80 75.625 21286.799
81 76.291 21246.74
82 76.876 21205.303
83 77.468 21163.947
84 78.098 21124.252
85 78.697 21087.281
86 79.345 21053.406
87 79.988 21022.221
88 80.594 20993.033
89 81.27 20965.166
90 81.896 20938.434
91 82.564 20913.268
92 83.265 20890.604
93 83.888 20871.619
94 84.556 20857.477
95 85.186 20849.084
96 85.864 20846.957
97 86.51 20851.316
98 87.162 20862.129
99 87.685 20879.09
100 88.186 20901.73
101 88.746 20929.258
102 89.417 20960.771
103 89.95 20995.289
104 90.54 21031.992
105 91.033 21070.367
106 91.552 21110.191
107 92.072 21151.301
108 92.583 21193.346
109 93.095 21235.52
110 93.455 21276.723
111 93.873 21315.705
112 94.374 21351.379
113 94.831 21383.021
114 95.226 21410.303
115 95.604 21433.039
116 95.913 21451.074
117 96.234 21464.061
118 96.5 21471.564
119 96.761 21472.99
120 96.964 21468
121 97.139 21456.709
122 97.295 21439.631
123 97.403 21418.006
124 97.486 21398.451
125 97.523 21367.055
126 97.524 21340.041
127 97.46 21317.926
128 97.369 21283.129
129 97.211 21251.475
130 97.024 21223.736
131 96.786 21185.479
132 96.474 21133.533
133 96.18 21084.486
134 95.812 21029.443
135 95.397 20968.041
136 94.855 20900.678
137 94.204 20869.2415
138 93.553 20837.805
139 92.915 20766.945
140 92.15 20706.842
141 91.541 20646.246
142 90.705 20585.289
143 89.986 20523.898
144 89.115 20462.1
145 88.422 20399.809
146 87.494 20336.934
147 86.655 20273.322
148 85.803 20208.801
149 84.822 20142.934
150 83.874 20075.289
151 82.799 20005.555
152 81.743 19933.865
153 80.603 19860.869
154 79.471 19787.252
155 78.329 19712.945
156 77.192 19636.195
157 75.934 19553.801
158 74.894 19462.336
159 73.566 19381.215
160 72.402 19270.275
161 71.108 19127.168
162 69.83 19004.096
163 68.522 18880.473
164 67.462 18756.268
165 66.519 18628.811
166 65.277 18494.354
167 63.888 18349.867
168 62.604 18226.49
169 61.243 18030.561
170 60.041 17861.422
171 58.685 17691.57
172 57.462 17524.723
173 56.186 17363.125
174 54.861 17207.604
175 53.747 17057.811
176 52.697 16913.043
177 51.434 16772.414
178 49.993 16635.408
179 48.743 16501.477
180 47.351 16370.187
181 46.177 16240.931
182 44.689 16113.276
183 43.5 15987.118
184 42.148 15862.771
185 41.034 15740.656
186 39.706 15644.551
187 38.486 15501.667
188 37.293 15381.678
189 36.021 15258.817
190 34.801 15132.413
191 33.599 15003.871
192 32.437 14876.461
193 31.236 14754.779
194 29.983 14664.868
195 28.794 14547.581
196 27.592 14469.979
197 26.408 14413.429
198 25.314 14379.121
199 24.097 14366.802
200 23.017 14374.891
201 21.85 14400.629
202 20.739 14440.64
203 19.554 14491.544
204 18.633 14550.2
205 17.751 14614.021
206 16.773 14681.21
207 15.64 14736.744
208 14.741 14808.233
209 13.679 14897.548
210 12.78 14975.478
211 11.935 15056.833
212 11.048 15141.636
213 10.209 15229.934
214 9.408 15303.563
215 8.798 15420.521
216 8.123 15525.71
217 7.458 15639.033
218 6.831 15760.201
219 6.347 15887.575
220 5.87 16018.198
221 5.502 16148.507
222 5.211 16274.701
223 4.961 16393.051
224 4.784 16500.121
225 4.662 16593.516

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,5 @@
#Generated by Maven
#Wed Feb 01 14:16:23 CST 2017
version=1.0-SNAPSHOT
groupId=com.henrypump.poc
artifactId=poc-java

View File

@@ -0,0 +1,10 @@
com/henrypump/poc/LPPair.class
com/henrypump/poc/AnalogIn.class
com/henrypump/poc/Card.class
com/henrypump/poc/Simulation.class
com/henrypump/poc/DigitalIn.class
com/henrypump/poc/POC.class
com/henrypump/poc/App.class
com/henrypump/poc/Well.class
com/henrypump/poc/LPStatus.class
com/henrypump/poc/DigitalOut.class

View File

@@ -0,0 +1,10 @@
/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/Well.java
/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/Simulation.java
/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/LPStatus.java
/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/AnalogIn.java
/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/LPPair.java
/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/App.java
/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/Card.java
/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/POC.java
/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/DigitalOut.java
/Users/patrickjmcd/Henry_Pump/poc-java/src/main/java/com/henrypump/poc/DigitalIn.java

View File

@@ -0,0 +1 @@
com/henrypump/poc/AppTest.class

View File

@@ -0,0 +1 @@
/Users/patrickjmcd/Henry_Pump/poc-java/src/test/java/com/henrypump/poc/AppTest.java

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="1" failures="0" name="com.henrypump.poc.AppTest" time="0.002" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
<property name="sun.boot.library.path" value="/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib"/>
<property name="java.vm.version" value="25.65-b01"/>
<property name="gopherProxySet" value="false"/>
<property name="java.vm.vendor" value="Oracle Corporation"/>
<property name="maven.multiModuleProjectDirectory" value="/Users/patrickjmcd/Henry_Pump/poc-java"/>
<property name="java.vendor.url" value="http://java.oracle.com/"/>
<property name="path.separator" value=":"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
<property name="java.vm.name" value="Java HotSpot(TM) 64-Bit Server VM"/>
<property name="file.encoding.pkg" value="sun.io"/>
<property name="user.country" value="US"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="sun.os.patch.level" value="unknown"/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="user.dir" value="/Users/patrickjmcd/Henry_Pump/poc-java"/>
<property name="java.runtime.version" value="1.8.0_65-b17"/>
<property name="java.awt.graphicsenv" value="sun.awt.CGraphicsEnvironment"/>
<property name="java.endorsed.dirs" value="/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/endorsed"/>
<property name="os.arch" value="x86_64"/>
<property name="java.io.tmpdir" value="/var/folders/25/g595lvf126b_wnjr08ngs5f80000gn/T/"/>
<property name="line.separator" value="
"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="os.name" value="Mac OS X"/>
<property name="classworlds.conf" value="/usr/local/Cellar/maven/3.3.9/libexec/bin/m2.conf"/>
<property name="sun.jnu.encoding" value="UTF-8"/>
<property name="java.library.path" value="/Users/patrickjmcd/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:."/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="java.class.version" value="52.0"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.version" value="10.12.4"/>
<property name="http.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
<property name="user.home" value="/Users/patrickjmcd"/>
<property name="user.timezone" value="America/Chicago"/>
<property name="java.awt.printerjob" value="sun.lwawt.macosx.CPrinterJob"/>
<property name="java.specification.version" value="1.8"/>
<property name="file.encoding" value="UTF-8"/>
<property name="user.name" value="patrickjmcd"/>
<property name="java.class.path" value="/usr/local/Cellar/maven/3.3.9/libexec/boot/plexus-classworlds-2.5.2.jar"/>
<property name="java.vm.specification.version" value="1.8"/>
<property name="sun.arch.data.model" value="64"/>
<property name="java.home" value="/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre"/>
<property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher clean compile install package"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="user.language" value="en"/>
<property name="awt.toolkit" value="sun.lwawt.macosx.LWCToolkit"/>
<property name="java.vm.info" value="mixed mode"/>
<property name="java.version" value="1.8.0_65"/>
<property name="java.ext.dirs" value="/Users/patrickjmcd/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java"/>
<property name="sun.boot.class.path" value="/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/classes"/>
<property name="java.vendor" value="Oracle Corporation"/>
<property name="maven.home" value="/usr/local/Cellar/maven/3.3.9/libexec"/>
<property name="file.separator" value="/"/>
<property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/"/>
<property name="sun.cpu.endian" value="little"/>
<property name="sun.io.unicode.encoding" value="UnicodeBig"/>
<property name="socksNonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
<property name="ftp.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
<property name="sun.cpu.isalist" value=""/>
</properties>
<testcase classname="com.henrypump.poc.AppTest" name="testApp" time="0.002"/>
</testsuite>

View File

@@ -0,0 +1,4 @@
-------------------------------------------------------------------------------
Test set: com.henrypump.poc.AppTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec

Binary file not shown.

25
wellSetup.json Normal file
View File

@@ -0,0 +1,25 @@
{
"deltaT": 0.06,
"pumpDiameter": 1.5,
"fluidGradient": 0.45,
"tubingID": 1.0,
"tubingOD": 1.225,
"tubingAnchorDepth": 8923.0,
"structuralRating": 320000.0,
"stuffingBoxFriction": 300.0,
"tubingHeadPressure": 200.0,
"tapers": [
{
"length": 10095.0,
"diameter": 0.75,
"material": "steel",
"dampingFactor": 0.8
},
{
"length": 300.0,
"diameter": 1.5,
"material": "steel",
"dampingFactor": 0.8
}
]
}