Assign priorities to event images and colors based on ordinal of event types (higher ordinal means higher priority)
This commit is contained in:
parent
c1b76be844
commit
eb4b02bda4
@ -40,6 +40,8 @@ public class EventGraphics {
|
|||||||
EVENT_COLORS.put(FlightEvent.Type.GROUND_HIT, new Color(0, 0, 0));
|
EVENT_COLORS.put(FlightEvent.Type.GROUND_HIT, new Color(0, 0, 0));
|
||||||
EVENT_COLORS.put(FlightEvent.Type.SIMULATION_END, new Color(128, 0, 0));
|
EVENT_COLORS.put(FlightEvent.Type.SIMULATION_END, new Color(128, 0, 0));
|
||||||
EVENT_COLORS.put(FlightEvent.Type.TUMBLE, new Color(196, 0, 255));
|
EVENT_COLORS.put(FlightEvent.Type.TUMBLE, new Color(196, 0, 255));
|
||||||
|
EVENT_COLORS.put(FlightEvent.Type.EXCEPTION, new Color(255, 0, 0));
|
||||||
|
EVENT_COLORS.put(FlightEvent.Type.SIM_ABORT, new Color(255, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Map<FlightEvent.Type, Image> EVENT_IMAGES = new HashMap<FlightEvent.Type, Image>();
|
private static final Map<FlightEvent.Type, Image> EVENT_IMAGES = new HashMap<FlightEvent.Type, Image>();
|
||||||
|
@ -444,6 +444,7 @@ public class SimulationPlot {
|
|||||||
String text = null;
|
String text = null;
|
||||||
Color color = null;
|
Color color = null;
|
||||||
Image image = null;
|
Image image = null;
|
||||||
|
int maxOrdinal = -1;
|
||||||
for (EventDisplayInfo info : eventList) {
|
for (EventDisplayInfo info : eventList) {
|
||||||
if (branch >= 0 && branch != info.stage) {
|
if (branch >= 0 && branch != info.stage) {
|
||||||
continue;
|
continue;
|
||||||
@ -451,12 +452,14 @@ public class SimulationPlot {
|
|||||||
|
|
||||||
double t = info.time;
|
double t = info.time;
|
||||||
FlightEvent.Type type = info.event.getType();
|
FlightEvent.Type type = info.event.getType();
|
||||||
|
|
||||||
if (Math.abs(t - prevTime) <= 0.05) {
|
if (Math.abs(t - prevTime) <= 0.05) {
|
||||||
if (!typeSet.contains(type)) {
|
if (!typeSet.contains(type)) {
|
||||||
text = text + ", " + type.toString();
|
text = text + ", " + type.toString();
|
||||||
|
if (type.ordinal() > maxOrdinal) {
|
||||||
color = EventGraphics.getEventColor(type);
|
color = EventGraphics.getEventColor(type);
|
||||||
image = EventGraphics.getEventImage(type);
|
image = EventGraphics.getEventImage(type);
|
||||||
|
maxOrdinal = type.ordinal();
|
||||||
|
}
|
||||||
typeSet.add(type);
|
typeSet.add(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -473,6 +476,7 @@ public class SimulationPlot {
|
|||||||
image = EventGraphics.getEventImage(type);
|
image = EventGraphics.getEventImage(type);
|
||||||
typeSet.clear();
|
typeSet.clear();
|
||||||
typeSet.add(type);
|
typeSet.add(type);
|
||||||
|
maxOrdinal = type.ordinal();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user