diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml
index 6f54b49..6965a52 100644
--- a/dependency-reduced-pom.xml
+++ b/dependency-reduced-pom.xml
@@ -4,7 +4,7 @@
org.baxter.disco
ocr
Disco OCR Accuracy Over Life Testing
- 4.3.2
+ 4.3.3
Testing Discos for long-term accuracy, using automated optical character recognition.
Baxter International
diff --git a/pom.xml b/pom.xml
index b8cc3c6..4059755 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
org.baxter.disco
ocr
- 4.3.2
+ 4.3.3
jar
Disco OCR Accuracy Over Life Testing
Testing Discos for long-term accuracy, using automated optical character recognition.
diff --git a/runScript.sh b/runScript.sh
index bf30fd0..6729115 100644
--- a/runScript.sh
+++ b/runScript.sh
@@ -1,2 +1,2 @@
#! /usr/bin/env sh
-sudo java -jar discoTesting-4.2.0.jar 2>/dev/null
+sudo java -jar discoTesting-4.3.3.jar 2>/dev/null
diff --git a/src/main/java/org/baxter/disco/ocr/Cli.java b/src/main/java/org/baxter/disco/ocr/Cli.java
index aaeba77..755bb01 100644
--- a/src/main/java/org/baxter/disco/ocr/Cli.java
+++ b/src/main/java/org/baxter/disco/ocr/Cli.java
@@ -25,7 +25,7 @@ public class Cli
/**
* Complete build version number
*/
- private static final String version = "4.3.2";
+ private static final String version = "4.3.3";
/**
* Currently saved iteration count.
@@ -687,19 +687,15 @@ public class Cli
//useful for multithreading, which isn't necessary in CLI
final int localIterations = iterationCount;
- //TODO: Hard-coded value that needs fixing
- boolean prime = false;
+ //Save whether to prime the devices; defaults to false
+ boolean prime = false;
//Create a List of *active* cameras.
List cameraList = new ArrayList<>();
for(String cameraName : OpenCVFacade.getCameraNames())
{
- //if(cameraName != null) { /*println(cameraName);*/ }
- //else ErrorLogging.logError("Null camera!");
- if(ConfigFacade.getValue(cameraName,ConfigProperties.PRIME) != 0)
- {
- prime = true;
- }
+ prime = (ConfigFacade.getValue(cameraName,ConfigProperties.PRIME) != 0) || prime;
+
if(ConfigFacade.getValue(cameraName,ConfigProperties.ACTIVE) != 0)
{
cameraList.add(cameraName);
@@ -709,11 +705,10 @@ public class Cli
//Initialise the workbook, with the number of cameras and the final output location
DataSaving.initWorkbook(ConfigFacade.getOutputSaveLocation(),cameraList.size());
- //Do 2 dummy passes, to make completely sure that the devices are awake
+ //Wake the device, then wait to ensure they're awake before continuing
ErrorLogging.logError("DEBUG: Waking devices...");
- fixture.iterationMovement(prime);
fixture.pressButton();
- fixture.iterationMovement(prime);
+ try{ Thread.sleep(2000); } catch(Exception e){ ErrorLogging.logError(e); }
//Create final maps for result images, result values, and camera names
Map resultMap = new HashMap<>();
@@ -779,22 +774,20 @@ public class Cli
resultMap.put(file,result);
ErrorLogging.logError("Tesseract final output: " + result);
LOCK.unlock();
- }
-
- //LO detection and avoidance
- for(Double result : resultMap.values())
- {
- if(result <= 1.0 || result >= 117.0 || result == Double.NEGATIVE_INFINITY)
+ if(result <= 10 ||
+ result >= 100 ||
+ result == Double.NEGATIVE_INFINITY)
{
fixture.goUp();
- try{ Thread.sleep(20000); } catch(Exception e){ ErrorLogging.logError(e); }
+ try{ Thread.sleep(20000); }
+ catch(Exception e){ ErrorLogging.logError(e); }
fixture.pressButton();
fail = true;
break;
}
}
}
- while(fail == true);
+ while(fail);
//Write all given values to the Excel file
while(!LOCK.tryLock()) {}
diff --git a/src/main/java/org/baxter/disco/ocr/DataSaving.java b/src/main/java/org/baxter/disco/ocr/DataSaving.java
index dfe08c6..56aaadb 100644
--- a/src/main/java/org/baxter/disco/ocr/DataSaving.java
+++ b/src/main/java/org/baxter/disco/ocr/DataSaving.java
@@ -1,16 +1,19 @@
package org.baxter.disco.ocr;
+import java.io.DataInputStream;
//Standard imports
import java.io.File;
+import java.io.FileInputStream;
import java.io.FileOutputStream;
+import java.io.InputStream;
import java.util.ArrayList;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
//Generic spreadsheet imports
import org.apache.poi.ss.util.CellReference;
+import org.apache.poi.util.IOUtils;
import org.apache.poi.ss.usermodel.DataFormat;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.FormulaEvaluator;
@@ -18,16 +21,18 @@ import org.apache.poi.ss.usermodel.FormulaEvaluator;
//Excel-specific imports
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
+import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFPatriarch;
import static org.apache.poi.hssf.util.HSSFColor.HSSFColorPredefined;
/**
* Facade for saving data out to a file.
*
* @author Blizzard Finnegan
- * @version 4.0.1, 13 Feb. 2023
+ * @version 4.1.0, 24 Feb. 2023
*/
public class DataSaving
{
@@ -222,7 +227,7 @@ public class DataSaving
HSSFRow row = outputSheet.createRow(++startingRow);
List cameraNames = new ArrayList<>(cameraToFile.keySet());
//ErrorLogging.logError("DEBUG: image locations: " + imageLocations.toString());
- List