mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
refs #849, statistics UI in pilot client
This commit is contained in:
committed by
Mathew Sutcliffe
parent
cfca78ec2a
commit
bac77e233d
46
src/blackgui/components/matchingstatisticscomponent.cpp
Normal file
46
src/blackgui/components/matchingstatisticscomponent.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
/* Copyright (C) 2017
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "matchingstatisticscomponent.h"
|
||||
#include "ui_matchingstatisticscomponent.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackcore/context/contextsimulator.h"
|
||||
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackCore::Context;
|
||||
using namespace BlackGui::Views;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
CMatchingStatisticsComponent::CMatchingStatisticsComponent(QWidget *parent) :
|
||||
QFrame(parent),
|
||||
ui(new Ui::CMatchingStatisticsComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(ui->pb_Generate, &QPushButton::clicked, this, &CMatchingStatisticsComponent::onGenerateClicked);
|
||||
connect(ui->tvp_MatchingStatistics, &CMatchingStatisticsView::requestNewBackendData, this, &CMatchingStatisticsComponent::onGenerateClicked);
|
||||
connect(ui->tvp_MatchingStatistics, &CMatchingStatisticsView::requestUpdate, this, &CMatchingStatisticsComponent::onGenerateClicked);
|
||||
}
|
||||
|
||||
CMatchingStatisticsComponent::~CMatchingStatisticsComponent()
|
||||
{ }
|
||||
|
||||
void CMatchingStatisticsComponent::onGenerateClicked()
|
||||
{
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Missing sGui");
|
||||
Q_ASSERT_X(sGui->getIContextSimulator(), Q_FUNC_INFO, "Missing context");
|
||||
|
||||
const bool missingOnly = ui->rb_MissingOnly->isChecked();
|
||||
const CMatchingStatistics stats = sGui->getIContextSimulator()->getCurrentMatchingStatistics(missingOnly);
|
||||
ui->tvp_MatchingStatistics->updateContainerMaybeAsync(stats);
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
Reference in New Issue
Block a user