commit 27/03/2025
This commit is contained in:
@@ -450,7 +450,12 @@ public class CaptureView {
|
||||
long duration = (System.nanoTime() - nanostart) / 1000000; // in milliseconds
|
||||
System.out.println("TakePhotos duration: "+duration+" ms");
|
||||
|
||||
AutoCloseAlert.show("Photos Taken", "Photos Taken", "Photos Taken", 5, null);
|
||||
//AutoCloseAlert.show("Photos Taken", "Photos Taken", "Photos Taken", 5, null);
|
||||
if (AutoCloseAlert.banner_02!=null) {
|
||||
System.out.println("Showing banner 02 after photo taken");
|
||||
AutoCloseAlert.showbanner(AutoCloseAlert.banner_02, 0, null);
|
||||
|
||||
}
|
||||
|
||||
String[] files = prc.compressed();
|
||||
if (files.length>0){
|
||||
@@ -465,7 +470,6 @@ public class CaptureView {
|
||||
|
||||
@Override
|
||||
public void onPlaybackFinished(String filename) {
|
||||
Platform.runLater(AutoCloseAlert::close);
|
||||
UploadFiles(prc, prefix);
|
||||
}
|
||||
|
||||
@@ -557,17 +561,40 @@ public class CaptureView {
|
||||
if (audioPlayer!=null && audioPlayer.isInited()){
|
||||
if (!Objects.equals(audioPlayer.getCurrentFile(), audio_upload_berhasil)){
|
||||
audioPlayer.StopCurrentPlayback();
|
||||
audioPlayer.PlayFile(audio_upload_berhasil, null);
|
||||
audioPlayer.PlayFile(audio_upload_berhasil, new PlaybackStatus() {
|
||||
@Override
|
||||
public void onPlaybackStarted(String filename) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlaybackFinished(String filename) {
|
||||
Platform.runLater(()->{
|
||||
AutoCloseAlert.close();
|
||||
barcodeData.setText("");
|
||||
medicalRecordID.setText("");
|
||||
PatientName.setText("");
|
||||
isTakingPhoto.set(false);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlaybackFailure(String filename) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
AutoCloseAlert.show("Upload Success", "Upload Success", "Upload Success", 5, s -> {
|
||||
isTakingPhoto.set(false);
|
||||
Platform.runLater(()->{
|
||||
barcodeData.setText("");
|
||||
medicalRecordID.setText("");
|
||||
PatientName.setText("");
|
||||
});
|
||||
});
|
||||
// AutoCloseAlert.show("Upload Success", "Upload Success", "Upload Success", 5, s -> {
|
||||
// isTakingPhoto.set(false);
|
||||
// Platform.runLater(()->{
|
||||
// barcodeData.setText("");
|
||||
// medicalRecordID.setText("");
|
||||
// PatientName.setText("");
|
||||
// });
|
||||
// });
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
@@ -610,17 +637,21 @@ public class CaptureView {
|
||||
|
||||
|
||||
//tambahan 19/03/2025
|
||||
barcodeData.textProperty().addListener(observable -> {
|
||||
String barcode = barcodeData.getText();
|
||||
//System.out.println("barcodeData invalidated, value: "+barcode);
|
||||
if (ValidBarCode(barcode)){
|
||||
if (AutoCloseAlert.shownTitle.equals("Scan Barcode")){
|
||||
barcodeData.textProperty().addListener((observable, oldValue, newValue) -> {
|
||||
System.out.println("barcodeData changed from ["+oldValue+"] to ["+newValue+"]");
|
||||
if (ValidBarCode(newValue)){
|
||||
if (Objects.equals(AutoCloseAlert.banner_01, AutoCloseAlert.shownBanner)){
|
||||
System.out.println("Close banner 01");
|
||||
AutoCloseAlert.close();
|
||||
}
|
||||
} else {
|
||||
AutoCloseAlert.show("Scan Barcode", "Silahkan Scan Barcode Anda", "Arahkan kertas barcode ke kamera", 0, null);
|
||||
if (AutoCloseAlert.banner_01!=null){
|
||||
System.out.println("Show banner 01");
|
||||
AutoCloseAlert.showbanner(AutoCloseAlert.banner_01,0, null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
barcodeData.setText("");
|
||||
|
||||
audioPlayer = new AudioPlayer(1,48000);
|
||||
@@ -1076,7 +1107,13 @@ public class CaptureView {
|
||||
} else {
|
||||
System.out.println("Prefix invalid, not taking photo");
|
||||
isTakingPhoto.set(false);
|
||||
AutoCloseAlert.show("QR Code Not Available", "", "Please scan QR before continue", 5, s -> AutoCloseAlert.show("Scan Barcode", "Silahkan Scan Barcode Anda", "Arahkan kertas barcode ke kamera", 0, null));
|
||||
//AutoCloseAlert.show("QR Code Not Available", "", "Please scan QR before continue", 5, s -> AutoCloseAlert.show("Scan Barcode", "Silahkan Scan Barcode Anda", "Arahkan kertas barcode ke kamera", 0, null));
|
||||
if (!Objects.equals(AutoCloseAlert.shownBanner, AutoCloseAlert.banner_01)){
|
||||
if (AutoCloseAlert.banner_01!=null){
|
||||
System.out.println("Showing banner 01 because prefix invalid");
|
||||
AutoCloseAlert.showbanner(AutoCloseAlert.banner_01,0,null);
|
||||
}
|
||||
}
|
||||
if (audioPlayer!=null && audioPlayer.isInited()){
|
||||
if (!Objects.equals(audioPlayer.getCurrentFile(), audio_scan_barcode)) {
|
||||
audioPlayer.StopCurrentPlayback();
|
||||
@@ -1093,6 +1130,17 @@ public class CaptureView {
|
||||
|
||||
@Override
|
||||
public void onStartCapturing() {
|
||||
if (!Objects.equals(AutoCloseAlert.shownBanner, AutoCloseAlert.banner_01)){
|
||||
if (AutoCloseAlert.banner_01!=null){
|
||||
System.out.println("Showing banner 01 for first time");
|
||||
AutoCloseAlert.showbanner(AutoCloseAlert.banner_01,0,null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIntervalUpdate() {
|
||||
update_status(image);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user