Klaus Basan
2019-11-29 22:43:53 +01:00
committed by Mat Sutcliffe
parent 3b0001d113
commit 03afc8968a
3 changed files with 18 additions and 16 deletions

View File

@@ -50,15 +50,15 @@ namespace BlackGui
connect(ui->gv_RadarView, &CRadarView::radarViewResized, this, &CRadarComponent::fitInView); connect(ui->gv_RadarView, &CRadarView::radarViewResized, this, &CRadarComponent::fitInView);
connect(ui->gv_RadarView, &CRadarView::zoomEvent, this, &CRadarComponent::changeRangeInSteps); connect(ui->gv_RadarView, &CRadarView::zoomEvent, this, &CRadarComponent::changeRangeInSteps);
connect(&m_updateTimer, &QTimer::timeout, this, &CRadarComponent::refreshTargets); connect(&m_updateTimer, &QTimer::timeout, this, &CRadarComponent::refreshTargets);
connect(&m_headingTimer, &QTimer::timeout, this, &CRadarComponent::rotateView); connect(&m_headingTimer, &QTimer::timeout, this, &CRadarComponent::rotateView);
connect(ui->cb_RadarRange, qOverload<int>(&QComboBox::currentIndexChanged), this, &CRadarComponent::changeRangeFromUserSelection); connect(ui->cb_RadarRange, qOverload<int>(&QComboBox::currentIndexChanged), this, &CRadarComponent::changeRangeFromUserSelection);
connect(ui->cb_Callsign, &QCheckBox::toggled, this, &CRadarComponent::refreshTargets); connect(ui->cb_Callsign, &QCheckBox::toggled, this, &CRadarComponent::refreshTargets);
connect(ui->cb_Heading, &QCheckBox::toggled, this, &CRadarComponent::refreshTargets); connect(ui->cb_Heading, &QCheckBox::toggled, this, &CRadarComponent::refreshTargets);
connect(ui->cb_Altitude, &QCheckBox::toggled, this, &CRadarComponent::refreshTargets); connect(ui->cb_Altitude, &QCheckBox::toggled, this, &CRadarComponent::refreshTargets);
connect(ui->cb_GroundSpeed, &QCheckBox::toggled, this, &CRadarComponent::refreshTargets); connect(ui->cb_GroundSpeed, &QCheckBox::toggled, this, &CRadarComponent::refreshTargets);
connect(ui->cb_Grid, &QCheckBox::toggled, this, &CRadarComponent::toggleGrid); connect(ui->cb_Grid, &QCheckBox::toggled, this, &CRadarComponent::toggleGrid);
prepareScene(); prepareScene();
@@ -188,10 +188,10 @@ namespace BlackGui
if (ui->cb_Heading->isChecked() && groundSpeedKts > 3.0) if (ui->cb_Heading->isChecked() && groundSpeedKts > 3.0)
{ {
double headingRad = sa.getHeading().value(CAngleUnit::rad()); const double headingRad = sa.getHeading().value(CAngleUnit::rad());
QPen pen(Qt::green, 1); QPen pen(Qt::green, 1);
pen.setCosmetic(true); pen.setCosmetic(true);
QGraphicsLineItem *li = new QGraphicsLineItem(QLineF({ 0.0, 0.0 }, polarPoint(20.0, headingRad)), &m_radarTargets); QGraphicsLineItem *li = new QGraphicsLineItem(QLineF({ 0.0, 0.0 }, polarPoint(5.0, headingRad)), &m_radarTargets);
li->setPos(position); li->setPos(position);
li->setPen(pen); li->setPen(pen);
} }
@@ -268,7 +268,7 @@ namespace BlackGui
void CRadarComponent::onInfoAreaTabBarChanged(int index) void CRadarComponent::onInfoAreaTabBarChanged(int index)
{ {
Q_UNUSED(index); Q_UNUSED(index)
// ignore in those cases // ignore in those cases
if (!this->isVisibleWidget()) return; if (!this->isVisibleWidget()) return;

View File

@@ -63,7 +63,7 @@ namespace BlackGui
void onInfoAreaTabBarChanged(int index); void onInfoAreaTabBarChanged(int index);
QScopedPointer<Ui::CRadarComponent> ui; QScopedPointer<Ui::CRadarComponent> ui;
QGraphicsScene m_scene; QGraphicsScene m_scene;
QGraphicsItemGroup m_radarTargets; QGraphicsItemGroup m_radarTargets;
QGraphicsItemGroup m_center; QGraphicsItemGroup m_center;
QGraphicsItemGroup m_macroGraticule; QGraphicsItemGroup m_macroGraticule;
@@ -71,10 +71,8 @@ namespace BlackGui
QGraphicsItemGroup m_radials; QGraphicsItemGroup m_radials;
QPen m_radarTargetPen = { Qt::green, 1 }; QPen m_radarTargetPen = { Qt::green, 1 };
qreal m_rangeNM = 10.0;
qreal m_rangeNM = 10.0; int m_rotatenAngle = 0;
int m_rotatenAngle = 0;
QTimer m_updateTimer; QTimer m_updateTimer;
QTimer m_headingTimer; QTimer m_headingTimer;
}; };

View File

@@ -54,7 +54,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QCheckBox" name="cb_Heading"> <widget class="QCheckBox" name="cb_Heading">
<property name="text"> <property name="text">
<string>Heading Bug</string> <string>Track line</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@@ -129,8 +129,12 @@
<tabstops> <tabstops>
<tabstop>gv_RadarView</tabstop> <tabstop>gv_RadarView</tabstop>
<tabstop>cb_Callsign</tabstop> <tabstop>cb_Callsign</tabstop>
<tabstop>cb_Heading</tabstop>
<tabstop>cb_Altitude</tabstop>
<tabstop>cb_LockNorth</tabstop>
<tabstop>cb_GroundSpeed</tabstop> <tabstop>cb_GroundSpeed</tabstop>
<tabstop>cb_Grid</tabstop> <tabstop>cb_Grid</tabstop>
<tabstop>cb_RadarRange</tabstop>
</tabstops> </tabstops>
<resources/> <resources/>
<connections/> <connections/>