From 3183db5cb3aef2c01b7947bc3dde5823e7115887 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Thu, 11 Jan 2024 22:20:11 +0800 Subject: [PATCH] update --- libxsync | 2 +- mainwindow.cpp | 36 +++++++++++++++- mainwindow.h | 5 +++ mainwindow.ui | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 170 insertions(+), 3 deletions(-) diff --git a/libxsync b/libxsync index f0e204c..b6ba9ab 160000 --- a/libxsync +++ b/libxsync @@ -1 +1 @@ -Subproject commit f0e204cec62237684d61dab803498d6403966a9b +Subproject commit b6ba9ab22e85b62aa4b573b43a753edb3f22a0d3 diff --git a/mainwindow.cpp b/mainwindow.cpp index 8cc1fb3..cb0ba4b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -303,6 +303,13 @@ void MainWindow::UI_TimecodeOutputModuleConstruct() { } } +void MainWindow::UI_CameraSyncPacketGeneratorModuleConstruct() { + ui->CameraSyncPacketGeneratorModule_TriggerSig->clear(); + for (auto &str : camera_sync_packet_generator_module::TriggerSigTypeStrSet()) { + ui->CameraSyncPacketGeneratorModule_TriggerSig->addItem(QString::fromStdString(str)); + } +} + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); m_mainWindow = this; @@ -315,6 +322,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi UI_TTLOutputMoudleConstruct(); UI_SigGeneratorConstruct(); UI_TimecodeOutputModuleConstruct(); + UI_CameraSyncPacketGeneratorModuleConstruct(); /******************************************************************************* * 连接信号与槽 * @@ -551,4 +559,30 @@ void MainWindow::on_TimecodeOutputModule_Update_clicked() { DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_setTimecodeSrcSelect(TimecodeSrcSelect)); DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_setBncOutputLevel(BncOutputLevel)); DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_setHeadphoneOutputLevel(HeadphoneOutputLevel)); -} \ No newline at end of file +} + +void MainWindow::on_CameraSyncPacketGeneratorModule_Update_clicked() { + auto TriggerSig = camera_sync_packet_generator_module::Str2TriggerSigType(ui->CameraSyncPacketGeneratorModule_TriggerSig->currentText().toStdString()); + auto ReportPeriod = ui->CameraSyncPacketGeneratorModule_ReportPeriod->text().toUInt(); + + DO_XSYNC_FUNC(Xsync::Ins().CameraSyncPacketGeneratorModule_setTriggerSig(TriggerSig)); + DO_XSYNC_FUNC(Xsync::Ins().CameraSyncPacketGeneratorModule_setReportPeriod(ReportPeriod)); +} +void MainWindow::on_CameraSyncPacketGeneratorModule_Read_clicked() { + camera_sync_packet_generator_module::TriggerSigType_t TriggerSig; + + uint32_t ReportPeriod; + uint32_t PacketIndex; + + DO_XSYNC_FUNC(Xsync::Ins().CameraSyncPacketGeneratorModule_getTriggerSig(TriggerSig)); + DO_XSYNC_FUNC(Xsync::Ins().CameraSyncPacketGeneratorModule_getReportPeriod(ReportPeriod)); + DO_XSYNC_FUNC(Xsync::Ins().CameraSyncPacketGeneratorModule_getPacketIndex(PacketIndex)); + + ui->CameraSyncPacketGeneratorModule_TriggerSig->setCurrentText(QString::fromStdString(camera_sync_packet_generator_module::TriggerSigType2Str(TriggerSig))); + ui->CameraSyncPacketGeneratorModule_ReportPeriod->setText(QString::number(ReportPeriod)); + ui->CameraSyncPacketGeneratorModule_PacketIndex->setText(QString::number(PacketIndex)); +} +void MainWindow::on_CameraSyncPacketGeneratorModule_ClearPacketIndex_clicked() { + DO_XSYNC_FUNC(Xsync::Ins().CameraSyncPacketGeneratorModule_clearPacketIndex()); + on_CameraSyncPacketGeneratorModule_Read_clicked(); +} diff --git a/mainwindow.h b/mainwindow.h index 59e899c..45dec60 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -110,6 +110,10 @@ class MainWindow : public QMainWindow { void on_TimecodeOutputModule_Read_clicked(); void on_TimecodeOutputModule_Update_clicked(); + void on_CameraSyncPacketGeneratorModule_Update_clicked(); + void on_CameraSyncPacketGeneratorModule_Read_clicked(); + void on_CameraSyncPacketGeneratorModule_ClearPacketIndex_clicked(); + signals: void append_log_signal(QString str); void updateUI_timeCodeInfo_signal(QString); @@ -124,5 +128,6 @@ class MainWindow : public QMainWindow { void UI_TTLOutputMoudleConstruct(); void UI_SigGeneratorConstruct(); void UI_TimecodeOutputModuleConstruct(); + void UI_CameraSyncPacketGeneratorModuleConstruct(); }; #endif // MAINWINDOW_H diff --git a/mainwindow.ui b/mainwindow.ui index 12e9c20..ce34f41 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -102,7 +102,7 @@ - 4 + 5 @@ -938,6 +938,134 @@ + + + 相机同步消息上报 + + + + + 210 + 50 + 241 + 31 + + + + -1 + + + + + + 490 + 50 + 151 + 41 + + + + Read + + + + + + 20 + 50 + 101 + 31 + + + + TriggerSigType + + + + + + 490 + 100 + 151 + 41 + + + + Update + + + + + + 490 + 150 + 151 + 41 + + + + 清零包序号 + + + + + + 210 + 100 + 241 + 31 + + + + + 75 + true + + + + + + + false + + + + + + 20 + 100 + 151 + 31 + + + + ReportPeriodCount + + + + + + 20 + 150 + 151 + 31 + + + + Index + + + + + + 210 + 150 + 241 + 31 + + + +