Permalink
Browse files

fix cam calibration "error null" (#435)

* Camera calibration: Error message if no settings are available

Fixes #295

also fixes german localization for the calibration dialog

* Error dialogs: Also show stacktrace for plain Exception("") with empty message
  • Loading branch information...
mgmax authored and t-oster committed Jan 27, 2018
1 parent 558c80d commit 60d9625f4b3ef1967ae78760a6349c9a182834c3
@@ -45,6 +45,7 @@
import java.awt.image.BufferedImage;
import java.net.URL;
import java.net.URLConnection;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
@@ -429,7 +430,14 @@ private void sendButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FI
throw new Exception(java.util.ResourceBundle.getBundle("com/t_oster/visicut/gui/resources/CamCalibrationDialog").getString("NO LASERCUTTER SELECTED"));
}
VectorPart vp = null;
for (LaserProperty lp : LaserPropertyManager.getInstance().getLaserProperties(laserDevice, vm.getMaterial(), profile, vm.getMaterialThickness()))
if (vm.getMaterial() == null) {
throw new Exception(java.util.ResourceBundle.getBundle("com/t_oster/visicut/gui/resources/CamCalibrationDialog").getString("NO MATERIAL SELECTED"));
}
List<LaserProperty> laserProperties = LaserPropertyManager.getInstance().getLaserProperties(laserDevice, vm.getMaterial(), profile, vm.getMaterialThickness());
if (laserProperties == null) {
throw new Exception(java.util.ResourceBundle.getBundle("com/t_oster/visicut/gui/resources/CamCalibrationDialog").getString("NO LASER SETTINGS FOR THIS MATERIAL"));
}
for (LaserProperty lp : laserProperties)
{
if (vp == null)
{
@@ -12,4 +12,6 @@ CALIBRATION=Calibration
TITLE=VisiCut - Camera calibration
btZoomIn.text=
btZoomOut.text=
alignmentPointsLabel.text=alignment points:
alignmentPointsLabel.text=number of alignment points:
NO\ MATERIAL\ SELECTED=No material selected
NO\ LASER\ SETTINGS\ FOR\ THIS\ MATERIAL=There are no laser settings for this material. Please make sure that you can run a normal laser job with the chosen profile and material.
@@ -10,3 +10,6 @@ PLEASE\ PRESS\ 'START'\ ON\ THE\ LASERCUTTER=Bitte "START" auf dem Lasercutter d
VISICUT\ CALIBRATION\ PAGE=VisiCut Kalibrierungsjob
CALIBRATION=Kalibrierung
TITLE=VisiCut - Kamera Kalibrierung
NO\ MATERIAL\ SELECTED=Kein Material ausgew\u00e4hlt
alignmentPointsLabel.text=Anzahl der Ausrichtungspunkte:
NO\ LASER\ SETTINGS\ FOR\ THIS\ MATERIAL=F\u00fcr dieses Material sind keine Laser-Einstellungen vorhanden. Bitte stellen Sie sicher, dass Sie einen normalen Laser-Job mit dem gew\u00e4hlten Profil und Material ausf\u00fchren k\u00f6nnen.
@@ -13,3 +13,5 @@ TITLE=VisiCut - Calibrage de la Camera
btZoomIn.text=Zommer
btZoomOut.text=D\u00e9zoomer
alignmentPointsLabel.text=alignement des points:
NO\ MATERIAL\ SELECTED=No material selected
NO\ LASER\ SETTINGS\ FOR\ THIS\ MATERIAL=There are no laser settings for this material. Please make sure that you can run a normal laser job with the chosen profile and material.
@@ -13,3 +13,5 @@ TITLE=VisiCut - Calibrazione Camera
btZoomIn.text=
btZoomOut.text=
alignmentPointsLabel.text=allineamento punti:
NO\ MATERIAL\ SELECTED=No material selected
NO\ LASER\ SETTINGS\ FOR\ THIS\ MATERIAL=There are no laser settings for this material. Please make sure that you can run a normal laser job with the chosen profile and material.
@@ -10,3 +10,5 @@ PLEASE\ PRESS\ 'START'\ ON\ THE\ LASERCUTTER=Gelieve 'START' te drukken op de La
VISICUT\ CALIBRATION\ PAGE=VisiCut Calibratie Pagina
CALIBRATION=Calibratie
TITLE=VisiCut - Camera calibratie
NO\ MATERIAL\ SELECTED=No material selected
NO\ LASER\ SETTINGS\ FOR\ THIS\ MATERIAL=There are no laser settings for this material. Please make sure that you can run a normal laser job with the chosen profile and material.
@@ -252,7 +252,9 @@ public static String getHumanReadableErrorMessage(Exception cause, String text)
}
}
// for interesting exceptions, add the first few stack trace lines
if (cause.getClass().equals(NullPointerException.class))
boolean emptyMessage = cause.getMessage() == null || cause.getMessage().trim().length() == 0;
if (cause.getClass().equals(NullPointerException.class) ||
(cause.getClass().equals(Exception.class) && emptyMessage))
{
StackTraceElement[] stackTrace = cause.getStackTrace();
for (int i = 0; i < 2 && i < stackTrace.length; i++)

0 comments on commit 60d9625

Please sign in to comment.