From f00fc6fdea284a9e7d84639a0ca54881bc6223be Mon Sep 17 00:00:00 2001 From: tangchao0503 <735056338@qq.com> Date: Fri, 31 Jul 2026 17:29:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=93=E5=87=BA=E7=9B=B8=E6=9C=BA=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E6=97=B6=E7=9A=84=E6=8A=A5=E9=94=99=EF=BC=8C=E6=96=B9?= =?UTF-8?q?=E4=BE=BF=E6=8E=92=E6=9F=A5=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HPPA/HPPA.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/HPPA/HPPA.cpp b/HPPA/HPPA.cpp index 465fa6e..0ab5799 100644 --- a/HPPA/HPPA.cpp +++ b/HPPA/HPPA.cpp @@ -2563,6 +2563,15 @@ void HPPA::onconnect() std::cerr << "Error: " << e.what() << std::endl; + QString errorFilePath = QCoreApplication::applicationDirPath() + "/camerror.txt"; + QFile file(errorFilePath); + if (file.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) + { + QTextStream out(&file); + out << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss") << " - std::exception: " << e.what() << "\n"; + file.close(); + } + delete m_Imager; m_Imager = nullptr; @@ -2572,6 +2581,15 @@ void HPPA::onconnect() { ui.action_connect_imager->setIcon(QIcon(":/svg/resources/icons/svg/connect_imager.svg")); + QString errorFilePath = QCoreApplication::applicationDirPath() + "/camerror.txt"; + QFile file(errorFilePath); + if (file.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) + { + QTextStream out(&file); + out << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss") << " - int exception: " << e << "\n"; + file.close(); + } + delete m_Imager; m_Imager = nullptr;