mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
70 lines
2.0 KiB
C++
70 lines
2.0 KiB
C++
/* Copyright (C) 2019
|
|
* 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. 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_AUTOPUBLISHCOMPONENT_H
|
|
#define BLACKGUI_COMPONENTS_AUTOPUBLISHCOMPONENT_H
|
|
|
|
#include "blackgui/overlaymessagesframe.h"
|
|
#include "blackmisc/simulation/autopublishdata.h"
|
|
|
|
#include <QFrame>
|
|
#include <QScopedPointer>
|
|
|
|
namespace Ui { class CAutoPublishComponent; }
|
|
namespace BlackGui
|
|
{
|
|
namespace Components
|
|
{
|
|
//! Data automatically collected and be be sent to backend
|
|
class CAutoPublishComponent : public COverlayMessagesFrame
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
//! Ctor
|
|
explicit CAutoPublishComponent(QWidget *parent = nullptr);
|
|
|
|
//! Destructor
|
|
virtual ~CAutoPublishComponent() override;
|
|
|
|
//! Read the files
|
|
int readFiles();
|
|
|
|
//! Data empty
|
|
bool isEmpty() const;
|
|
|
|
private:
|
|
QScopedPointer<Ui::CAutoPublishComponent> ui;
|
|
BlackMisc::Simulation::CAutoPublishData m_data;
|
|
BlackMisc::CData<BlackMisc::Simulation::Data::TLastAutoPublish> m_lastAutoPublish { this };
|
|
|
|
//! Analyze against DB data
|
|
void analyzeAgainstDBData();
|
|
|
|
//! Send to DB
|
|
void sendToDb();
|
|
|
|
//! Display data in JSON text field
|
|
void displayData();
|
|
|
|
//! Delete all files
|
|
void deleteAllFiles();
|
|
|
|
//! Auto publishing completed
|
|
void onAutoPublished(bool success, const QString &url, const BlackMisc::CStatusMessageList &msgs);
|
|
|
|
//! Close parent dialog (if any)
|
|
void closeParentDialog();
|
|
};
|
|
} // ns
|
|
} // ns
|
|
|
|
#endif // guard
|