|
|
@ -2,8 +2,11 @@ |
|
|
|
|
|
|
|
#include <QDateTime>
|
|
|
|
#include <QtConcurrent>
|
|
|
|
#include <QtSerialPort/QSerialPort>
|
|
|
|
#include <QtSerialPort/QSerialPortInfo>
|
|
|
|
|
|
|
|
#include "./ui_mainwindow.h"
|
|
|
|
#include "logger.hpp"
|
|
|
|
#include "xsync_regs.hpp"
|
|
|
|
|
|
|
|
using namespace iflytop; |
|
|
@ -42,855 +45,50 @@ static const uint32_t str2int(QString str) { |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::log_output(QtMsgType type, const QMessageLogContext &context, const QString &msg) { |
|
|
|
QString text; |
|
|
|
text.append(msg); |
|
|
|
m_mainWindow->append_log_signal(text); |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::append_log_slot(QString text) { ui->logbrowser->append(text); } |
|
|
|
|
|
|
|
void MainWindow::updateUI_timeCodeInfo_slot(QString text) { ui->TimecodeDisplayer->setText(text); } |
|
|
|
void MainWindow::updateUI_cameraSyncInfo_slot(QString text) { ui->CameraSyncIndex->setText(text); } |
|
|
|
void MainWindow::updateUI_reg_slot(int32_t regadd, uint32_t regval) { |
|
|
|
auto it = m_regdisplayer.find(regadd); |
|
|
|
if (it != m_regdisplayer.end()) { |
|
|
|
ZLOGI(TAG, "updateUI_reg_slot %x %d", regadd, regval); |
|
|
|
it->second->regBrowser->setText(QString::number(regval, 16)); |
|
|
|
} |
|
|
|
// QString text;
|
|
|
|
// text.append(msg);
|
|
|
|
} |
|
|
|
// void MainWindow::append_log_slot(QString text) { ui->logbrowser->append(text); }
|
|
|
|
void MainWindow::doinui_slot(QFunction func) { |
|
|
|
if (func.get()) func.get()(); |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::push_reg(QWidget *parent, int off, const char *regname, int32_t regadd, int32_t rwflag, reg_val_type_t regvaltype) { |
|
|
|
DispalyRegIterm *regitem = new DispalyRegIterm(); |
|
|
|
regitem->regvaltype = regvaltype; |
|
|
|
{ |
|
|
|
auto *label = new QLabel(parent); |
|
|
|
label->setObjectName(QString::fromUtf8("label")); |
|
|
|
label->setText(QString(fmt("%s(0x%04x)", regname, regadd))); |
|
|
|
QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Expanding); |
|
|
|
sizePolicy1.setHorizontalStretch(0); |
|
|
|
sizePolicy1.setVerticalStretch(0); |
|
|
|
sizePolicy1.setHeightForWidth(label->sizePolicy().hasHeightForWidth()); |
|
|
|
label->setSizePolicy(sizePolicy1); |
|
|
|
label->setMinimumSize(QSize(300, 0)); |
|
|
|
label->setMaximumSize(QSize(16777215, 16777215)); |
|
|
|
ui->reg_table->addWidget(label, off, 0, 1, 1); |
|
|
|
regitem->label = label; |
|
|
|
} |
|
|
|
{ |
|
|
|
auto *textbrowser = new QTextBrowser(parent); |
|
|
|
textbrowser->setObjectName(QString::fromUtf8("textbrowser")); |
|
|
|
textbrowser->setEnabled(true); |
|
|
|
textbrowser->setText(QString("unset")); |
|
|
|
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
|
|
sizePolicy.setHorizontalStretch(0); |
|
|
|
sizePolicy.setVerticalStretch(0); |
|
|
|
sizePolicy.setHeightForWidth(textbrowser->sizePolicy().hasHeightForWidth()); |
|
|
|
|
|
|
|
textbrowser->setSizePolicy(sizePolicy); |
|
|
|
textbrowser->setMaximumSize(QSize(16777215, 16777215)); |
|
|
|
|
|
|
|
ui->reg_table->addWidget(textbrowser, off, 1, 1, 1); |
|
|
|
regitem->regBrowser = textbrowser; |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
auto *textEdit = new QTextEdit(parent); |
|
|
|
textEdit->setObjectName(QString::fromUtf8("textEdit")); |
|
|
|
textEdit->setEnabled(true); |
|
|
|
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
|
|
sizePolicy.setHorizontalStretch(0); |
|
|
|
sizePolicy.setVerticalStretch(0); |
|
|
|
sizePolicy.setHeightForWidth(textEdit->sizePolicy().hasHeightForWidth()); |
|
|
|
|
|
|
|
textEdit->setSizePolicy(sizePolicy); |
|
|
|
textEdit->setMaximumSize(QSize(16777215, 16777215)); |
|
|
|
|
|
|
|
ui->reg_table->addWidget(textEdit, off, 2, 1, 1); |
|
|
|
regitem->regEditer = textEdit; |
|
|
|
} |
|
|
|
{ |
|
|
|
// new button
|
|
|
|
auto *button = new QPushButton(parent); |
|
|
|
button->setObjectName(QString::fromUtf8("button")); |
|
|
|
button->setText(QString("Write")); |
|
|
|
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
|
|
|
sizePolicy.setHorizontalStretch(0); |
|
|
|
sizePolicy.setVerticalStretch(0); |
|
|
|
sizePolicy.setHeightForWidth(button->sizePolicy().hasHeightForWidth()); |
|
|
|
button->setSizePolicy(sizePolicy); |
|
|
|
|
|
|
|
// connect(this,
|
|
|
|
connect(button, &QPushButton::clicked, [this, regadd](bool) { //
|
|
|
|
QString regval_str = m_regdisplayer[regadd]->regEditer->toPlainText(); |
|
|
|
uint32_t regval = str2int(regval_str); |
|
|
|
ZLOGI(TAG, "write reg 0x%04x %d", regadd, regval); |
|
|
|
|
|
|
|
uint32_t readbackval = 0; |
|
|
|
auto ecode = XsyncIns()->reg_write(regadd, regval, readbackval); |
|
|
|
if (ecode == kxs_ec_success) { |
|
|
|
ZLOGI(TAG, "write reg 0x%04x %d success", regadd, regval); |
|
|
|
m_regdisplayer[regadd]->regvalcache = readbackval; |
|
|
|
updateUI_reg(regadd); |
|
|
|
} else { |
|
|
|
ZLOGE(TAG, "write reg 0x%04x %d fail,ecode:%s", regadd, regval, xs_error_code_2_str(ecode)); |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
regitem->writerButton = button; |
|
|
|
ui->reg_table->addWidget(button, off, 3, 1, 1); |
|
|
|
} |
|
|
|
m_regdisplayer[regadd] = regitem; |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::updateUI_reg(uint32_t regoff) { |
|
|
|
// m_regdisplayer[regoff]->regBrowser->setText("0x" + QString::number(regValue, 16));
|
|
|
|
|
|
|
|
uint32_t regval = m_regdisplayer[regoff]->regvalcache; |
|
|
|
auto *regBrowser = m_regdisplayer[regoff]->regBrowser; |
|
|
|
reg_val_type_t regvaltype = m_regdisplayer[regoff]->regvaltype; |
|
|
|
|
|
|
|
if (regvaltype == kreg_val_type_dotted_hex) { |
|
|
|
regBrowser->setText(QString(fmt("%02x.%02x.%02x.%02x", (regval >> 0) & 0xff, (regval >> 8) & 0xff, (regval >> 16) & 0xff, (regval >> 24) & 0xff))); |
|
|
|
} else if (regvaltype == kreg_val_type_dotted_decimal) { |
|
|
|
regBrowser->setText(QString(fmt("%d.%d.%d.%d", (regval >> 0) & 0xff, (regval >> 8) & 0xff, (regval >> 16) & 0xff, (regval >> 24) & 0xff))); |
|
|
|
} else if (regvaltype == kreg_val_type_str) { |
|
|
|
char text[5] = {0}; |
|
|
|
memcpy(text, ®val, 4); |
|
|
|
regBrowser->setText(QString(text)); |
|
|
|
} else if (regvaltype == kreg_val_type_hex) { |
|
|
|
regBrowser->setText(QString(fmt("0x%08x", regval))); |
|
|
|
} else if (regvaltype == kreg_val_type_decimal) { |
|
|
|
regBrowser->setText(QString::number(regval, 10)); |
|
|
|
} else if (regvaltype == kreg_val_type_binary) { |
|
|
|
regBrowser->setText(QString::number(regval, 2)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::construct_reg_table() { //
|
|
|
|
int regoff = 1; |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "software_version", reg::ksoftware_version, 0, kreg_val_type_dotted_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "manufacturer0", reg::kmanufacturer0, 0, kreg_val_type_str); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "manufacturer1", reg::kmanufacturer1, 0, kreg_val_type_str); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "product_type_id", reg::kproduct_type_id, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sn_id0", reg::ksn_id0, 0, kreg_val_type_dotted_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sn_id1", reg::ksn_id1, 0, kreg_val_type_dotted_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sn_id2", reg::ksn_id2, 0, kreg_val_type_dotted_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "mac0", reg::kmac0, 0, kreg_val_type_dotted_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "mac1", reg::kmac1, 0, kreg_val_type_dotted_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "stm32_ip", reg::kstm32_ip, 0, kreg_val_type_dotted_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "stm32_gw", reg::kstm32_gw, 0, kreg_val_type_dotted_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "stm32_netmask", reg::kstm32_netmask, 0, kreg_val_type_dotted_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "stm32_camera_sync_signal_count", reg::kstm32_camera_sync_signal_count, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "fpga_reg_test_reg0", reg::kfpga_info_reg0, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "fpga_reg_test_reg1", reg::kfpga_info_reg1, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "fpga_reg_test_reg2", reg::kfpga_info_reg2, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "fpga_reg_test_reg3", reg::kfpga_info_reg3, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "fpga_reg_test_reg4", reg::kfpga_info_reg4, 0, kreg_val_type_hex); |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlin_module", reg::k_ttlin_module, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlin_en_reg", reg::k_ttlin_en_reg, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlin1_freq_detector_reg", reg::k_ttlin1_freq_detector_reg, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlin2_freq_detector_reg", reg::k_ttlin2_freq_detector_reg, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlin3_freq_detector_reg", reg::k_ttlin3_freq_detector_reg, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlin4_freq_detector_reg", reg::k_ttlin4_freq_detector_reg, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlin1_filter_factor_reg", reg::k_ttlin1_filter_factor_reg, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlin2_filter_factor_reg", reg::k_ttlin2_filter_factor_reg, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlin3_filter_factor_reg", reg::k_ttlin3_filter_factor_reg, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlin4_filter_factor_reg", reg::k_ttlin4_filter_factor_reg, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* TIMECODE输入模块 * |
|
|
|
*******************************************************************************/ |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "internal_timecode_module", reg::internal_timecode_module, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "internal_timecode_en", reg::internal_timecode_en, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "internal_timecode_format", reg::internal_timecode_format, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "internal_timecode_data0", reg::internal_timecode_data0, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "internal_timecode_data1", reg::internal_timecode_data1, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "external_timecode_module", reg::external_timecode_module, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "external_timecode_sig_selt", reg::external_timecode_sig_selt, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "external_timecode_format", reg::external_timecode_format, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "external_timecode_code0", reg::external_timecode_code0, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "external_timecode_code1", reg::external_timecode_code1, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_timecode_module", reg::sys_timecode_module, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_timecode_select", reg::sys_timecode_select, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_timecode_format", reg::sys_timecode_format, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_timecode_data0", reg::sys_timecode_data0, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_timecode_data1", reg::sys_timecode_data1, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "timecode_output_module", reg::timecode_output_module, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "timecode_output_timecode0", reg::timecode_output_timecode0, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "timecode_output_timecode1", reg::timecode_output_timecode1, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "timecode_output_timecode_format", reg::timecode_output_timecode_format, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "timecode_output_bnc_outut_level_select", reg::timecode_output_bnc_outut_level_select, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* TTL输出模块配置 * |
|
|
|
*******************************************************************************/ |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout1_module", reg::kreg_ttlout1_module, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout1_signal_process_mode", reg::kreg_ttlout1_signal_process_mode, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout1_input_signal_select", reg::kreg_ttlout1_input_signal_select, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout1_pllout_freq_division_ctrl", reg::kreg_ttlout1_pllout_freq_division_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout1_pllout_freq_multiplication_ctrl", reg::kreg_ttlout1_pllout_freq_multiplication_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout1_pllout_polarity_ctrl", reg::kreg_ttlout1_pllout_polarity_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout1_pllout_trigger_edge_select", reg::kreg_ttlout1_pllout_trigger_edge_select, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout1_forward_mode_polarity_ctrl", reg::kreg_ttlout1_forward_mode_polarity_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout1_freq_detect_bias", reg::kreg_ttlout1_freq_detect_bias, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout1_placeholder0", reg::kreg_ttlout1_placeholder0, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout1_sig_in_freq_detect", reg::kreg_ttlout1_sig_in_freq_detect, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout1_sig_out_freq_detect", reg::kreg_ttlout1_sig_out_freq_detect, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout2_module", reg::kreg_ttlout2_module, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout2_signal_process_mode", reg::kreg_ttlout2_signal_process_mode, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout2_input_signal_select", reg::kreg_ttlout2_input_signal_select, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout2_pllout_freq_division_ctrl", reg::kreg_ttlout2_pllout_freq_division_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout2_pllout_freq_multiplication_ctrl", reg::kreg_ttlout2_pllout_freq_multiplication_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout2_pllout_polarity_ctrl", reg::kreg_ttlout2_pllout_polarity_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout2_pllout_trigger_edge_select", reg::kreg_ttlout2_pllout_trigger_edge_select, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout2_forward_mode_polarity_ctrl", reg::kreg_ttlout2_forward_mode_polarity_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout2_freq_detect_bias", reg::kreg_ttlout2_freq_detect_bias, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout2_placeholder0", reg::kreg_ttlout2_placeholder0, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout2_sig_in_freq_detect", reg::kreg_ttlout2_sig_in_freq_detect, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout2_sig_out_freq_detect", reg::kreg_ttlout2_sig_out_freq_detect, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout3_module", reg::kreg_ttlout3_module, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout3_signal_process_mode", reg::kreg_ttlout3_signal_process_mode, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout3_input_signal_select", reg::kreg_ttlout3_input_signal_select, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout3_pllout_freq_division_ctrl", reg::kreg_ttlout3_pllout_freq_division_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout3_pllout_freq_multiplication_ctrl", reg::kreg_ttlout3_pllout_freq_multiplication_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout3_pllout_polarity_ctrl", reg::kreg_ttlout3_pllout_polarity_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout3_pllout_trigger_edge_select", reg::kreg_ttlout3_pllout_trigger_edge_select, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout3_forward_mode_polarity_ctrl", reg::kreg_ttlout3_forward_mode_polarity_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout3_freq_detect_bias", reg::kreg_ttlout3_freq_detect_bias, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout3_placeholder0", reg::kreg_ttlout3_placeholder0, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout3_sig_in_freq_detect", reg::kreg_ttlout3_sig_in_freq_detect, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout3_sig_out_freq_detect", reg::kreg_ttlout3_sig_out_freq_detect, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout4_module", reg::kreg_ttlout4_module, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout4_signal_process_mode", reg::kreg_ttlout4_signal_process_mode, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout4_input_signal_select", reg::kreg_ttlout4_input_signal_select, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout4_pllout_freq_division_ctrl", reg::kreg_ttlout4_pllout_freq_division_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout4_pllout_freq_multiplication_ctrl", reg::kreg_ttlout4_pllout_freq_multiplication_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout4_pllout_polarity_ctrl", reg::kreg_ttlout4_pllout_polarity_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout4_pllout_trigger_edge_select", reg::kreg_ttlout4_pllout_trigger_edge_select, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout4_forward_mode_polarity_ctrl", reg::kreg_ttlout4_forward_mode_polarity_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout4_freq_detect_bias", reg::kreg_ttlout4_freq_detect_bias, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout4_placeholder0", reg::kreg_ttlout4_placeholder0, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout4_sig_in_freq_detect", reg::kreg_ttlout4_sig_in_freq_detect, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "ttlout4_sig_out_freq_detect", reg::kreg_ttlout4_sig_out_freq_detect, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "external_genlock_module", reg::external_genlock_module, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "external_genlock_freq_detect_bias", reg::external_genlock_freq_detect_bias, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "external_genlock_freq", reg::external_genlock_freq, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "internal_genlock_module", reg::internal_genlock_module, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "internal_genlock_ctrl_mode", reg::internal_genlock_ctrl_mode, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "internal_genlock_en", reg::internal_genlock_en, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "internal_genlock_format", reg::internal_genlock_format, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "internal_genlock_freq", reg::internal_genlock_freq, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_genlock_module", reg::sys_genlock_module, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_genlock_source", reg::sys_genlock_source, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_genlock_freq_detect_bias", reg::sys_genlock_freq_detect_bias, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_genlock_freq", reg::sys_genlock_freq, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "internal_clock_module", reg::internal_clock_module, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "internal_clock_ctrl_mode", reg::internal_clock_ctrl_mode, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "internal_clock_en", reg::internal_clock_en, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "internal_clock_freq", reg::internal_clock_freq, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_clock_module", reg::sys_clock_module, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_clock_source", reg::sys_clock_source, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_clock_freq_division_ctrl", reg::sys_clock_freq_division_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_clock_freq_multiplication_ctrl", reg::sys_clock_freq_multiplication_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_clock_freq_detect_bias", reg::sys_clock_freq_detect_bias, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_clock_trigger_edge_select", reg::sys_clock_trigger_edge_select, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_clock_infreq_detect", reg::sys_clock_infreq_detect, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "sys_clock_outfreq_detect", reg::sys_clock_outfreq_detect, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "record_sig_gen_module", reg::record_sig_gen_module, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "record_sig_gen_ctrl_control_mode", reg::record_sig_gen_ctrl_control_mode, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "record_sig_gen_timecode_start0", reg::record_sig_gen_timecode_start0, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "record_sig_gen_timecode_start1", reg::record_sig_gen_timecode_start1, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "record_sig_gen_timecode_stop0", reg::record_sig_gen_timecode_stop0, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "record_sig_gen_timecode_stop1", reg::record_sig_gen_timecode_stop1, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "record_sig_gen_timecode_control_flag", reg::record_sig_gen_timecode_control_flag, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "record_sig_gen_ttlin_trigger_sig_source", reg::record_sig_gen_ttlin_trigger_sig_source, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "record_sig_gen_ttlin_trigger_level", reg::record_sig_gen_ttlin_trigger_level, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "record_sig_gen_exposure_time", reg::record_sig_gen_exposure_time, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "record_sig_gen_exposure_offset_time", reg::record_sig_gen_exposure_offset_time, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "record_sig_gen_manual_ctrl", reg::record_sig_gen_manual_ctrl, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "record_sig_gen_timecode_snapshot0", reg::record_sig_gen_timecode_snapshot0, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "record_sig_gen_timecode_snapshot1", reg::record_sig_gen_timecode_snapshot1, 0, kreg_val_type_decimal); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "record_sig_gen_record_state", reg::record_sig_gen_record_state, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "camera_sync_module", reg::camera_sync_module, 0, kreg_val_type_hex); |
|
|
|
push_reg(ui->gridLayoutWidget, regoff++, "camera_sync_pulse_mode_valid_len", reg::camera_sync_pulse_mode_valid_len, 0, kreg_val_type_decimal); |
|
|
|
|
|
|
|
auto qrect = ui->gridLayoutWidget->geometry(); |
|
|
|
qrect.setHeight(31 * regoff - 1); |
|
|
|
ui->scrollAreaWidgetContents->setMinimumHeight(31 * (regoff + 10) - 1); |
|
|
|
ui->gridLayoutWidget->setGeometry(qrect); |
|
|
|
} |
|
|
|
//
|
|
|
|
|
|
|
|
void MainWindow::UI_TimecodePageConstruct() { |
|
|
|
ui->InternalTimecode_Format->clear(); |
|
|
|
for (auto &str : TimecodeFormatStrSet()) { |
|
|
|
ui->InternalTimecode_Format->addItem(QString::fromStdString(str)); |
|
|
|
} |
|
|
|
|
|
|
|
ui->ExternalTimecode_Format->clear(); |
|
|
|
for (auto &str : TimecodeFormatStrSet()) { |
|
|
|
ui->ExternalTimecode_Format->addItem(QString::fromStdString(str)); |
|
|
|
} |
|
|
|
|
|
|
|
ui->ExternalTimecode_Source->clear(); |
|
|
|
ui->ExternalTimecode_Source->addItem(QString::fromStdString(InputInterface2Str(INPUT_IF_TIMECODE_BNC))); |
|
|
|
ui->ExternalTimecode_Source->addItem(QString::fromStdString(InputInterface2Str(INPUT_IF_TIMECODE_HEADPHONE))); |
|
|
|
|
|
|
|
ui->SysTimecode_Source->clear(); |
|
|
|
ui->SysTimecode_Source->addItem(QString::fromStdString("0")); |
|
|
|
ui->SysTimecode_Source->addItem(QString::fromStdString("1")); |
|
|
|
} |
|
|
|
|
|
|
|
// void MainWindow::UI_CameraSyncPacketGeneratorModuleConstruct() {
|
|
|
|
// ui->CameraSyncPacketGeneratorModule_TriggerSig->clear();
|
|
|
|
// for (auto &str : camera_sync_packet_generator_module::TriggerSigTypeStrSet()) {
|
|
|
|
// ui->CameraSyncPacketGeneratorModule_TriggerSig->addItem(QString::fromStdString(str));
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
void MainWindow::UI_TTLPageConstruct() { |
|
|
|
QStringList list; |
|
|
|
|
|
|
|
list.push_back(QString::fromStdString(SignalType2Str(SIGNAL_LOGIC0))); |
|
|
|
list.push_back(QString::fromStdString(SignalType2Str(SIGNAL_LOGIC1))); |
|
|
|
list.push_back(QString::fromStdString(SignalType2Str(SIGNAL_TTLIN1))); |
|
|
|
list.push_back(QString::fromStdString(SignalType2Str(SIGNAL_TTLIN2))); |
|
|
|
list.push_back(QString::fromStdString(SignalType2Str(SIGNAL_TTLIN3))); |
|
|
|
list.push_back(QString::fromStdString(SignalType2Str(SIGNAL_TTLIN4))); |
|
|
|
list.push_back(QString::fromStdString(SignalType2Str(SIGNAL_SYS_CLK_OUTPUT))); |
|
|
|
list.push_back(QString::fromStdString(SignalType2Str(SIGNAL_SYS_GENLOCK_OUTPUT))); |
|
|
|
list.push_back(QString::fromStdString(SignalType2Str(SIGNAL_SYS_TIMECODE_FREQ_OUTPUT))); |
|
|
|
list.push_back(QString::fromStdString(SignalType2Str(SIGNAL_BUSINESS_RECORD_SIG))); |
|
|
|
list.push_back(QString::fromStdString(SignalType2Str(SIGNAL_BUSINESS_RECORD_EXPOSURE_SIG))); |
|
|
|
|
|
|
|
ui->TTLOutputModule_SrcSigType_1->clear(); |
|
|
|
ui->TTLOutputModule_SrcSigType_1->addItems(list); |
|
|
|
|
|
|
|
ui->TTLOutputModule_SrcSigType_2->clear(); |
|
|
|
ui->TTLOutputModule_SrcSigType_2->addItems(list); |
|
|
|
|
|
|
|
ui->TTLOutputModule_SrcSigType_3->clear(); |
|
|
|
ui->TTLOutputModule_SrcSigType_3->addItems(list); |
|
|
|
|
|
|
|
ui->TTLOutputModule_SrcSigType_4->clear(); |
|
|
|
ui->TTLOutputModule_SrcSigType_4->addItems(list); |
|
|
|
} |
|
|
|
void MainWindow::UI_GenlockPageConstruct() { |
|
|
|
//
|
|
|
|
// ui->ExternalGenlock_Source->clear();
|
|
|
|
|
|
|
|
ui->InternalGenlock_Format->clear(); |
|
|
|
for (auto &str : GenlockFormatStrSet()) { |
|
|
|
ui->InternalGenlock_Format->addItem(QString::fromStdString(str)); |
|
|
|
} |
|
|
|
|
|
|
|
ui->SysGenlock_Src->clear(); |
|
|
|
ui->SysGenlock_Src->addItem(QString::fromStdString("0")); |
|
|
|
ui->SysGenlock_Src->addItem(QString::fromStdString("1")); |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::UI_SysClockPageConstruct() { |
|
|
|
ui->SysClock_Src->clear(); |
|
|
|
|
|
|
|
ui->SysClock_Src->addItem(QString::fromStdString(SignalType2Str(SIGNAL_TTLIN1))); |
|
|
|
ui->SysClock_Src->addItem(QString::fromStdString(SignalType2Str(SIGNAL_TTLIN2))); |
|
|
|
ui->SysClock_Src->addItem(QString::fromStdString(SignalType2Str(SIGNAL_TTLIN3))); |
|
|
|
ui->SysClock_Src->addItem(QString::fromStdString(SignalType2Str(SIGNAL_TTLIN4))); |
|
|
|
ui->SysClock_Src->addItem(QString::fromStdString(SignalType2Str(SIGNAL_INTERNAL_CLOCK_SIG))); |
|
|
|
ui->SysClock_Src->addItem(QString::fromStdString(SignalType2Str(SIGNAL_SYS_GENLOCK_OUTPUT))); |
|
|
|
ui->SysClock_Src->addItem(QString::fromStdString(SignalType2Str(SIGNAL_SYS_TIMECODE_FREQ_OUTPUT))); |
|
|
|
} |
|
|
|
void MainWindow::UI_RecordSigGenConstruct() { |
|
|
|
ui->RecordSigGenerator_ContrlMode->clear(); |
|
|
|
ui->RecordSigGenerator_ContrlMode->addItem(QString::fromStdString(ControlMode2Str(CONTROLMODE_MANUAL_TRIGGER))); |
|
|
|
ui->RecordSigGenerator_ContrlMode->addItem(QString::fromStdString(ControlMode2Str(CONTROLMODE_TIMECODE_TRIGGER))); |
|
|
|
ui->RecordSigGenerator_ContrlMode->addItem(QString::fromStdString(ControlMode2Str(CONTROLMODE_EXTERNALTTL_TRIGGER))); |
|
|
|
|
|
|
|
ui->RecordSigGenerator_ExternalTTLTriggerSrc->clear(); |
|
|
|
ui->RecordSigGenerator_ExternalTTLTriggerSrc->addItem(QString::fromStdString(InputInterface2Str(INPUT_IF_TTL1))); |
|
|
|
ui->RecordSigGenerator_ExternalTTLTriggerSrc->addItem(QString::fromStdString(InputInterface2Str(INPUT_IF_TTL2))); |
|
|
|
ui->RecordSigGenerator_ExternalTTLTriggerSrc->addItem(QString::fromStdString(InputInterface2Str(INPUT_IF_TTL3))); |
|
|
|
ui->RecordSigGenerator_ExternalTTLTriggerSrc->addItem(QString::fromStdString(InputInterface2Str(INPUT_IF_TTL4))); |
|
|
|
} |
|
|
|
|
|
|
|
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { |
|
|
|
ui->setupUi(this); |
|
|
|
m_mainWindow = this; |
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief 填充部分UI |
|
|
|
*/ |
|
|
|
construct_reg_table(); |
|
|
|
qInstallMessageHandler(log_output); |
|
|
|
UI_TimecodePageConstruct(); |
|
|
|
// UI_CameraSyncPacketGeneratorModuleConstruct();
|
|
|
|
UI_TTLPageConstruct(); |
|
|
|
UI_GenlockPageConstruct(); |
|
|
|
UI_SysClockPageConstruct(); |
|
|
|
UI_RecordSigGenConstruct(); |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* 连接信号与槽 * |
|
|
|
*******************************************************************************/ |
|
|
|
|
|
|
|
qRegisterMetaType<int32_t>("int32_t"); |
|
|
|
qRegisterMetaType<uint32_t>("uint32_t"); |
|
|
|
qRegisterMetaType<function<void()>>("function<void()>"); |
|
|
|
qRegisterMetaType<QFunction>("QFunction"); |
|
|
|
|
|
|
|
XSyncUdpFactoryImpl::Ins()->initialize(); |
|
|
|
connect(this, SIGNAL(append_log_signal(QString)), this, SLOT(append_log_slot(QString))); |
|
|
|
connect(this, SIGNAL(updateUI_timeCodeInfo_signal(QString)), this, SLOT(updateUI_timeCodeInfo_slot(QString))); |
|
|
|
connect(this, SIGNAL(updateUI_cameraSyncInfo_signal(QString)), this, SLOT(updateUI_cameraSyncInfo_slot(QString))); |
|
|
|
connect(this, SIGNAL(updateUI_reg_signal(int32_t, uint32_t)), this, SLOT(updateUI_reg_slot(int32_t, uint32_t))); |
|
|
|
// qInstallMessageHandler(log_output);
|
|
|
|
connect(this, SIGNAL(doinui_signal(QFunction)), this, SLOT(doinui_slot(QFunction))); |
|
|
|
m_thread.reset(new ZQThread("test", [this]() { mainWindowsRun(); })); |
|
|
|
m_thread->start(); |
|
|
|
|
|
|
|
// m_xsync.reset(new Xsync());
|
|
|
|
|
|
|
|
// XsyncIns()->initialize(XSyncUdpFactoryImpl::Ins());
|
|
|
|
XsyncInit(XSyncUdpFactoryImpl::Ins(), "192.168.8.10"); |
|
|
|
XsyncIns()->registerOnTimecodeMsgCallback([this](XsyncTimecode_t *timecode_msg) { //
|
|
|
|
XsyncTimecode_t timecode = *timecode_msg; |
|
|
|
QString text = QString(fmt("%02d:%02d:%02d:%02d", timecode.hour, timecode.minute, timecode.second, timecode.frame)); |
|
|
|
updateUI_timeCodeInfo_signal(text); |
|
|
|
}); |
|
|
|
|
|
|
|
XsyncIns()->registerOnCameraSyncMsgCallback([this](xysnc_camera_sync_data_t *camera_sync_msg) { //
|
|
|
|
xysnc_camera_sync_data_t camera_sync_data = *camera_sync_msg; |
|
|
|
updateUI_cameraSyncInfo_signal(QString(fmt("%d", camera_sync_data.frameIndex))); |
|
|
|
}); |
|
|
|
|
|
|
|
XsyncIns()->registerOnRecordSigChangeMsgCallback([this](uint32_t recordSig, XsyncTimecode_t *timecode_msg) { //
|
|
|
|
XsyncTimecode_t timecodecpy = *timecode_msg; |
|
|
|
QString timecodeStr = QString(fmt("%02d:%02d:%02d:%02d", timecodecpy.hour, timecodecpy.minute, timecodecpy.second, timecodecpy.frame)); |
|
|
|
emit doinui_signal(QFunction([this, recordSig, timecodeStr]() { |
|
|
|
ui->WorkState->setText(QString::number(recordSig)); |
|
|
|
ui->WorkState_Timecode->setText(timecodeStr); |
|
|
|
})); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
MainWindow::~MainWindow() { delete ui; } |
|
|
|
|
|
|
|
#define XS_ASSERT(exptr) \
|
|
|
|
{ \ |
|
|
|
auto ecode = exptr; \ |
|
|
|
while (!(ecode == kxs_ec_success)) { \ |
|
|
|
ZLOGE(TAG, "do: %s fail,ecode:%d", #exptr, ecode); \ |
|
|
|
ZQThread::sleep(1); \ |
|
|
|
} \ |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::on_RefreshRegsButton_clicked() { //
|
|
|
|
ZLOGI(TAG, "on_refreshRegsButton_clicked"); |
|
|
|
// int32_t _t1, uint32_t _t2
|
|
|
|
|
|
|
|
QtConcurrent::run([this]() { |
|
|
|
bool suc = true; |
|
|
|
for (auto ® : m_regdisplayer) { |
|
|
|
uint32_t regValue = 0; |
|
|
|
auto ecode = XsyncIns()->reg_read(reg.first, regValue); |
|
|
|
int regoff = reg.first; |
|
|
|
|
|
|
|
if (ecode == kxs_ec_success) { |
|
|
|
ZLOGI(TAG, "reg_read %x success", reg.first); |
|
|
|
m_regdisplayer[regoff]->regvalcache = regValue; |
|
|
|
emit doinui_signal(QFunction([this, regoff, regValue]() { updateUI_reg(regoff); })); |
|
|
|
} else { |
|
|
|
emit doinui_signal(QFunction([this, regoff, regValue]() { |
|
|
|
m_regdisplayer[regoff]->regvalcache = 0; |
|
|
|
m_regdisplayer[regoff]->regBrowser->setText("error"); |
|
|
|
})); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
void MainWindow::on_ClearLogButton_clicked() { //
|
|
|
|
ui->logbrowser->clear(); |
|
|
|
} |
|
|
|
void MainWindow::on_Connect2XsyncButton_clicked() { //
|
|
|
|
XsyncIns()->changeXsyncIp(ui->IpInput->text().toStdString()); |
|
|
|
} |
|
|
|
void MainWindow::mainWindowsRun() { //
|
|
|
|
} |
|
|
|
|
|
|
|
#define DO_XSYNC_FUNC(exptr) \
|
|
|
|
{ \ |
|
|
|
auto ecode = exptr; \ |
|
|
|
if (!(ecode == kxs_ec_success)) { \ |
|
|
|
ZLOGE(TAG, "do: %s fail,ecode:[%d](%s)", #exptr, ecode, xs_error_code_2_str(ecode)); \ |
|
|
|
return; \ |
|
|
|
} else { \ |
|
|
|
ZLOGI(TAG, "do: %s success", #exptr); \ |
|
|
|
} \ |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::on_GenNewMac_clicked() { DO_XSYNC_FUNC(XsyncIns()->generatorNewMac()); } |
|
|
|
void MainWindow::on_FactoryReset_clicked() { DO_XSYNC_FUNC(XsyncIns()->factoryReset()); } |
|
|
|
void MainWindow::on_Reboot_clicked() { DO_XSYNC_FUNC(XsyncIns()->reboot()); } |
|
|
|
void MainWindow::on_ChangeNetCfg_clicked() { //
|
|
|
|
DO_XSYNC_FUNC(XsyncIns()->changeNetworkConfig(ui->ChangeNetCfg_ip->text().toStdString(), ui->ChangeNetCfg_mask->text().toStdString(), ui->ChangeNetCfg_gateway->text().toStdString())); |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::on_TimecodePage_Read_clicked() { |
|
|
|
TimecodeFormat_t InternalTimecode_Format; |
|
|
|
XsyncTimecode_t InternalTimecode_Code; |
|
|
|
TimecodeFormat_t ExternalTimecode_Format; |
|
|
|
InputInterface_t ExternalTimecode_Source; |
|
|
|
XsyncTimecode_t ExternalTimecode_Code; |
|
|
|
uint32_t SysTimecode_Source; |
|
|
|
TimecodeFormat_t SysTimecode_Format; |
|
|
|
XsyncTimecode_t SysTimecode_Code; |
|
|
|
|
|
|
|
DO_XSYNC_FUNC(XsyncIns()->InternalTimecode_getFormat(InternalTimecode_Format)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->InternalTimecode_getCode(InternalTimecode_Code)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->ExternalTimecode_getFormat(ExternalTimecode_Format)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->ExternalTimecode_getSource(ExternalTimecode_Source)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->ExternalTimecode_readCode(ExternalTimecode_Code)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->SysTimecode_getSource(SysTimecode_Source)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->SysTimecode_readFormat(SysTimecode_Format)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->SysTimecode_readCode(SysTimecode_Code)); |
|
|
|
|
|
|
|
ui->InternalTimecode_Format->setCurrentText(QString::fromStdString(TimecodeFormatToStr(InternalTimecode_Format))); |
|
|
|
ui->InternalTimecode_Code->setText(QString(XsyncTimecodeToStr(InternalTimecode_Code).c_str())); |
|
|
|
ui->ExternalTimecode_Format->setCurrentText(QString::fromStdString(TimecodeFormatToStr(ExternalTimecode_Format))); |
|
|
|
ui->ExternalTimecode_Source->setCurrentText(QString::fromStdString(InputInterface2Str(ExternalTimecode_Source))); |
|
|
|
ui->ExternalTimecode_Code->setText(QString(XsyncTimecodeToStr(ExternalTimecode_Code).c_str())); |
|
|
|
ui->SysTimecode_Source->setCurrentText(QString::number(SysTimecode_Source)); |
|
|
|
ui->SysTimecode_Format->setText(QString::fromStdString(TimecodeFormatToStr(SysTimecode_Format))); |
|
|
|
ui->SysTimecode_Code->setText(QString(XsyncTimecodeToStr(SysTimecode_Code).c_str())); |
|
|
|
} |
|
|
|
void MainWindow::on_TimecodePage_Update_clicked() { |
|
|
|
TimecodeFormat_t InternalTimecode_Format = Str2TimecodeFormat(ui->InternalTimecode_Format->currentText().toStdString()); |
|
|
|
XsyncTimecode_t InternalTimecode_Code = Str2XsyncTimecode(ui->InternalTimecode_Code->text().toStdString()); |
|
|
|
TimecodeFormat_t ExternalTimecode_Format = Str2TimecodeFormat(ui->ExternalTimecode_Format->currentText().toStdString()); |
|
|
|
InputInterface_t ExternalTimecode_Source = Str2InputInterface(ui->ExternalTimecode_Source->currentText().toStdString()); |
|
|
|
uint32_t SysTimecode_Source = ui->SysTimecode_Source->currentText().toInt(); |
|
|
|
|
|
|
|
DO_XSYNC_FUNC(XsyncIns()->InternalTimecode_setFormat(InternalTimecode_Format)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->InternalTimecode_setCode(InternalTimecode_Code)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->ExternalTimecode_setFormat(ExternalTimecode_Format)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->ExternalTimecode_setSource(ExternalTimecode_Source)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->SysTimecode_setSource(SysTimecode_Source)); |
|
|
|
} |
|
|
|
|
|
|
|
// void MainWindow::on_CameraSyncPacketGeneratorModule_ClearPacketIndex_clicked() {
|
|
|
|
// DO_XSYNC_FUNC(XsyncIns()->CameraSyncPacketGeneratorModule_clearPacketIndex());
|
|
|
|
// on_CameraSyncPacketGeneratorModule_Read_clicked();
|
|
|
|
// }
|
|
|
|
|
|
|
|
void MainWindow::on_tabWidget_currentChanged(int index) { |
|
|
|
on_RefreshRegsButton_clicked(); |
|
|
|
on_TimecodePage_Read_clicked(); |
|
|
|
on_TTLPage_Read_clicked(); |
|
|
|
on_GenlockPage_Read_clicked(); |
|
|
|
on_SysClockPage_Read_clicked(); |
|
|
|
on_RecordSigGen_Read_clicked(); |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::on_TTLInputModule_Index_currentIndexChanged(int index) {} |
|
|
|
void MainWindow::on_TTLOutputMoudle_ID_currentIndexChanged(int index) {} |
|
|
|
|
|
|
|
void MainWindow::on_TTLPage_Read_clicked() { |
|
|
|
{ |
|
|
|
float freq1 = 0; |
|
|
|
float freq2 = 0; |
|
|
|
float freq3 = 0; |
|
|
|
float freq4 = 0; |
|
|
|
bool En; |
|
|
|
|
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLInputModule1_detectFreq(freq1)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLInputModule2_detectFreq(freq2)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLInputModule3_detectFreq(freq3)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLInputModule4_detectFreq(freq4)); |
|
|
|
|
|
|
|
ui->TTLinModule_ttl_freq_1->setText(QString::number(freq1, 'f', 2)); |
|
|
|
ui->TTLinModule_ttl_freq_2->setText(QString::number(freq2, 'f', 2)); |
|
|
|
ui->TTLinModule_ttl_freq_3->setText(QString::number(freq3, 'f', 2)); |
|
|
|
ui->TTLinModule_ttl_freq_4->setText(QString::number(freq4, 'f', 2)); |
|
|
|
} |
|
|
|
|
|
|
|
SignalType_t source; |
|
|
|
uint32_t div; |
|
|
|
uint32_t multi; |
|
|
|
float infreq; |
|
|
|
float outfreq; |
|
|
|
|
|
|
|
{ |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule1_getSrcSigType(source)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule1_getFreqDivision(div)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule1_getFreqMultiplication(multi)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule1_readInFreq(infreq)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule1_readOutFreq(outfreq)); |
|
|
|
|
|
|
|
ui->TTLOutputModule_SrcSigType_1->setCurrentText(QString::fromStdString(SignalType2Str(source))); |
|
|
|
ui->TTLOutputModule_FreqDivision_1->setText(QString::number(div)); |
|
|
|
ui->TTLOutputModule_FreqMultiplication_1->setText(QString::number(multi)); |
|
|
|
ui->TTLOutputModule_InFreq_1->setText(QString::number(infreq, 'f', 2)); |
|
|
|
ui->TTLOutputModule_OutFreq_1->setText(QString::number(outfreq, 'f', 2)); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule2_getSrcSigType(source)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule2_getFreqDivision(div)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule2_getFreqMultiplication(multi)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule2_readInFreq(infreq)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule2_readOutFreq(outfreq)); |
|
|
|
|
|
|
|
ui->TTLOutputModule_SrcSigType_2->setCurrentText(QString::fromStdString(SignalType2Str(source))); |
|
|
|
ui->TTLOutputModule_FreqDivision_2->setText(QString::number(div)); |
|
|
|
ui->TTLOutputModule_FreqMultiplication_2->setText(QString::number(multi)); |
|
|
|
ui->TTLOutputModule_InFreq_2->setText(QString::number(infreq, 'f', 2)); |
|
|
|
ui->TTLOutputModule_OutFreq_2->setText(QString::number(outfreq, 'f', 2)); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule3_getSrcSigType(source)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule3_getFreqDivision(div)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule3_getFreqMultiplication(multi)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule3_readInFreq(infreq)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule3_readOutFreq(outfreq)); |
|
|
|
|
|
|
|
ui->TTLOutputModule_SrcSigType_3->setCurrentText(QString::fromStdString(SignalType2Str(source))); |
|
|
|
ui->TTLOutputModule_FreqDivision_3->setText(QString::number(div)); |
|
|
|
ui->TTLOutputModule_FreqMultiplication_3->setText(QString::number(multi)); |
|
|
|
ui->TTLOutputModule_InFreq_3->setText(QString::number(infreq, 'f', 2)); |
|
|
|
ui->TTLOutputModule_OutFreq_3->setText(QString::number(outfreq, 'f', 2)); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule4_getSrcSigType(source)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule4_getFreqDivision(div)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule4_getFreqMultiplication(multi)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule4_readInFreq(infreq)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule4_readOutFreq(outfreq)); |
|
|
|
|
|
|
|
ui->TTLOutputModule_SrcSigType_4->setCurrentText(QString::fromStdString(SignalType2Str(source))); |
|
|
|
ui->TTLOutputModule_FreqDivision_4->setText(QString::number(div)); |
|
|
|
ui->TTLOutputModule_FreqMultiplication_4->setText(QString::number(multi)); |
|
|
|
ui->TTLOutputModule_InFreq_4->setText(QString::number(infreq, 'f', 2)); |
|
|
|
ui->TTLOutputModule_OutFreq_4->setText(QString::number(outfreq, 'f', 2)); |
|
|
|
} |
|
|
|
} |
|
|
|
void MainWindow::on_TTLPage_Write_clicked() { |
|
|
|
{ |
|
|
|
auto source = Str2SignalType(ui->TTLOutputModule_SrcSigType_1->currentText().toStdString()); |
|
|
|
auto div = ui->TTLOutputModule_FreqDivision_1->text().toUInt(); |
|
|
|
auto multi = ui->TTLOutputModule_FreqMultiplication_1->text().toUInt(); |
|
|
|
|
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule1_setSrcSigType(source)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule1_setFreqDivision(div)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule1_setFreqMultiplication(multi)); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
auto source = Str2SignalType(ui->TTLOutputModule_SrcSigType_2->currentText().toStdString()); |
|
|
|
auto div = ui->TTLOutputModule_FreqDivision_2->text().toUInt(); |
|
|
|
auto multi = ui->TTLOutputModule_FreqMultiplication_2->text().toUInt(); |
|
|
|
|
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule2_setSrcSigType(source)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule2_setFreqDivision(div)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule2_setFreqMultiplication(multi)); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
auto source = Str2SignalType(ui->TTLOutputModule_SrcSigType_3->currentText().toStdString()); |
|
|
|
auto div = ui->TTLOutputModule_FreqDivision_3->text().toUInt(); |
|
|
|
auto multi = ui->TTLOutputModule_FreqMultiplication_3->text().toUInt(); |
|
|
|
|
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule3_setSrcSigType(source)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule3_setFreqDivision(div)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule3_setFreqMultiplication(multi)); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
auto source = Str2SignalType(ui->TTLOutputModule_SrcSigType_4->currentText().toStdString()); |
|
|
|
auto div = ui->TTLOutputModule_FreqDivision_4->text().toUInt(); |
|
|
|
auto multi = ui->TTLOutputModule_FreqMultiplication_4->text().toUInt(); |
|
|
|
|
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule4_setSrcSigType(source)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule4_setFreqDivision(div)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule4_setFreqMultiplication(multi)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::on_GenlockPage_Read_clicked() { |
|
|
|
{ |
|
|
|
GenlockFormat_t format; |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->InternalGenlock_getFormat(format)); |
|
|
|
ui->InternalGenlock_Format->setCurrentText(QString::fromStdString(GenlockFormatToStr(format))); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
float freq; |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->ExternalGenlock_detectFreq(freq)); |
|
|
|
ui->ExternalGenlock_Freq->setText(QString::number(freq, 'f', 2)); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
uint32_t src; |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->SysGenlock_getSrc(src)); |
|
|
|
ui->SysGenlock_Src->setCurrentText(QString::number(src)); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
float freq; |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->SysGenlock_readFreq(freq)); |
|
|
|
ui->SysGenlock_Freq->setText(QString::number(freq, 'f', 2)); |
|
|
|
} |
|
|
|
} |
|
|
|
void MainWindow::on_GenlockPage_Write_clicked() { |
|
|
|
{ |
|
|
|
auto format = Str2GenlockFormat(ui->InternalGenlock_Format->currentText().toStdString()); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->InternalGenlock_setFormat(format)); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
auto src = ui->SysGenlock_Src->currentText().toUInt(); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->SysGenlock_setSrc(src)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::on_SysClockPage_Read_clicked() { |
|
|
|
{ |
|
|
|
float freq; |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->InternalClock_getFreq(freq)); |
|
|
|
ui->InternalClock_Freq->setText(QString::number(freq, 'f', 2)); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
SignalType_t src; |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->SysClock_getSrc(src)); |
|
|
|
ui->SysClock_Src->setCurrentText(QString::fromStdString(SignalType2Str(src))); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
uint32_t div; |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->SysClock_geFreqtDivision(div)); |
|
|
|
ui->SysClock_FreqtDivision->setText(QString::number(div)); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
uint32_t multi; |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->SysClock_getFreqMultiplication(multi)); |
|
|
|
ui->SysClock_FreqMultiplication->setText(QString::number(multi)); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
float freq; |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->SysClock_readInSigFreq(freq)); |
|
|
|
ui->SysClock_InSigFreq->setText(QString::number(freq, 'f', 2)); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
float freq; |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->SysClock_readOutSigFreq(freq)); |
|
|
|
ui->SysClock_OutSigFreq->setText(QString::number(freq, 'f', 2)); |
|
|
|
} |
|
|
|
} |
|
|
|
void MainWindow::on_SysClockPage_Wirte_clicked() { |
|
|
|
{ |
|
|
|
auto freq = ui->InternalClock_Freq->text().toFloat(); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->InternalClock_setFreq(freq)); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
auto src = Str2SignalType(ui->SysClock_Src->currentText().toStdString()); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->SysClock_setSrc(src)); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
auto div = ui->SysClock_FreqtDivision->text().toUInt(); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->SysClock_setFreqDivision(div)); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
auto multi = ui->SysClock_FreqMultiplication->text().toUInt(); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->SysClock_setFreqMultiplication(multi)); |
|
|
|
} |
|
|
|
} |
|
|
|
/**
|
|
|
|
* @brief 填充部分UI |
|
|
|
*/ |
|
|
|
|
|
|
|
void MainWindow::on_RecordSigGen_Read_clicked() { |
|
|
|
ControlMode_t mode; |
|
|
|
XsyncTimecode_t autoStartTimecode; |
|
|
|
XsyncTimecode_t autoStopTimecode; |
|
|
|
uint32_t autoStart; |
|
|
|
uint32_t autoStop; |
|
|
|
InputInterface_t ttlPortNum; |
|
|
|
uint32_t polarity; |
|
|
|
uint32_t exposureTime; |
|
|
|
uint32_t exposureOffsetTime; |
|
|
|
uint32_t state; |
|
|
|
XsyncTimecode_t timecode_snapshot; |
|
|
|
// ZLOG
|
|
|
|
// ZLOGI(TAG, "Hello");
|
|
|
|
// QSerialPort *serialPort;
|
|
|
|
// const auto infos = QSerialPortInfo::availablePorts();
|
|
|
|
// for(const QSerialPortInfo &info : infos)
|
|
|
|
// {
|
|
|
|
// ZLOGI(TAG,"PortName:%s",info.portName().toStdString().c_str());
|
|
|
|
// QSerialPort serial;
|
|
|
|
// serial.setPort(info);
|
|
|
|
// if(serial.open(QIODevice::ReadWrite))
|
|
|
|
// {
|
|
|
|
// // ui->PortBox->addItem(info.portName());
|
|
|
|
// serial.close();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_getContrlMode(mode)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_getAutoStartTimecode(autoStartTimecode)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_getAutoStopTimecode(autoStopTimecode)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_getTimecodeCtrlFlag(autoStart, autoStop)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_getExternalTTLTriggerSrc(ttlPortNum)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_getExternalTTLTriggerPolarity(polarity)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_getRecordExposureTime(exposureTime)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_getRecordExposureOffsetTime(exposureOffsetTime)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_getRecordState(state)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_readTimecodeSnapshot(timecode_snapshot)); |
|
|
|
/*******************************************************************************
|
|
|
|
* 连接信号与槽 * |
|
|
|
*******************************************************************************/ |
|
|
|
|
|
|
|
ui->RecordSigGenerator_ContrlMode->setCurrentText(QString::fromStdString(ControlMode2Str(mode))); |
|
|
|
ui->RecordSigGenerator_AutoStartTimecode->setText(QString(XsyncTimecodeToStr(autoStartTimecode).c_str())); |
|
|
|
ui->RecordSigGenerator_AutoStopTimecode->setText(QString(XsyncTimecodeToStr(autoStopTimecode).c_str())); |
|
|
|
ui->RecordSigGenerator_TimecodeCtrlFlag0->setChecked(autoStart); |
|
|
|
ui->RecordSigGenerator_TimecodeCtrlFlag1->setChecked(autoStop); |
|
|
|
ui->RecordSigGenerator_ExternalTTLTriggerSrc->setCurrentText(QString::fromStdString(InputInterface2Str(ttlPortNum))); |
|
|
|
ui->RecordSigGenerator_ExternalTTLTriggerPolarity->setText(QString::number(polarity)); |
|
|
|
ui->RecordSigGenerator_RecordExposureTime->setText(QString::number(exposureTime)); |
|
|
|
ui->RecordSigGenerator_RecordExposureOffsetTime->setText(QString::number(exposureOffsetTime)); |
|
|
|
ui->RecordSigGenerator_RecordState->setText(QString::number(state)); |
|
|
|
ui->RecordSigGenerator_TimecodeSnapshot->setText(QString(XsyncTimecodeToStr(timecode_snapshot).c_str())); |
|
|
|
// XSyncUdpFactoryImpl::Ins()->initialize();
|
|
|
|
} |
|
|
|
void MainWindow::on_RecordSigGen_Write_clicked() { |
|
|
|
ControlMode_t mode = Str2ControlMode(ui->RecordSigGenerator_ContrlMode->currentText().toStdString()); |
|
|
|
XsyncTimecode_t autoStartTimecode = Str2XsyncTimecode(ui->RecordSigGenerator_AutoStartTimecode->text().toStdString()); |
|
|
|
XsyncTimecode_t autoStopTimecode = Str2XsyncTimecode(ui->RecordSigGenerator_AutoStopTimecode->text().toStdString()); |
|
|
|
uint32_t autoStart = ui->RecordSigGenerator_TimecodeCtrlFlag0->isChecked(); |
|
|
|
uint32_t autoStop = ui->RecordSigGenerator_TimecodeCtrlFlag1->isChecked(); |
|
|
|
InputInterface_t ttlPortNum = Str2InputInterface(ui->RecordSigGenerator_ExternalTTLTriggerSrc->currentText().toStdString()); |
|
|
|
uint32_t polarity = ui->RecordSigGenerator_ExternalTTLTriggerPolarity->text().toUInt(); |
|
|
|
uint32_t exposureTime = ui->RecordSigGenerator_RecordExposureTime->text().toUInt(); |
|
|
|
uint32_t exposureOffsetTime = ui->RecordSigGenerator_RecordExposureOffsetTime->text().toUInt(); |
|
|
|
|
|
|
|
// RecordSigGenerator_readTimecodeSnapshot
|
|
|
|
|
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_setContrlMode(mode)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_setAutoStartTimecode(autoStartTimecode)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_setAutoStopTimecode(autoStopTimecode)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_setTimecodeCtrlFlag(autoStart, autoStop)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_setExternalTTLTriggerSrc(ttlPortNum)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_setExternalTTLTriggerPolarity(polarity)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_setRecordExposureTime(exposureTime)); |
|
|
|
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_setRecordExposureOffsetTime(exposureOffsetTime)); |
|
|
|
} |
|
|
|
void MainWindow::on_RecordSigGenerator_manualStart_clicked() { DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_manualStart()); } |
|
|
|
void MainWindow::on_RecordSigGenerator_manualStop_clicked() { DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_manualStop()); } |
|
|
|
MainWindow::~MainWindow() { delete ui; } |