diff --git a/ocr/dependency-reduced-pom.xml b/ocr/dependency-reduced-pom.xml index d54d01d..ef36ef7 100644 --- a/ocr/dependency-reduced-pom.xml +++ b/ocr/dependency-reduced-pom.xml @@ -8,6 +8,11 @@ ${project.artifactId} + + maven-javadoc-plugin + 3.4.1 + + maven-compiler-plugin 3.8.1 @@ -66,6 +71,17 @@ + + + + maven-javadoc-plugin + 3.4.1 + + public + + + + 2.8.0 11 diff --git a/ocr/pom.xml b/ocr/pom.xml index 00aa984..a05664c 100644 --- a/ocr/pom.xml +++ b/ocr/pom.xml @@ -106,6 +106,27 @@ ${project.artifactId} + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + org.apache.maven.plugins maven-compiler-plugin @@ -192,4 +213,16 @@ + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + public + + + + diff --git a/ocr/src/main/java/org/baxter/disco/ocr/ConfigFacade.java b/ocr/src/main/java/org/baxter/disco/ocr/ConfigFacade.java index 3255103..e7321ba 100644 --- a/ocr/src/main/java/org/baxter/disco/ocr/ConfigFacade.java +++ b/ocr/src/main/java/org/baxter/disco/ocr/ConfigFacade.java @@ -53,7 +53,7 @@ public class ConfigFacade /** * Map of all config values relating to the camera. */ - private static final Map> configMap = new HashMap<>(); + private static final Map> configMap = new HashMap<>(); private static final Configurations CONFIGURATIONS = new Configurations(); private static FileBasedConfigurationBuilder CONFIG_BUILDER = CONFIGURATIONS.iniBuilder(configFileLocation); @@ -61,6 +61,7 @@ public class ConfigFacade static { + //TODO: Fix loadConfig(); } /** @@ -231,7 +232,7 @@ public class ConfigFacade for(String sectionName : CONFIG_STORE.getSections()) { Map savedSection = new HashMap<>(); - SubnodeConfiguration section = CONFIG_STORE.getSection(sectionName); + var section = CONFIG_STORE.getSection(sectionName); for(ConfigProperties configState : ConfigProperties.values()) { diff --git a/ocr/src/main/java/org/baxter/disco/ocr/ErrorLogging.java b/ocr/src/main/java/org/baxter/disco/ocr/ErrorLogging.java index 593fa34..0ea682a 100644 --- a/ocr/src/main/java/org/baxter/disco/ocr/ErrorLogging.java +++ b/ocr/src/main/java/org/baxter/disco/ocr/ErrorLogging.java @@ -26,6 +26,9 @@ public class ErrorLogging { try { + /* + * New file per runtime + */ fw = new FileWriter(logFile, true); bw = new BufferedWriter(fw); fileOut = new PrintWriter(bw); diff --git a/ocr/src/main/java/org/baxter/disco/ocr/MovementFacade.java b/ocr/src/main/java/org/baxter/disco/ocr/MovementFacade.java index 6897ed1..9845922 100644 --- a/ocr/src/main/java/org/baxter/disco/ocr/MovementFacade.java +++ b/ocr/src/main/java/org/baxter/disco/ocr/MovementFacade.java @@ -28,8 +28,9 @@ public class MovementFacade /** * PWM Frequency + * TODO: Setter with bounds */ - public static final int FREQUENCY = 60000; + private static int FREQUENCY = 60000; /** * PWM Duty Cycle @@ -165,6 +166,7 @@ public class MovementFacade PwmConfigBuilder configBuilder; switch (address) { + //TODO: Set PWM duty cycle //The following pins allow for hardware PWM support. case 12: case 13: diff --git a/ocr/src/main/java/org/baxter/disco/ocr/OpenCVFacade.java b/ocr/src/main/java/org/baxter/disco/ocr/OpenCVFacade.java index e329ac2..73b9745 100644 --- a/ocr/src/main/java/org/baxter/disco/ocr/OpenCVFacade.java +++ b/ocr/src/main/java/org/baxter/disco/ocr/OpenCVFacade.java @@ -177,7 +177,7 @@ public class OpenCVFacade } else { - ErrorLogging.logError("CAMERA ERROR!!! - Illegal camera name."); + ErrorLogging.logError("CAMERA ERROR!!! - Given camera name not initialised."); return false; } } @@ -228,6 +228,7 @@ public class OpenCVFacade /** * + * TODO: Overload frameCount * @param cameraName Name of the camera to take a picture with. * @param frameCount The number of images to take. * @@ -351,6 +352,7 @@ public class OpenCVFacade /** * Processes image from defined camera, using the config defaults. * + * TODO: More robust file output checking * @param cameraName Name of the camera to take a picture from. * @param crop Whether to crop the image * @param threshold Whether to threshold the image diff --git a/ocr/src/main/java/org/baxter/disco/ocr/TesseractFacade.java b/ocr/src/main/java/org/baxter/disco/ocr/TesseractFacade.java index bf7d95e..332ecaa 100644 --- a/ocr/src/main/java/org/baxter/disco/ocr/TesseractFacade.java +++ b/ocr/src/main/java/org/baxter/disco/ocr/TesseractFacade.java @@ -57,14 +57,19 @@ public class TesseractFacade //Determine whether the OCR output is actually a double if(!stringOutput.isEmpty()) { - Scanner sc = new Scanner(stringOutput.trim()); - if(!sc.hasNextDouble()) + try(Scanner sc = new Scanner(stringOutput.trim());) { - output = sc.nextDouble(); - if(output >= 200) ErrorLogging.logError("OCR ERROR!!! - OCR output is too high for DUT, potential misread."); - if(output <= -10) ErrorLogging.logError("OCR ERROR!!! - OCR output is too low for DUT, potential misread."); + /* + *Discos have error messages (LO, HI, POS, ?). Consider parsing as well. + */ + if(sc.hasNextDouble()) + { + output = sc.nextDouble(); + if(output >= 200) ErrorLogging.logError("OCR ERROR!!! - OCR output is too high for DUT, potential misread."); + if(output <= -10) ErrorLogging.logError("OCR ERROR!!! - OCR output is too low for DUT, potential misread."); + } + else ErrorLogging.logError("OCR ERROR!!! - OCR output is not a Double."); } - else ErrorLogging.logError("OCR ERROR!!! - OCR output is not a Double."); } //Return output diff --git a/ocr/src/main/java/org/baxter/disco/ocr/calibrationMenu.fxml b/ocr/src/main/java/org/baxter/disco/ocr/calibrationMenu.fxml index 104c33a..af614c0 100644 --- a/ocr/src/main/java/org/baxter/disco/ocr/calibrationMenu.fxml +++ b/ocr/src/main/java/org/baxter/disco/ocr/calibrationMenu.fxml @@ -12,7 +12,6 @@ - @@ -156,6 +155,7 @@ +