private void updateTimeSeries() { String[][] data = null; if (sat.hasTimeZero()) { data = sat.getT0TableData(); } if (data == null) { data = new String[1][2]; data[0][0] = "0"; data[0][1] = "Time origin missing"; } t0TableModel.setData(data); }
@Override public void actionPerformed(ActionEvent e) { boolean refreshTabs = false; if (e.getSource() == btnGetT0) { MainWindow.updateManager.updateT0(sat); updateTimeSeries(); } if (e.getSource() == btnCancel) { this.dispose(); } if (e.getSource() == btnSave) { try { try { sat.telemetryDownlinkFreqkHz = Integer.parseInt(telemetryDownlinkFreqkHz.getText()); sat.minFreqBoundkHz = Integer.parseInt(minFreqBoundkHz.getText()); sat.maxFreqBoundkHz = Integer.parseInt(maxFreqBoundkHz.getText()); } catch (NumberFormatException ex) { throw new Exception("The Frequency fields must contain a valid number"); } if (sat.rssiLookUpTableFileName != rssiLookUpTableFileName.getText()) { sat.rssiLookUpTableFileName = rssiLookUpTableFileName.getText(); refreshTabs = true; } if (sat.ihuTempLookUpTableFileName != ihuTempLookUpTableFileName.getText()) { sat.ihuTempLookUpTableFileName = ihuTempLookUpTableFileName.getText(); refreshTabs = true; } if (sat.ihuVBattLookUpTableFileName != ihuVBattLookUpTableFileName.getText()) { sat.ihuVBattLookUpTableFileName = ihuVBattLookUpTableFileName.getText(); refreshTabs = true; } if (sat.BATTERY_CURRENT_ZERO != Double.parseDouble(BATTERY_CURRENT_ZERO.getText())) { sat.BATTERY_CURRENT_ZERO = Double.parseDouble(BATTERY_CURRENT_ZERO.getText()); refreshTabs = true; } if (sat.useIHUVBatt != useIHUVBatt.isSelected()) { sat.useIHUVBatt = useIHUVBatt.isSelected(); refreshTabs = true; } sat.track = track.isSelected(); if (refreshTabs) MainWindow.refreshTabs(false); sat.save(); this.dispose(); } catch (Exception Ex) { Log.errorDialog("Invalid Paramaters", Ex.getMessage()); } } }