commit 10/04/2025

This commit is contained in:
rdkartono
2025-04-10 16:21:56 +07:00
parent 7cdefa6f1d
commit b6a3076993
23 changed files with 420 additions and 119681 deletions

View File

@@ -197,11 +197,7 @@ public class Cameradetail_Arducam {
* @param title Title of the Camera
*/
public void setCameraTitle(String title){
if (ValidString(title)){
if (cameratitle!=null){
cameratitle.setText(title);
}
}
LabelSetText(this.cameratitle, title, null);
}
public void setSaturation(double value){
@@ -259,11 +255,7 @@ public class Cameradetail_Arducam {
* @param status Status of the Camera
*/
public void setCameraStatus(String status){
if (ValidString(status)){
if (camerastatus!=null){
camerastatus.setText(status);
}
}
LabelSetText(this.camerastatus, status,null);
}
/**
@@ -519,13 +511,12 @@ public class Cameradetail_Arducam {
* @param prefix filename prefix
* @return filename path of the saved photo, or null if failed
*/
@SuppressWarnings("BusyWait")
public String TakePhoto(String directory, String prefix){
if (!ValidDirectory(directory)) directory = currentDirectory;
if (mGrabber!=null){
try{
long nanos = System.nanoTime();
while(IsGrabbingLiveView.get()) Thread.sleep(10);
while(IsGrabbingLiveView.get()) Wait(10);
long delta = System.nanoTime() - nanos;
double ms = delta / 1000000.0;
if (event!=null) event.onLog("Waited IsGrabbingLiveView for "+ms+" miliseconds");
@@ -542,10 +533,10 @@ public class Cameradetail_Arducam {
setAutoWB(true);
Thread.sleep(1000);
Wait(1000);
setAutoExposure(true);
Thread.sleep(1000);
Wait(1000);
long delta3 = System.nanoTime() - nanos;
double ms3 = delta3 / 1000000.0;
@@ -673,14 +664,13 @@ public class Cameradetail_Arducam {
AutoWhiteBalance.setSelected(true);
val task = new Task<Image>() {
@SuppressWarnings("BusyWait")
@Override
protected Image call() {
while (Capturing.get()) {
try {
// selama proses pengambilan foto, jangan ambil frame
while(TakingPhoto.get() && Capturing.get()){
Thread.sleep(10);
Wait(10);
}
if (!Capturing.get()) return null;
@@ -737,7 +727,10 @@ public class Cameradetail_Arducam {
});
// start task
new Thread(task).start();
Thread taskThread = new Thread(task);
taskThread.setDaemon(true);
taskThread.start();
return true;
} catch (Exception e) {