From 88cfeecf930305da0f01a5a330d030c26ebd9272 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Mon, 11 Mar 2024 16:28:19 +0800 Subject: [PATCH] V2 --- mainwindow.cpp | 89 +- mainwindow.ui | 1717 +++++++++++--------- .../clst_controler.cpp | 17 +- .../clst_controler.hpp | 4 + .../clst_controler_sig_type.hpp | 4 +- zaf_protocol | 2 +- 6 files changed, 1034 insertions(+), 799 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 0c3a687..f5b9818 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -108,6 +108,8 @@ void MainWindow::updatePage() { uint32_t bias; uint32_t division; uint32_t multiplication; + uint32_t cnt; +// TriInX_setSequentialControlPluseCntMax #define UPDATE(index) \ src = ExtTriggerSrcType(ui->TriInX_SrcSelect_Val_##index->currentText().toStdString()); \ @@ -117,13 +119,15 @@ void MainWindow::updatePage() { edge = TriggerEdge(ui->TriInX_TriggerModeTriggerEdge_Val_##index->currentText().toStdString()); \ division = ui->TriInX_TriggerModeFreqDivision_Val_##index->text().toUInt(); \ multiplication = ui->TriInX_TriggerModeFreqMultiplication_Val_##index->text().toUInt(); \ + cnt = ui->TriInX_SequentialControlPluseCntMax_Val_##index->text().toUInt(); \ DO(m_clstc->TriInX_setSrcSelect(index, src)); \ DO(m_clstc->TriInX_setFileterCoefficient(index, coefficient)); \ DO(m_clstc->TriInX_setFreqDetectBias(index, bias)); \ DO(m_clstc->TriInX_setMode(index, mode)); \ DO(m_clstc->TriInX_setTriggerModeTriggerEdge(index, edge)); \ DO(m_clstc->TriInX_setTriggerModeFreqDivision(index, division)); \ - DO(m_clstc->TriInX_setTriggerModeFreqMultiplication(index, multiplication)); + DO(m_clstc->TriInX_setTriggerModeFreqMultiplication(index, multiplication));\ + DO(m_clstc->TriInX_setSequentialControlPluseCntMax(index, cnt)); UPDATE(1); UPDATE(2); @@ -166,22 +170,25 @@ void MainWindow::updatePage() { uint32_t bindstate3; uint32_t bindstate4; InternalSig sig; + uint32_t reversal; -#define UPDATE(index) \ - mode = SigProcessMode(ui->ShutterX_OutputCtrlMode_##index->currentText().toStdString()); \ - offset = ui->ShutterX_LtEnOffset_##index->text().toUInt(); \ - bindstate1 = ui->ShutterX_LtEnBind_val1_##index->checkState() == Qt::CheckState::Checked; \ - bindstate2 = ui->ShutterX_LtEnBind_val2_##index->checkState() == Qt::CheckState::Checked; \ - bindstate3 = ui->ShutterX_LtEnBind_val3_##index->checkState() == Qt::CheckState::Checked; \ - bindstate4 = ui->ShutterX_LtEnBind_val4_##index->checkState() == Qt::CheckState::Checked; \ - sig = InternalSig(ui->ShutterX_InSigSelect_##index->currentText().toStdString()); \ - DO(m_clstc->ShutterX_setOutputCtrlMode(index, mode)); \ - DO(m_clstc->ShutterX_setLtEnOffset(index, offset)); \ - DO(m_clstc->ShutterX_setLtEnBind(index, 1, bindstate1)); \ - DO(m_clstc->ShutterX_setLtEnBind(index, 2, bindstate2)); \ - DO(m_clstc->ShutterX_setLtEnBind(index, 3, bindstate3)); \ - DO(m_clstc->ShutterX_setLtEnBind(index, 4, bindstate4)); \ - DO(m_clstc->ShutterX_setInSigSelect(index, sig)); +#define UPDATE(index) \ + mode = SigProcessMode(ui->ShutterX_OutputCtrlMode_##index->currentText().toStdString()); \ + offset = ui->ShutterX_LtEnOffset_##index->text().toUInt(); \ + bindstate1 = ui->ShutterX_LtEnBind_val1_##index->checkState() == Qt::CheckState::Checked; \ + bindstate2 = ui->ShutterX_LtEnBind_val2_##index->checkState() == Qt::CheckState::Checked; \ + bindstate3 = ui->ShutterX_LtEnBind_val3_##index->checkState() == Qt::CheckState::Checked; \ + bindstate4 = ui->ShutterX_LtEnBind_val4_##index->checkState() == Qt::CheckState::Checked; \ + sig = InternalSig(ui->ShutterX_InSigSelect_##index->currentText().toStdString()); \ + reversal = ui->ShutterX_OutPolarityReversal_##index->checkState() == Qt::CheckState::Checked; \ + DO(m_clstc->ShutterX_setOutputCtrlMode(index, mode)); \ + DO(m_clstc->ShutterX_setLtEnOffset(index, offset)); \ + DO(m_clstc->ShutterX_setLtEnBind(index, 1, bindstate1)); \ + DO(m_clstc->ShutterX_setLtEnBind(index, 2, bindstate2)); \ + DO(m_clstc->ShutterX_setLtEnBind(index, 3, bindstate3)); \ + DO(m_clstc->ShutterX_setLtEnBind(index, 4, bindstate4)); \ + DO(m_clstc->ShutterX_setInSigSelect(index, sig)); \ + DO(m_clstc->ShutterX_setOutPolarityReversal(index, reversal)); UPDATE(1); UPDATE(2); @@ -312,26 +319,29 @@ void MainWindow::refreshPage() { uint32_t multiplication; float infreq; float outfreq; - -#define UPDATE(index) \ - DO(m_clstc->TriInX_getSrcSelect(index, src)); \ - DO(m_clstc->TriInX_getFileterCoefficient(index, coefficient)); \ - DO(m_clstc->TriInX_getFreqDetectBias(index, bias)); \ - DO(m_clstc->TriInX_getMode(index, mode)); \ - DO(m_clstc->TriInX_getTriggerModeTriggerEdge(index, edge)); \ - DO(m_clstc->TriInX_getTriggerModeFreqDivision(index, division)); \ - DO(m_clstc->TriInX_getTriggerModeFreqMultiplication(index, multiplication)); \ - DO(m_clstc->TriInX_readInSignalFreq(index, infreq)); \ - DO(m_clstc->TriInX_readOutSignalFreq(index, outfreq)); \ - ui->TriInX_SrcSelect_Val_##index->setCurrentText(QString::fromStdString(src.toString())); \ - ui->TriInX_FileterCoefficient_Val_##index->setText(QString::number(coefficient)); \ - ui->TriInX_FreqDetectBias_Val_##index->setText(QString::number(bias)); \ - ui->TriInX_Mode_Val_##index->setCurrentText(QString::fromStdString(mode.toString())); \ - ui->TriInX_OutSignalFreq_Val_##index->setText(QString::number(outfreq, 'f', 2)); \ - ui->TriInX_InSignalFreq_Val_##index->setText(QString::number(infreq, 'f', 2)); \ - ui->TriInX_TriggerModeFreqDivision_Val_##index->setText(QString::number(division)); \ - ui->TriInX_TriggerModeFreqMultiplication_Val_##index->setText(QString::number(multiplication)); \ - ui->TriInX_TriggerModeTriggerEdge_Val_##index->setCurrentText(QString::fromStdString(edge.toString())); + uint32_t cnt; +// TriInX_setSequentialControlPluseCntMax +#define UPDATE(index) \ + DO(m_clstc->TriInX_getSrcSelect(index, src)); \ + DO(m_clstc->TriInX_getFileterCoefficient(index, coefficient)); \ + DO(m_clstc->TriInX_getFreqDetectBias(index, bias)); \ + DO(m_clstc->TriInX_getMode(index, mode)); \ + DO(m_clstc->TriInX_getTriggerModeTriggerEdge(index, edge)); \ + DO(m_clstc->TriInX_getTriggerModeFreqDivision(index, division)); \ + DO(m_clstc->TriInX_getTriggerModeFreqMultiplication(index, multiplication)); \ + DO(m_clstc->TriInX_readInSignalFreq(index, infreq)); \ + DO(m_clstc->TriInX_readOutSignalFreq(index, outfreq)); \ + DO(m_clstc->TriInX_getSequentialControlPluseCntMax(index, cnt)); \ + ui->TriInX_SrcSelect_Val_##index->setCurrentText(QString::fromStdString(src.toString())); \ + ui->TriInX_FileterCoefficient_Val_##index->setText(QString::number(coefficient)); \ + ui->TriInX_FreqDetectBias_Val_##index->setText(QString::number(bias)); \ + ui->TriInX_Mode_Val_##index->setCurrentText(QString::fromStdString(mode.toString())); \ + ui->TriInX_OutSignalFreq_Val_##index->setText(QString::number(outfreq, 'f', 2)); \ + ui->TriInX_InSignalFreq_Val_##index->setText(QString::number(infreq, 'f', 2)); \ + ui->TriInX_TriggerModeFreqDivision_Val_##index->setText(QString::number(division)); \ + ui->TriInX_TriggerModeFreqMultiplication_Val_##index->setText(QString::number(multiplication)); \ + ui->TriInX_TriggerModeTriggerEdge_Val_##index->setCurrentText(QString::fromStdString(edge.toString())); \ + ui->TriInX_SequentialControlPluseCntMax_Val_##index->setText(QString::number(cnt)); UPDATE(1); UPDATE(2); @@ -385,6 +395,9 @@ void MainWindow::refreshPage() { uint32_t bindstate3; uint32_t bindstate4; InternalSig sig; + uint32_t reversal; + + // zaf_error_code_t ShutterX_setOutPolarityReversal(int32_t index, uint32_t reversal); #define UPDATE(index) \ DO(m_clstc->ShutterX_getOutputCtrlMode(index, mode)); \ @@ -394,13 +407,15 @@ void MainWindow::refreshPage() { DO(m_clstc->ShutterX_getLtEnBind(index, 3, bindstate3)); \ DO(m_clstc->ShutterX_getLtEnBind(index, 4, bindstate4)); \ DO(m_clstc->ShutterX_getInSigSelect(index, sig)); \ + DO(m_clstc->ShutterX_getOutPolarityReversal(index, reversal)); \ ui->ShutterX_OutputCtrlMode_##index->setCurrentText(QString::fromStdString(mode.toString())); \ ui->ShutterX_LtEnOffset_##index->setText(QString::number(offset)); \ ui->ShutterX_LtEnBind_val1_##index->setChecked(bindstate1 != 0 ? Qt::CheckState::Checked : Qt::CheckState::Unchecked); \ ui->ShutterX_LtEnBind_val2_##index->setChecked(bindstate2 != 0 ? Qt::CheckState::Checked : Qt::CheckState::Unchecked); \ ui->ShutterX_LtEnBind_val3_##index->setChecked(bindstate3 != 0 ? Qt::CheckState::Checked : Qt::CheckState::Unchecked); \ ui->ShutterX_LtEnBind_val4_##index->setChecked(bindstate4 != 0 ? Qt::CheckState::Checked : Qt::CheckState::Unchecked); \ - ui->ShutterX_InSigSelect_##index->setCurrentText(QString::fromStdString(sig.toString())); + ui->ShutterX_InSigSelect_##index->setCurrentText(QString::fromStdString(sig.toString())); \ + ui->ShutterX_OutPolarityReversal_##index->setChecked(reversal != 0 ? Qt::CheckState::Checked : Qt::CheckState::Unchecked); // ui->ShutterX_LtEnBind_val1_1->checkState() diff --git a/mainwindow.ui b/mainwindow.ui index 8795d24..84f22f5 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 1167 - 955 + 1200 + 1055 @@ -449,7 +449,7 @@ - 0 + 3 true @@ -471,7 +471,102 @@ 外部触发3 - + + + + + 0 + 0 + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + 触发源选择 + + + + + + + + 0 + 0 + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + 滤波系数(x10ns) + + + + + + + + 0 + 25 + + + + + + + + + 0 + 25 + + + + + + + + + 0 + 0 + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + 模式 + + + + @@ -597,18 +692,8 @@ - - - - - 0 - 25 - - - - - - + + 0 @@ -628,49 +713,12 @@ - 输入频率探测(HZ) - - - - - - - - 0 - 25 - - - - - - - - - 0 - 25 - - - - - - - - Qt::Horizontal - - - - - - - - 0 - 25 - + 输出频率探测(HZ) - - + + 0 @@ -690,12 +738,12 @@ - 模式 + 频率探测允许误差(x10ns) - - + + 0 @@ -704,33 +752,18 @@ - - - - - 0 - 0 - - + + 0 25 - - - 16777215 - 25 - - - - 输出频率探测(HZ) - - - + + 0 @@ -750,32 +783,24 @@ - 滤波系数(x10ns) + 输入频率探测(HZ) - - - - - 0 - 0 - - + + 0 25 - - - 16777215 - 25 - - - - 频率探测允许误差(x10ns) + + + + + + Qt::Horizontal @@ -789,8 +814,8 @@ - - + + 0 @@ -810,7 +835,17 @@ - 触发源选择 + 顺序触发最大计数 + + + + + + + + 0 + 25 + @@ -842,8 +877,18 @@ 外部触发2 - - + + + + + 0 + 25 + + + + + + 0 @@ -863,12 +908,12 @@ - 频率探测允许误差(x10ns) + 触发源选择 - - + + 0 @@ -888,172 +933,22 @@ - 输入频率探测(HZ) + 输出频率探测(HZ) - - + + 0 - 25 + 120 - - - - - + - 0 - 25 - - - - - - - - - 0 - 0 - - - - - 0 - 25 - - - - - 16777215 - 25 - - - - 触发源选择 - - - - - - - - 0 - 0 - - - - - 0 - 25 - - - - - 16777215 - 25 - - - - 输出频率探测(HZ) - - - - - - - - 0 - 25 - - - - - - - - - 0 - 0 - - - - - 0 - 25 - - - - - 16777215 - 25 - - - - 滤波系数(x10ns) - - - - - - - - 0 - 25 - - - - - - - - - 0 - 0 - - - - - 0 - 25 - - - - - 16777215 - 25 - - - - 模式 - - - - - - - - 0 - 25 - - - - - - - - - 0 - 120 - - - - - 16777215 - 120 + 16777215 + 120 @@ -1168,40 +1063,8 @@ - - - - Qt::Horizontal - - - - - - - - 0 - 25 - - - - - - - - - - - - 400 - 16777215 - - - - 外部触发1 - - - + 0 @@ -1225,8 +1088,18 @@ - - + + + + + 0 + 25 + + + + + + 0 @@ -1250,8 +1123,8 @@ - - + + 0 @@ -1260,8 +1133,8 @@ - - + + 0 @@ -1270,33 +1143,25 @@ - - - - - 0 - 0 - + + + + Qt::Horizontal + + + + 0 25 - - - 16777215 - 25 - - - - 触发源选择 - - - + + 0 @@ -1316,12 +1181,12 @@ - 输出频率探测(HZ) + 滤波系数(x10ns) - - + + 0 @@ -1330,8 +1195,8 @@ - - + + 0 @@ -1351,22 +1216,12 @@ - 滤波系数(x10ns) - - - - - - - - 0 - 25 - + 模式 - - + + 0 @@ -1386,12 +1241,12 @@ - 模式 + 顺序触发最大计数 - + 0 @@ -1400,9 +1255,59 @@ - - - + + + + + + + + 400 + 16777215 + + + + 外部触发1 + + + + + + + 0 + 0 + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + 模式 + + + + + + + + 0 + 25 + + + + + + + 0 120 @@ -1526,15 +1431,33 @@ - - - - Qt::Horizontal + + + + + 0 + 0 + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + 触发源选择 - - + + 0 @@ -1543,36 +1466,18 @@ - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 400 - 16777215 - - - - 外部触发4 - - - - + + + + + 0 + 25 + + + + + + 0 @@ -1592,12 +1497,32 @@ - 频率探测允许误差(x10ns) + 滤波系数(x10ns) - - + + + + + 0 + 25 + + + + + + + + + 0 + 25 + + + + + + 0 @@ -1617,12 +1542,12 @@ - 输入频率探测(HZ) + 频率探测允许误差(x10ns) - - + + 0 @@ -1631,18 +1556,33 @@ - - + + + + + 0 + 0 + + 0 25 + + + 16777215 + 25 + + + + 输出频率探测(HZ) + - - + + 0 @@ -1662,12 +1602,19 @@ - 触发源选择 + 输入频率探测(HZ) - - + + + + Qt::Horizontal + + + + + 0 @@ -1687,12 +1634,12 @@ - 输出频率探测(HZ) + 顺序触发最大计数 - - + + 0 @@ -1701,8 +1648,36 @@ - - + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 400 + 16777215 + + + + 外部触发4 + + + + 0 @@ -1722,12 +1697,12 @@ - 滤波系数(x10ns) + 频率探测允许误差(x10ns) - - + + 0 @@ -1736,8 +1711,8 @@ - - + + 0 @@ -1757,21 +1732,36 @@ - 模式 + 触发源选择 - - + + + + + 0 + 0 + + 0 25 + + + 16777215 + 25 + + + + 模式 + - + @@ -1897,15 +1887,165 @@ - + + + + + 0 + 25 + + + + + Qt::Horizontal - - + + + + + 0 + 25 + + + + + + + + + 0 + 0 + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + 滤波系数(x10ns) + + + + + + + + 0 + 0 + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + 输入频率探测(HZ) + + + + + + + + 0 + 25 + + + + + + + + + 0 + 0 + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + 输出频率探测(HZ) + + + + + + + + 0 + 25 + + + + + + + + + 0 + 25 + + + + + + + + + 0 + 0 + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + 顺序触发最大计数 + + + + + 0 @@ -1917,6 +2057,13 @@ + + + + GroupBox + + + @@ -3331,8 +3478,8 @@ 快门时序配置 - - + + 400 @@ -3340,25 +3487,63 @@ - 快门输出1 + 快门输出2 - - - + + + Qt::Horizontal - - + + + + + 0 + 0 + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + 触发模式 + + + + + Qt::Horizontal - - + + + + Qt::Vertical + + + + 20 + 60 + + + + + + 0 @@ -3372,11 +3557,11 @@ - TRANSPARENT模式配置 + BIND模式配置 - - - + + + 0 @@ -3385,8 +3570,29 @@ + + + + 光源2 + + + + + + + 光源3 + + + + + + + 光源4 + + + - + 0 @@ -3406,40 +3612,22 @@ - 转发信号选择 + 触发延迟(100ns) + + + + + + + 光源1 - - - - - 0 - 0 - - - - - 0 - 25 - - - - - 16777215 - 25 - - - - 触发模式 - - - - - + + 0 @@ -3453,11 +3641,11 @@ - BIND模式配置 + TRANSPARENT模式配置 - - - + + + 0 @@ -3466,36 +3654,8 @@ - - - - 光源1 - - - - - - - 光源2 - - - - - - - 光源3 - - - - - - - 光源4 - - - - + 0 @@ -3515,15 +3675,22 @@ - 触发延迟(100ns) + 转发信号选择 + + + + Qt::Horizontal + + + - + 0 @@ -3532,24 +3699,31 @@ - - - - Qt::Vertical - - - - 20 - 60 - + + + + 输出极性翻转 - + - - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + 400 @@ -3557,94 +3731,18 @@ - 快门输出1 + 快门输出4 - - - - - Qt::Vertical - - - - 20 - 60 - - - - - - - - Qt::Horizontal - - - - - + + + Qt::Horizontal - - - - - 0 - 0 - - - - - 16777215 - 120 - - - - TRANSPARENT模式配置 - - - - - - - 0 - 25 - - - - - - - - - 0 - 0 - - - - - 0 - 25 - - - - - 16777215 - 25 - - - - 转发信号选择 - - - - - - - + 0 @@ -3668,8 +3766,28 @@ - - + + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + + 20 + 60 + + + + + + 0 @@ -3685,9 +3803,9 @@ BIND模式配置 - + - + 0 @@ -3697,28 +3815,28 @@ - + 光源2 - + 光源3 - + 光源4 - + 0 @@ -3743,7 +3861,7 @@ - + 光源1 @@ -3752,47 +3870,8 @@ - - - - - 0 - 25 - - - - - - - - - - - - 400 - 16777215 - - - - 快门输出1 - - - - - - Qt::Horizontal - - - - - - - Qt::Horizontal - - - - - + + 0 @@ -3808,9 +3887,9 @@ TRANSPARENT模式配置 - + - + 0 @@ -3820,7 +3899,7 @@ - + 0 @@ -3847,8 +3926,54 @@ + + + + Qt::Horizontal + + + + + + + + 0 + 25 + + + + + + + + 输出极性翻转 + + + + + + + + + + + 400 + 16777215 + + + + 快门输出1 + + + + + + Qt::Horizontal + + + - + 0 @@ -3872,8 +3997,28 @@ - - + + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + + 20 + 60 + + + + + + 0 @@ -3889,9 +4034,9 @@ BIND模式配置 - + - + 0 @@ -3900,36 +4045,29 @@ - - - - 光源1 - - - - + 光源2 - + 光源3 - + 光源4 - + 0 @@ -3953,63 +4091,18 @@ + + + + 光源1 + + + - - - - - 0 - 25 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - 400 - 16777215 - - - - 快门输出1 - - - - - - Qt::Horizontal - - - - - - - Qt::Horizontal - - - - - + + 0 @@ -4025,9 +4118,9 @@ TRANSPARENT模式配置 - + - + 0 @@ -4037,7 +4130,7 @@ - + 0 @@ -4064,8 +4157,67 @@ + + + + Qt::Horizontal + + + + + + + + 0 + 25 + + + + + + + + 输出极性翻转 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 400 + 16777215 + + + + 快门输出3 + + + + + + Qt::Horizontal + + + - + 0 @@ -4089,8 +4241,28 @@ - - + + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + + 20 + 60 + + + + + + 0 @@ -4106,9 +4278,9 @@ BIND模式配置 - + - + 0 @@ -4117,36 +4289,29 @@ - - - - 光源1 - - - - + 光源2 - + 光源3 - + 光源4 - + 0 @@ -4170,61 +4335,99 @@ + + + + 光源1 + + + - - + + 0 - 25 + 0 + + + + + 16777215 + 120 + + TRANSPARENT模式配置 + + + + + + + 0 + 25 + + + + + + + + + 0 + 0 + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + 转发信号选择 + + + + - - + + - Qt::Vertical + Qt::Horizontal - + + + + + - 20 - 40 + 0 + 25 - + + + + + + 输出极性翻转 + + - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -4260,7 +4463,7 @@ 0 0 - 1167 + 1200 23 diff --git a/src/camera_light_src_timing_controller/clst_controler.cpp b/src/camera_light_src_timing_controller/clst_controler.cpp index 83c8704..1689890 100644 --- a/src/camera_light_src_timing_controller/clst_controler.cpp +++ b/src/camera_light_src_timing_controller/clst_controler.cpp @@ -457,7 +457,7 @@ zaf_error_code_t CLSTControler::TriInX_setTriggerModeFreqMultiplication(int32_t } zaf_error_code_t CLSTControler::TriInX_setSequentialControlPluseCntMax(int32_t index, uint32_t cnt) { // if (index < 1 || index > 4) return kaf_ec_param_error; - return reg_write(kreg_trigger_in1_sequential_control_pluse_cnt_max + (index - 1) * 32, cnt); + return reg_write(kreg_trigger_in1_sequential_control_pluse_cnt_max + (index - 1) * 32, cnt - 1); } zaf_error_code_t CLSTControler::TriInX_getSrcSelect(int32_t index, ExtTriggerSrcType &src) { // @@ -507,6 +507,12 @@ zaf_error_code_t CLSTControler::TriInX_readOutSignalFreq(int32_t index, float &f return readFreq(kreg_trigger_in1_out_signal_freq + (index - 1) * 32, freq); return kaf_ec_success; } +zaf_error_code_t CLSTControler::TriInX_getSequentialControlPluseCntMax(int32_t index, uint32_t &cnt) { + if (index < 1 || index > 4) return kaf_ec_param_error; + DO_CMD(reg_read(kreg_trigger_in1_sequential_control_pluse_cnt_max + (index - 1) * 32, cnt)); + cnt++; + return kaf_ec_success; +} /******************************************************************************* * ???? * @@ -615,6 +621,8 @@ zaf_error_code_t CLSTControler::ShutterX_setInSigSelect(int32_t index, InternalS return reg_write(kreg_ttl_output_module1_in_sig_select + (index - 1) * 32, sig); } +zaf_error_code_t CLSTControler::ShutterX_setOutPolarityReversal(int32_t index, uint32_t reversal) { return reg_write(kreg_ttl_output_module1_out_polarity_reversal + (index - 1) * 32, reversal); } + zaf_error_code_t CLSTControler::ShutterX_getOutputCtrlMode(int32_t index, SigProcessMode &mode) { // uint32_t val; DO_CMD(reg_read(kreg_ttl_output_module1_output_ctrl_mode + (index - 1) * 32, val)); @@ -638,4 +646,9 @@ zaf_error_code_t CLSTControler::ShutterX_getInSigSelect(int32_t index, InternalS DO_CMD(reg_read(kreg_ttl_output_module1_in_sig_select + (index - 1) * 32, val)); sig = InternalSig(val); return kaf_ec_success; -} \ No newline at end of file +} + +zaf_error_code_t CLSTControler::ShutterX_getOutPolarityReversal(int32_t index, uint32_t &reversal) { + DO_CMD(reg_read(kreg_ttl_output_module1_out_polarity_reversal + (index - 1) * 32, reversal)); + return kaf_ec_success; +} diff --git a/src/camera_light_src_timing_controller/clst_controler.hpp b/src/camera_light_src_timing_controller/clst_controler.hpp index 21174ec..4bcb9ee 100644 --- a/src/camera_light_src_timing_controller/clst_controler.hpp +++ b/src/camera_light_src_timing_controller/clst_controler.hpp @@ -124,6 +124,8 @@ class CLSTControler { zaf_error_code_t TriInX_getTriggerModeTriggerEdge(int32_t index, TriggerEdge &edge); zaf_error_code_t TriInX_getTriggerModeFreqDivision(int32_t index, uint32_t &division); zaf_error_code_t TriInX_getTriggerModeFreqMultiplication(int32_t index, uint32_t &multiplication); + zaf_error_code_t TriInX_getSequentialControlPluseCntMax(int32_t index, uint32_t& cnt); + zaf_error_code_t TriInX_readInSignalFreq(int32_t index, float &freq); zaf_error_code_t TriInX_readOutSignalFreq(int32_t index, float &freq); @@ -155,11 +157,13 @@ class CLSTControler { zaf_error_code_t ShutterX_setLtEnBind(int32_t index, uint32_t lt_en_sig_index, uint32_t state); zaf_error_code_t ShutterX_setLtEnOffset(int32_t index, uint32_t offset); zaf_error_code_t ShutterX_setInSigSelect(int32_t index, InternalSig sig); + zaf_error_code_t ShutterX_setOutPolarityReversal(int32_t index, uint32_t reversal); zaf_error_code_t ShutterX_getOutputCtrlMode(int32_t index, SigProcessMode &mode); zaf_error_code_t ShutterX_getLtEnBind(int32_t index, uint32_t lt_en_sig_index, uint32_t &state); zaf_error_code_t ShutterX_getLtEnOffset(int32_t index, uint32_t &offset); zaf_error_code_t ShutterX_getInSigSelect(int32_t index, InternalSig &sig); + zaf_error_code_t ShutterX_getOutPolarityReversal(int32_t index, uint32_t &reversal); private: void processRxData(uint8_t *rx, uint32_t rxlen); diff --git a/src/camera_light_src_timing_controller/clst_controler_sig_type.hpp b/src/camera_light_src_timing_controller/clst_controler_sig_type.hpp index 1859e5b..333c2ed 100644 --- a/src/camera_light_src_timing_controller/clst_controler_sig_type.hpp +++ b/src/camera_light_src_timing_controller/clst_controler_sig_type.hpp @@ -49,8 +49,8 @@ class ExtTriggerSrcType { class TriggerEdge { public: typedef enum { - RISING = 0, // 上升沿触发 - FALLING = 1, // 下降沿触发 + RISING = 1, // 上升沿触发 + FALLING = 0, // 下降沿触发 BOTH = 2, // 上升沿和下降沿触发 } EnumType_t; diff --git a/zaf_protocol b/zaf_protocol index d29b003..c6d92f6 160000 --- a/zaf_protocol +++ b/zaf_protocol @@ -1 +1 @@ -Subproject commit d29b00371520aea2566aa09cba2384e3e937a908 +Subproject commit c6d92f6fde665a4821dfdf968a84b2d987e441e6