mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
@@ -22,7 +22,7 @@ using namespace BlackGui::Views;
|
|||||||
namespace BlackGui::Components
|
namespace BlackGui::Components
|
||||||
{
|
{
|
||||||
CRadarComponent::CRadarComponent(QWidget *parent) : QFrame(parent),
|
CRadarComponent::CRadarComponent(QWidget *parent) : QFrame(parent),
|
||||||
ui(new Ui::CRadarComponent)
|
ui(new Ui::CRadarComponent), m_tagFont(QApplication::font())
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
@@ -39,6 +39,8 @@ namespace BlackGui::Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
ui->cb_RadarRange->setCurrentText(QString::number(m_rangeNM) % u" nm");
|
ui->cb_RadarRange->setCurrentText(QString::number(m_rangeNM) % u" nm");
|
||||||
|
ui->sb_FontSize->setRange(1, 100);
|
||||||
|
ui->sb_FontSize->setValue(QApplication::font().pointSize());
|
||||||
|
|
||||||
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);
|
||||||
@@ -46,6 +48,7 @@ namespace BlackGui::Components
|
|||||||
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->sb_FontSize, qOverload<int>(&QSpinBox::valueChanged), this, &CRadarComponent::updateFont);
|
||||||
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);
|
||||||
@@ -175,6 +178,7 @@ namespace BlackGui::Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
tag->setPlainText(tagText);
|
tag->setPlainText(tagText);
|
||||||
|
tag->setFont(m_tagFont);
|
||||||
tag->setPos(position);
|
tag->setPos(position);
|
||||||
tag->setDefaultTextColor(Qt::green);
|
tag->setDefaultTextColor(Qt::green);
|
||||||
tag->setFlags(QGraphicsItem::ItemIgnoresTransformations);
|
tag->setFlags(QGraphicsItem::ItemIgnoresTransformations);
|
||||||
@@ -259,6 +263,12 @@ namespace BlackGui::Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CRadarComponent::updateFont(int pointSize)
|
||||||
|
{
|
||||||
|
m_tagFont.setPointSize(pointSize);
|
||||||
|
this->refreshTargets();
|
||||||
|
}
|
||||||
|
|
||||||
void CRadarComponent::onInfoAreaTabBarChanged(int index)
|
void CRadarComponent::onInfoAreaTabBarChanged(int index)
|
||||||
{
|
{
|
||||||
Q_UNUSED(index)
|
Q_UNUSED(index)
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ namespace BlackGui::Components
|
|||||||
void fitInView();
|
void fitInView();
|
||||||
void changeRangeInSteps(bool zoomIn);
|
void changeRangeInSteps(bool zoomIn);
|
||||||
void changeRangeFromUserSelection(int index);
|
void changeRangeFromUserSelection(int index);
|
||||||
|
void updateFont(int pointSize);
|
||||||
|
|
||||||
static QPointF polarPoint(double distance, double angleRadians);
|
static QPointF polarPoint(double distance, double angleRadians);
|
||||||
|
|
||||||
@@ -74,6 +75,8 @@ namespace BlackGui::Components
|
|||||||
QTimer m_updateTimer;
|
QTimer m_updateTimer;
|
||||||
QTimer m_headingTimer;
|
QTimer m_headingTimer;
|
||||||
|
|
||||||
|
QFont m_tagFont;
|
||||||
|
|
||||||
BlackCore::CActionBind m_actionZoomIn { BlackMisc::Input::radarZoomInHotkeyAction(), BlackMisc::Input::radarZoomInHotkeyIcon(), this, &CRadarComponent::rangeZoomIn };
|
BlackCore::CActionBind m_actionZoomIn { BlackMisc::Input::radarZoomInHotkeyAction(), BlackMisc::Input::radarZoomInHotkeyIcon(), this, &CRadarComponent::rangeZoomIn };
|
||||||
BlackCore::CActionBind m_actionZoomOut { BlackMisc::Input::radarZoomOutHotkeyAction(), BlackMisc::Input::radarZoomOutHotkeyIcon(), this, &CRadarComponent::rangeZoomOut };
|
BlackCore::CActionBind m_actionZoomOut { BlackMisc::Input::radarZoomOutHotkeyAction(), BlackMisc::Input::radarZoomOutHotkeyIcon(), this, &CRadarComponent::rangeZoomOut };
|
||||||
void rangeZoomIn(bool keydown)
|
void rangeZoomIn(bool keydown)
|
||||||
|
|||||||
@@ -44,10 +44,16 @@
|
|||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="1" column="0">
|
<item row="0" column="4">
|
||||||
<widget class="QCheckBox" name="cb_LockNorth">
|
<widget class="QSpinBox" name="sb_FontSize"/>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QCheckBox" name="cb_Callsign">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Lock North</string>
|
<string>Callsign</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -61,7 +67,17 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2" colspan="2">
|
<item row="0" column="3">
|
||||||
|
<widget class="QLabel" name="lbl_FontSize">
|
||||||
|
<property name="text">
|
||||||
|
<string>Font size</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
<widget class="QCheckBox" name="cb_Altitude">
|
<widget class="QCheckBox" name="cb_Altitude">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Altitude (FL)</string>
|
<string>Altitude (FL)</string>
|
||||||
@@ -71,6 +87,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QCheckBox" name="cb_LockNorth">
|
||||||
|
<property name="text">
|
||||||
|
<string>Lock North</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QCheckBox" name="cb_GroundSpeed">
|
<widget class="QCheckBox" name="cb_GroundSpeed">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -81,16 +104,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QCheckBox" name="cb_Callsign">
|
|
||||||
<property name="text">
|
|
||||||
<string>Callsign</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
<item row="1" column="2">
|
||||||
<widget class="QCheckBox" name="cb_Grid">
|
<widget class="QCheckBox" name="cb_Grid">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -101,10 +114,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="2" colspan="2">
|
<item row="1" column="3">
|
||||||
<widget class="QComboBox" name="cb_RadarRange"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="lbl_Range">
|
<widget class="QLabel" name="lbl_Range">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Range</string>
|
<string>Range</string>
|
||||||
@@ -114,6 +124,9 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="4">
|
||||||
|
<widget class="QComboBox" name="cb_RadarRange"/>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -131,6 +144,7 @@
|
|||||||
<tabstop>cb_Callsign</tabstop>
|
<tabstop>cb_Callsign</tabstop>
|
||||||
<tabstop>cb_Heading</tabstop>
|
<tabstop>cb_Heading</tabstop>
|
||||||
<tabstop>cb_Altitude</tabstop>
|
<tabstop>cb_Altitude</tabstop>
|
||||||
|
<tabstop>sb_FontSize</tabstop>
|
||||||
<tabstop>cb_LockNorth</tabstop>
|
<tabstop>cb_LockNorth</tabstop>
|
||||||
<tabstop>cb_GroundSpeed</tabstop>
|
<tabstop>cb_GroundSpeed</tabstop>
|
||||||
<tabstop>cb_Grid</tabstop>
|
<tabstop>cb_Grid</tabstop>
|
||||||
|
|||||||
Reference in New Issue
Block a user