From 5f0c86ba196ce1fcb753a0aab88c057f864b85e1 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Tue, 7 Nov 2023 09:23:43 +0100 Subject: [PATCH] Minor: removed obsolete test-code. --- mainwindow.cpp | 85 -------------------------------------------------- 1 file changed, 85 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 1e5ec38..daf3969 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -13,82 +13,6 @@ #include - -#if EMERGENCY_LEAVE_BL==1 -static int step = 0; - -void MainWindow::emergencyLeaveBL() { - // - qCritical() << __func__ << step; - switch(step) { - case 0: - if (m_hw->dc_openSerial(5, "115200", "ttymxc2", 1)) { - qCritical() << __func__ << "open ok"; - step++; - QThread::msleep(2000); - m_hw->dc_autoRequest(false); - emit leaveBL(); - } - break; - case 1: - m_hw->bl_rebootDC(); - QThread::msleep(1000); - qCritical() << __func__ << "reboot ok" << QDateTime::currentDateTime().toString(Qt::ISODateWithMs); - step++; - emit leaveBL(); - break; - case 2: - case 3: - case 4: - case 5: - case 6: - m_hw->bl_startBL(); - QThread::msleep(1000); - qCritical() << __func__ << "start" << QDateTime::currentDateTime().toString(Qt::ISODateWithMs); - step++; - emit leaveBL(); - break; - case 7: - case 9: - case 11: - case 13: - case 15: - m_hw->bl_checkBL(); - qCritical() << __func__ << "check" << QDateTime::currentDateTime().toString(Qt::ISODateWithMs); - QThread::msleep(1500); - ++step; - emit leaveBL(); - break; - case 8: - case 10: - case 12: - case 14: - case 16: - qCritical() << __func__ << "is Up..." << QDateTime::currentDateTime().toString(Qt::ISODateWithMs); - if (m_hw->bl_isUp()) { - qCritical() << __func__ << "is Up...OK" << step << QDateTime::currentDateTime().toString(Qt::ISODateWithMs); - QThread::msleep(5000); - step = 16; - } else { - qCritical() << __func__ << "is Up...NO" << step << QDateTime::currentDateTime().toString(Qt::ISODateWithMs); - } - ++step; - emit leaveBL(); - break; - case 17: - case 18: - case 19: - qCritical() << __func__ << "stop" << QDateTime::currentDateTime().toString(Qt::ISODateWithMs); - m_hw->bl_stopBL(); - QThread::msleep(1000); - //m_hw->dc_closeSerial(); - ++step; - emit leaveBL(); - break; - } -} -#endif - MainWindow::MainWindow(Worker *worker, QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) @@ -97,15 +21,6 @@ MainWindow::MainWindow(Worker *worker, QWidget *parent) , m_progressRunning(false) , m_updateStep(UpdateDcEvent::UpdateStep::NONE) { -#if EMERGENCY_LEAVE_BL==1 - QTimer *t = new QTimer(this); - connect(t, SIGNAL(timeout()), this, SLOT(emergencyLeaveBL())); - connect(this, SIGNAL(leaveBL()), this, SLOT(emergencyLeaveBL()), Qt::QueuedConnection); - t->setSingleShot(true); - t->start(1000); - return; -#endif - this->setStatusBar(new QStatusBar(this)); QFont f; f.setStyleHint(QFont::Monospace);