mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-04 08:55:43 +08:00
Ref T441, statistics can also display matrix
This commit is contained in:
@@ -9,6 +9,12 @@
|
|||||||
|
|
||||||
#include "aircraftmodelstatisticsdialog.h"
|
#include "aircraftmodelstatisticsdialog.h"
|
||||||
#include "ui_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;
|
using namespace BlackMisc::Simulation;
|
||||||
|
|
||||||
@@ -22,6 +28,8 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
this->setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
|
||||||
|
connect(ui->pb_GenerateMatrix, &QPushButton::clicked, this, &CAircraftModelStatisticsDialog::displayHTMLMatrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
CAircraftModelStatisticsDialog::~CAircraftModelStatisticsDialog()
|
CAircraftModelStatisticsDialog::~CAircraftModelStatisticsDialog()
|
||||||
@@ -29,7 +37,15 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CAircraftModelStatisticsDialog::analyzeModels(const CAircraftModelList &models)
|
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
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -37,7 +37,11 @@ namespace BlackGui
|
|||||||
void analyzeModels(const BlackMisc::Simulation::CAircraftModelList &models);
|
void analyzeModels(const BlackMisc::Simulation::CAircraftModelList &models);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
//! Display the HTML matrix
|
||||||
|
void displayHTMLMatrix();
|
||||||
|
|
||||||
QScopedPointer<Ui::CAircraftModelStatisticsDialog> ui;
|
QScopedPointer<Ui::CAircraftModelStatisticsDialog> ui;
|
||||||
|
BlackMisc::Simulation::CAircraftModelList m_models;
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -21,13 +21,48 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTextEdit" name="te_Statistics">
|
<widget class="QTabWidget" name="tw_ModelStatistics">
|
||||||
<property name="documentTitle">
|
<property name="currentIndex">
|
||||||
<string>Statistics</string>
|
<number>0</number>
|
||||||
</property>
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
</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>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
Reference in New Issue
Block a user