commit 03/10/2025

This commit is contained in:
2025-10-03 08:09:04 +07:00
parent 1ef8af4d42
commit d5fbd2bc0a
4 changed files with 10 additions and 16 deletions

View File

@@ -50,6 +50,8 @@ import static org.bytedeco.opencv.global.opencv_core.CV_64F;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class SomeCodes { public class SomeCodes {
// dermiesMode = true means for Dermies Clinic, false means for Erha Clinic
public static boolean DermiesMode = false;
public final static String currentDirectory = System.getProperty("user.dir"); public final static String currentDirectory = System.getProperty("user.dir");
private static final DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); private static final DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
public static final Java2DFrameConverter converter = new Java2DFrameConverter(); public static final Java2DFrameConverter converter = new Java2DFrameConverter();

View File

@@ -29,7 +29,6 @@ public class ErhaAPI {
private String auth; private String auth;
private String API_URL=""; private String API_URL="";
private boolean DermiesMode = false;
private final Gson gson = new Gson(); private final Gson gson = new Gson();
@@ -41,15 +40,7 @@ public class ErhaAPI {
setProduction(isProduction); setProduction(isProduction);
} }
/**
* Create Erha API object
* @param isProduction if true will use Production URL, if false will use Staging URL
* @param dermiesMode if true will use Dermies Mode (for Dermies Clinic)
*/
public ErhaAPI(boolean isProduction, boolean dermiesMode){
setProduction(isProduction);
this.DermiesMode = dermiesMode;
}
public void setProduction(boolean isProduction){ public void setProduction(boolean isProduction){
final String API_URL_PROD = "https://connect-api.aryanoble.co.id/api"; final String API_URL_PROD = "https://connect-api.aryanoble.co.id/api";

View File

@@ -90,8 +90,8 @@ public class CaptureView {
private final AtomicBoolean isTakingPhoto = new AtomicBoolean(false); private final AtomicBoolean isTakingPhoto = new AtomicBoolean(false);
// dermiesMode = true means for Dermies Clinic, false means for Erha Clinic
private final ErhaAPI erhaAPI = new ErhaAPI(config.isProduction(), true); private final ErhaAPI erhaAPI = new ErhaAPI(config.isProduction());
// for timeout 180 detik // for timeout 180 detik
private final int timeout = 180; private final int timeout = 180;

View File

@@ -18,8 +18,7 @@ import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static Config.SomeCodes.ShowAlert; import static Config.SomeCodes.*;
import static Config.SomeCodes.config;
public class MainApplication extends Application { public class MainApplication extends Application {
@@ -48,13 +47,15 @@ public class MainApplication extends Application {
String UserID = Integer.toHexString(sd.ReadUserID()) ; String UserID = Integer.toHexString(sd.ReadUserID()) ;
sd.Close(); sd.Close();
if (UserID.equals("14022025")){ if (UserID.equals("14022025") || UserID.equals("03102025")){
// 14022025 = Erha, 03102025 = Dermies
DermiesMode = !UserID.equals("14022025");
Logger.info("Secure Dongle UserID valid"); Logger.info("Secure Dongle UserID valid");
FXMLLoader fxmlLoader = new FXMLLoader(MainApplication.class.getResource("main-view.fxml")); FXMLLoader fxmlLoader = new FXMLLoader(MainApplication.class.getResource("main-view.fxml"));
Screen screen = Screen.getPrimary(); Screen screen = Screen.getPrimary();
Rectangle2D screenbound = screen.getBounds(); Rectangle2D screenbound = screen.getBounds();
Scene scene = new Scene(fxmlLoader.load(), screenbound.getWidth(), screenbound.getHeight()); Scene scene = new Scene(fxmlLoader.load(), screenbound.getWidth(), screenbound.getHeight());
stage.setTitle("MultiCam Capture App for Dermies "+version); stage.setTitle("MultiCam Capture App for "+(DermiesMode?"Dermies ":"Erha ") + version);
stage.setScene(scene); stage.setScene(scene);
stage.setResizable(true); stage.setResizable(true);
stage.setMaximized(true); stage.setMaximized(true);