1 Commits

Author SHA1 Message Date
Patrick McDonagh
33de831391 allow enable/disable of IO 2018-02-01 12:01:13 -06:00
12 changed files with 399 additions and 829 deletions

5
.idea/dbnavigator.xml generated
View File

@@ -2,7 +2,7 @@
<project version="4"> <project version="4">
<component name="DBNavigator.Project.DataEditorManager"> <component name="DBNavigator.Project.DataEditorManager">
<record-view-column-sorting-type value="BY_INDEX" /> <record-view-column-sorting-type value="BY_INDEX" />
<value-preview-text-wrapping value="true" /> <value-preview-text-wrapping value="false" />
<value-preview-pinned value="false" /> <value-preview-pinned value="false" />
</component> </component>
<component name="DBNavigator.Project.DataExportManager"> <component name="DBNavigator.Project.DataExportManager">
@@ -39,9 +39,6 @@
<component name="DBNavigator.Project.EditorStateManager"> <component name="DBNavigator.Project.EditorStateManager">
<last-used-providers /> <last-used-providers />
</component> </component>
<component name="DBNavigator.Project.FileConnectionMappingManager">
<mapping file-url="file://$PROJECT_DIR$/db_setup.sql" connection-id="94a6cabe-5b17-467d-a87c-dc17d3749f25" current-schema="information_schema" />
</component>
<component name="DBNavigator.Project.MethodExecutionManager"> <component name="DBNavigator.Project.MethodExecutionManager">
<method-browser /> <method-browser />
<execution-history> <execution-history>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="Gradle: :IOBoard-RPi-0.1:">
<CLASSES>
<root url="jar://$PROJECT_DIR$/libs/IOBoard-RPi-0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -5,6 +5,7 @@
<content url="file://$MODULE_DIR$/../.."> <content url="file://$MODULE_DIR$/../..">
<excludeFolder url="file://$MODULE_DIR$/../../.gradle" /> <excludeFolder url="file://$MODULE_DIR$/../../.gradle" />
<excludeFolder url="file://$MODULE_DIR$/../../build" /> <excludeFolder url="file://$MODULE_DIR$/../../build" />
<excludeFolder url="file://$MODULE_DIR$/../../out" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="poc-java:main" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="com.henrypump.poc" external.system.module.type="sourceSet" external.system.module.version="1.0-SNAPSHOT" type="JAVA_MODULE" version="4"> <module external.linked.project.id="poc-java:main" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="com.henrypump.poc" external.system.module.type="sourceSet" external.system.module.version="1.0-SNAPSHOT" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/../../build/classes/main" /> <output url="file://$MODULE_DIR$/../../out/production/classes" />
<exclude-output /> <exclude-output />
<content url="file://$MODULE_DIR$/../../src/main"> <content url="file://$MODULE_DIR$/../../src/main">
<sourceFolder url="file://$MODULE_DIR$/../../src/main/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/../../src/main/java" isTestSource="false" />
@@ -14,6 +14,7 @@
<orderEntry type="library" name="Gradle: org.mongodb:mongodb-driver:3.4.2" level="project" /> <orderEntry type="library" name="Gradle: org.mongodb:mongodb-driver:3.4.2" level="project" />
<orderEntry type="library" name="Gradle: de.vandermeer:asciitable:0.2.5" level="project" /> <orderEntry type="library" name="Gradle: de.vandermeer:asciitable:0.2.5" level="project" />
<orderEntry type="library" name="Gradle: :IOBoard-0.1:" level="project" /> <orderEntry type="library" name="Gradle: :IOBoard-0.1:" level="project" />
<orderEntry type="library" name="Gradle: :IOBoard-RPi-0.1:" level="project" />
<orderEntry type="library" name="Gradle: junit:junit:4.10" level="project" /> <orderEntry type="library" name="Gradle: junit:junit:4.10" level="project" />
<orderEntry type="library" name="Gradle: org.mongodb:bson:3.4.2" level="project" /> <orderEntry type="library" name="Gradle: org.mongodb:bson:3.4.2" level="project" />
<orderEntry type="library" name="Gradle: org.mongodb:mongodb-driver-core:3.4.2" level="project" /> <orderEntry type="library" name="Gradle: org.mongodb:mongodb-driver-core:3.4.2" level="project" />

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="poc-java:test" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="com.henrypump.poc" external.system.module.type="sourceSet" external.system.module.version="1.0-SNAPSHOT" type="JAVA_MODULE" version="4"> <module external.linked.project.id="poc-java:test" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="com.henrypump.poc" external.system.module.type="sourceSet" external.system.module.version="1.0-SNAPSHOT" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output-test url="file://$MODULE_DIR$/../../build/classes/test" /> <output-test url="file://$MODULE_DIR$/../../out/test/classes" />
<exclude-output /> <exclude-output />
<content url="file://$MODULE_DIR$/../../src/test"> <content url="file://$MODULE_DIR$/../../src/test">
<sourceFolder url="file://$MODULE_DIR$/../../src/test/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/../../src/test/java" isTestSource="true" />
@@ -15,6 +15,7 @@
<orderEntry type="library" name="Gradle: org.mongodb:mongodb-driver:3.4.2" level="project" /> <orderEntry type="library" name="Gradle: org.mongodb:mongodb-driver:3.4.2" level="project" />
<orderEntry type="library" name="Gradle: de.vandermeer:asciitable:0.2.5" level="project" /> <orderEntry type="library" name="Gradle: de.vandermeer:asciitable:0.2.5" level="project" />
<orderEntry type="library" name="Gradle: :IOBoard-0.1:" level="project" /> <orderEntry type="library" name="Gradle: :IOBoard-0.1:" level="project" />
<orderEntry type="library" name="Gradle: :IOBoard-RPi-0.1:" level="project" />
<orderEntry type="library" name="Gradle: org.mongodb:bson:3.4.2" level="project" /> <orderEntry type="library" name="Gradle: org.mongodb:bson:3.4.2" level="project" />
<orderEntry type="library" name="Gradle: org.mongodb:mongodb-driver-core:3.4.2" level="project" /> <orderEntry type="library" name="Gradle: org.mongodb:mongodb-driver-core:3.4.2" level="project" />
<orderEntry type="library" name="Gradle: de.vandermeer:asciilist:0.0.3" level="project" /> <orderEntry type="library" name="Gradle: de.vandermeer:asciilist:0.0.3" level="project" />

1162
.idea/workspace.xml generated

File diff suppressed because it is too large Load Diff

View File

@@ -25,6 +25,7 @@ dependencies {
compile group: 'org.mongodb', name: 'mongodb-driver', version:'3.4.2' compile group: 'org.mongodb', name: 'mongodb-driver', version:'3.4.2'
compile group: 'de.vandermeer', name: 'asciitable', version:'0.2.5' compile group: 'de.vandermeer', name: 'asciitable', version:'0.2.5'
compile name: 'IOBoard-0.1' compile name: 'IOBoard-0.1'
compile name: 'IOBoard-RPi-0.1'
testCompile group: 'junit', name: 'junit', version:'3.8.1' testCompile group: 'junit', name: 'junit', version:'3.8.1'
} }

Binary file not shown.

Binary file not shown.

View File

@@ -2,7 +2,6 @@ package com.henrypump.poc;
import com.henrypump.io.DigitalIn; import com.henrypump.io.DigitalIn;
import com.henrypump.io.DigitalOut; import com.henrypump.io.DigitalOut;
import com.henrypump.io.MuxSetup;
/** /**
* Created by patrickjmcd on 2/10/17. * Created by patrickjmcd on 2/10/17.
@@ -16,17 +15,30 @@ public class IOControl implements Runnable {
private double pos = 0; private double pos = 0;
private int runStatus; private int runStatus;
IOControl(POC poc){ IOControl(POC poc) {
this.poc = poc; this.poc = poc;
// IO // IO
startBtn = new DigitalIn(1);
stopBtn = new DigitalIn(2); if (this.poc.ioEnabled){
led2 = new DigitalOut(3); startBtn = new DigitalIn(1);
led3 = new DigitalOut(4); stopBtn = new DigitalIn(2);
led4 = new DigitalOut(5); led2 = new DigitalOut(3);
led5 = new DigitalOut(6); led3 = new DigitalOut(4);
runningIndicator = new DigitalOut(2); led4 = new DigitalOut(5);
runCommand = new DigitalOut(1); led5 = new DigitalOut(6);
runningIndicator = new DigitalOut(2);
runCommand = new DigitalOut(1);
} else {
startBtn = new DigitalIn(99);
stopBtn = new DigitalIn(99);
led2 = new DigitalOut(99);
led3 = new DigitalOut(99);
led4 = new DigitalOut(99);
led5 = new DigitalOut(99);
runningIndicator = new DigitalOut(99);
runCommand = new DigitalOut(99);
}
} }
private void startWell(){ private void startWell(){

View File

@@ -11,7 +11,7 @@ import java.time.ZonedDateTime;
public class POC implements Runnable{ public class POC implements Runnable{
protected Well thisWell; protected Well thisWell;
private Thread t; private Thread t;
private boolean ioEnabled; boolean ioEnabled;
POC(String dbHostname){ POC(String dbHostname){
ioEnabled = true; ioEnabled = true;

View File

@@ -242,12 +242,12 @@ public class Well {
int minRaw = Integer.MAX_VALUE; int minRaw = Integer.MAX_VALUE;
while (Duration.between(startTime, Instant.now()).toMillis() < 30000){ while (Duration.between(startTime, Instant.now()).toMillis() < 30000){
inclinometer.read(ioMux); inclinometer.read(ioMux);
if (inclinometer.rawValue > maxRaw){ if (inclinometer.getRawValue() > maxRaw){
maxRaw = inclinometer.rawValue; maxRaw = inclinometer.getRawValue();
} }
if (inclinometer.rawValue < minRaw){ if (inclinometer.getRawValue() < minRaw){
minRaw = inclinometer.rawValue; minRaw = inclinometer.getRawValue();
} }
try { try {
Thread.sleep(10); Thread.sleep(10);
@@ -867,7 +867,7 @@ public class Well {
pumpStartTime = ZonedDateTime.now(); pumpStartTime = ZonedDateTime.now();
db.newRunStatus(getRunStatusString(), initiator); db.newRunStatus(getRunStatusString(), initiator);
int[] inclMinMax = calibrateInclinometer(); int[] inclMinMax = calibrateInclinometer();
inclinometer = new AnalogIn(inclinometer.channel, inclMinMax[0], inclMinMax[1], inclinometer.euMin, inclinometer.euMax); inclinometer = new AnalogIn(inclinometer.getChannel(), inclMinMax[0], inclMinMax[1], inclinometer.getEuMin(), inclinometer.getEuMax());
} }
} }