[#1809] Ignore stages with no sim data in plots

This commit is contained in:
SiboVG 2022-11-10 19:45:54 +01:00
parent 884e8edd59
commit 0385b30d8b
2 changed files with 13 additions and 0 deletions

View File

@ -458,6 +458,10 @@ public class PlotConfiguration implements Cloneable {
double max = unit.toUnit(data.get(0).getMaximum(type)); double max = unit.toUnit(data.get(0).getMaximum(type));
for (int j = 1; j < data.size(); j++) { for (int j = 1; j < data.size(); j++) {
// Ignore empty data
if (data.get(j).getLength() == 0) {
continue;
}
min = Math.min(min, unit.toUnit(data.get(j).getMinimum(type))); min = Math.min(min, unit.toUnit(data.get(j).getMinimum(type)));
max = Math.max(max, unit.toUnit(data.get(j).getMaximum(type))); max = Math.max(max, unit.toUnit(data.get(j).getMaximum(type)));
} }

View File

@ -193,6 +193,15 @@ public class SimulationPlot {
FlightDataBranch primaryBranch = simulation.getSimulatedData().getBranch(0); FlightDataBranch primaryBranch = simulation.getSimulatedData().getBranch(0);
FlightDataBranch thisBranch = simulation.getSimulatedData().getBranch(branchIndex); FlightDataBranch thisBranch = simulation.getSimulatedData().getBranch(branchIndex);
// Ignore empty branches
if (thisBranch.getLength() == 0) {
// Add an empty series to keep the series count consistent
XYSeries series = new XYSeries(seriesCount++, false, true);
series.setDescription(thisBranch.getBranchName() + ": " + name);
data[axis].addSeries(series);
continue;
}
// Get first time index used in secondary branch; // Get first time index used in secondary branch;
double firstSampleTime = thisBranch.get(FlightDataType.TYPE_TIME).get(0); double firstSampleTime = thisBranch.get(FlightDataType.TYPE_TIME).get(0);