Database and IO Simulation working
This commit is contained in:
449
.idea/workspace.xml
generated
449
.idea/workspace.xml
generated
@@ -2,21 +2,26 @@
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="28cc251f-c94f-44ee-a66d-77aaab6e3483" name="Default" comment="">
|
||||
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
|
||||
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/main/java/com/henrypump/poc/Database.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/classes/com/henrypump/poc/AnalogIn.class" afterPath="$PROJECT_DIR$/target/classes/com/henrypump/poc/AnalogIn.class" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/classes/com/henrypump/poc/Card.class" afterPath="$PROJECT_DIR$/target/classes/com/henrypump/poc/Card.class" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/classes/com/henrypump/poc/DigitalIn.class" afterPath="$PROJECT_DIR$/target/classes/com/henrypump/poc/DigitalIn.class" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/classes/com/henrypump/poc/DigitalOut.class" afterPath="$PROJECT_DIR$/target/classes/com/henrypump/poc/DigitalOut.class" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/classes/com/henrypump/poc/POC.class" afterPath="$PROJECT_DIR$/target/classes/com/henrypump/poc/POC.class" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/classes/com/henrypump/poc/Simulation.class" afterPath="$PROJECT_DIR$/target/classes/com/henrypump/poc/Simulation.class" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/classes/com/henrypump/poc/Well.class" afterPath="$PROJECT_DIR$/target/classes/com/henrypump/poc/Well.class" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/original-poc-java-1.0-SNAPSHOT.jar" afterPath="$PROJECT_DIR$/target/original-poc-java-1.0-SNAPSHOT.jar" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/poc-java-1.0-SNAPSHOT.jar" afterPath="$PROJECT_DIR$/target/poc-java-1.0-SNAPSHOT.jar" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/poc-java.iml" afterPath="$PROJECT_DIR$/poc-java.iml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/pom.xml" afterPath="$PROJECT_DIR$/pom.xml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/henrypump/poc/AnalogIn.java" afterPath="$PROJECT_DIR$/src/main/java/com/henrypump/poc/AnalogIn.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/henrypump/poc/Card.java" afterPath="$PROJECT_DIR$/src/main/java/com/henrypump/poc/Card.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/henrypump/poc/DigitalIn.java" afterPath="$PROJECT_DIR$/src/main/java/com/henrypump/poc/DigitalIn.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/henrypump/poc/DigitalOut.java" afterPath="$PROJECT_DIR$/src/main/java/com/henrypump/poc/DigitalOut.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/henrypump/poc/POC.java" afterPath="$PROJECT_DIR$/src/main/java/com/henrypump/poc/POC.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/henrypump/poc/Simulation.java" afterPath="$PROJECT_DIR$/src/main/java/com/henrypump/poc/Simulation.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/henrypump/poc/Well.java" afterPath="$PROJECT_DIR$/src/main/java/com/henrypump/poc/Well.java" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/maven-archiver/pom.properties" afterPath="$PROJECT_DIR$/target/maven-archiver/pom.properties" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/surefire-reports/TEST-com.henrypump.poc.AppTest.xml" afterPath="$PROJECT_DIR$/target/surefire-reports/TEST-com.henrypump.poc.AppTest.xml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/target/surefire-reports/com.henrypump.poc.AppTest.txt" afterPath="$PROJECT_DIR$/target/surefire-reports/com.henrypump.poc.AppTest.txt" />
|
||||
</list>
|
||||
<ignored path="$PROJECT_DIR$/target/" />
|
||||
@@ -36,71 +41,136 @@
|
||||
<file leaf-file-name="Card.java" pinned="false" current-in-tab="false">
|
||||
<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="-1182">
|
||||
<caret line="208" column="36" lean-forward="true" selection-start-line="208" selection-start-column="36" selection-end-line="208" selection-end-column="36" />
|
||||
<state relative-caret-position="693">
|
||||
<caret line="373" column="33" lean-forward="false" selection-start-line="345" selection-start-column="12" selection-end-line="373" selection-end-column="33" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
<element signature="e#2914#2915#0" expanded="true" />
|
||||
<element signature="e#2949#2950#0" expanded="true" />
|
||||
<element signature="e#2995#2996#0" expanded="true" />
|
||||
<element signature="e#3037#3038#0" expanded="true" />
|
||||
<element signature="e#3087#3088#0" expanded="true" />
|
||||
<element signature="e#3133#3134#0" expanded="true" />
|
||||
<element signature="e#3185#3186#0" expanded="true" />
|
||||
<element signature="e#3233#3234#0" expanded="true" />
|
||||
<element signature="e#3293#3294#0" expanded="true" />
|
||||
<element signature="e#3349#3350#0" expanded="true" />
|
||||
<element signature="e#3392#3393#0" expanded="true" />
|
||||
<element signature="e#3431#3432#0" expanded="true" />
|
||||
<element signature="e#3467#3468#0" expanded="true" />
|
||||
<element signature="e#3499#3500#0" expanded="true" />
|
||||
<element signature="e#3542#3543#0" expanded="true" />
|
||||
<element signature="e#3581#3582#0" expanded="true" />
|
||||
<element signature="e#3625#3626#0" expanded="true" />
|
||||
<element signature="e#3665#3666#0" expanded="true" />
|
||||
<element signature="e#3706#3707#0" expanded="true" />
|
||||
<element signature="e#3743#3744#0" expanded="true" />
|
||||
<element signature="e#3783#3784#0" expanded="true" />
|
||||
<element signature="e#3819#3820#0" expanded="true" />
|
||||
<element signature="e#3861#3862#0" expanded="true" />
|
||||
<element signature="e#3899#3900#0" expanded="true" />
|
||||
<element signature="e#3943#3944#0" expanded="true" />
|
||||
<element signature="e#3983#3984#0" expanded="true" />
|
||||
<element signature="e#4020#4021#0" expanded="true" />
|
||||
<element signature="e#4056#4057#0" expanded="true" />
|
||||
<element signature="e#4111#4112#0" expanded="true" />
|
||||
<element signature="e#4161#4162#0" expanded="true" />
|
||||
<element signature="e#2917#2918#0" expanded="true" />
|
||||
<element signature="e#2952#2953#0" expanded="true" />
|
||||
<element signature="e#2998#2999#0" expanded="true" />
|
||||
<element signature="e#3040#3041#0" expanded="true" />
|
||||
<element signature="e#3090#3091#0" expanded="true" />
|
||||
<element signature="e#3136#3137#0" expanded="true" />
|
||||
<element signature="e#3188#3189#0" expanded="true" />
|
||||
<element signature="e#3236#3237#0" expanded="true" />
|
||||
<element signature="e#3296#3297#0" expanded="true" />
|
||||
<element signature="e#3352#3353#0" expanded="true" />
|
||||
<element signature="e#3395#3396#0" expanded="true" />
|
||||
<element signature="e#3434#3435#0" expanded="true" />
|
||||
<element signature="e#3470#3471#0" expanded="true" />
|
||||
<element signature="e#3502#3503#0" expanded="true" />
|
||||
<element signature="e#3545#3546#0" expanded="true" />
|
||||
<element signature="e#3584#3585#0" expanded="true" />
|
||||
<element signature="e#3628#3629#0" expanded="true" />
|
||||
<element signature="e#3668#3669#0" expanded="true" />
|
||||
<element signature="e#3709#3710#0" expanded="true" />
|
||||
<element signature="e#3746#3747#0" expanded="true" />
|
||||
<element signature="e#3786#3787#0" expanded="true" />
|
||||
<element signature="e#3822#3823#0" expanded="true" />
|
||||
<element signature="e#3864#3865#0" expanded="true" />
|
||||
<element signature="e#3902#3903#0" expanded="true" />
|
||||
<element signature="e#3946#3947#0" expanded="true" />
|
||||
<element signature="e#3986#3987#0" expanded="true" />
|
||||
<element signature="e#4023#4024#0" expanded="true" />
|
||||
<element signature="e#4059#4060#0" expanded="true" />
|
||||
<element signature="e#4114#4115#0" expanded="true" />
|
||||
<element signature="e#4164#4165#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="LPStatus.java" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/LPStatus.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>
|
||||
</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="783">
|
||||
<caret line="364" column="0" lean-forward="true" selection-start-line="364" selection-start-column="0" selection-end-line="364" selection-end-column="0" />
|
||||
<state relative-caret-position="285">
|
||||
<caret line="35" column="0" lean-forward="true" selection-start-line="35" selection-start-column="0" selection-end-line="35" selection-end-column="0" />
|
||||
<folding>
|
||||
<element signature="e#2942#2943#0" expanded="true" />
|
||||
<element signature="e#2982#2983#0" expanded="true" />
|
||||
<element signature="e#5781#5782#0" expanded="true" />
|
||||
<element signature="e#5820#5821#0" expanded="true" />
|
||||
<element signature="e#5860#5861#0" expanded="true" />
|
||||
<element signature="e#5896#5897#0" expanded="true" />
|
||||
<element signature="e#5931#5932#0" expanded="true" />
|
||||
<element signature="e#5962#5963#0" expanded="true" />
|
||||
<element signature="e#6013#6014#0" expanded="true" />
|
||||
<element signature="e#6060#6061#0" expanded="true" />
|
||||
<element signature="e#6917#6918#0" expanded="true" />
|
||||
<element signature="e#6946#6947#0" expanded="true" />
|
||||
<element signature="e#7062#7063#0" expanded="true" />
|
||||
<element signature="e#7107#7108#0" expanded="true" />
|
||||
<element signature="e#7231#7232#0" expanded="true" />
|
||||
<element signature="e#7280#7281#0" expanded="true" />
|
||||
<element signature="e#7872#7873#0" expanded="true" />
|
||||
<element signature="e#7911#7912#0" expanded="true" />
|
||||
<element signature="e#7951#7952#0" expanded="true" />
|
||||
<element signature="e#7987#7988#0" expanded="true" />
|
||||
<element signature="e#8022#8023#0" expanded="true" />
|
||||
<element signature="e#8053#8054#0" expanded="true" />
|
||||
<element signature="e#8104#8105#0" expanded="true" />
|
||||
<element signature="e#8151#8152#0" expanded="true" />
|
||||
<element signature="e#8388#8389#0" expanded="true" />
|
||||
<element signature="e#8419#8420#0" expanded="true" />
|
||||
<element signature="e#8458#8459#0" expanded="true" />
|
||||
<element signature="e#8493#8494#0" expanded="true" />
|
||||
<element signature="e#8526#8527#0" expanded="true" />
|
||||
<element signature="e#8558#8559#0" expanded="true" />
|
||||
<element signature="e#8589#8590#0" expanded="true" />
|
||||
<element signature="e#8619#8620#0" expanded="true" />
|
||||
<element signature="e#8661#8662#0" expanded="true" />
|
||||
<element signature="e#8699#8700#0" expanded="true" />
|
||||
<element signature="e#8737#8738#0" expanded="true" />
|
||||
<element signature="e#8771#8772#0" expanded="true" />
|
||||
<element signature="e#8810#8811#0" expanded="true" />
|
||||
<element signature="e#8847#8848#0" expanded="true" />
|
||||
<element signature="e#8905#8906#0" expanded="true" />
|
||||
<element signature="e#8957#8958#0" expanded="true" />
|
||||
<element signature="e#8999#9000#0" expanded="true" />
|
||||
<element signature="e#9039#9040#0" expanded="true" />
|
||||
<element signature="e#9076#9077#0" expanded="true" />
|
||||
<element signature="e#9111#9112#0" expanded="true" />
|
||||
<element signature="e#9151#9152#0" expanded="true" />
|
||||
<element signature="e#9189#9190#0" expanded="true" />
|
||||
<element signature="e#9222#9223#0" expanded="true" />
|
||||
<element signature="e#9254#9255#0" expanded="true" />
|
||||
<element signature="e#9871#9872#0" expanded="true" />
|
||||
<element signature="e#9906#9907#0" expanded="true" />
|
||||
<element signature="e#31056#31057#0" expanded="true" />
|
||||
<element signature="e#31097#31098#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="Database.java" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/Database.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="753">
|
||||
<caret line="72" column="28" lean-forward="false" selection-start-line="72" selection-start-column="28" selection-end-line="72" selection-end-column="28" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
<element signature="e#1554#1562#0" expanded="true" />
|
||||
<element signature="e#1676#1684#0" expanded="true" />
|
||||
<element signature="e#1794#1802#0" expanded="true" />
|
||||
<element signature="e#1917#1925#0" expanded="true" />
|
||||
<element signature="e#2365#2366#0" expanded="true" />
|
||||
<element signature="e#2400#2401#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="48">
|
||||
<caret line="19" column="4" lean-forward="false" selection-start-line="19" selection-start-column="4" selection-end-line="28" 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="420">
|
||||
<caret line="34" column="5" lean-forward="false" selection-start-line="34" selection-start-column="5" selection-end-line="34" selection-end-column="5" />
|
||||
<folding>
|
||||
<element signature="e#1499#1500#0" expanded="true" />
|
||||
<element signature="e#1541#1542#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
@@ -109,13 +179,25 @@
|
||||
<file leaf-file-name="POC.java" pinned="false" current-in-tab="true">
|
||||
<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="633">
|
||||
<caret line="72" column="26" lean-forward="false" selection-start-line="72" selection-start-column="26" selection-end-line="72" selection-end-column="26" />
|
||||
<state relative-caret-position="378">
|
||||
<caret line="79" column="12" lean-forward="false" selection-start-line="79" selection-start-column="12" selection-end-line="79" selection-end-column="12" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<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="735">
|
||||
<caret line="57" column="30" lean-forward="true" selection-start-line="57" selection-start-column="30" selection-end-line="57" selection-end-column="30" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
@@ -136,13 +218,14 @@
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<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$/pom.xml" />
|
||||
<option value="$PROJECT_DIR$/src/main/java/com/henrypump/poc/Simulation.java" />
|
||||
<option value="$PROJECT_DIR$/src/main/java/com/henrypump/poc/Card.java" />
|
||||
<option value="$PROJECT_DIR$/src/main/java/com/henrypump/poc/Database.java" />
|
||||
<option value="$PROJECT_DIR$/src/main/java/com/henrypump/poc/Well.java" />
|
||||
<option value="$PROJECT_DIR$/src/main/java/com/henrypump/poc/DigitalOut.java" />
|
||||
<option value="$PROJECT_DIR$/src/main/java/com/henrypump/poc/AnalogIn.java" />
|
||||
<option value="$PROJECT_DIR$/src/main/java/com/henrypump/poc/DigitalIn.java" />
|
||||
<option value="$PROJECT_DIR$/src/main/java/com/henrypump/poc/POC.java" />
|
||||
</list>
|
||||
</option>
|
||||
@@ -155,6 +238,7 @@
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectFrameBounds">
|
||||
<option name="x" value="3818" />
|
||||
<option name="y" value="23" />
|
||||
<option name="width" value="1680" />
|
||||
<option name="height" value="964" />
|
||||
@@ -467,7 +551,7 @@
|
||||
<servers />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="0" y="23" width="1680" height="964" extended-state="6" />
|
||||
<frame x="3818" y="23" width="1680" height="964" 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" />
|
||||
@@ -485,6 +569,7 @@
|
||||
<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.27797619" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32960895" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<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" />
|
||||
@@ -495,7 +580,6 @@
|
||||
<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>
|
||||
@@ -503,7 +587,9 @@
|
||||
<option name="myLimit" value="2678400000" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager />
|
||||
<breakpoint-manager>
|
||||
<option name="time" value="1" />
|
||||
</breakpoint-manager>
|
||||
<watches-manager />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
@@ -523,40 +609,6 @@
|
||||
</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="false" />
|
||||
</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="false" />
|
||||
<element signature="e#1368#1369#0" expanded="false" />
|
||||
<element signature="e#1405#1406#0" expanded="false" />
|
||||
</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$/dependency-reduced-pom.xml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
@@ -581,14 +633,6 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/pom.xml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="438">
|
||||
<caret line="38" column="17" lean-forward="false" selection-start-line="38" selection-start-column="17" selection-end-line="38" selection-end-column="17" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/LPStatus.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="75">
|
||||
@@ -626,69 +670,164 @@
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/IO.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="75">
|
||||
<caret line="5" column="17" lean-forward="true" selection-start-line="5" selection-start-column="17" selection-end-line="5" selection-end-column="17" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/pom.xml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="513">
|
||||
<caret line="40" column="9" lean-forward="false" selection-start-line="40" selection-start-column="9" selection-end-line="40" selection-end-column="9" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<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="-1182">
|
||||
<caret line="208" column="36" lean-forward="true" selection-start-line="208" selection-start-column="36" selection-end-line="208" selection-end-column="36" />
|
||||
<state relative-caret-position="693">
|
||||
<caret line="373" column="33" lean-forward="false" selection-start-line="345" selection-start-column="12" selection-end-line="373" selection-end-column="33" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
<element signature="e#2914#2915#0" expanded="true" />
|
||||
<element signature="e#2949#2950#0" expanded="true" />
|
||||
<element signature="e#2995#2996#0" expanded="true" />
|
||||
<element signature="e#3037#3038#0" expanded="true" />
|
||||
<element signature="e#3087#3088#0" expanded="true" />
|
||||
<element signature="e#3133#3134#0" expanded="true" />
|
||||
<element signature="e#3185#3186#0" expanded="true" />
|
||||
<element signature="e#3233#3234#0" expanded="true" />
|
||||
<element signature="e#3293#3294#0" expanded="true" />
|
||||
<element signature="e#3349#3350#0" expanded="true" />
|
||||
<element signature="e#3392#3393#0" expanded="true" />
|
||||
<element signature="e#3431#3432#0" expanded="true" />
|
||||
<element signature="e#3467#3468#0" expanded="true" />
|
||||
<element signature="e#3499#3500#0" expanded="true" />
|
||||
<element signature="e#3542#3543#0" expanded="true" />
|
||||
<element signature="e#3581#3582#0" expanded="true" />
|
||||
<element signature="e#3625#3626#0" expanded="true" />
|
||||
<element signature="e#3665#3666#0" expanded="true" />
|
||||
<element signature="e#3706#3707#0" expanded="true" />
|
||||
<element signature="e#3743#3744#0" expanded="true" />
|
||||
<element signature="e#3783#3784#0" expanded="true" />
|
||||
<element signature="e#3819#3820#0" expanded="true" />
|
||||
<element signature="e#3861#3862#0" expanded="true" />
|
||||
<element signature="e#3899#3900#0" expanded="true" />
|
||||
<element signature="e#3943#3944#0" expanded="true" />
|
||||
<element signature="e#3983#3984#0" expanded="true" />
|
||||
<element signature="e#4020#4021#0" expanded="true" />
|
||||
<element signature="e#4056#4057#0" expanded="true" />
|
||||
<element signature="e#4111#4112#0" expanded="true" />
|
||||
<element signature="e#4161#4162#0" expanded="true" />
|
||||
<element signature="e#2917#2918#0" expanded="true" />
|
||||
<element signature="e#2952#2953#0" expanded="true" />
|
||||
<element signature="e#2998#2999#0" expanded="true" />
|
||||
<element signature="e#3040#3041#0" expanded="true" />
|
||||
<element signature="e#3090#3091#0" expanded="true" />
|
||||
<element signature="e#3136#3137#0" expanded="true" />
|
||||
<element signature="e#3188#3189#0" expanded="true" />
|
||||
<element signature="e#3236#3237#0" expanded="true" />
|
||||
<element signature="e#3296#3297#0" expanded="true" />
|
||||
<element signature="e#3352#3353#0" expanded="true" />
|
||||
<element signature="e#3395#3396#0" expanded="true" />
|
||||
<element signature="e#3434#3435#0" expanded="true" />
|
||||
<element signature="e#3470#3471#0" expanded="true" />
|
||||
<element signature="e#3502#3503#0" expanded="true" />
|
||||
<element signature="e#3545#3546#0" expanded="true" />
|
||||
<element signature="e#3584#3585#0" expanded="true" />
|
||||
<element signature="e#3628#3629#0" expanded="true" />
|
||||
<element signature="e#3668#3669#0" expanded="true" />
|
||||
<element signature="e#3709#3710#0" expanded="true" />
|
||||
<element signature="e#3746#3747#0" expanded="true" />
|
||||
<element signature="e#3786#3787#0" expanded="true" />
|
||||
<element signature="e#3822#3823#0" expanded="true" />
|
||||
<element signature="e#3864#3865#0" expanded="true" />
|
||||
<element signature="e#3902#3903#0" expanded="true" />
|
||||
<element signature="e#3946#3947#0" expanded="true" />
|
||||
<element signature="e#3986#3987#0" expanded="true" />
|
||||
<element signature="e#4023#4024#0" expanded="true" />
|
||||
<element signature="e#4059#4060#0" expanded="true" />
|
||||
<element signature="e#4114#4115#0" expanded="true" />
|
||||
<element signature="e#4164#4165#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/com/henrypump/poc/Database.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="753">
|
||||
<caret line="72" column="28" lean-forward="false" selection-start-line="72" selection-start-column="28" selection-end-line="72" selection-end-column="28" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
<element signature="e#1554#1562#0" expanded="true" />
|
||||
<element signature="e#1676#1684#0" expanded="true" />
|
||||
<element signature="e#1794#1802#0" expanded="true" />
|
||||
<element signature="e#1917#1925#0" expanded="true" />
|
||||
<element signature="e#2365#2366#0" expanded="true" />
|
||||
<element signature="e#2400#2401#0" expanded="true" />
|
||||
</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="783">
|
||||
<caret line="364" column="0" lean-forward="true" selection-start-line="364" selection-start-column="0" selection-end-line="364" selection-end-column="0" />
|
||||
<state relative-caret-position="285">
|
||||
<caret line="35" column="0" lean-forward="true" selection-start-line="35" selection-start-column="0" selection-end-line="35" selection-end-column="0" />
|
||||
<folding>
|
||||
<element signature="e#2942#2943#0" expanded="true" />
|
||||
<element signature="e#2982#2983#0" expanded="true" />
|
||||
<element signature="e#5781#5782#0" expanded="true" />
|
||||
<element signature="e#5820#5821#0" expanded="true" />
|
||||
<element signature="e#5860#5861#0" expanded="true" />
|
||||
<element signature="e#5896#5897#0" expanded="true" />
|
||||
<element signature="e#5931#5932#0" expanded="true" />
|
||||
<element signature="e#5962#5963#0" expanded="true" />
|
||||
<element signature="e#6013#6014#0" expanded="true" />
|
||||
<element signature="e#6060#6061#0" expanded="true" />
|
||||
<element signature="e#6917#6918#0" expanded="true" />
|
||||
<element signature="e#6946#6947#0" expanded="true" />
|
||||
<element signature="e#7062#7063#0" expanded="true" />
|
||||
<element signature="e#7107#7108#0" expanded="true" />
|
||||
<element signature="e#7231#7232#0" expanded="true" />
|
||||
<element signature="e#7280#7281#0" expanded="true" />
|
||||
<element signature="e#7872#7873#0" expanded="true" />
|
||||
<element signature="e#7911#7912#0" expanded="true" />
|
||||
<element signature="e#7951#7952#0" expanded="true" />
|
||||
<element signature="e#7987#7988#0" expanded="true" />
|
||||
<element signature="e#8022#8023#0" expanded="true" />
|
||||
<element signature="e#8053#8054#0" expanded="true" />
|
||||
<element signature="e#8104#8105#0" expanded="true" />
|
||||
<element signature="e#8151#8152#0" expanded="true" />
|
||||
<element signature="e#8388#8389#0" expanded="true" />
|
||||
<element signature="e#8419#8420#0" expanded="true" />
|
||||
<element signature="e#8458#8459#0" expanded="true" />
|
||||
<element signature="e#8493#8494#0" expanded="true" />
|
||||
<element signature="e#8526#8527#0" expanded="true" />
|
||||
<element signature="e#8558#8559#0" expanded="true" />
|
||||
<element signature="e#8589#8590#0" expanded="true" />
|
||||
<element signature="e#8619#8620#0" expanded="true" />
|
||||
<element signature="e#8661#8662#0" expanded="true" />
|
||||
<element signature="e#8699#8700#0" expanded="true" />
|
||||
<element signature="e#8737#8738#0" expanded="true" />
|
||||
<element signature="e#8771#8772#0" expanded="true" />
|
||||
<element signature="e#8810#8811#0" expanded="true" />
|
||||
<element signature="e#8847#8848#0" expanded="true" />
|
||||
<element signature="e#8905#8906#0" expanded="true" />
|
||||
<element signature="e#8957#8958#0" expanded="true" />
|
||||
<element signature="e#8999#9000#0" expanded="true" />
|
||||
<element signature="e#9039#9040#0" expanded="true" />
|
||||
<element signature="e#9076#9077#0" expanded="true" />
|
||||
<element signature="e#9111#9112#0" expanded="true" />
|
||||
<element signature="e#9151#9152#0" expanded="true" />
|
||||
<element signature="e#9189#9190#0" expanded="true" />
|
||||
<element signature="e#9222#9223#0" expanded="true" />
|
||||
<element signature="e#9254#9255#0" expanded="true" />
|
||||
<element signature="e#9871#9872#0" expanded="true" />
|
||||
<element signature="e#9906#9907#0" expanded="true" />
|
||||
<element signature="e#31056#31057#0" expanded="true" />
|
||||
<element signature="e#31097#31098#0" expanded="true" />
|
||||
</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="48">
|
||||
<caret line="19" column="4" lean-forward="false" selection-start-line="19" selection-start-column="4" selection-end-line="28" 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="420">
|
||||
<caret line="34" column="5" lean-forward="false" selection-start-line="34" selection-start-column="5" selection-end-line="34" selection-end-column="5" />
|
||||
<folding>
|
||||
<element signature="e#1499#1500#0" expanded="true" />
|
||||
<element signature="e#1541#1542#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="735">
|
||||
<caret line="57" column="30" lean-forward="true" selection-start-line="57" selection-start-column="30" selection-end-line="57" selection-end-column="30" />
|
||||
<folding>
|
||||
<element signature="imports" 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="633">
|
||||
<caret line="72" column="26" lean-forward="false" selection-start-line="72" selection-start-column="26" selection-end-line="72" selection-end-column="26" />
|
||||
<state relative-caret-position="378">
|
||||
<caret line="79" column="12" lean-forward="false" selection-start-line="79" selection-start-column="12" selection-end-line="79" selection-end-column="12" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
|
||||
@@ -21,6 +21,7 @@ public class AnalogIn {
|
||||
private double rawMax;
|
||||
private double euMin;
|
||||
private double euMax;
|
||||
private double[] history = new double[100];
|
||||
|
||||
static {
|
||||
try {
|
||||
@@ -34,20 +35,26 @@ public class AnalogIn {
|
||||
}
|
||||
|
||||
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;
|
||||
if (channel != 99) {
|
||||
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.gpioPin = new Aio(this.channel);
|
||||
}
|
||||
|
||||
this.channel = channel;
|
||||
this.gpioPin = new Aio(this.channel);
|
||||
this.rawMax = rawMax;
|
||||
this.rawMin = rawMin;
|
||||
this.euMax = euMax;
|
||||
this.euMin = euMin;
|
||||
}
|
||||
|
||||
public double getHistory(int pointIndex) {
|
||||
return history[pointIndex];
|
||||
}
|
||||
|
||||
public long readRaw(){
|
||||
return gpioPin.read();
|
||||
}
|
||||
@@ -55,6 +62,20 @@ public class AnalogIn {
|
||||
public double readScaled(){
|
||||
double pv = ((euMax - euMin)/(rawMax - rawMin)) * gpioPin.read() + (euMax - ((euMax - euMin)/(rawMax - rawMin)) * rawMax);
|
||||
lastValue = pv;
|
||||
for(int i = 98; i >= 0; i--){
|
||||
history[i+1] = history[i];
|
||||
}
|
||||
history[0] = lastValue;
|
||||
return pv;
|
||||
}
|
||||
|
||||
public double readScaledSim(double simRaw){
|
||||
double pv = ((euMax - euMin)/(rawMax - rawMin)) * simRaw + (euMax - ((euMax - euMin)/(rawMax - rawMin)) * rawMax);
|
||||
lastValue = pv;
|
||||
for(int i = 98; i >= 0; i--){
|
||||
history[i+1] = history[i];
|
||||
}
|
||||
history[0] = lastValue;
|
||||
return pv;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ public class Card {
|
||||
private int numPointsUsed;
|
||||
|
||||
//Card
|
||||
private int strokeNumber;
|
||||
private long strokeNumber;
|
||||
private LPPair surfacePositionMax;
|
||||
private LPPair surfacePositionMin;
|
||||
private LPPair surfaceLoadMax;
|
||||
@@ -57,7 +57,7 @@ public class Card {
|
||||
|
||||
private long strokeStartTime;
|
||||
|
||||
Card(int strokeNumber){
|
||||
Card(long strokeNumber){
|
||||
this.strokeNumber = strokeNumber;
|
||||
strokeStartTime = System.currentTimeMillis();
|
||||
}
|
||||
@@ -98,7 +98,7 @@ public class Card {
|
||||
return this.surfacePositionMax;
|
||||
}
|
||||
|
||||
public int getStrokeNumber() {
|
||||
public long getStrokeNumber() {
|
||||
return strokeNumber;
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ public class Card {
|
||||
if (fillageCalculated > 100)
|
||||
fillageCalculated = 100.0;
|
||||
|
||||
fluidLoad = (downholeLoadMax.getLoad() - downholeLoadMin.getLoad()) - frictionEstimate;
|
||||
fluidLoad = downholeLoadSpan - frictionEstimate;
|
||||
pumpIntakePressure = fluidGradient * rodDepth - (fluidLoad / pumpArea);
|
||||
//printf("PIP = %f * %f - (%f / %f) = %f\n", fluidGradient, rodDepth, fluidLoad, pumpArea, pumpIntakePressure);
|
||||
fluidLevel = pumpIntakePressure / fluidGradient;
|
||||
|
||||
75
src/main/java/com/henrypump/poc/Database.java
Normal file
75
src/main/java/com/henrypump/poc/Database.java
Normal file
@@ -0,0 +1,75 @@
|
||||
package com.henrypump.poc;
|
||||
|
||||
/**
|
||||
* Created by patrickjmcd on 2/2/17.
|
||||
*/
|
||||
|
||||
import com.mongodb.*;
|
||||
|
||||
import com.mongodb.client.MongoDatabase;
|
||||
import com.mongodb.client.MongoCollection;
|
||||
|
||||
import com.mongodb.client.model.Sorts;
|
||||
import org.bson.Document;
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.mongodb.client.MongoCursor;
|
||||
|
||||
import static com.mongodb.client.model.Aggregates.limit;
|
||||
import static com.mongodb.client.model.Filters.*;
|
||||
import com.mongodb.client.result.DeleteResult;
|
||||
import static com.mongodb.client.model.Updates.*;
|
||||
import com.mongodb.client.result.UpdateResult;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
public class Database {
|
||||
private String pocDatabase = "poc";
|
||||
private MongoClient mongoClient;
|
||||
private MongoDatabase database;
|
||||
|
||||
Database(){
|
||||
mongoClient = new MongoClient();
|
||||
database = mongoClient.getDatabase(pocDatabase);
|
||||
}
|
||||
|
||||
public long getLastStrokeNum(){
|
||||
MongoCollection<Document> collection = database.getCollection("cards");
|
||||
MongoCursor<Document> cursor = collection.find().iterator();
|
||||
long lastStroke = 0;
|
||||
try {
|
||||
while (cursor.hasNext()) {
|
||||
long docStroke = (Long) cursor.next().get("strokeNumber");
|
||||
if (docStroke > lastStroke) { lastStroke = docStroke; }
|
||||
}
|
||||
} finally {
|
||||
cursor.close();
|
||||
}
|
||||
return lastStroke;
|
||||
}
|
||||
|
||||
public long newCard(Card inpCard){
|
||||
MongoCollection<Document> collection = database.getCollection("cards");
|
||||
List<Double> s_p = new ArrayList<Double>();
|
||||
for(Double pt: inpCard.getSurfacePosition()) { s_p.add(pt);}
|
||||
|
||||
List<Double> s_l = new ArrayList<Double>();
|
||||
for(Double pt: inpCard.getSurfaceLoad()) { s_l.add(pt);}
|
||||
|
||||
List<Double> d_p = new ArrayList<Double>();
|
||||
for(Double pt: inpCard.getDownholePosition()) { d_p.add(pt);}
|
||||
|
||||
List<Double> d_l = new ArrayList<Double>();
|
||||
for(Double pt: inpCard.getDownholeLoad()) { d_l.add(pt);}
|
||||
|
||||
Document doc = new Document("strokeNumber", inpCard.getStrokeNumber())
|
||||
.append("surface_position", s_p)
|
||||
.append("surface_load", s_l)
|
||||
.append("downhole_position", d_p)
|
||||
.append("downhole_load", d_l);
|
||||
collection.insertOne(doc);
|
||||
return collection.count();
|
||||
}
|
||||
public void close(){
|
||||
mongoClient.close();
|
||||
}
|
||||
}
|
||||
@@ -4,31 +4,6 @@ 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;
|
||||
@@ -40,28 +15,21 @@ public class DigitalIn {
|
||||
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();
|
||||
this.channel = channel;
|
||||
if (channel != 99) {
|
||||
|
||||
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());
|
||||
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.gpioPin = new Gpio(this.channel);
|
||||
gpioPin.dir(Dir.DIR_IN);
|
||||
}
|
||||
|
||||
this.channel = channel;
|
||||
this.gpioPin = new Gpio(this.channel);
|
||||
gpioPin.dir(Dir.DIR_IN);
|
||||
|
||||
}
|
||||
|
||||
public int read(){
|
||||
@@ -75,8 +43,8 @@ public class DigitalIn {
|
||||
DigitalIn testIn8 = new DigitalIn(8);
|
||||
DigitalIn testIn9 = new DigitalIn(9);
|
||||
|
||||
DigitalOut testOut2 = new DigitalOut(2);
|
||||
DigitalOut testOut3 = new DigitalOut(3);
|
||||
DigitalOut testOut2 = new DigitalOut(2,0);
|
||||
DigitalOut testOut3 = new DigitalOut(3,0);
|
||||
|
||||
int in8val, in9val;
|
||||
do {
|
||||
|
||||
@@ -15,6 +15,7 @@ import static java.lang.Thread.sleep;
|
||||
public class DigitalOut {
|
||||
private int channel;
|
||||
private Gpio gpioPin;
|
||||
private int value;
|
||||
|
||||
static {
|
||||
try {
|
||||
@@ -27,51 +28,66 @@ public class DigitalOut {
|
||||
}
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
DigitalOut(int channel, int startupValue){
|
||||
this.channel = channel;
|
||||
this.gpioPin = new Gpio(this.channel);
|
||||
gpioPin.dir(Dir.DIR_OUT);
|
||||
if (channel != 99) {
|
||||
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.gpioPin = new Gpio(this.channel);
|
||||
gpioPin.dir(Dir.DIR_OUT);
|
||||
this.value = startupValue;
|
||||
write(value);
|
||||
}
|
||||
}
|
||||
|
||||
public void write(int writeVal){
|
||||
gpioPin.write(writeVal);
|
||||
if ( value != writeVal & channel != 99) {
|
||||
gpioPin.write(writeVal);
|
||||
value = writeVal;
|
||||
}
|
||||
}
|
||||
|
||||
public void write(int writeVal, boolean force){
|
||||
if ( value != writeVal || force) {
|
||||
if (channel != 99) {
|
||||
gpioPin.write(writeVal);
|
||||
value = writeVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args){
|
||||
try {
|
||||
DigitalOut testOut2 = new DigitalOut(2);
|
||||
DigitalOut testOut2 = new DigitalOut(2, 0);
|
||||
testOut2.write(1);
|
||||
sleep(500);
|
||||
testOut2.write(0);
|
||||
|
||||
DigitalOut testOut3 = new DigitalOut(3);
|
||||
DigitalOut testOut3 = new DigitalOut(3, 0);
|
||||
testOut3.write(1);
|
||||
sleep(500);
|
||||
testOut3.write(0);
|
||||
|
||||
DigitalOut testOut4 = new DigitalOut(4);
|
||||
DigitalOut testOut4 = new DigitalOut(4, 0);
|
||||
testOut4.write(1);
|
||||
sleep(500);
|
||||
testOut4.write(0);
|
||||
|
||||
DigitalOut testOut5 = new DigitalOut(5);
|
||||
DigitalOut testOut5 = new DigitalOut(5, 0);
|
||||
testOut5.write(1);
|
||||
sleep(500);
|
||||
testOut5.write(0);
|
||||
|
||||
DigitalOut testOut6 = new DigitalOut(6);
|
||||
DigitalOut testOut6 = new DigitalOut(6, 0);
|
||||
testOut6.write(1);
|
||||
sleep(500);
|
||||
testOut6.write(0);
|
||||
|
||||
DigitalOut testOut7 = new DigitalOut(7);
|
||||
DigitalOut testOut7 = new DigitalOut(7, 0);
|
||||
testOut7.write(1);
|
||||
sleep(500);
|
||||
testOut7.write(0);
|
||||
|
||||
@@ -3,61 +3,96 @@ package com.henrypump.poc;
|
||||
/**
|
||||
* Created by patrickjmcd on 2/1/17.
|
||||
*/
|
||||
|
||||
public class POC implements Runnable{
|
||||
private Well thisWell;
|
||||
private Simulation sim;
|
||||
private int simLoops;
|
||||
private double tubingMovement;
|
||||
private double pumpIntakePressure;
|
||||
private double fluidLoad;
|
||||
private double fluidLevel;
|
||||
private Thread t;
|
||||
private DigitalIn startBtn = new DigitalIn(8);
|
||||
private DigitalIn stopBtn = new DigitalIn(9);
|
||||
private DigitalOut led2 = new DigitalOut(2, 0);
|
||||
private DigitalOut led3 = new DigitalOut(3, 0);
|
||||
private DigitalOut led4 = new DigitalOut(4, 0);
|
||||
private DigitalOut led5 = new DigitalOut(5, 0);
|
||||
private DigitalOut runIndicator = new DigitalOut(6,0);
|
||||
|
||||
|
||||
|
||||
POC(String wellName, String wellSetupJsonFile, String simFileName, int simLoops){
|
||||
POC(String wellName, String wellSetupJsonFile, int simLoops){
|
||||
thisWell = new Well(wellName);
|
||||
thisWell.parseJSONFile(wellSetupJsonFile);
|
||||
thisWell.printTapers();
|
||||
sim = new Simulation(simFileName);
|
||||
this.simLoops = simLoops;
|
||||
}
|
||||
|
||||
public void run(){
|
||||
POC(String wellName, String wellSetupJsonFile, String simFileName, int simLoops){
|
||||
thisWell = new Well(wellName, simFileName);
|
||||
thisWell.parseJSONFile(wellSetupJsonFile);
|
||||
thisWell.printTapers();
|
||||
this.simLoops = simLoops;
|
||||
}
|
||||
|
||||
int loopCounter = 0, loopLimit = simLoops;
|
||||
public void allOutputsOff(){
|
||||
led2.write(0,true);
|
||||
led3.write(0,true);
|
||||
led4.write(0,true);
|
||||
led5.write(0,true);
|
||||
}
|
||||
|
||||
public void run(){
|
||||
int loopCounter = 0, loopLimit = simLoops, led2out, led3out, led4out,led5out;
|
||||
double pos;
|
||||
long sleepMilliseconds = (long) (thisWell.getDt() * 1000);
|
||||
|
||||
LPStatus downholePoint;
|
||||
while (loopCounter < loopLimit) {
|
||||
Card thisCard = new Card(loopCounter);
|
||||
for (int i = 0; i <= sim.getLastFilledIndex(); i++) {
|
||||
thisCard.setSurfacePosition(i, sim.getPositionAtIndex(i));
|
||||
thisCard.setSurfaceLoad(i, sim.getLoadAtIndex(i));
|
||||
downholePoint = thisWell.calc(sim.getPositionAtIndex(i), sim.getLoadAtIndex(i));
|
||||
if (downholePoint.getStatus() == Well.GOOD_STATUS) {
|
||||
thisCard.setDownholePosition(i, downholePoint.getPosition());
|
||||
thisCard.setDownholeLoad(i, downholePoint.getLoad());
|
||||
}
|
||||
try {
|
||||
Thread.sleep(sleepMilliseconds);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
thisWell.checkSafeties();
|
||||
while (true) {
|
||||
while (loopCounter < loopLimit && (thisWell.getRunStatus() == Well.RUNSTATUS_RUNNING || thisWell.getRunStatus() == Well.RUNSTATUS_STARTING)) {
|
||||
for (int i = 0; i <= thisWell.sim.getLastFilledIndex(); i++) {
|
||||
if (startBtn.read() == 1) thisWell.start("startbutton");
|
||||
if (stopBtn.read() == 1) thisWell.stop("stopbutton");
|
||||
if (startBtn.read() == 1 && stopBtn.read() == 1) {
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
|
||||
thisWell.eval(i);
|
||||
|
||||
pos = thisWell.getCurrentPosition();
|
||||
|
||||
led2.write(pos > 20.0 ? 1 : 0);
|
||||
led3.write(pos > 40.0 ? 1 : 0);
|
||||
led4.write(pos > 60.0 ? 1 : 0);
|
||||
led5.write(pos > 80.0 ? 1 : 0);
|
||||
|
||||
runIndicator.write(thisWell.getRunStatus()==Well.RUNSTATUS_RUNNING ? 1 : 0);
|
||||
|
||||
try {
|
||||
Thread.sleep(sleepMilliseconds);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
loopCounter++;
|
||||
}
|
||||
thisCard.setNumPointsUsed(sim.getLastFilledIndex());
|
||||
thisCard.calcStrokeData(150, thisWell.getFluidGradient(),
|
||||
thisWell.getRodDepthTotal(), thisWell.getTubingAnchorDepth(),
|
||||
thisWell.getTubingCrossSectionalArea(), thisWell.getPumpArea(),
|
||||
thisWell.getFrictionEstimate(), thisWell.getStructuralRating());
|
||||
thisCard.printCard("none", true);
|
||||
loopCounter++;
|
||||
|
||||
if (startBtn.read() == 1) thisWell.start("startbutton");
|
||||
if (stopBtn.read() == 1) thisWell.stop("stopbutton");
|
||||
if (startBtn.read() == 1 && stopBtn.read() == 1) {
|
||||
System.exit(0);
|
||||
}
|
||||
led2.write(0);
|
||||
led3.write(0);
|
||||
led4.write(0);
|
||||
led5.write(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void start () {
|
||||
System.out.println("Starting POC");
|
||||
System.out.println("Starting POC Thread");
|
||||
if (t == null) {
|
||||
t = new Thread (this, "POC-Thread");
|
||||
t.start ();
|
||||
@@ -66,15 +101,9 @@ public class POC implements Runnable{
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
POC thisPOC = new POC("Barney", args[0], args[1], 3);
|
||||
final POC thisPOC = new POC("Barney", args[0], args[1], 100);
|
||||
thisPOC.start();
|
||||
|
||||
try {
|
||||
Thread.sleep(15000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
POC otherPOC = new POC("NotBarney", args[0], args[1], 4);
|
||||
otherPOC.start();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
package com.henrypump.poc;
|
||||
|
||||
|
||||
import de.vandermeer.asciitable.v2.RenderedTable;
|
||||
import de.vandermeer.asciitable.v2.V2_AsciiTable;
|
||||
import de.vandermeer.asciitable.v2.render.V2_AsciiTableRenderer;
|
||||
import de.vandermeer.asciitable.v2.render.WidthAbsoluteEven;
|
||||
import de.vandermeer.asciitable.v2.themes.V2_E_TableThemes;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
@@ -19,8 +24,19 @@ import java.io.IOException;
|
||||
*/
|
||||
public class Well {
|
||||
private String wellName;
|
||||
private double[][] topPosArray = new double[10][100];
|
||||
private double[][] topLoadArray = new double[10][100];
|
||||
protected Simulation sim;
|
||||
protected Database db;
|
||||
|
||||
// IO
|
||||
AnalogIn inclinometer = new AnalogIn(99, 0, 100, 0, 100);
|
||||
AnalogIn loadCell = new AnalogIn(99, 0, 50000, 0, 50000);
|
||||
DigitalOut runCommand = new DigitalOut(7, 0);
|
||||
private double currentPosition;
|
||||
private double currentLoad;
|
||||
|
||||
// CARDS
|
||||
private Card currentCard;
|
||||
private Card[] cardStorage = new Card[100];
|
||||
|
||||
// CONSTANTS
|
||||
private static double YM_STEEL = 30.5;
|
||||
@@ -72,22 +88,62 @@ public class Well {
|
||||
private double rodWeightAirTotal;
|
||||
private double[] rodWeightFluid = new double[11];
|
||||
private double rodWeightFluidTotal;
|
||||
|
||||
|
||||
private double pumpArea;
|
||||
private double tubingCrossSectionalArea;
|
||||
|
||||
// Statuses
|
||||
private int runStatus;
|
||||
public static final int RUNSTATUS_STOPPED = 0;
|
||||
public static final int RUNSTATUS_STARTING = 1;
|
||||
public static final int RUNSTATUS_RUNNING = 2;
|
||||
public static final int RUNSTATUS_PUMPEDOFF = 3;
|
||||
public static final int RUNSTATUS_FAULTED = 4;
|
||||
public static final int RUNSTATUS_LOCKEDOUT = 5;
|
||||
|
||||
private boolean permissiveOK;
|
||||
private long strokesSinceStart = 0;
|
||||
private long startupStrokes = 1;
|
||||
private long strokesToday = 0;
|
||||
private long strokesLifetime;
|
||||
private int pointCounter =0;
|
||||
|
||||
// DIRECTION
|
||||
private static final int DIRECTION_UNKNOWN = 0;
|
||||
private static final int DIRECTION_UP = 1;
|
||||
private static final int DIRECTION_DOWN = 2;
|
||||
private int direction = DIRECTION_UNKNOWN;
|
||||
private int lastDirection = DIRECTION_UNKNOWN;
|
||||
|
||||
// Modes
|
||||
private int runMode;
|
||||
public static final int RUNMODE_POC = 0;
|
||||
public static final int RUNMODE_MANUAL = 1;
|
||||
public static final int RUNMODE_TIMER = 2;
|
||||
|
||||
|
||||
// Intermediate Variables
|
||||
private double[][] topPosArray = new double[10][100];
|
||||
private double[][] topLoadArray = new double[10][100];
|
||||
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;
|
||||
|
||||
Well(String wellName){
|
||||
this.wellName = wellName;
|
||||
db = new Database();
|
||||
strokesLifetime = db.getLastStrokeNum() + 1;
|
||||
currentCard = new Card(strokesLifetime);
|
||||
}
|
||||
|
||||
Well(String wellName, String simFileName){
|
||||
this.wellName = wellName;
|
||||
sim = new Simulation(simFileName);
|
||||
db = new Database();
|
||||
strokesLifetime = db.getLastStrokeNum() + 1;
|
||||
currentCard = new Card(strokesLifetime);
|
||||
}
|
||||
|
||||
public double getDt() {
|
||||
@@ -225,6 +281,76 @@ public class Well {
|
||||
this.structuralRating = structuralRating;
|
||||
}
|
||||
|
||||
public String getWellName() {
|
||||
return wellName;
|
||||
}
|
||||
|
||||
public boolean isPermissiveOK() {
|
||||
return permissiveOK;
|
||||
}
|
||||
|
||||
public int getRunStatus() {
|
||||
return runStatus;
|
||||
}
|
||||
|
||||
public int getRunMode() {
|
||||
return runMode;
|
||||
}
|
||||
|
||||
public double getCurrentPosition() {
|
||||
return currentPosition;
|
||||
}
|
||||
|
||||
public double getCurrentLoad() {
|
||||
return currentLoad;
|
||||
}
|
||||
|
||||
public long getStartupStrokes() {
|
||||
return startupStrokes;
|
||||
}
|
||||
|
||||
public void setStartupStrokes(long startupStrokes) {
|
||||
this.startupStrokes = startupStrokes;
|
||||
}
|
||||
|
||||
public long getStrokesSinceStart() {
|
||||
return strokesSinceStart;
|
||||
}
|
||||
|
||||
public long getStrokesToday() {
|
||||
return strokesToday;
|
||||
}
|
||||
|
||||
public long getStrokesLifetime() {
|
||||
return strokesLifetime;
|
||||
}
|
||||
|
||||
public int getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
// WELL COMMAND FUNCTIONS
|
||||
public void start(String initiator){
|
||||
if (runStatus == RUNSTATUS_STOPPED && permissiveOK){
|
||||
System.out.println("Starting " + wellName + " from " + initiator + "...");
|
||||
runStatus = RUNSTATUS_STARTING;
|
||||
strokesSinceStart = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void stop(String initiator){
|
||||
if (runStatus == RUNSTATUS_STARTING || runStatus == RUNSTATUS_RUNNING){
|
||||
System.out.println("Stopping " + wellName + " from " + initiator + "...");
|
||||
runStatus = RUNSTATUS_STOPPED;
|
||||
}
|
||||
}
|
||||
|
||||
public void checkSafeties(){
|
||||
permissiveOK = true;
|
||||
}
|
||||
|
||||
// WELL CALCULATION FUNCTIONS
|
||||
|
||||
public static double lookupRodWeightPerFoot(double i_ym, double i_diam) {
|
||||
double wtPerFt;
|
||||
if (i_ym == YM_STEEL) {
|
||||
@@ -337,29 +463,48 @@ public class Well {
|
||||
}
|
||||
|
||||
public void printTapers(){
|
||||
System.out.println("!!!!!! " + wellName + " !!!!!!");
|
||||
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("Friction Estimate: " + getFrictionEstimate());
|
||||
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("");
|
||||
|
||||
System.out.println("===== " + wellName + " =====");
|
||||
System.out.println("--- INPUT PARAMETERS ---");
|
||||
|
||||
V2_AsciiTable inputTable = new V2_AsciiTable();
|
||||
inputTable.addRule();
|
||||
inputTable.addRow("DeltaT", getDt());
|
||||
inputTable.addStrongRule();
|
||||
inputTable.addRow("Fluid Gradient", getFluidGradient());
|
||||
inputTable.addRow("Pump Diameter", getPumpDiameter());
|
||||
inputTable.addRow("Stuffing Box Friction", getSbfriction());
|
||||
inputTable.addRow("Friction Estimate", getFrictionEstimate());
|
||||
inputTable.addRule();
|
||||
inputTable.addRow("Tubing Anchor Depth", getTubingAnchorDepth());
|
||||
inputTable.addRow("Tubing ID", getTubingID());
|
||||
inputTable.addRow("Tubing OD", getTubingOD());
|
||||
inputTable.addRule();
|
||||
inputTable.addRow("Number of Tapers", getNumTapers());
|
||||
inputTable.addRule();
|
||||
V2_AsciiTableRenderer rend = new V2_AsciiTableRenderer();
|
||||
rend.setTheme(V2_E_TableThemes.UTF_LIGHT.get());
|
||||
rend.setWidth(new WidthAbsoluteEven(50));
|
||||
RenderedTable rt = rend.render(inputTable);
|
||||
System.out.println(rt);
|
||||
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("");
|
||||
V2_AsciiTable taperTable = new V2_AsciiTable();
|
||||
taperTable.addRule();
|
||||
taperTable.addRow("Taper", i);
|
||||
taperTable.addStrongRule();
|
||||
taperTable.addRow("Rod Length", getRodLength(i));
|
||||
taperTable.addRow("Rod Diameter", getRodDiameter(i));
|
||||
taperTable.addRow("Rod Damping Factor", getDampingFactor(i));
|
||||
taperTable.addRow("Rod Material", getRodMaterial(i));
|
||||
taperTable.addRow("Rod Young's Modulus", getRodYM(i));
|
||||
taperTable.addRule();
|
||||
rend.setTheme(V2_E_TableThemes.UTF_LIGHT.get());
|
||||
rend.setWidth(new WidthAbsoluteEven(50));
|
||||
rt = rend.render(taperTable);
|
||||
System.out.println(rt);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
|
||||
@@ -540,7 +685,7 @@ public class Well {
|
||||
return pumpLOAD;
|
||||
};
|
||||
|
||||
public LPStatus calc(double sPosition, double sLoad){
|
||||
private LPStatus calc(double sPosition, double sLoad){
|
||||
boolean useShift = false;
|
||||
int loadMult = 1;
|
||||
int tapersAllowed = 1;
|
||||
@@ -605,6 +750,104 @@ public class Well {
|
||||
return downholeValues;
|
||||
};
|
||||
|
||||
public void eval(){
|
||||
checkSafeties();
|
||||
currentPosition = inclinometer.readScaled();
|
||||
currentLoad = loadCell.readScaled();
|
||||
LPStatus lastPoint = calc(currentPosition, currentLoad);
|
||||
if(runStatus == RUNSTATUS_STARTING || runStatus == RUNSTATUS_RUNNING) {
|
||||
if (lastPoint.getStatus() == GOOD_STATUS) {
|
||||
currentCard.setSurfacePosition(pointCounter, currentPosition);
|
||||
currentCard.setSurfaceLoad(pointCounter, currentLoad);
|
||||
currentCard.setDownholePosition(pointCounter, lastPoint.getPosition());
|
||||
currentCard.setDownholeLoad(pointCounter, lastPoint.getLoad());
|
||||
}
|
||||
|
||||
if (inclinometer.getHistory(0) > inclinometer.getHistory(1))
|
||||
direction = DIRECTION_UP;
|
||||
else if (inclinometer.getHistory(0) < inclinometer.getHistory(1))
|
||||
direction = DIRECTION_DOWN;
|
||||
|
||||
if (direction == DIRECTION_UP && lastDirection == DIRECTION_DOWN && pointCounter > 0) {
|
||||
currentCard.setNumPointsUsed(pointCounter + 1);
|
||||
currentCard.calcStrokeData(150, fluidGradient,
|
||||
rodDepthTotal, tubingAnchorDepth,
|
||||
tubingCrossSectionalArea, pumpArea,
|
||||
frictionEstimate, structuralRating);
|
||||
for (int j = 98; j >= 0; j--) {
|
||||
cardStorage[j + 1] = cardStorage[j];
|
||||
}
|
||||
cardStorage[0] = currentCard;
|
||||
currentCard.printCard("none", true);
|
||||
System.out.println("Cards in DB: " + db.newCard(currentCard));
|
||||
strokesSinceStart++;
|
||||
strokesToday++;
|
||||
strokesLifetime++;
|
||||
currentCard = new Card(strokesLifetime);
|
||||
pointCounter = -1;
|
||||
if (strokesSinceStart > startupStrokes) {
|
||||
runStatus = RUNSTATUS_RUNNING;
|
||||
}
|
||||
}
|
||||
lastDirection = direction;
|
||||
pointCounter++;
|
||||
}
|
||||
}
|
||||
|
||||
public void eval(int simPoint){
|
||||
checkSafeties();
|
||||
currentPosition = inclinometer.readScaledSim(sim.getPositionAtIndex(simPoint));
|
||||
currentLoad = loadCell.readScaledSim(sim.getLoadAtIndex(simPoint));
|
||||
LPStatus lastPoint = calc(currentPosition, currentLoad);
|
||||
if(runStatus == RUNSTATUS_STARTING || runStatus == RUNSTATUS_RUNNING) {
|
||||
if (lastPoint.getStatus() == GOOD_STATUS) {
|
||||
currentCard.setSurfacePosition(pointCounter, currentPosition);
|
||||
currentCard.setSurfaceLoad(pointCounter, currentLoad);
|
||||
currentCard.setDownholePosition(pointCounter, lastPoint.getPosition());
|
||||
currentCard.setDownholeLoad(pointCounter, lastPoint.getLoad());
|
||||
}
|
||||
|
||||
if (inclinometer.getHistory(0) > inclinometer.getHistory(1))
|
||||
direction = DIRECTION_UP;
|
||||
else if (inclinometer.getHistory(0) < inclinometer.getHistory(1))
|
||||
direction = DIRECTION_DOWN;
|
||||
|
||||
if (direction == DIRECTION_UP && lastDirection == DIRECTION_DOWN && pointCounter > 0) {
|
||||
currentCard.setNumPointsUsed(pointCounter + 1);
|
||||
currentCard.calcStrokeData(150, fluidGradient,
|
||||
rodDepthTotal, tubingAnchorDepth,
|
||||
tubingCrossSectionalArea, pumpArea,
|
||||
frictionEstimate, structuralRating);
|
||||
for (int j = 98; j >= 0; j--) {
|
||||
cardStorage[j + 1] = cardStorage[j];
|
||||
}
|
||||
cardStorage[0] = currentCard;
|
||||
currentCard.printCard("none", true);
|
||||
System.out.println("Cards in DB: " + db.newCard(currentCard));
|
||||
strokesSinceStart++;
|
||||
strokesToday++;
|
||||
strokesLifetime++;
|
||||
currentCard = new Card(strokesLifetime);
|
||||
pointCounter = -1;
|
||||
if (strokesSinceStart > startupStrokes){
|
||||
runStatus = RUNSTATUS_RUNNING;
|
||||
}
|
||||
}
|
||||
lastDirection = direction;
|
||||
pointCounter++;
|
||||
}
|
||||
|
||||
if (runStatus == RUNSTATUS_RUNNING || runStatus == RUNSTATUS_STARTING){
|
||||
runCommand.write(1);
|
||||
} else {
|
||||
runCommand.write(0);
|
||||
}
|
||||
}
|
||||
|
||||
public void allOutputsOff(){
|
||||
runCommand.write(0, true);
|
||||
}
|
||||
|
||||
public static void main( String[] args ){
|
||||
Well thisWell = new Well("Barney");
|
||||
thisWell.parseJSONFile(args[0]);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/henrypump/poc/Database.class
Normal file
BIN
target/classes/com/henrypump/poc/Database.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Feb 01 18:42:01 CST 2017
|
||||
#Thu Feb 02 18:00:05 CST 2017
|
||||
version=1.0-SNAPSHOT
|
||||
groupId=com.henrypump.poc
|
||||
artifactId=poc-java
|
||||
|
||||
@@ -6,5 +6,6 @@ com/henrypump/poc/DigitalIn.class
|
||||
com/henrypump/poc/POC.class
|
||||
com/henrypump/poc/App.class
|
||||
com/henrypump/poc/Well.class
|
||||
com/henrypump/poc/Database.class
|
||||
com/henrypump/poc/LPStatus.class
|
||||
com/henrypump/poc/DigitalOut.class
|
||||
|
||||
@@ -6,5 +6,6 @@
|
||||
/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/Database.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
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<testsuite tests="1" failures="0" name="com.henrypump.poc.AppTest" time="0.002" errors="0" skipped="0">
|
||||
<testsuite tests="1" failures="0" name="com.henrypump.poc.AppTest" time="0.003" 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"/>
|
||||
@@ -62,5 +62,5 @@
|
||||
<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"/>
|
||||
<testcase classname="com.henrypump.poc.AppTest" name="testApp" time="0.003"/>
|
||||
</testsuite>
|
||||
@@ -1,4 +1,4 @@
|
||||
-------------------------------------------------------------------------------
|
||||
Test set: com.henrypump.poc.AppTest
|
||||
-------------------------------------------------------------------------------
|
||||
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec
|
||||
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec
|
||||
|
||||
Reference in New Issue
Block a user