Ignore empty simulations in sim table export

This commit is contained in:
SiboVG 2023-03-14 00:14:21 +01:00
parent 14db274d42
commit 1b7213e21f
2 changed files with 15 additions and 1 deletions

View File

@ -459,7 +459,7 @@ public class Simulation implements ChangeSource, Cloneable {
/** /**
* Return true if this simulation contains plottable flight data. * Return true if this simulation contains plottable flight data.
* *
* @return * @return true if this simulation contains plottable flight data.
*/ */
public boolean hasSimulationData() { public boolean hasSimulationData() {
FlightData data = getSimulatedData(); FlightData data = getSimulatedData();
@ -472,6 +472,15 @@ public class Simulation implements ChangeSource, Cloneable {
return true; return true;
} }
/**
* Return true if this simulation contains summary flight data.
* @return true if this simulation contains summary flight data.
*/
public boolean hasSummaryData() {
FlightData data = getSimulatedData();
return data != null;
}
/** /**
* Returns a copy of this simulation suitable for cut/copy/paste operations. * Returns a copy of this simulation suitable for cut/copy/paste operations.
* The rocket refers to the same instance as the original simulation. * The rocket refers to the same instance as the original simulation.

View File

@ -118,6 +118,11 @@ public class SimulationTableCSVExport {
// Account for sorting... resulting CSV file will be in the same order as shown in the table thanks to this gem. // Account for sorting... resulting CSV file will be in the same order as shown in the table thanks to this gem.
int idx = simulationTable.convertRowIndexToModel(i); int idx = simulationTable.convertRowIndexToModel(i);
// Ignore empty simulation
if (!document.getSimulation(idx).hasSummaryData()) {
continue;
}
int nullCnt = 0; int nullCnt = 0;
rowColumnElement.clear(); rowColumnElement.clear();