[#2456] Fix sim no data issues
This commit is contained in:
parent
80d82ad99d
commit
cbc392ca70
@ -547,7 +547,9 @@ SimulationConfigDialog.CancelOperation.title = Cancel operation
|
|||||||
SimulationConfigDialog.CancelOperation.checkbox.dontAskAgain = Don't ask me again
|
SimulationConfigDialog.CancelOperation.checkbox.dontAskAgain = Don't ask me again
|
||||||
SimulationConfigDialog.tab.warnDis.ttip = Warnings not supported for multi-simulation editing
|
SimulationConfigDialog.tab.warnDis.ttip = Warnings not supported for multi-simulation editing
|
||||||
SimulationConfigDialog.tab.plotDis.ttip = Plotting not supported for multi-simulation editing
|
SimulationConfigDialog.tab.plotDis.ttip = Plotting not supported for multi-simulation editing
|
||||||
|
SimulationConfigDialog.tab.plotNoData.ttip = Simulation has no data to plot
|
||||||
SimulationConfigDialog.tab.expDis.ttip = Exporting not supported for multi-simulation editing
|
SimulationConfigDialog.tab.expDis.ttip = Exporting not supported for multi-simulation editing
|
||||||
|
SimulationConfigDialog.tab.expNoData.ttip = Simulation has no data to export
|
||||||
|
|
||||||
! SimulationWarningsPanel
|
! SimulationWarningsPanel
|
||||||
SimulationWarningsPanel.lbl.CriticalWarnings = Critical Warning(s)
|
SimulationWarningsPanel.lbl.CriticalWarnings = Critical Warning(s)
|
||||||
|
@ -790,6 +790,12 @@ public class SimulationPanel extends JPanel {
|
|||||||
if (includeSimName) {
|
if (includeSimName) {
|
||||||
tip.append("<b>").append(sim.getName()).append("</b><br>");
|
tip.append("<b>").append(sim.getName()).append("</b><br>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data == null) {
|
||||||
|
tip.append(trans.get("simpanel.ttip.noData"));
|
||||||
|
return tip.toString();
|
||||||
|
}
|
||||||
|
|
||||||
switch (sim.getStatus()) {
|
switch (sim.getStatus()) {
|
||||||
case CANT_RUN:
|
case CANT_RUN:
|
||||||
tip.append(trans.get("simpanel.ttip.noData")).append("<br>");
|
tip.append(trans.get("simpanel.ttip.noData")).append("<br>");
|
||||||
@ -814,11 +820,6 @@ public class SimulationPanel extends JPanel {
|
|||||||
return tip.toString();
|
return tip.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data == null) {
|
|
||||||
tip.append(trans.get("simpanel.ttip.noData"));
|
|
||||||
return tip.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int b = 0; b < data.getBranchCount(); b++) {
|
for (int b = 0; b < data.getBranchCount(); b++) {
|
||||||
FlightEvent abortEvent = data.getBranch(b).getFirstEvent(FlightEvent.Type.SIM_ABORT);
|
FlightEvent abortEvent = data.getBranch(b).getFirstEvent(FlightEvent.Type.SIM_ABORT);
|
||||||
if (abortEvent != null) {
|
if (abortEvent != null) {
|
||||||
|
@ -118,19 +118,30 @@ public class SimulationConfigDialog extends JDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//// Plot data
|
//// Plot data
|
||||||
|
boolean hasData = simulationList[0].hasSimulationData();
|
||||||
|
if (hasData) {
|
||||||
this.plotTab = new SimulationPlotPanel(simulationList[0]);
|
this.plotTab = new SimulationPlotPanel(simulationList[0]);
|
||||||
|
} else {
|
||||||
|
this.plotTab = null;
|
||||||
|
}
|
||||||
tabbedPane.addTab(trans.get("SimulationConfigDialog.tab.Plotdata"), plotTab);
|
tabbedPane.addTab(trans.get("SimulationConfigDialog.tab.Plotdata"), plotTab);
|
||||||
if (isMultiCompEdit()) {
|
if (isMultiCompEdit() || !hasData) {
|
||||||
tabbedPane.setEnabledAt(PLOT_IDX, false);
|
tabbedPane.setEnabledAt(PLOT_IDX, false);
|
||||||
tabbedPane.setToolTipTextAt(PLOT_IDX, trans.get("SimulationConfigDialog.tab.plotDis.ttip"));
|
String ttip = hasData ? trans.get("SimulationConfigDialog.tab.plotDis.ttip") : trans.get("SimulationConfigDialog.tab.plotNoData.ttip");
|
||||||
|
tabbedPane.setToolTipTextAt(PLOT_IDX, ttip);
|
||||||
}
|
}
|
||||||
|
|
||||||
//// Export data
|
//// Export data
|
||||||
|
if (hasData) {
|
||||||
this.exportTab = new SimulationExportPanel(simulationList[0]);
|
this.exportTab = new SimulationExportPanel(simulationList[0]);
|
||||||
|
} else {
|
||||||
|
this.exportTab = null;
|
||||||
|
}
|
||||||
tabbedPane.addTab(trans.get("SimulationConfigDialog.tab.Exportdata"), exportTab);
|
tabbedPane.addTab(trans.get("SimulationConfigDialog.tab.Exportdata"), exportTab);
|
||||||
if (isMultiCompEdit()) {
|
if (isMultiCompEdit() || !hasData) {
|
||||||
tabbedPane.setEnabledAt(EXPORT_IDX, false);
|
tabbedPane.setEnabledAt(EXPORT_IDX, false);
|
||||||
tabbedPane.setToolTipTextAt(EXPORT_IDX, trans.get("SimulationConfigDialog.tab.expDis.ttip"));
|
String ttip = hasData ? trans.get("SimulationConfigDialog.tab.expDis.ttip") : trans.get("SimulationConfigDialog.tab.expNoData.ttip");
|
||||||
|
tabbedPane.setToolTipTextAt(EXPORT_IDX, ttip);
|
||||||
}
|
}
|
||||||
|
|
||||||
contentPanel.add(tabbedPane, "grow, wrap");
|
contentPanel.add(tabbedPane, "grow, wrap");
|
||||||
@ -354,6 +365,10 @@ public class SimulationConfigDialog extends JDialog {
|
|||||||
|
|
||||||
int tabIdx = tabbedPane.getSelectedIndex();
|
int tabIdx = tabbedPane.getSelectedIndex();
|
||||||
if (tabIdx == PLOT_IDX) {
|
if (tabIdx == PLOT_IDX) {
|
||||||
|
if (plotTab == null) {
|
||||||
|
closeDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
JDialog plot = plotTab.doPlot(SimulationConfigDialog.this.parentWindow);
|
JDialog plot = plotTab.doPlot(SimulationConfigDialog.this.parentWindow);
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
plot.setVisible(true);
|
plot.setVisible(true);
|
||||||
@ -361,7 +376,7 @@ public class SimulationConfigDialog extends JDialog {
|
|||||||
closeDialog();
|
closeDialog();
|
||||||
return;
|
return;
|
||||||
} else if (tabIdx == EXPORT_IDX) {
|
} else if (tabIdx == EXPORT_IDX) {
|
||||||
if (exportTab.doExport()) {
|
if (exportTab == null || exportTab.doExport()) {
|
||||||
closeDialog();
|
closeDialog();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -37,9 +37,9 @@ public class SimulationWarningsPanel extends JPanel {
|
|||||||
super(new MigLayout("fill"));
|
super(new MigLayout("fill"));
|
||||||
|
|
||||||
WarningSet warnings = simulation.getSimulatedWarnings();
|
WarningSet warnings = simulation.getSimulatedWarnings();
|
||||||
List<Warning> criticalWarnings = warnings.getCriticalWarnings();
|
List<Warning> criticalWarnings = warnings == null ? null : warnings.getCriticalWarnings();
|
||||||
List<Warning> normalWarnings = warnings.getNormalWarnings();
|
List<Warning> normalWarnings = warnings == null ? null : warnings.getNormalWarnings();
|
||||||
List<Warning> informativeWarnings = warnings.getInformativeWarnings();
|
List<Warning> informativeWarnings = warnings == null ? null : warnings.getInformativeWarnings();
|
||||||
|
|
||||||
// Critical warnings
|
// Critical warnings
|
||||||
JPanel criticalPanel = createWarningsPanel(criticalWarnings, Icons.WARNING_HIGH, trans.get("SimulationWarningsPanel.lbl.CriticalWarnings"), darkErrorColor);
|
JPanel criticalPanel = createWarningsPanel(criticalWarnings, Icons.WARNING_HIGH, trans.get("SimulationWarningsPanel.lbl.CriticalWarnings"), darkErrorColor);
|
||||||
@ -74,11 +74,12 @@ public class SimulationWarningsPanel extends JPanel {
|
|||||||
|
|
||||||
// Title
|
// Title
|
||||||
float size = 1.1f;
|
float size = 1.1f;
|
||||||
StyledLabel title = new StyledLabel(warnings.size() + " " + titleText, size, StyledLabel.Style.BOLD);
|
int nrOfWarnings = warnings == null ? 0 : warnings.size();
|
||||||
|
StyledLabel title = new StyledLabel(nrOfWarnings + " " + titleText, size, StyledLabel.Style.BOLD);
|
||||||
title.setFontColor(textColor);
|
title.setFontColor(textColor);
|
||||||
panel.add(title, "wrap, spanx");
|
panel.add(title, "wrap, spanx");
|
||||||
|
|
||||||
if (warnings.isEmpty()) {
|
if (nrOfWarnings == 0) {
|
||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user