mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 10:15:38 +08:00
Ref T441, statistics can also display matrix
This commit is contained in:
@@ -9,6 +9,12 @@
|
||||
|
||||
#include "aircraftmodelstatisticsdialog.h"
|
||||
#include "ui_aircraftmodelstatisticsdialog.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackmisc/simulation/aircraftmodelutils.h"
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
using namespace BlackMisc::Simulation;
|
||||
|
||||
@@ -22,6 +28,8 @@ namespace BlackGui
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
connect(ui->pb_GenerateMatrix, &QPushButton::clicked, this, &CAircraftModelStatisticsDialog::displayHTMLMatrix);
|
||||
}
|
||||
|
||||
CAircraftModelStatisticsDialog::~CAircraftModelStatisticsDialog()
|
||||
@@ -29,7 +37,15 @@ namespace BlackGui
|
||||
|
||||
void CAircraftModelStatisticsDialog::analyzeModels(const CAircraftModelList &models)
|
||||
{
|
||||
ui->te_Statistics->setHtml(models.htmlStatistics(true, true));
|
||||
ui->te_GeneralStatistics->setHtml(models.htmlStatistics(true, true));
|
||||
m_models = models;
|
||||
}
|
||||
|
||||
void CAircraftModelStatisticsDialog::displayHTMLMatrix()
|
||||
{
|
||||
const QString file = CAircraftModelUtilities::createIcaoAirlineAircraftHtmlMatrixFile(m_models, CGuiApplication::getTemporaryDirectory());
|
||||
if (file.isEmpty()) { return; }
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(file));
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -37,7 +37,11 @@ namespace BlackGui
|
||||
void analyzeModels(const BlackMisc::Simulation::CAircraftModelList &models);
|
||||
|
||||
private:
|
||||
//! Display the HTML matrix
|
||||
void displayHTMLMatrix();
|
||||
|
||||
QScopedPointer<Ui::CAircraftModelStatisticsDialog> ui;
|
||||
BlackMisc::Simulation::CAircraftModelList m_models;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -21,13 +21,48 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTextEdit" name="te_Statistics">
|
||||
<property name="documentTitle">
|
||||
<string>Statistics</string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
<widget class="QTabWidget" name="tw_ModelStatistics">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tb_GeneralStatistics">
|
||||
<attribute name="title">
|
||||
<string>General</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="vl_GeneralStatistics">
|
||||
<item>
|
||||
<widget class="QTextEdit" name="te_GeneralStatistics">
|
||||
<property name="documentTitle">
|
||||
<string>Statistics</string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tb_Matrix">
|
||||
<attribute name="title">
|
||||
<string>Matrix</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbl_MatitxInfo">
|
||||
<property name="text">
|
||||
<string>Generate matrix and display in browser</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="pb_GenerateMatrix">
|
||||
<property name="text">
|
||||
<string>generate matix</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
Reference in New Issue
Block a user