*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
import java.io.*;
import java.util.concurrent.*;
import java.util.*;
-import org.altusmetrum.altoslib_3.*;
-import org.altusmetrum.altosuilib_1.*;
+import org.altusmetrum.altoslib_14.*;
+import org.altusmetrum.altosuilib_14.*;
public class MicroDownload extends AltosUIDialog implements Runnable, ActionListener, MicroSerialLog, WindowListener {
MicroPeak owner;
}
private void done_internal() {
- setVisible(false);
- dispose();
-
if (data != null && data.crc_valid) {
- status_value.setText("Received MicroPeak Data");
- owner = owner.SetData(data);
- MicroSave save = new MicroSave(owner, data);
- if (save.runDialog())
- owner.SetName(data.name);
+ if (data.nsamples == 0) {
+ JOptionPane.showMessageDialog(owner,
+ "No Flight Data Present",
+ "Empty Log",
+ JOptionPane.WARNING_MESSAGE);
+ } else {
+ status_value.setText("Received MicroPeak Data");
+ owner = owner.SetData(data);
+ MicroSave save = new MicroSave(owner, data);
+ if (save.runDialog())
+ owner.SetName(data.name);
+ }
} else {
JOptionPane.showMessageDialog(owner,
"Download Failed",
"Flight data corrupted",
JOptionPane.ERROR_MESSAGE);
}
+ setVisible(false);
+ dispose();
}
public void drain_queue() {