/** * This should be called when the radar needs to be repainted */ void FlarmTrafficWindow::Update(Angle new_direction, const FlarmState &new_data, const TeamCodeSettings &new_settings) { FlarmId selection_id; RasterPoint pt; if (!small && data.available && selection >= 0) { selection_id = data.traffic[selection].id; pt = sc[selection]; } else { selection_id.Clear(); pt.x = -100; pt.y = -100; } heading = new_direction; fr.SetAngle(-heading); fir.SetAngle(heading); data = new_data; settings = new_settings; UpdateWarnings(); UpdateSelector(selection_id, pt); Invalidate(); }
/** * This should be called when the radar needs to be repainted */ void FlarmTrafficWindow::Update(Angle new_direction, const TrafficList &new_data, const TeamCodeSettings &new_settings) { static constexpr Angle min_heading_delta = Angle::Degrees(2); if (new_data.modified == data_modified && (heading - new_direction).Absolute() < min_heading_delta) /* no change - don't redraw */ return; FlarmId selection_id; PixelPoint pt; if (!small && selection >= 0) { selection_id = data.list[selection].id; pt = sc[selection]; } else { selection_id.Clear(); pt.x = -100; pt.y = -100; } heading = new_direction; fr.SetAngle(-heading); fir.SetAngle(heading); data = new_data; settings = new_settings; UpdateWarnings(); UpdateSelector(selection_id, pt); Invalidate(); }
/** * This should be called when the radar needs to be repainted */ void FlarmTrafficWindow::Update(Angle new_direction, const FLARM_STATE &new_data, const SETTINGS_TEAMCODE &new_settings) { direction = new_direction; fr.SetAngle(-direction); data = new_data; settings = new_settings; UpdateSelector(); UpdateWarnings(); invalidate(); }