From 41ec94773030e8978cd12365ba8f95c112d88cb2 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Fri, 10 May 2024 11:11:30 +0800 Subject: [PATCH] V14 --- libzqt/logger.cpp | 4 +- mainwindow.cpp | 2 +- mainwindow.ui | 148 +++++++++++++++------ .../clst_controler.cpp | 5 +- src/version.h | 2 +- 5 files changed, 114 insertions(+), 47 deletions(-) diff --git a/libzqt/logger.cpp b/libzqt/logger.cpp index b9cef92..e2d0b28 100644 --- a/libzqt/logger.cpp +++ b/libzqt/logger.cpp @@ -2,7 +2,7 @@ #include #include -// #include +#include #include void zos_log(const char *fmt, ...) { @@ -10,7 +10,7 @@ void zos_log(const char *fmt, ...) { va_start(args, fmt); char buf[1024] = {0}; vsnprintf(buf, sizeof(buf), fmt, args); - // qInfo() << buf; + qInfo() << buf; va_end(args); } diff --git a/mainwindow.cpp b/mainwindow.cpp index b8d0de9..b2c1975 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -397,7 +397,7 @@ zaf_error_code_t MainWindow::refreshPage() { ui->LightSrcX_TriSrc_##index->setCurrentText(QString::fromStdString(src.toString())); \ ui->LightSrcX_TriggerModePluseWidth_##index->setText(QString::number(width)); \ ui->LightSrcX_TriggerModeFirstPluseOffset_##index->setText(QString::number(offset)); \ - ui->LightSrcX_LightIntensityDuty_##index->setText(QString::number(duty, 'f', 2)); \ + ui->LightSrcX_LightIntensityDuty_##index->setText(QString::number(duty, 'f', 3)); \ ui->LightSrcX_LightDriverFreq_##index->setText(QString::number(freq, 'f', 2)); UPDATE(1); diff --git a/mainwindow.ui b/mainwindow.ui index ef0b812..60d810d 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -17,7 +17,7 @@ - 相机光源和时序控制器 + 相机光源和时序控制器V14 /* @@ -1226,7 +1226,7 @@ QGroupBox:title { - 0 + 4 true @@ -5242,47 +5242,115 @@ QGroupBox:title { 版本说明 - - - - 10 - 20 - 451 - 511 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + + + + 451 + 511 + + + + + 451 + 511 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'SimSun'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">PC-VERSION</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;"> V13:</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;"> 1.添加版本说明</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">    V12:</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">        1.增加影子寄存器,加快提交配置速度。</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">        2.提交配置后,自动启动内部触发</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">        </span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">FPGA-FIRMWARE-VERSION</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">    V7:</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">        1.修复倍频器BUG的BUG</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">        2.添加调试信号输出</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">    V6: </span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">        1.光耦输入默认反向</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">        2.修改内部触发默认滤波参数为0</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">        3.光耦输入和TTL输入默认可调</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">    V5:</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">        1.解决上电灯闪烁的问题</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">        2.修改默认滤波参数为10</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">        3.优化分频倍频逻辑,支持不稳定频率输入</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">ARM-FIRMWARE-VERSION</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">    V3:</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">        1.支持配置保存</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;">        2.上电复位后,自动复位FPGA芯片</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:10pt; font-weight:600; color:#ff0000;"><br /><br /></span></p></body></html> - - +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">PC-VERSION</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;"> V14:</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;"> 1.修正光源亮度每次提交都会递减的BUG</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;"> V13:</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;"> 1.添加版本说明</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">    V12:</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">        1.增加影子寄存器,加快提交配置速度。</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">        2.提交配置后,自动启动内部触发</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">        </span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">FPGA-FIRMWARE-VERSION</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">    V7:</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">        1.修复倍频器BUG的BUG</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">        2.添加调试信号输出</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">    V6: </span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">        1.光耦输入默认反向</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">        2.修改内部触发默认滤波参数为0</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">        3.光耦输入和TTL输入默认可调</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">    V5:</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">        1.解决上电灯闪烁的问题</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">        2.修改默认滤波参数为10</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">        3.优化分频倍频逻辑,支持不稳定频率输入</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">ARM-FIRMWARE-VERSION</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">    V3:</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">        1.支持配置保存</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;">        2.上电复位后,自动复位FPGA芯片</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Consolas','Courier New','monospace'; font-size:11pt; font-weight:600; color:#ff0000;"><br /><br /></span></p></body></html> + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 注意事项 + + + + + + + 451 + 511 + + + + + 451 + 511 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'SimSun'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt; font-weight:600; color:#ff0000;">使用注意事项:</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt; font-weight:600; color:#ff0000;"> 1.设置光源时序时,偏移应当小于触发脉冲的脉冲周期。</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt; font-weight:600; color:#ff0000;"> 2.外部触发的滤波系数应当小于输入脉冲的脉冲周期。</span></p></body></html> + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + diff --git a/src/camera_light_src_timing_controller/clst_controler.cpp b/src/camera_light_src_timing_controller/clst_controler.cpp index 69f0fed..3627d11 100644 --- a/src/camera_light_src_timing_controller/clst_controler.cpp +++ b/src/camera_light_src_timing_controller/clst_controler.cpp @@ -595,15 +595,14 @@ zaf_error_code_t CLSTControler::LightSrcX_setLightIntensityDuty(int32_t index, f if (duty >= 99) { duty = 99; } - - uint32_t cnt = freqcnt * (duty / 100.0); + uint32_t cnt = freqcnt * (duty / 100.0) + 0.5; if (duty < 1) { cnt = 1; } if (cnt >= freqcnt) { cnt = freqcnt - 1; } - + // float bakduty = (cnt * 100.0 / freqcnt); return reg_write(kreg_light_ctrol_module1_light_intensity_cnt + (index - 1) * 32, cnt); } zaf_error_code_t CLSTControler::LightSrcX_setLightDriverFreq(int32_t index, float freq) { // diff --git a/src/version.h b/src/version.h index 393b1f2..248e814 100644 --- a/src/version.h +++ b/src/version.h @@ -1,4 +1,4 @@ #pragma once -#define VERSION 13 +#define VERSION 14 #define MAUFACTURER "iflytop" \ No newline at end of file