Do you want to save anyway ?
" + + " If you have added new modules, the answer is probably \"Yes\""; + int ans = WarnOnce.showWarning("Confuguration file warning", msg, WarnOnce.YES_NO_OPTION); + if (ans == WarnOnce.CANCEL_OPTION) { + System.out.println("Settings have not yet loaded. Don't save file"); + return false; + } } saveGlobalSettings(); diff --git a/src/PamController/PamguardVersionInfo.java b/src/PamController/PamguardVersionInfo.java index 791c56a3..b83f6404 100644 --- a/src/PamController/PamguardVersionInfo.java +++ b/src/PamController/PamguardVersionInfo.java @@ -31,12 +31,12 @@ public class PamguardVersionInfo { * Version number, major version.minorversion.sub-release. * Note: can't go higher than sub-release 'f' */ - static public final String version = "2.02.07f"; + static public final String version = "2.02.08"; /** * Release date */ - static public final String date = "4 April 2023"; + static public final String date = "9 May 2023"; // /** // * Release type - Beta or Core diff --git a/src/PamView/dialog/warn/WarnOnce.java b/src/PamView/dialog/warn/WarnOnce.java index bee48997..93ed4618 100644 --- a/src/PamView/dialog/warn/WarnOnce.java +++ b/src/PamView/dialog/warn/WarnOnce.java @@ -24,6 +24,7 @@ import javafx.scene.control.Alert.AlertType; public class WarnOnce implements PamSettings { public static final int OK_CANCEL_OPTION = JOptionPane.OK_CANCEL_OPTION; + public static final int YES_NO_OPTION = JOptionPane.YES_NO_OPTION; public static final int WARNING_MESSAGE = JOptionPane.DEFAULT_OPTION; public static final int OK_OPTION = JOptionPane.OK_OPTION; public static final int CANCEL_OPTION = JOptionPane.CANCEL_OPTION; diff --git a/src/PamView/dialog/warn/WarnOnceDialog.java b/src/PamView/dialog/warn/WarnOnceDialog.java index 48d90d87..2f211919 100644 --- a/src/PamView/dialog/warn/WarnOnceDialog.java +++ b/src/PamView/dialog/warn/WarnOnceDialog.java @@ -92,12 +92,17 @@ public class WarnOnceDialog extends PamDialog { } // if the message type is OK_OPTION, hide the cancel button - if (messageType == WarnOnce.OK_OPTION) { + if (messageType == WarnOnce.YES_NO_OPTION) { + getOkButton().setText("Yes"); + getCancelButton().setText("No"); + } + else if (messageType == WarnOnce.OK_OPTION) { getCancelButton().setVisible(false); } else { getCancelButton().setVisible(true); } + // change the button text to custom text, if needed if (okButtonText!=null) { getOkButton().setText(okButtonText); diff --git a/src/analogarraysensor/AnalogArraySensorDataUnit.java b/src/analogarraysensor/AnalogArraySensorDataUnit.java index c9d3ec79..201d3355 100644 --- a/src/analogarraysensor/AnalogArraySensorDataUnit.java +++ b/src/analogarraysensor/AnalogArraySensorDataUnit.java @@ -60,7 +60,7 @@ public class AnalogArraySensorDataUnit extends PamDataUnit implements Array.sens } private Double getFieldVal(int iVal) { - if (sensorData == null || sensorData.length <= iVal) { + if (sensorData == null || sensorData.length <= iVal || iVal < 0) { return null; } AnalogSensorData sensDat = sensorData[iVal]; diff --git a/src/analoginput/swing/AnalogDiagnosticsDisplay.java b/src/analoginput/swing/AnalogDiagnosticsDisplay.java index 0a0d1bbd..d4a19d5a 100644 --- a/src/analoginput/swing/AnalogDiagnosticsDisplay.java +++ b/src/analoginput/swing/AnalogDiagnosticsDisplay.java @@ -225,7 +225,8 @@ public class AnalogDiagnosticsDisplay extends UserDisplayComponentAdapter implem } break; case 4: - if (allItemData[rowIndex] != null) { + ItemAllData data = allItemData[rowIndex]; + if (data != null) { return allItemData[rowIndex].getIntValue(); } break; diff --git a/src/modbustcp/brainbox/BBED549.java b/src/modbustcp/brainbox/BBED549.java index 394891fe..754e1e77 100644 --- a/src/modbustcp/brainbox/BBED549.java +++ b/src/modbustcp/brainbox/BBED549.java @@ -140,7 +140,7 @@ public class BBED549 { public static double hexToEngineering(int range, int data) { /** * convert integer data to engineering units. - * @param range range on device, asumed the same for all channels. + * @param range range on device, assumed the same for all channels. * @param data data array * @return */