diff options
| author | Bdale Garbee <bdale@gag.com> | 2014-09-06 13:41:36 -0600 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2014-09-06 13:41:36 -0600 | 
| commit | 8c212cd5bfa03f71a31d84bd0051314e77d88461 (patch) | |
| tree | 5be036b3510b8b474ad829caea20fcbc75b56839 /altoslib/AltosStateIterable.java | |
| parent | e9714e34091abe657aa1b30aeda9466331aa39c1 (diff) | |
| parent | dd26ec2e706bdd29090759deeb90090a0e3b74f0 (diff) | |
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Conflicts:
	ao-bringup/turnon_telemega
Diffstat (limited to 'altoslib/AltosStateIterable.java')
| -rw-r--r-- | altoslib/AltosStateIterable.java | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/altoslib/AltosStateIterable.java b/altoslib/AltosStateIterable.java index f7cd424d..4154b71c 100644 --- a/altoslib/AltosStateIterable.java +++ b/altoslib/AltosStateIterable.java @@ -26,4 +26,18 @@ public abstract class AltosStateIterable implements Iterable<AltosState> {  	}  	public abstract void write(PrintStream out); + +	public static AltosStateIterable iterable(File file) { +		FileInputStream in; +		try { +			in = new FileInputStream(file); +		} catch (Exception e) { +			System.out.printf("Failed to open file '%s'\n", file); +			return null; +		} +		if (file.getName().endsWith("telem")) +			return new AltosTelemetryFile(in); +		else +			return new AltosEepromFile(in); +	}  } | 
