altosui: Add ability to create CSV file from telem or eeprom files
[fw/altos] / ao-tools / altosui / AltosFile.java
index c7ee86797ef3afeb8dbe77da01b60cb989a45065..7f65381f43926dd1cea5f2e14ae0d604567627cc 100644 (file)
@@ -24,14 +24,23 @@ import altosui.AltosTelemetry;
 import altosui.AltosPreferences;
 
 class AltosFile extends File {
-       public AltosFile(AltosTelemetry telem) {
+
+       public AltosFile(int year, int month, int day, int serial, int flight, String extension) {
                super (AltosPreferences.logdir(),
                       String.format("%04d-%02d-%02d-serial-%03d-flight-%03d.%s",
-                                    Calendar.getInstance().get(Calendar.YEAR),
-                                    Calendar.getInstance().get(Calendar.MONTH),
-                                    Calendar.getInstance().get(Calendar.DAY_OF_MONTH),
-                                    telem.serial,
-                                    telem.flight,
-                                    "telem"));
+                                    year, month, day, serial, flight, extension));
+       }
+
+       public AltosFile(int serial, int flight, String extension) {
+               this(Calendar.getInstance().get(Calendar.YEAR),
+                    Calendar.getInstance().get(Calendar.MONTH) + 1,
+                    Calendar.getInstance().get(Calendar.DAY_OF_MONTH),
+                    serial,
+                    flight,
+                    extension);
+       }
+
+       public AltosFile(AltosTelemetry telem) {
+               this(telem.serial, telem.flight, "telem");
        }
 }