- Formatted all CodeGen module files (9 files) - Formatted LtsAppDescriptor module files - Formatted LtsAppManager/AppChooser files - Applied clang-format to all DTC and enum headers across modules - Removed coordTransTests from CommonUnitTestsPlaceholder (moved to tests/) Cosmetic changes only, no functional modifications. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
74 lines
1.6 KiB
C++
74 lines
1.6 KiB
C++
|
|
|
|
#pragma once
|
|
#include "ltsutilsguiconnectdialog_export.h"
|
|
|
|
#include <LtsWidgets/lts_frameless_dialog.h>
|
|
#include <QObject>
|
|
#include <QTimer>
|
|
#include <QWidget>
|
|
#include <functional>
|
|
|
|
namespace Ui
|
|
{
|
|
class ConnectingDialog;
|
|
}
|
|
|
|
namespace LtsUtils
|
|
{
|
|
|
|
class LTSUTILSGUICONNECTDIALOG_EXPORT ConnectingDialog : public LtsWidgets::LtsFramelessDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
static int s_waitForHistoricalDataWaitTime;
|
|
|
|
template <typename DtcType, typename WaitForHistoricalDataFunction>
|
|
explicit ConnectingDialog(DtcType dtc, WaitForHistoricalDataFunction waitForHistoricalDataFunction,
|
|
const QString& serviceName, const QString& exerciseName, QWidget* parent = nullptr)
|
|
: LtsWidgets::LtsFramelessDialog(parent, LtsWidgets::Behaviour::Modal), m_serviceName(serviceName),
|
|
m_exerciseName(exerciseName), m_ui(nullptr)
|
|
{
|
|
setWindowTitle(tr("Connecting .."));
|
|
setup();
|
|
show();
|
|
|
|
while (true)
|
|
{
|
|
if ((dtc.get()->*waitForHistoricalDataFunction)(s_waitForHistoricalDataWaitTime))
|
|
{
|
|
deleteLater();
|
|
return;
|
|
}
|
|
|
|
if (s_waitForHistoricalDataWaitTime >= 999999)
|
|
{
|
|
deleteLater();
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
failed();
|
|
}
|
|
}
|
|
}
|
|
|
|
~ConnectingDialog();
|
|
|
|
void failed();
|
|
|
|
private:
|
|
QString m_serviceName;
|
|
QString m_exerciseName;
|
|
Ui::ConnectingDialog* m_ui;
|
|
|
|
void reset();
|
|
void setup();
|
|
|
|
signals:
|
|
void signalStopLoop();
|
|
};
|
|
|
|
} // namespace LtsUtils
|