Minor updates to improve ease of use #4

Merged
blizzardfinnegan merged 1 commit from devel into stable 2023-02-09 15:50:25 -05:00
5 changed files with 21 additions and 11 deletions

View file

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.baxter.disco</groupId>
<artifactId>ocr</artifactId>
<version>4.0.0</version>
<version>4.0.1</version>
<packaging>jar</packaging>
<name>Disco OCR Accuracy Over Life Testing</name>
<description>Testing Discos for long-term accuracy, using automated optical character recognition.</description>

View file

@ -17,10 +17,15 @@ import java.util.concurrent.locks.ReentrantLock;
* classes).
*
* @author Blizzard Finnegan
* @version 1.4.0, 08 Feb. 2023
* @version 1.4.1, 09 Feb. 2023
*/
public class Cli
{
/**
* Complete build version number
*/
private static final String version = "4.0.0";
/**
* Currently saved iteration count.
*/
@ -78,6 +83,10 @@ public class Cli
public static void main(String[] args)
{
ErrorLogging.logError("========================");
ErrorLogging.logError("Accuracy Over Life Test");
ErrorLogging.logError("Version: " + version);
ErrorLogging.logError("========================");
try{
inputScanner = new Scanner(System.in);
@ -385,7 +394,7 @@ public class Cli
println("Will the image be thresholded? " + thresholdImage);
String cameraActive = ((ConfigFacade.getValue(cameraName,ConfigProperties.ACTIVE) != 0) ? "yes" : "no");
println("Will the camera be used when running tests? " + cameraActive);
println("Tesseract parsed value: " + tesseractValue);
println("Tesseract parsed value for camera " + cameraName + ": " + tesseractValue);
println("------------------------------------");
println("1. Change Crop X");
println("2. Change Crop Y");
@ -573,7 +582,8 @@ public class Cli
}
else if(modifiedProperty != ConfigProperties.PRIME)
{
prompt("Enter new value for this property (" + modifiedProperty.toString() + "): ");
prompt("Enter new value for this property (" + modifiedProperty.toString() + ", currently : " +
ConfigFacade.getValue(cameraName,modifiedProperty) + "): ");
userInput = inputFiltering(inputScanner.nextLine());
ConfigFacade.setValue(cameraName,modifiedProperty,userInput);
//if(canvas != null) canvas.dispose();
@ -764,6 +774,7 @@ public class Cli
fixture.closeGPIO();
ErrorLogging.logError("DEBUG: END OF PROGRAM.");
ErrorLogging.closeLogs();
println("The program has exited successfully. Please press Ctrl-c to return to the terminal prompt.");
}
/**

View file

@ -23,7 +23,7 @@ import java.util.ArrayList;
* Can write to file when requested, reads from file on initial start.
*
* @author Blizzard Finnegan
* @version 1.3.0, 08 Feb. 2023
* @version 1.3.1, 09 Feb. 2023
*/
public class ConfigFacade
{

View file

@ -17,7 +17,7 @@ import org.apache.commons.lang3.exception.ExceptionUtils;
* as well as stderr.
*
* @author Blizzard Finnegan
* @version 1.3.0, 03 Feb. 2023
* @version 1.3.1, 09 Feb. 2023
*/
public class ErrorLogging
@ -87,7 +87,8 @@ public class ErrorLogging
{
String errorStackTrace = ExceptionUtils.getStackTrace(error);
String errorMessage = datetime.format(LocalDateTime.now()) + " - " + errorStackTrace;
logError(errorMessage);
fileOut.println(errorMessage);
fileOut.flush();
}
/**

View file

@ -22,7 +22,7 @@ import java.util.List;
* Performs image capture, as well as image manipulation.
*
* @author Blizzard Finnegan
* @version 1.4.0, 08 Feb. 2023
* @version 1.4.1, 09 Feb. 2023
*/
public class OpenCVFacade
{
@ -136,9 +136,7 @@ public class OpenCVFacade
* @return List of available Webcam names.
*/
public static Set<String> getCameraNames()
{
return cameraMap.keySet();
}
{ return cameraMap.keySet(); }
/**