Ref T259, Ref T243 interpolation component and setup component

This commit is contained in:
Klaus Basan
2018-03-19 21:07:00 +01:00
parent 0ff3b68d5c
commit 624eb7ca93
6 changed files with 606 additions and 0 deletions

View File

@@ -0,0 +1,87 @@
/* Copyright (C) 2018
* 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.
*/
//! \file
#ifndef BLACKGUI_COMPONENTS_INTERPOLATIONSETUPCOMPONENT_H
#define BLACKGUI_COMPONENTS_INTERPOLATIONSETUPCOMPONENT_H
#include "blackmisc/simulation/interpolationsetuplist.h"
#include "blackgui/overlaymessagesframe.h"
#include <QFrame>
#include <QScopedPointer>
#include <QModelIndex>
namespace Ui { class CInterpolationSetupComponent; }
namespace BlackGui
{
namespace Components
{
//! Setup component
class CInterpolationSetupComponent : public COverlayMessagesFrame
{
Q_OBJECT
public:
//! Mode of setup
enum Mode
{
Global,
PerCallsign
};
//! Constructor
explicit CInterpolationSetupComponent(QWidget *parent = nullptr);
//! Destructor
virtual ~CInterpolationSetupComponent();
//! Setup mode
Mode getSetupMode() const;
signals:
//! Request restrictions UI
void requestRenderingRestrictionsWidget();
private:
QScopedPointer<Ui::CInterpolationSetupComponent> ui;
//! Double clicked in view
void onRowDoubleClicked(const QModelIndex &index);
//! Mode has been changed
void onModeChanged();
//! View has been changed
void onModelChanged();
//! Save a setup
void saveSetup();
//! Delete a setup
void removeSetup();
//! Values from global setup
void setUiValuesFromGlobal();
//! Values per callsign
void displaySetupsPerCallsign();
//! Check prerequisites before saving etc.
bool checkPrerequisites();
//! Send to context
bool setSetupsToContext(const BlackMisc::Simulation::CInterpolationSetupList &setups);
BlackMisc::Simulation::CInterpolationSetupList m_lastSetSetups; //!< last setups set to context
};
} // ns
}// ns
#endif // guard