1088 lines
41 KiB
Java
1088 lines
41 KiB
Java
package Config;
|
|
|
|
import id.co.gtc.erhacam.Detectors;
|
|
import lombok.Getter;
|
|
import org.tinylog.Logger;
|
|
|
|
import java.io.File;
|
|
import java.io.FileInputStream;
|
|
import java.io.FileOutputStream;
|
|
import java.nio.file.Path;
|
|
import java.util.Properties;
|
|
import static Config.SomeCodes.*;
|
|
|
|
@SuppressWarnings("unused")
|
|
@Getter
|
|
public class ConfigFile {
|
|
private String AudioPhase1;
|
|
private String AudioPhase2;
|
|
private String AudioPhase3;
|
|
private String AudioPhase4;
|
|
private String AudioPhase5;
|
|
|
|
private String CameraLeft90;
|
|
private String CameraLeft45;
|
|
private String CameraCenter;
|
|
private String CameraRight45;
|
|
private String CameraRight90;
|
|
|
|
private CameraConfig ConfigLeft90 = new CameraConfig();
|
|
private CameraConfig ConfigLeft45 = new CameraConfig();
|
|
private CameraConfig ConfigCenter = new CameraConfig();
|
|
private CameraConfig ConfigRight45 =new CameraConfig();
|
|
private CameraConfig ConfigRight90 = new CameraConfig();
|
|
|
|
private String FTPHost;
|
|
private String FTPPort;
|
|
private String FTPUser;
|
|
private String FTPPass;
|
|
private String FTPPath;
|
|
|
|
private String PhotoDirectory;
|
|
|
|
private @Getter double cascadeScaleFactor;
|
|
private @Getter int cascadeMinNeighbors;
|
|
private @Getter int cascadeMinSize;
|
|
private @Getter int cascadeMaxSize;
|
|
|
|
private @Getter boolean MirrorCamera = false;
|
|
private @Getter boolean FlipCamera = false;
|
|
|
|
private @Getter double SharpnessThreshold;
|
|
|
|
private @Getter final double topcropmax = 30.0;
|
|
private @Getter final double bottomcropmax = 30.0;
|
|
private @Getter final double leftcropmax = 30.0;
|
|
private @Getter final double rightcropmax = 30.0;
|
|
private @Getter double Cam1TopCrop = 10.0;
|
|
private @Getter double Cam1BottomCrop = 10.0;
|
|
private @Getter double Cam1LeftCrop = 10.0;
|
|
private @Getter double Cam1RightCrop = 10.0;
|
|
private @Getter double Cam2TopCrop = 10.0;
|
|
private @Getter double Cam2BottomCrop = 10.0;
|
|
private @Getter double Cam2LeftCrop = 10.0;
|
|
private @Getter double Cam2RightCrop = 10.0;
|
|
private @Getter double Cam3TopCrop = 10.0;
|
|
private @Getter double Cam3BottomCrop = 10.0;
|
|
private @Getter double Cam3LeftCrop = 10.0;
|
|
private @Getter double Cam3RightCrop = 10.0;
|
|
private @Getter double Cam4TopCrop = 10.0;
|
|
private @Getter double Cam4BottomCrop = 10.0;
|
|
private @Getter double Cam4LeftCrop = 10.0;
|
|
private @Getter double Cam4RightCrop = 10.0;
|
|
private @Getter double Cam5TopCrop = 10.0;
|
|
private @Getter double Cam5BottomCrop = 10.0;
|
|
private @Getter double Cam5LeftCrop = 10.0;
|
|
private @Getter double Cam5RightCrop = 10.0;
|
|
|
|
private boolean needsave = false;
|
|
|
|
public ConfigFile(){
|
|
String ss = String.format("Current working directory in Java : %s", currentDirectory);
|
|
Logger.info(ss);
|
|
Load();
|
|
}
|
|
|
|
public void setCam1TopCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam1TopCrop && v <= topcropmax && v >= 0.0){
|
|
Cam1TopCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void setCam1BottomCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam1BottomCrop && v <= bottomcropmax && v >= 0.0){
|
|
Cam1BottomCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam1LeftCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam1LeftCrop && v <= leftcropmax && v >= 0.0){
|
|
Cam1LeftCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam1RightCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam1RightCrop && v <= rightcropmax && v >= 0.0){
|
|
Cam1RightCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam2TopCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam2TopCrop && v <= topcropmax && v >= 0.0){
|
|
Cam2TopCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam2BottomCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam2BottomCrop && v <= bottomcropmax && v >= 0.0){
|
|
Cam2BottomCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam2LeftCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam2LeftCrop && v <= leftcropmax && v >= 0.0){
|
|
Cam2LeftCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam2RightCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam2RightCrop && v <= rightcropmax && v >= 0.0){
|
|
Cam2RightCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam3TopCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam3TopCrop && v <= topcropmax && v >= 0.0){
|
|
Cam3TopCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam3BottomCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam3BottomCrop && v <= bottomcropmax && v >= 0.0){
|
|
Cam3BottomCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam3LeftCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam3LeftCrop && v <= leftcropmax && v >= 0.0){
|
|
Cam3LeftCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam3RightCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam3RightCrop && v <= rightcropmax && v >= 0.0){
|
|
Cam3RightCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam4TopCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam4TopCrop && v <= topcropmax && v >= 0.0){
|
|
Cam4TopCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam4BottomCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam4BottomCrop && v <= bottomcropmax && v >= 0.0){
|
|
Cam4BottomCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam4LeftCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam4LeftCrop && v <= leftcropmax && v >= 0.0){
|
|
Cam4LeftCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam4RightCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam4RightCrop && v <= rightcropmax && v >= 0.0){
|
|
Cam4RightCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam5TopCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam5TopCrop && v <= topcropmax && v >= 0.0){
|
|
Cam5TopCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam5BottomCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam5BottomCrop && v <= bottomcropmax && v >= 0.0){
|
|
Cam5BottomCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam5LeftCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam5LeftCrop && v <= leftcropmax && v >= 0.0){
|
|
Cam5LeftCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
public void setCam5RightCrop(String value){
|
|
if (ValidDouble(value)){
|
|
double v = toDouble(value);
|
|
if (v != Cam5RightCrop && v <= rightcropmax && v >= 0.0){
|
|
Cam5RightCrop = v;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void setMirrorCamera(boolean value){
|
|
if (MirrorCamera != value){
|
|
MirrorCamera = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public void setFlipCamera(boolean value){
|
|
if (FlipCamera != value){
|
|
FlipCamera = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public void setSharpnessThreshold(double value){
|
|
if (SharpnessThreshold != value){
|
|
SharpnessThreshold = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public void setCascadeScaleFactor(double value){
|
|
if (cascadeScaleFactor != value){
|
|
cascadeScaleFactor = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public void setCascadeMinNeighbors(int value){
|
|
if (cascadeMinNeighbors != value){
|
|
cascadeMinNeighbors = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public void setCascadeMinSize(int value){
|
|
if (cascadeMinSize != value){
|
|
cascadeMinSize = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public void setCascadeMaxSize(int value){
|
|
if (cascadeMaxSize != value){
|
|
cascadeMaxSize = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public void SetPhotoDirectory(String path){
|
|
if (ValidString(path)){
|
|
if (!path.equals(PhotoDirectory)){
|
|
File ff = new File(path);
|
|
if (ff.isDirectory()){
|
|
Logger.info("Photo Directory changed from {} to {}", PhotoDirectory, path);
|
|
PhotoDirectory = path;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SetAudioPhase1(String path){
|
|
if (ValidString(path)){
|
|
if (!path.equals(AudioPhase1)){
|
|
Logger.info("Audio Phase 1 changed from {} to {}", AudioPhase1, path);
|
|
AudioPhase1 = path;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SetAudioPhase2(String path){
|
|
if (ValidString(path)){
|
|
if (!path.equals(AudioPhase2)){
|
|
Logger.info("Audio Phase 2 changed from {} to {}", AudioPhase2, path);
|
|
AudioPhase2 = path;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SetAudioPhase3(String path){
|
|
if (ValidString(path)){
|
|
if (!path.equals(AudioPhase3)){
|
|
Logger.info("Audio Phase 3 changed from {} to {}", AudioPhase3, path);
|
|
AudioPhase3 = path;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SetAudioPhase4(String path){
|
|
if (ValidString(path)){
|
|
if (!path.equals(AudioPhase4)){
|
|
Logger.info("Audio Phase 4 changed from {} to {}", AudioPhase4, path);
|
|
AudioPhase4 = path;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SetAudioPhase5(String path){
|
|
if (ValidString(path)){
|
|
if (!path.equals(AudioPhase5)){
|
|
Logger.info("Audio Phase 5 changed from {} to {}", AudioPhase5, path);
|
|
AudioPhase5 = path;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Set Camera Path for Left 90 Degree
|
|
* @param path Path to Camera, or empty string to disable
|
|
*/
|
|
public void SetCameraLeft90(String path){
|
|
if (path==null) path="";
|
|
if (!path.equals(CameraLeft90)){
|
|
Logger.info("Camera Left 90 Degree changed from {} to {}", CameraLeft90, path);
|
|
CameraLeft90 = path;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Set Camera Path for Left 45 Degree
|
|
* @param path Path to Camera, or empty string to disable
|
|
*/
|
|
public void SetCameraLeft45(String path){
|
|
if (path==null) path="";
|
|
if (!path.equals(CameraLeft45)){
|
|
Logger.info("Camera Left 45 Degree changed from {} to {}", CameraLeft45, path);
|
|
CameraLeft45 = path;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Set Camera Path for Center
|
|
* @param path Path to Camera, or empty string to disable
|
|
*/
|
|
public void SetCameraCenter(String path){
|
|
if (path==null) path="";
|
|
if (!path.equals(CameraCenter)){
|
|
Logger.info("Camera Center changed from {} to {}", CameraCenter, path);
|
|
CameraCenter = path;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Set Camera Path for Right 45 Degree
|
|
* @param path Path to Camera, or empty string to disable
|
|
*/
|
|
public void SetCameraRight45(String path){
|
|
if (path==null) path="";
|
|
if (!path.equals(CameraRight45)){
|
|
Logger.info("Camera Right 45 Degree changed from {} to {}", CameraRight45, path);
|
|
CameraRight45 = path;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Set Camera Path for Right 90 Degree
|
|
* @param path Path to Camera, or empty string to disable
|
|
*/
|
|
public void SetCameraRight90(String path){
|
|
if (path==null) path="";
|
|
if (!path.equals(CameraRight90)){
|
|
Logger.info("Camera Right 90 Degree changed from {} to {}", CameraRight90, path);
|
|
CameraRight90 = path;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public void SetFTPHost(String host){
|
|
if (ValidString(host)){
|
|
if (!host.equals(FTPHost)){
|
|
Logger.info("FTP Host changed from {} to {}", FTPHost, host);
|
|
FTPHost = host;
|
|
needsave = true;
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SetFTPPort(String port){
|
|
if (ValidString(port)){
|
|
if (!port.equals(FTPPort)){
|
|
if (ValidPortNumber(toInt(port))){
|
|
Logger.info("FTP Port changed from {} to {}", FTPPort, port);
|
|
FTPPort = port;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SetFTPUser(String user){
|
|
if (ValidString(user)){
|
|
if (!user.equals(FTPUser)){
|
|
Logger.info("FTP User changed from {} to {}", FTPUser, user);
|
|
FTPUser = user;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SetFTPPass(String pass){
|
|
if (ValidString(pass)){
|
|
if (!pass.equals(FTPPass)){
|
|
Logger.info("FTP Password changed from {} to {}", FTPPass, pass);
|
|
FTPPass = pass;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SetFTPPath(String path){
|
|
if (ValidString(path)){
|
|
if (!path.equals(FTPPath)){
|
|
Logger.info("FTP Path changed from {} to {}", FTPPath, path);
|
|
FTPPath = path;
|
|
needsave = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void setBrightness(CameraConfigEnum cc, double value){
|
|
CameraConfig conf = switch (cc) {
|
|
case CameraConfigLeft90 -> ConfigLeft90;
|
|
case CameraConfigLeft45 -> ConfigLeft45;
|
|
case CameraConfigCenter -> ConfigCenter;
|
|
case CameraConfigRight45 -> ConfigRight45;
|
|
case CameraConfigRight90 -> ConfigRight90;
|
|
};
|
|
if (conf.Brightness != value){
|
|
|
|
conf.Brightness = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public double getBrightness(CameraConfigEnum cc){
|
|
return switch (cc) {
|
|
case CameraConfigLeft90 -> ConfigLeft90.Brightness;
|
|
case CameraConfigLeft45 -> ConfigLeft45.Brightness;
|
|
case CameraConfigCenter -> ConfigCenter.Brightness;
|
|
case CameraConfigRight45 -> ConfigRight45.Brightness;
|
|
case CameraConfigRight90 -> ConfigRight90.Brightness;
|
|
};
|
|
}
|
|
|
|
public void setContrast(CameraConfigEnum cc, double value){
|
|
CameraConfig conf = switch (cc) {
|
|
case CameraConfigLeft90 -> ConfigLeft90;
|
|
case CameraConfigLeft45 -> ConfigLeft45;
|
|
case CameraConfigCenter -> ConfigCenter;
|
|
case CameraConfigRight45 -> ConfigRight45;
|
|
case CameraConfigRight90 -> ConfigRight90;
|
|
};
|
|
if (conf.Contrast != value){
|
|
conf.Contrast = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public double getContrast(CameraConfigEnum cc){
|
|
return switch (cc){
|
|
case CameraConfigLeft90 -> ConfigLeft90.Contrast;
|
|
case CameraConfigLeft45 -> ConfigLeft45.Contrast;
|
|
case CameraConfigCenter -> ConfigCenter.Contrast;
|
|
case CameraConfigRight45 -> ConfigRight45.Contrast;
|
|
case CameraConfigRight90 -> ConfigRight90.Contrast;
|
|
};
|
|
}
|
|
|
|
public void setSaturation(CameraConfigEnum cc, double value){
|
|
CameraConfig conf = switch (cc) {
|
|
case CameraConfigLeft90 -> ConfigLeft90;
|
|
case CameraConfigLeft45 -> ConfigLeft45;
|
|
case CameraConfigCenter -> ConfigCenter;
|
|
case CameraConfigRight45 -> ConfigRight45;
|
|
case CameraConfigRight90 -> ConfigRight90;
|
|
};
|
|
if (conf.Saturation != value){
|
|
conf.Saturation = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public double getSaturation(CameraConfigEnum cc){
|
|
return switch (cc){
|
|
case CameraConfigLeft90 -> ConfigLeft90.Saturation;
|
|
case CameraConfigLeft45 -> ConfigLeft45.Saturation;
|
|
case CameraConfigCenter -> ConfigCenter.Saturation;
|
|
case CameraConfigRight45 -> ConfigRight45.Saturation;
|
|
case CameraConfigRight90 -> ConfigRight90.Saturation;
|
|
};
|
|
}
|
|
|
|
public void setHue(CameraConfigEnum cc, double value){
|
|
CameraConfig conf = switch (cc) {
|
|
case CameraConfigLeft90 -> ConfigLeft90;
|
|
case CameraConfigLeft45 -> ConfigLeft45;
|
|
case CameraConfigCenter -> ConfigCenter;
|
|
case CameraConfigRight45 -> ConfigRight45;
|
|
case CameraConfigRight90 -> ConfigRight90;
|
|
};
|
|
if (conf.Hue != value){
|
|
conf.Hue = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public double getHue(CameraConfigEnum cc){
|
|
return switch (cc){
|
|
case CameraConfigLeft90 -> ConfigLeft90.Hue;
|
|
case CameraConfigLeft45 -> ConfigLeft45.Hue;
|
|
case CameraConfigCenter -> ConfigCenter.Hue;
|
|
case CameraConfigRight45 -> ConfigRight45.Hue;
|
|
case CameraConfigRight90 -> ConfigRight90.Hue;
|
|
};
|
|
}
|
|
|
|
public void setGain(CameraConfigEnum cc, double value){
|
|
CameraConfig conf = switch (cc) {
|
|
case CameraConfigLeft90 -> ConfigLeft90;
|
|
case CameraConfigLeft45 -> ConfigLeft45;
|
|
case CameraConfigCenter -> ConfigCenter;
|
|
case CameraConfigRight45 -> ConfigRight45;
|
|
case CameraConfigRight90 -> ConfigRight90;
|
|
};
|
|
if (conf.Gain != value){
|
|
conf.Gain = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public double getGain(CameraConfigEnum cc){
|
|
return switch (cc){
|
|
case CameraConfigLeft90 -> ConfigLeft90.Gain;
|
|
case CameraConfigLeft45 -> ConfigLeft45.Gain;
|
|
case CameraConfigCenter -> ConfigCenter.Gain;
|
|
case CameraConfigRight45 -> ConfigRight45.Gain;
|
|
case CameraConfigRight90 -> ConfigRight90.Gain;
|
|
};
|
|
}
|
|
|
|
public void setExposure(CameraConfigEnum cc, double value){
|
|
CameraConfig conf = switch (cc) {
|
|
case CameraConfigLeft90 -> ConfigLeft90;
|
|
case CameraConfigLeft45 -> ConfigLeft45;
|
|
case CameraConfigCenter -> ConfigCenter;
|
|
case CameraConfigRight45 -> ConfigRight45;
|
|
case CameraConfigRight90 -> ConfigRight90;
|
|
};
|
|
if (conf.Exposure != value){
|
|
conf.Exposure = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public double getExposure(CameraConfigEnum cc){
|
|
return switch (cc){
|
|
case CameraConfigLeft90 -> ConfigLeft90.Exposure;
|
|
case CameraConfigLeft45 -> ConfigLeft45.Exposure;
|
|
case CameraConfigCenter -> ConfigCenter.Exposure;
|
|
case CameraConfigRight45 -> ConfigRight45.Exposure;
|
|
case CameraConfigRight90 -> ConfigRight90.Exposure;
|
|
};
|
|
}
|
|
|
|
public void setSharpness(CameraConfigEnum cc, double value){
|
|
CameraConfig conf = switch (cc) {
|
|
case CameraConfigLeft90 -> ConfigLeft90;
|
|
case CameraConfigLeft45 -> ConfigLeft45;
|
|
case CameraConfigCenter -> ConfigCenter;
|
|
case CameraConfigRight45 -> ConfigRight45;
|
|
case CameraConfigRight90 -> ConfigRight90;
|
|
};
|
|
if (conf.Sharpness != value){
|
|
conf.Sharpness = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public double getSharpness(CameraConfigEnum cc){
|
|
return switch (cc){
|
|
case CameraConfigLeft90 -> ConfigLeft90.Sharpness;
|
|
case CameraConfigLeft45 -> ConfigLeft45.Sharpness;
|
|
case CameraConfigCenter -> ConfigCenter.Sharpness;
|
|
case CameraConfigRight45 -> ConfigRight45.Sharpness;
|
|
case CameraConfigRight90 -> ConfigRight90.Sharpness;
|
|
};
|
|
}
|
|
|
|
public void setGamma(CameraConfigEnum cc, double value){
|
|
CameraConfig conf = switch (cc) {
|
|
case CameraConfigLeft90 -> ConfigLeft90;
|
|
case CameraConfigLeft45 -> ConfigLeft45;
|
|
case CameraConfigCenter -> ConfigCenter;
|
|
case CameraConfigRight45 -> ConfigRight45;
|
|
case CameraConfigRight90 -> ConfigRight90;
|
|
};
|
|
if (conf.Gamma != value){
|
|
conf.Gamma = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public double getGamma(CameraConfigEnum cc){
|
|
return switch (cc){
|
|
case CameraConfigLeft90 -> ConfigLeft90.Gamma;
|
|
case CameraConfigLeft45 -> ConfigLeft45.Gamma;
|
|
case CameraConfigCenter -> ConfigCenter.Gamma;
|
|
case CameraConfigRight45 -> ConfigRight45.Gamma;
|
|
case CameraConfigRight90 -> ConfigRight90.Gamma;
|
|
};
|
|
}
|
|
|
|
public void setAutoExposure(CameraConfigEnum cc, boolean value){
|
|
CameraConfig conf = switch (cc) {
|
|
case CameraConfigLeft90 -> ConfigLeft90;
|
|
case CameraConfigLeft45 -> ConfigLeft45;
|
|
case CameraConfigCenter -> ConfigCenter;
|
|
case CameraConfigRight45 -> ConfigRight45;
|
|
case CameraConfigRight90 -> ConfigRight90;
|
|
};
|
|
if (conf.AutoExposure != value){
|
|
conf.AutoExposure = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public boolean getAutoExposure(CameraConfigEnum cc){
|
|
return switch (cc){
|
|
case CameraConfigLeft90 -> ConfigLeft90.AutoExposure;
|
|
case CameraConfigLeft45 -> ConfigLeft45.AutoExposure;
|
|
case CameraConfigCenter -> ConfigCenter.AutoExposure;
|
|
case CameraConfigRight45 -> ConfigRight45.AutoExposure;
|
|
case CameraConfigRight90 -> ConfigRight90.AutoExposure;
|
|
};
|
|
}
|
|
|
|
public void setAutoFocus(CameraConfigEnum cc, boolean value){
|
|
CameraConfig conf = switch (cc) {
|
|
case CameraConfigLeft90 -> ConfigLeft90;
|
|
case CameraConfigLeft45 -> ConfigLeft45;
|
|
case CameraConfigCenter -> ConfigCenter;
|
|
case CameraConfigRight45 -> ConfigRight45;
|
|
case CameraConfigRight90 -> ConfigRight90;
|
|
};
|
|
if (conf.AutoFocus != value){
|
|
conf.AutoFocus = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public boolean getAutoFocus(CameraConfigEnum cc){
|
|
return switch (cc){
|
|
case CameraConfigLeft90 -> ConfigLeft90.AutoFocus;
|
|
case CameraConfigLeft45 -> ConfigLeft45.AutoFocus;
|
|
case CameraConfigCenter -> ConfigCenter.AutoFocus;
|
|
case CameraConfigRight45 -> ConfigRight45.AutoFocus;
|
|
case CameraConfigRight90 -> ConfigRight90.AutoFocus;
|
|
};
|
|
}
|
|
|
|
public void setAutoWhiteBalance(CameraConfigEnum cc, boolean value){
|
|
CameraConfig conf = switch (cc) {
|
|
case CameraConfigLeft90 -> ConfigLeft90;
|
|
case CameraConfigLeft45 -> ConfigLeft45;
|
|
case CameraConfigCenter -> ConfigCenter;
|
|
case CameraConfigRight45 -> ConfigRight45;
|
|
case CameraConfigRight90 -> ConfigRight90;
|
|
};
|
|
if (conf.AutoWhiteBalance != value){
|
|
conf.AutoWhiteBalance = value;
|
|
needsave = true;
|
|
}
|
|
}
|
|
|
|
public boolean getAutoWhiteBalance(CameraConfigEnum cc){
|
|
return switch (cc){
|
|
case CameraConfigLeft90 -> ConfigLeft90.AutoWhiteBalance;
|
|
case CameraConfigLeft45 -> ConfigLeft45.AutoWhiteBalance;
|
|
case CameraConfigCenter -> ConfigCenter.AutoWhiteBalance;
|
|
case CameraConfigRight45 -> ConfigRight45.AutoWhiteBalance;
|
|
case CameraConfigRight90 -> ConfigRight90.AutoWhiteBalance;
|
|
};
|
|
}
|
|
|
|
|
|
|
|
private void Load(){
|
|
File ff = Path.of(currentDirectory, "config.properties").toFile();
|
|
if (ff.isFile()){
|
|
String ss = String.format("Load config file at %s", ff.getPath());
|
|
Logger.info(ss);
|
|
try{
|
|
Properties prop = new Properties();
|
|
FileInputStream FIS = new FileInputStream(ff.getPath());
|
|
prop.load(FIS);
|
|
boolean allcorrect = prop.getProperty("AudioPhase1") != null;
|
|
if (prop.getProperty("AudioPhase2") == null) allcorrect = false;
|
|
if (prop.getProperty("AudioPhase3") == null) allcorrect = false;
|
|
if (prop.getProperty("AudioPhase4") == null) allcorrect = false;
|
|
if (prop.getProperty("AudioPhase5") == null) allcorrect = false;
|
|
if (prop.getProperty("CameraLeft90") == null) allcorrect = false;
|
|
if (prop.getProperty("CameraLeft45") == null) allcorrect = false;
|
|
if (prop.getProperty("CameraCenter") == null) allcorrect = false;
|
|
if (prop.getProperty("CameraRight45") == null) allcorrect = false;
|
|
if (prop.getProperty("CameraRight90") == null) allcorrect = false;
|
|
if (prop.getProperty("FTPHost") == null) allcorrect = false;
|
|
if (prop.getProperty("FTPPort") == null) allcorrect = false;
|
|
if (prop.getProperty("FTPUser") == null) allcorrect = false;
|
|
if (prop.getProperty("FTPPass") == null) allcorrect = false;
|
|
if (prop.getProperty("FTPPath") == null) allcorrect = false;
|
|
if (prop.getProperty("PhotoDirectory") == null) allcorrect = false;
|
|
if (prop.getProperty("MirrorCamera") == null) allcorrect = false;
|
|
if (prop.getProperty("FlipCamera") == null) allcorrect = false;
|
|
if (prop.getProperty("SharpnessThreshold") == null) allcorrect = false;
|
|
|
|
|
|
if (prop.getProperty(CameraConfigEnum.CameraConfigLeft90.toString()) == null) allcorrect = false;
|
|
if (prop.getProperty(CameraConfigEnum.CameraConfigLeft45.toString()) == null) allcorrect = false;
|
|
if (prop.getProperty(CameraConfigEnum.CameraConfigCenter.toString()) == null) allcorrect = false;
|
|
if (prop.getProperty(CameraConfigEnum.CameraConfigRight45.toString()) == null) allcorrect = false;
|
|
if (prop.getProperty(CameraConfigEnum.CameraConfigRight90.toString()) == null) allcorrect = false;
|
|
|
|
if (prop.getProperty("cascadeScaleFactor") == null) allcorrect = false;
|
|
if (prop.getProperty("cascadeMinNeighbors") == null) allcorrect = false;
|
|
if (prop.getProperty("cascadeMinSize") == null) allcorrect = false;
|
|
if (prop.getProperty("cascadeMaxSize") == null) allcorrect = false;
|
|
|
|
if (prop.getProperty("Cam1TopCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam1BottomCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam1LeftCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam1RightCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam2TopCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam2BottomCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam2LeftCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam2RightCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam3TopCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam3BottomCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam3LeftCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam3RightCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam4TopCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam4BottomCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam4LeftCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam4RightCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam5TopCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam5BottomCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam5LeftCrop") == null) allcorrect = false;
|
|
if (prop.getProperty("Cam5RightCrop") == null) allcorrect = false;
|
|
|
|
|
|
if (allcorrect){
|
|
AudioPhase1 = prop.getProperty("AudioPhase1");
|
|
AudioPhase2 = prop.getProperty("AudioPhase2");
|
|
AudioPhase3 = prop.getProperty("AudioPhase3");
|
|
AudioPhase4 = prop.getProperty("AudioPhase4");
|
|
AudioPhase5 = prop.getProperty("AudioPhase5");
|
|
|
|
CameraLeft90 = prop.getProperty("CameraLeft90");
|
|
CameraLeft45 = prop.getProperty("CameraLeft45");
|
|
CameraCenter = prop.getProperty("CameraCenter");
|
|
CameraRight45 = prop.getProperty("CameraRight45");
|
|
CameraRight90 = prop.getProperty("CameraRight90");
|
|
|
|
FTPHost = prop.getProperty("FTPHost");
|
|
FTPPort = prop.getProperty("FTPPort");
|
|
FTPUser = prop.getProperty("FTPUser");
|
|
FTPPass = prop.getProperty("FTPPass");
|
|
FTPPath = prop.getProperty("FTPPath");
|
|
PhotoDirectory = prop.getProperty("PhotoDirectory");
|
|
|
|
ConfigLeft90 = gson.fromJson(prop.getProperty(CameraConfigEnum.CameraConfigLeft90.toString()), CameraConfig.class);
|
|
ConfigLeft45 = gson.fromJson(prop.getProperty(CameraConfigEnum.CameraConfigLeft45.toString()), CameraConfig.class);
|
|
ConfigCenter = gson.fromJson(prop.getProperty(CameraConfigEnum.CameraConfigCenter.toString()), CameraConfig.class);
|
|
ConfigRight45 = gson.fromJson(prop.getProperty(CameraConfigEnum.CameraConfigRight45.toString()), CameraConfig.class);
|
|
ConfigRight90 = gson.fromJson(prop.getProperty(CameraConfigEnum.CameraConfigRight90.toString()), CameraConfig.class);
|
|
|
|
cascadeScaleFactor = cascadetoDouble(prop.getProperty("cascadeScaleFactor"));
|
|
cascadeMinNeighbors = toInt(prop.getProperty("cascadeMinNeighbors"));
|
|
cascadeMinSize = toInt(prop.getProperty("cascadeMinSize"));
|
|
cascadeMaxSize = toInt(prop.getProperty("cascadeMaxSize"));
|
|
|
|
Detectors.setFaceMaxSize(cascadeMaxSize);
|
|
Detectors.setFaceMinSize(cascadeMinSize);
|
|
Detectors.setScaleFactor(cascadeScaleFactor);
|
|
|
|
MirrorCamera = toBoolean(prop.getProperty("MirrorCamera"));
|
|
FlipCamera = toBoolean(prop.getProperty("FlipCamera"));
|
|
|
|
SharpnessThreshold = toDouble(prop.getProperty("SharpnessThreshold"));
|
|
|
|
Cam1TopCrop = toDouble(prop.getProperty("Cam1TopCrop"));
|
|
Cam1BottomCrop = toDouble(prop.getProperty("Cam1BottomCrop"));
|
|
Cam1LeftCrop = toDouble(prop.getProperty("Cam1LeftCrop"));
|
|
Cam1RightCrop = toDouble(prop.getProperty("Cam1RightCrop"));
|
|
Cam2TopCrop = toDouble(prop.getProperty("Cam2TopCrop"));
|
|
Cam2BottomCrop = toDouble(prop.getProperty("Cam2BottomCrop"));
|
|
Cam2LeftCrop = toDouble(prop.getProperty("Cam2LeftCrop"));
|
|
Cam2RightCrop = toDouble(prop.getProperty("Cam2RightCrop"));
|
|
Cam3TopCrop = toDouble(prop.getProperty("Cam3TopCrop"));
|
|
Cam3BottomCrop = toDouble(prop.getProperty("Cam3BottomCrop"));
|
|
Cam3LeftCrop = toDouble(prop.getProperty("Cam3LeftCrop"));
|
|
Cam3RightCrop = toDouble(prop.getProperty("Cam3RightCrop"));
|
|
Cam4TopCrop = toDouble(prop.getProperty("Cam4TopCrop"));
|
|
Cam4BottomCrop = toDouble(prop.getProperty("Cam4BottomCrop"));
|
|
Cam4LeftCrop = toDouble(prop.getProperty("Cam4LeftCrop"));
|
|
Cam4RightCrop = toDouble(prop.getProperty("Cam4RightCrop"));
|
|
Cam5TopCrop = toDouble(prop.getProperty("Cam5TopCrop"));
|
|
Cam5BottomCrop = toDouble(prop.getProperty("Cam5BottomCrop"));
|
|
Cam5LeftCrop = toDouble(prop.getProperty("Cam5LeftCrop"));
|
|
Cam5RightCrop = toDouble(prop.getProperty("Cam5RightCrop"));
|
|
|
|
|
|
Logger.info("Config Loaded");
|
|
MakeDirectories();
|
|
return;
|
|
} else {
|
|
Logger.info("Config File Not Correct, Creating Default");
|
|
}
|
|
} catch (Exception e){
|
|
Logger.error("Error Load Config: " + e.getMessage()+", Creating Default");
|
|
}
|
|
} else {
|
|
Logger.info("Config File Not Found, Creating Default");
|
|
}
|
|
CreateDefault();
|
|
}
|
|
|
|
private double cascadetoDouble(String cascadeScaleFactor) {
|
|
try{
|
|
return Double.parseDouble(cascadeScaleFactor);
|
|
} catch (Exception e){
|
|
return 1.1;
|
|
}
|
|
}
|
|
|
|
private double toDouble(String value) {
|
|
try{
|
|
return Double.parseDouble(value);
|
|
} catch (Exception e){
|
|
return 0.0;
|
|
}
|
|
}
|
|
|
|
private void CreateDefault(){
|
|
AudioPhase1 = Path.of(currentDirectory, "audio", "phase1.mp3").toString();
|
|
AudioPhase2 = Path.of(currentDirectory, "audio", "phase2.mp3").toString();
|
|
AudioPhase3 = Path.of(currentDirectory, "audio", "phase3.mp3").toString();
|
|
AudioPhase4 = Path.of(currentDirectory, "audio", "phase4.mp3").toString();
|
|
AudioPhase5 = Path.of(currentDirectory, "audio", "phase5.mp3").toString();
|
|
CameraLeft90 = "";
|
|
CameraLeft45 = "";
|
|
CameraCenter = "";
|
|
CameraRight45 = "";
|
|
CameraRight90 = "";
|
|
FTPHost = "192.168.10.2";
|
|
FTPPort = "21";
|
|
FTPUser = "user";
|
|
FTPPass = "password";
|
|
FTPPath = "/";
|
|
PhotoDirectory = currentDirectory;
|
|
SetDefaultCameraConfig(ConfigLeft90);
|
|
SetDefaultCameraConfig(ConfigLeft45);
|
|
SetDefaultCameraConfig(ConfigCenter);
|
|
SetDefaultCameraConfig(ConfigRight45);
|
|
SetDefaultCameraConfig(ConfigRight90);
|
|
cascadeScaleFactor = 1.1;
|
|
cascadeMinNeighbors = 3;
|
|
cascadeMinSize = 250;
|
|
cascadeMaxSize = 500;
|
|
Detectors.setFaceMaxSize(cascadeMaxSize);
|
|
Detectors.setFaceMinSize(cascadeMinSize);
|
|
Detectors.setScaleFactor(cascadeScaleFactor);
|
|
MirrorCamera = false;
|
|
FlipCamera = false;
|
|
SharpnessThreshold = 300.0;
|
|
|
|
Cam1TopCrop = 10.0;
|
|
Cam1BottomCrop = 10.0;
|
|
Cam1LeftCrop = 10.0;
|
|
Cam1RightCrop = 10.0;
|
|
|
|
Cam2TopCrop = 10.0;
|
|
Cam2BottomCrop = 10.0;
|
|
Cam2LeftCrop = 10.0;
|
|
Cam2RightCrop = 10.0;
|
|
|
|
Cam3TopCrop = 10.0;
|
|
Cam3BottomCrop = 10.0;
|
|
Cam3LeftCrop = 10.0;
|
|
Cam3RightCrop = 10.0;
|
|
|
|
Cam4TopCrop = 10.0;
|
|
Cam4BottomCrop = 10.0;
|
|
Cam4LeftCrop = 10.0;
|
|
Cam4RightCrop = 10.0;
|
|
|
|
Cam5TopCrop = 10.0;
|
|
Cam5BottomCrop = 10.0;
|
|
Cam5LeftCrop = 10.0;
|
|
Cam5RightCrop = 10.0;
|
|
|
|
Logger.info("Default Config Created");
|
|
needsave = true;
|
|
Save();
|
|
MakeDirectories();
|
|
}
|
|
|
|
private void SetDefaultCameraConfig(CameraConfig cc){
|
|
if (cc!=null){
|
|
cc.AutoExposure = true;
|
|
cc.AutoFocus = true;
|
|
cc.AutoWhiteBalance = true;
|
|
cc.Brightness = 0;
|
|
cc.Contrast = 0;
|
|
cc.Exposure = 0;
|
|
cc.Gain = 0;
|
|
cc.Saturation = 0;
|
|
cc.Hue = 0;
|
|
cc.Gamma = 0;
|
|
cc.Sharpness = 0;
|
|
}
|
|
}
|
|
|
|
public void Save(){
|
|
if (!needsave) return;
|
|
needsave = false;
|
|
Properties prop = new Properties();
|
|
prop.setProperty("AudioPhase1", AudioPhase1);
|
|
prop.setProperty("AudioPhase2", AudioPhase2);
|
|
prop.setProperty("AudioPhase3", AudioPhase3);
|
|
prop.setProperty("AudioPhase4", AudioPhase4);
|
|
prop.setProperty("AudioPhase5", AudioPhase5);
|
|
|
|
prop.setProperty("CameraLeft90", CameraLeft90);
|
|
prop.setProperty("CameraLeft45", CameraLeft45);
|
|
prop.setProperty("CameraCenter", CameraCenter);
|
|
prop.setProperty("CameraRight45", CameraRight45);
|
|
prop.setProperty("CameraRight90", CameraRight90);
|
|
|
|
prop.setProperty("FTPHost", FTPHost);
|
|
prop.setProperty("FTPPort", FTPPort);
|
|
prop.setProperty("FTPUser",FTPUser);
|
|
prop.setProperty("FTPPass", FTPPass);
|
|
prop.setProperty("FTPPath", FTPPath);
|
|
prop.setProperty("PhotoDirectory", PhotoDirectory);
|
|
|
|
prop.setProperty(CameraConfigEnum.CameraConfigLeft90.toString(), gson.toJson(ConfigLeft90));
|
|
prop.setProperty(CameraConfigEnum.CameraConfigLeft45.toString(), gson.toJson(ConfigLeft45));
|
|
prop.setProperty(CameraConfigEnum.CameraConfigCenter.toString(), gson.toJson(ConfigCenter));
|
|
prop.setProperty(CameraConfigEnum.CameraConfigRight45.toString(), gson.toJson(ConfigRight45));
|
|
prop.setProperty(CameraConfigEnum.CameraConfigRight90.toString(), gson.toJson(ConfigRight90));
|
|
|
|
prop.setProperty("cascadeScaleFactor", String.valueOf(cascadeScaleFactor));
|
|
prop.setProperty("cascadeMinNeighbors", String.valueOf(cascadeMinNeighbors));
|
|
prop.setProperty("cascadeMinSize", String.valueOf(cascadeMinSize));
|
|
prop.setProperty("cascadeMaxSize", String.valueOf(cascadeMaxSize));
|
|
|
|
prop.setProperty("MirrorCamera", String.valueOf(MirrorCamera));
|
|
prop.setProperty("FlipCamera", String.valueOf(FlipCamera));
|
|
prop.setProperty("SharpnessThreshold", String.valueOf(SharpnessThreshold));
|
|
|
|
prop.setProperty("Cam1TopCrop", String.valueOf(Cam1TopCrop));
|
|
prop.setProperty("Cam1BottomCrop", String.valueOf(Cam1BottomCrop));
|
|
prop.setProperty("Cam1LeftCrop", String.valueOf(Cam1LeftCrop));
|
|
prop.setProperty("Cam1RightCrop", String.valueOf(Cam1RightCrop));
|
|
prop.setProperty("Cam2TopCrop", String.valueOf(Cam2TopCrop));
|
|
prop.setProperty("Cam2BottomCrop", String.valueOf(Cam2BottomCrop));
|
|
prop.setProperty("Cam2LeftCrop", String.valueOf(Cam2LeftCrop));
|
|
prop.setProperty("Cam2RightCrop", String.valueOf(Cam2RightCrop));
|
|
prop.setProperty("Cam3TopCrop", String.valueOf(Cam3TopCrop));
|
|
prop.setProperty("Cam3BottomCrop", String.valueOf(Cam3BottomCrop));
|
|
prop.setProperty("Cam3LeftCrop", String.valueOf(Cam3LeftCrop));
|
|
prop.setProperty("Cam3RightCrop", String.valueOf(Cam3RightCrop));
|
|
prop.setProperty("Cam4TopCrop", String.valueOf(Cam4TopCrop));
|
|
prop.setProperty("Cam4BottomCrop", String.valueOf(Cam4BottomCrop));
|
|
prop.setProperty("Cam4LeftCrop", String.valueOf(Cam4LeftCrop));
|
|
prop.setProperty("Cam4RightCrop", String.valueOf(Cam4RightCrop));
|
|
prop.setProperty("Cam5TopCrop", String.valueOf(Cam5TopCrop));
|
|
prop.setProperty("Cam5BottomCrop", String.valueOf(Cam5BottomCrop));
|
|
prop.setProperty("Cam5LeftCrop", String.valueOf(Cam5LeftCrop));
|
|
prop.setProperty("Cam5RightCrop", String.valueOf(Cam5RightCrop));
|
|
|
|
|
|
try{
|
|
prop.store(new FileOutputStream(Path.of(currentDirectory, "config.properties").toString()), null);
|
|
Logger.info("Config Saved");
|
|
} catch (Exception e){
|
|
Logger.error("Error Save Config: " + e.getMessage());
|
|
}
|
|
}
|
|
|
|
private @Getter String FullQualityDirectory;
|
|
private @Getter String FullQualityCropDirectory;
|
|
private @Getter String CompressedDirectory;
|
|
private @Getter String CompressedCropDirectory;
|
|
private @Getter String ThumbsDirectory;
|
|
|
|
private void MakeDirectories(){
|
|
FullQualityDirectory = Path.of(PhotoDirectory,"FullQuality").toString();
|
|
FullQualityCropDirectory = Path.of(PhotoDirectory,"FullQualityCrop").toString();
|
|
CompressedDirectory = Path.of(PhotoDirectory,"Compressed").toString();
|
|
CompressedCropDirectory = Path.of(PhotoDirectory,"CompressedCrop").toString();
|
|
ThumbsDirectory = Path.of(PhotoDirectory,"thumbs").toString();
|
|
MakeDirectory(FullQualityDirectory);
|
|
MakeDirectory(FullQualityCropDirectory);
|
|
MakeDirectory(CompressedDirectory);
|
|
MakeDirectory(CompressedCropDirectory);
|
|
MakeDirectory(ThumbsDirectory);
|
|
}
|
|
}
|