Browse Source

v3.2

master
zhaohe 1 year ago
parent
commit
2bb38e1422
  1. 2
      libxsync
  2. 39
      mainwindow.cpp
  3. 32
      mainwindow.ui

2
libxsync

@ -1 +1 @@
Subproject commit 94c4352c150f3d559301a8c1f9a5baa2b5ff0394
Subproject commit ceb3c26ea5b262fe792bfb4418f8186b450faa39

39
mainwindow.cpp

@ -333,8 +333,6 @@ void MainWindow::construct_reg_table() { //
push_reg(ui->gridLayoutWidget, regoff++, "delayer_delay_sig_index", reg::delayer_delay_sig_index, 0, kreg_val_type_decimal);
push_reg(ui->gridLayoutWidget, regoff++, "delayer_delay_us", reg::delayer_delay_us, 0, kreg_val_type_decimal);
auto qrect = ui->gridLayoutWidget->geometry();
qrect.setHeight(31 * regoff - 1);
ui->scrollAreaWidgetContents->setMinimumHeight(31 * (regoff + 10) - 1);
@ -455,12 +453,18 @@ void MainWindow::UI_RecordSigGenConstruct() {
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_ContrlMode->addItem(QString::fromStdString(ControlMode2Str(CONTROLMODE_EXTERNALTTL_EDGE_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)));
ui->RecordSigGenerator_TriggerEdge->clear();
ui->RecordSigGenerator_TriggerEdge->addItem(QString::fromStdString(TriggerEdge2Str(TRIGGER_EDGE_RISING)));
ui->RecordSigGenerator_TriggerEdge->addItem(QString::fromStdString(TriggerEdge2Str(TRIGGER_EDGE_FALLING)));
ui->RecordSigGenerator_TriggerEdge->addItem(QString::fromStdString(TriggerEdge2Str(TRIGGER_EDGE_BOTH)));
}
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) {
@ -601,7 +605,7 @@ void MainWindow::mainWindowsRun() { //
ZLOGE(TAG, "do: %s fail,ecode:[%d](%s)", #exptr, ecode, xs_error_code_2_str(ecode)); \
return; \
} else { \
ZLOGI(TAG, "do: %s success", #exptr); \
\
} \
}
@ -1007,6 +1011,7 @@ void MainWindow::on_RecordSigGen_Read_clicked() {
uint32_t exposureOffsetTime;
uint32_t state;
XsyncTimecode_t timecode_snapshot;
TriggerEdge_t edge;
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_getContrlMode(mode));
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_getAutoStartTimecode(autoStartTimecode));
@ -1016,6 +1021,7 @@ void MainWindow::on_RecordSigGen_Read_clicked() {
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_getExternalTTLTriggerPolarity(polarity));
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_getRecordState(state));
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_readTimecodeSnapshot(timecode_snapshot));
DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_getTriggerEdge(edge));
ui->RecordSigGenerator_ContrlMode->setCurrentText(QString::fromStdString(ControlMode2Str(mode)));
ui->RecordSigGenerator_AutoStartTimecode->setText(QString(XsyncTimecodeToStr(autoStartTimecode).c_str()));
@ -1024,19 +1030,30 @@ void MainWindow::on_RecordSigGen_Read_clicked() {
ui->RecordSigGenerator_TimecodeCtrlFlag1->setChecked(autoStop);
ui->RecordSigGenerator_ExternalTTLTriggerSrc->setCurrentText(QString::fromStdString(InputInterface2Str(ttlPortNum)));
ui->RecordSigGenerator_ExternalTTLTriggerPolarity->setText(QString::number(polarity));
ui->RecordSigGenerator_TriggerEdge->setCurrentText(QString::fromStdString(TriggerEdge2Str(edge)));
// 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()));
}
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();
ControlMode_t mode = Str2ControlMode(ui->RecordSigGenerator_ContrlMode->currentText().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();
TriggerEdge_t edge = Str2TriggerEdge(ui->RecordSigGenerator_TriggerEdge->currentText().toStdString());
static XsyncTimecode_t autoStopTimecode;
Str2XsyncTimecode(ui->RecordSigGenerator_AutoStopTimecode->text().toStdString(), autoStopTimecode);
static XsyncTimecode_t autoStartTimecode;
Str2XsyncTimecode(ui->RecordSigGenerator_AutoStartTimecode->text().toStdString(), autoStartTimecode);
ZLOGI(TAG, "............. %s", ui->RecordSigGenerator_AutoStartTimecode->text().toStdString().c_str());
ZLOGI(TAG, "............. %s", ui->RecordSigGenerator_AutoStopTimecode->text().toStdString().c_str());
ZLOGI(TAG, "1 %d %d %d %d %d ", autoStartTimecode.hour, autoStartTimecode.minute, autoStartTimecode.second, autoStartTimecode.frame, autoStartTimecode.subframe);
ZLOGI(TAG, "2 %d %d %d %d %d ", autoStopTimecode.hour, autoStopTimecode.minute, autoStopTimecode.second, autoStopTimecode.frame, autoStopTimecode.subframe);
// uint32_t exposureTime = ui->RecordSigGenerator_RecordExposureTime->text().toUInt();
// uint32_t exposureOffsetTime = ui->RecordSigGenerator_RecordExposureOffsetTime->text().toUInt();
@ -1048,6 +1065,7 @@ void MainWindow::on_RecordSigGen_Write_clicked() {
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_setTriggerEdge(edge));
// DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_setRecordExposureTime(exposureTime));
// DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_setRecordExposureOffsetTime(exposureOffsetTime));
}
@ -1109,5 +1127,4 @@ void MainWindow::on_DelayContrl_Update_clicked() {
DO_XSYNC_FUNC(XsyncIns()->DelayContrl_setInputDelay(DelayContrl_InputDelay));
DO_XSYNC_FUNC(XsyncIns()->DelayContrl_setOutputDelay(DelayContrl_OutputDelay));
}

32
mainwindow.ui

@ -204,7 +204,7 @@
</sizepolicy>
</property>
<property name="currentIndex">
<number>6</number>
<number>4</number>
</property>
<widget class="QWidget" name="tab_8">
<attribute name="title">
@ -2752,7 +2752,7 @@
<property name="geometry">
<rect>
<x>20</x>
<y>60</y>
<y>100</y>
<width>81</width>
<height>31</height>
</rect>
@ -2765,7 +2765,7 @@
<property name="geometry">
<rect>
<x>110</x>
<y>60</y>
<y>100</y>
<width>141</width>
<height>31</height>
</rect>
@ -2796,6 +2796,32 @@
<number>-1</number>
</property>
</widget>
<widget class="QComboBox" name="RecordSigGenerator_TriggerEdge">
<property name="geometry">
<rect>
<x>110</x>
<y>60</y>
<width>141</width>
<height>31</height>
</rect>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
<widget class="QLabel" name="label_83">
<property name="geometry">
<rect>
<x>20</x>
<y>60</y>
<width>81</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>触发边沿</string>
</property>
</widget>
</widget>
<widget class="QLineEdit" name="RecordSigGenerator_RecordState">
<property name="geometry">

Loading…
Cancel
Save