|
|
@ -9,6 +9,7 @@ |
|
|
|
#include "./ui_mainwindow.h"
|
|
|
|
#include "camera_light_src_timing_controller/qt_serial_datachannel.hpp"
|
|
|
|
#include "logger.hpp"
|
|
|
|
#include "version.h"
|
|
|
|
|
|
|
|
using namespace iflytop; |
|
|
|
using namespace clst; |
|
|
@ -207,7 +208,6 @@ zaf_error_code_t MainWindow::updatePage() { |
|
|
|
#undef UPDATE
|
|
|
|
} |
|
|
|
return kaf_ec_success; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::refreshReadonlyPage0() { |
|
|
@ -299,6 +299,24 @@ bool MainWindow::checkConnected() { |
|
|
|
} |
|
|
|
|
|
|
|
zaf_error_code_t MainWindow::refreshPage() { |
|
|
|
/***********************************************************************************************************************
|
|
|
|
* 刷新版本信息 * |
|
|
|
***********************************************************************************************************************/ |
|
|
|
|
|
|
|
{ |
|
|
|
uint32_t upperVersion = VERSION; |
|
|
|
uint32_t FPGAVersion = 0; |
|
|
|
uint32_t ARMVersion = 0; |
|
|
|
|
|
|
|
DO(m_clstc->reg_read(kreg_fpga_version, FPGAVersion)); |
|
|
|
DO(m_clstc->reg_read(kreg_software_version, ARMVersion)); |
|
|
|
|
|
|
|
ui->UpperVersion->setText(QString::number(upperVersion)); |
|
|
|
ui->FPGAVersion->setText(QString::number(FPGAVersion)); |
|
|
|
ui->ARMVersion->setText(QString::number(ARMVersion)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* 刷新内部触发源页面 * |
|
|
|
*******************************************************************************/ |
|
|
@ -771,62 +789,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi |
|
|
|
} |
|
|
|
}); |
|
|
|
m_zqthread->start(); |
|
|
|
|
|
|
|
// connect(timer0, &QTimer::timeout, this, [this]() { refreshReadonlyPage0(); });
|
|
|
|
// connect(timer1, &QTimer::timeout, this, [this]() { refreshReadonlyPage1(); });
|
|
|
|
// connect(timer2, &QTimer::timeout, this, [this]() { refreshReadonlyPage2(); });
|
|
|
|
// connect(timer3, &QTimer::timeout, this, [this]() { refreshReadonlyPage3(); });
|
|
|
|
|
|
|
|
// connect(checkConnectTimer0, &QTimer::timeout, this, [this]() { //
|
|
|
|
// static bool connected = false;
|
|
|
|
// bool connect = checkConnected();
|
|
|
|
// if (connect) {
|
|
|
|
// ui->DeviceConnectStateTB->setText("已连接");
|
|
|
|
// ui->DeviceConnectStateTB->setStyleSheet("color: green");
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
// ui->DeviceConnectStateTB->setText("未连接");
|
|
|
|
// ui->DeviceConnectStateTB->setStyleSheet("color: red");
|
|
|
|
// }
|
|
|
|
// if (connected != connect) {
|
|
|
|
// connected = connect;
|
|
|
|
// if (connected) {
|
|
|
|
// refreshPage();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
|
|
|
|
// timer0->setInterval(1100); // 每隔一秒触发一次
|
|
|
|
// timer1->setInterval(1200); // 每隔一秒触发一次
|
|
|
|
// timer2->setInterval(900); // 每隔一秒触发一次
|
|
|
|
// timer3->setInterval(1000); // 每隔一秒触发一次
|
|
|
|
// checkConnectTimer0->setInterval(100);
|
|
|
|
// timer0->start();
|
|
|
|
// timer1->start();
|
|
|
|
// timer2->start();
|
|
|
|
// timer3->start();
|
|
|
|
// checkConnectTimer0->start();
|
|
|
|
|
|
|
|
// m_clstc->regRawDataListener([this](uart_message_type_t type, uint8_t *data, size_t len) {
|
|
|
|
// QString text;
|
|
|
|
// if (type == kuart_raw_tx) {
|
|
|
|
// text.append("TX: ");
|
|
|
|
// for (size_t i = 0; i < len; i++) {
|
|
|
|
// text.append(fmt("%02X ", data[i]));
|
|
|
|
// }
|
|
|
|
// } else if (type == kuart_raw_rx) {
|
|
|
|
// text.append("RX: ");
|
|
|
|
// for (size_t i = 0; i < len; i++) {
|
|
|
|
// text.append(fmt("%02X ", data[i]));
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// emit doinui_signal(QFunction([this, text]() {
|
|
|
|
// if (ui->instructionPreview->document()->lineCount() > 100) {
|
|
|
|
// ui->instructionPreview->document()->clear();
|
|
|
|
// }
|
|
|
|
// ui->instructionPreview->append(text);
|
|
|
|
// }));
|
|
|
|
// });
|
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::dumpLog(const char *fmt, ...) { |
|
|
|