X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Faltosui%2FAltosUI.java;h=8880618b251b3c2b4daa68a6673caa474721d950;hp=91278afe2ab7b2de388c8f676a6d00b752a70d6c;hb=4bea4c327e002ce8f88218f0d840af7c1521bc35;hpb=4ad062969ae8a608b8428620579bbe114e580a11 diff --git a/ao-tools/altosui/AltosUI.java b/ao-tools/altosui/AltosUI.java index 91278afe..8880618b 100644 --- a/ao-tools/altosui/AltosUI.java +++ b/ao-tools/altosui/AltosUI.java @@ -70,26 +70,6 @@ class AltosFlightStatusTableModel extends AbstractTableModel { } } -class AltosFlightStatusCellRenderer extends DefaultTableCellRenderer { - - static Font statusFont = new Font("SansSerif", Font.BOLD, 24); - - @Override public Component getTableCellRendererComponent (JTable table, Object value, boolean isSelected, - boolean hasFocus, int row, int column) - { - Component cell = super.getTableCellRendererComponent - (table, value, isSelected, hasFocus, row, column); - System.out.println("Selecting new font for cell " + row + " " + column + " " + statusFont); - cell.setFont(statusFont); - return cell; - } - - public AltosFlightStatusCellRenderer () { - super(); - System.out.println("Made a status cell renderer\n"); - } -} - class AltosFlightInfoTableModel extends AbstractTableModel { private String[] columnNames = {"Field", "Value"}; @@ -437,8 +417,11 @@ public class AltosUI extends JFrame { filename = name; } + /* Run the replay in a separate thread + * so that the UI can update + */ public void run() { - String line; + String line; AltosState state = null; try { while ((line = readline(replay)) != null) { @@ -446,6 +429,8 @@ public class AltosUI extends JFrame { AltosTelemetry t = new AltosTelemetry(line); state = new AltosState(t, state); show(state); + + /* Make it run in realtime after the rocket leaves the pad */ try { if (state.state > AltosTelemetry.ao_flight_pad) Thread.sleep((int) (state.time_change * 1000));