This commit is contained in:
root
2017-11-13 10:03:12 +01:00
parent 5645afe9f4
commit ffba57999d
8 changed files with 201 additions and 53 deletions

View File

@@ -2839,25 +2839,37 @@ public class ScreenPanel extends Panel {
private void buttonGrabBackgroundActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonGrabBackgroundActionPerformed
try {
if (camera != null) {
if (SwingUtils.showOption(getTopLevel(), "Background", "Do you want to capture background now?", OptionType.YesNo) == OptionResult.Yes) {
boolean laserOn = getLaserState();
if (laserOn) {
setLaserState(false);
boolean laserOn = getLaserState();
OptionResult ret = null;
if (laserOn){
ret = SwingUtils.showOption(getTopLevel(), "Capture Background", "Do you want to put laser on delay for capturing background?", OptionType.YesNoCancel);
if (ret == OptionResult.No){
laserOn = false;
}
try {
System.out.println("Grabbing background for: " + cameraName);
if (server != null) {
server.captureBackground(5);
} else {
camera.captureBackground(5, 0);
}
} finally {
if (laserOn) {
setLaserState(true);
}
}
SwingUtils.showMessage(getTopLevel(), "Success", "Success capturing background", 5000);
} else {
ret = SwingUtils.showOption(getTopLevel(), "Capture Background", "Do you want to capture background now?", OptionType.OkCancel);
}
if (ret == OptionResult.Cancel){
return;
}
if (laserOn) {
setLaserState(false);
}
try {
System.out.println("Grabbing background for: " + cameraName);
if (server != null) {
server.captureBackground(5);
} else {
camera.captureBackground(5, 0);
}
} finally {
if (laserOn) {
setLaserState(true);
}
}
SwingUtils.showMessage(getTopLevel(), "Success", "Success capturing background", 5000);
}
} catch (Exception ex) {
showException(ex);