diff --git a/libxsync b/libxsync index b6ba9ab..ae847b4 160000 --- a/libxsync +++ b/libxsync @@ -1 +1 @@ -Subproject commit b6ba9ab22e85b62aa4b573b43a753edb3f22a0d3 +Subproject commit ae847b48f919205f4a8330b35f318e4adb766f82 diff --git a/mainwindow.cpp b/mainwindow.cpp index e26f06d..4306e12 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -221,16 +221,6 @@ void MainWindow::construct_reg_table() { // push_reg(ui->gridLayoutWidget, regoff++, "ttlout4_config", reg::kttlout4_config, 0, kreg_val_type_hex); push_reg(ui->gridLayoutWidget, regoff++, "ttlout4_pulse_mode_duration", reg::kttlout4_pulse_mode_duration, 0, kreg_val_type_decimal); - // kSigGenerator_ctl - // kSigGenerator_genlock_format - // kSigGenerator_timecode_format - // kSigGenerator_control_trigger_reg - // kSigGenerator_timecode0 - // kSigGenerator_timecode1 - // kSigGenerator_timecode_start0 - // kSigGenerator_timecode_start1 - // kSigGenerator_work_state - push_reg(ui->gridLayoutWidget, regoff++, "SigGenerator_ctl", reg::kSigGenerator_ctl, 0, kreg_val_type_decimal); push_reg(ui->gridLayoutWidget, regoff++, "SigGenerator_genlock_format", reg::kSigGenerator_genlock_format, 0, kreg_val_type_decimal); push_reg(ui->gridLayoutWidget, regoff++, "SigGenerator_timecode_format", reg::kSigGenerator_timecode_format, 0, kreg_val_type_decimal); @@ -241,9 +231,18 @@ void MainWindow::construct_reg_table() { // push_reg(ui->gridLayoutWidget, regoff++, "SigGenerator_timecode_start1", reg::kSigGenerator_timecode_start1, 0, kreg_val_type_dotted_hex); push_reg(ui->gridLayoutWidget, regoff++, "SigGenerator_work_state", reg::kSigGenerator_work_state, 0, kreg_val_type_decimal); - push_reg(ui->gridLayoutWidget, regoff++, "camera_sync_out_camera_sync_select", reg::kcamera_sync_out_camera_sync_select, 0, kreg_val_type_decimal); + // ktimecode_in_timecode_sig_selt + // ktimecode_in_timecode_format + // ktimecode_in_timecode0 + // ktimecode_in_timecode1 + + push_reg(ui->gridLayoutWidget, regoff++, "timecode_in_timecode_sig_selt", reg::ktimecode_in_timecode_sig_selt, 0, kreg_val_type_decimal); + push_reg(ui->gridLayoutWidget, regoff++, "timecode_in_timecode_format", reg::ktimecode_in_timecode_format, 0, kreg_val_type_decimal); + push_reg(ui->gridLayoutWidget, regoff++, "timecode_in_timecode0", reg::ktimecode_in_timecode0, 0, kreg_val_type_dotted_hex); + push_reg(ui->gridLayoutWidget, regoff++, "timecode_in_timecode1", reg::ktimecode_in_timecode1, 0, kreg_val_type_dotted_hex); + // 设置table的高度 auto qrect = ui->gridLayoutWidget->geometry(); qrect.setHeight(31 * regoff - 1); @@ -313,6 +312,24 @@ void MainWindow::UI_CameraSyncPacketGeneratorModuleConstruct() { } } +void MainWindow::UI_TimecodeInModuleConstruct() { + ui->TimecodeInputModule_Format->clear(); + for (auto &str : TimecodeFormatStrSet()) { + ui->TimecodeInputModule_Format->addItem(QString::fromStdString(str)); + } + + ui->TimecodeInputModule_TriggerSigType->clear(); + for (auto &str : timecode_input_module::TriggerSigTypeStrSet()) { + ui->TimecodeInputModule_TriggerSigType->addItem(QString::fromStdString(str)); + } +} +void MainWindow::UI_TTLInModuleConstruct() { + ui->TTLInputModule_Index->clear(); + for (int i = 1; i <= 4; i++) { + ui->TTLInputModule_Index->addItem(QString::number(i)); + } +} + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); m_mainWindow = this; @@ -326,6 +343,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi UI_SigGeneratorConstruct(); UI_TimecodeOutputModuleConstruct(); UI_CameraSyncPacketGeneratorModuleConstruct(); + UI_TimecodeInModuleConstruct(); + UI_TTLInModuleConstruct(); /******************************************************************************* * 连接信号与槽 * @@ -589,3 +608,55 @@ void MainWindow::on_CameraSyncPacketGeneratorModule_ClearPacketIndex_clicked() { DO_XSYNC_FUNC(Xsync::Ins().CameraSyncPacketGeneratorModule_clearPacketIndex()); on_CameraSyncPacketGeneratorModule_Read_clicked(); } + +void MainWindow::on_TTLInputModule_Read_clicked() { + int32_t Index = ui->TTLInputModule_Index->currentText().toInt(); + uint32_t DivideFactor; + uint32_t FilterFactor; + bool En; + + DO_XSYNC_FUNC(Xsync::Ins().TTLInputModule_getDivideFactor(Index, DivideFactor)); + DO_XSYNC_FUNC(Xsync::Ins().TTLInputModule_getFilterFactor(Index, FilterFactor)); + DO_XSYNC_FUNC(Xsync::Ins().TTLInputModule_getEn(Index, En)); + + ui->TTLInputModule_DivideFactor->setText(QString::number(DivideFactor)); + ui->TTLInputModule_FilterFactor->setText(QString::number(FilterFactor)); + ui->TTLInputModule_En->setText(QString::number(En)); +} +void MainWindow::on_TTLInputModule_Update_clicked() { + int32_t Index = ui->TTLInputModule_Index->currentText().toInt(); + uint32_t DivideFactor; + uint32_t FilterFactor; + bool En; + + DivideFactor = ui->TTLInputModule_DivideFactor->text().toUInt(); + FilterFactor = ui->TTLInputModule_FilterFactor->text().toUInt(); + En = ui->TTLInputModule_En->text().toUInt(); + + DO_XSYNC_FUNC(Xsync::Ins().TTLInputModule_setDivideFactor(Index, DivideFactor)); + DO_XSYNC_FUNC(Xsync::Ins().TTLInputModule_setFilterFactor(Index, FilterFactor)); + DO_XSYNC_FUNC(Xsync::Ins().TTLInputModule_setEn(Index, En)); +} + +void MainWindow::on_TimecodeInputModule_Read_clicked() { + TimecodeFormat_t Format; + timecode_input_module::TriggerSigType_t TriggerSig; + XsyncTimecode_t Timecode; + + DO_XSYNC_FUNC(Xsync::Ins().TimecodeInputModule_getSrcSelect(TriggerSig)); + DO_XSYNC_FUNC(Xsync::Ins().TimecodeInputModule_getTimecodeFormat(Format)); + DO_XSYNC_FUNC(Xsync::Ins().TimecodeInputModule_getTimecode(Timecode)); + + // ZLOGI(TAG, "on_TimecodeInputModule_Read_clicked TriggerSig:%d Format:%d Timecode:%d %d %d %d", TriggerSig, Format, Timecode.hour, Timecode.minute, Timecode.second, Timecode.frame); + + ui->TimecodeInputModule_TriggerSigType->setCurrentText(QString::fromStdString(timecode_input_module::TriggerSigType2Str(TriggerSig))); + ui->TimecodeInputModule_Format->setCurrentText(QString::fromStdString(TimecodeFormatToStr(Format))); + ui->TimecodeInputModule_Timecode->setText(QString(XsyncTimecodeToStr(Timecode).c_str())); +} +void MainWindow::on_TimecodeInputModule_Update_clicked() { + auto TriggerSig = timecode_input_module::Str2TriggerSigType(ui->TimecodeInputModule_TriggerSigType->currentText().toStdString()); + TimecodeFormat_t Format = Str2TimecodeFormat(ui->TimecodeInputModule_Format->currentText().toStdString()); + + DO_XSYNC_FUNC(Xsync::Ins().TimecodeInputModule_setSrcSelect(TriggerSig)); + DO_XSYNC_FUNC(Xsync::Ins().TimecodeInputModule_setTimecodeFormat(Format)); +} diff --git a/mainwindow.h b/mainwindow.h index 45dec60..d6e5e92 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -114,6 +114,12 @@ class MainWindow : public QMainWindow { void on_CameraSyncPacketGeneratorModule_Read_clicked(); void on_CameraSyncPacketGeneratorModule_ClearPacketIndex_clicked(); + void on_TTLInputModule_Read_clicked(); + void on_TTLInputModule_Update_clicked(); + + void on_TimecodeInputModule_Read_clicked(); + void on_TimecodeInputModule_Update_clicked(); + signals: void append_log_signal(QString str); void updateUI_timeCodeInfo_signal(QString); @@ -129,5 +135,7 @@ class MainWindow : public QMainWindow { void UI_SigGeneratorConstruct(); void UI_TimecodeOutputModuleConstruct(); void UI_CameraSyncPacketGeneratorModuleConstruct(); + void UI_TimecodeInModuleConstruct(); + void UI_TTLInModuleConstruct(); }; #endif // MAINWINDOW_H diff --git a/mainwindow.ui b/mainwindow.ui index ce34f41..3d1ab11 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -19,8 +19,8 @@ 10 490 - 951 - 191 + 981 + 251 @@ -102,11 +102,11 @@ - 5 + 6 - 寄存器读写 + 寄存器1 @@ -1066,6 +1066,270 @@ + + + 时码输入模块 + + + + + 250 + 90 + 241 + 31 + + + + + + + 250 + 40 + 241 + 31 + + + + -1 + + + + + + 530 + 90 + 151 + 41 + + + + Update + + + + + + 60 + 90 + 151 + 31 + + + + TimecodeFormat + + + + + + 530 + 40 + 151 + 41 + + + + Read + + + + + + 60 + 40 + 101 + 31 + + + + TriggerSigType + + + + + + 60 + 140 + 151 + 31 + + + + Timecode + + + + + + 250 + 140 + 241 + 31 + + + + + 75 + true + + + + + + + false + + + + + + TTL输入 + + + + + 30 + 70 + 101 + 31 + + + + En + + + + + + 500 + 120 + 151 + 41 + + + + Update + + + + + + 30 + 120 + 101 + 31 + + + + FilterFactor(us) + + + + + + 30 + 170 + 161 + 31 + + + + DivideFactor(count) + + + + + + 220 + 170 + 241 + 31 + + + + + 75 + true + + + + + + + false + + + + + + 500 + 70 + 151 + 41 + + + + Read + + + + + + 30 + 21 + 81 + 31 + + + + -1 + + + + + + 220 + 120 + 241 + 31 + + + + + 75 + true + + + + + + + false + + + + + + 220 + 80 + 241 + 31 + + + + + 75 + true + + + + + + + false + + +