diff --git a/.gitignore b/.gitignore index cc2bf70..694f63f 100644 --- a/.gitignore +++ b/.gitignore @@ -70,4 +70,7 @@ Thumbs.db # -------- -build \ No newline at end of file +build +IFlytopLTC/IFlytopLTC.exe +appenv/app.exe +dist/app.exe diff --git a/README.md b/README.md index 7dafcac..a56f083 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,36 @@ V14: 修正光源亮度每次提交都会递减的BUG +V17: + 旧版本硬件稳定版本 V18: 添加信号延迟配置功能 V19,20: 修复信号延迟配置功能的BUG + +V22: + 基于V17,调整光源亮度计算公式 为duty = 59- 0.58773 * duty; + + +``` + +``` +编译说明 + +1. 使用QTCreater可以打开工程后直接编译 +2. 命令行编译指令如下 + ./init.bat + ./build.bat + + + +``` + + +``` +特殊版本说明: + V17: 旧版本硬件稳定版本 + V21: 添加信号延迟配置功能,该功能仅作为一个临时的调试功能,在后续版本中被删除 + + ``` \ No newline at end of file diff --git a/appenv/IFlytopLTC.exe b/appenv/IFlytopLTC.exe new file mode 100644 index 0000000..b11e559 Binary files /dev/null and b/appenv/IFlytopLTC.exe differ diff --git a/IFlytopLTC/Qt5Core.dll b/appenv/Qt5Core.dll similarity index 100% rename from IFlytopLTC/Qt5Core.dll rename to appenv/Qt5Core.dll diff --git a/IFlytopLTC/Qt5Gui.dll b/appenv/Qt5Gui.dll similarity index 100% rename from IFlytopLTC/Qt5Gui.dll rename to appenv/Qt5Gui.dll diff --git a/IFlytopLTC/Qt5SerialPort.dll b/appenv/Qt5SerialPort.dll similarity index 100% rename from IFlytopLTC/Qt5SerialPort.dll rename to appenv/Qt5SerialPort.dll diff --git a/IFlytopLTC/Qt5Widgets.dll b/appenv/Qt5Widgets.dll similarity index 100% rename from IFlytopLTC/Qt5Widgets.dll rename to appenv/Qt5Widgets.dll diff --git a/IFlytopLTC/iconengines/qsvgicond.dll b/appenv/iconengines/qsvgicond.dll similarity index 100% rename from IFlytopLTC/iconengines/qsvgicond.dll rename to appenv/iconengines/qsvgicond.dll diff --git a/IFlytopLTC/imageformats/qgifd.dll b/appenv/imageformats/qgifd.dll similarity index 100% rename from IFlytopLTC/imageformats/qgifd.dll rename to appenv/imageformats/qgifd.dll diff --git a/IFlytopLTC/imageformats/qicnsd.dll b/appenv/imageformats/qicnsd.dll similarity index 100% rename from IFlytopLTC/imageformats/qicnsd.dll rename to appenv/imageformats/qicnsd.dll diff --git a/IFlytopLTC/imageformats/qicod.dll b/appenv/imageformats/qicod.dll similarity index 100% rename from IFlytopLTC/imageformats/qicod.dll rename to appenv/imageformats/qicod.dll diff --git a/IFlytopLTC/imageformats/qsvgd.dll b/appenv/imageformats/qsvgd.dll similarity index 100% rename from IFlytopLTC/imageformats/qsvgd.dll rename to appenv/imageformats/qsvgd.dll diff --git a/IFlytopLTC/imageformats/qtgad.dll b/appenv/imageformats/qtgad.dll similarity index 100% rename from IFlytopLTC/imageformats/qtgad.dll rename to appenv/imageformats/qtgad.dll diff --git a/IFlytopLTC/imageformats/qtiffd.dll b/appenv/imageformats/qtiffd.dll similarity index 100% rename from IFlytopLTC/imageformats/qtiffd.dll rename to appenv/imageformats/qtiffd.dll diff --git a/IFlytopLTC/imageformats/qwbmpd.dll b/appenv/imageformats/qwbmpd.dll similarity index 100% rename from IFlytopLTC/imageformats/qwbmpd.dll rename to appenv/imageformats/qwbmpd.dll diff --git a/IFlytopLTC/libgcc_s_seh-1.dll b/appenv/libgcc_s_seh-1.dll similarity index 100% rename from IFlytopLTC/libgcc_s_seh-1.dll rename to appenv/libgcc_s_seh-1.dll diff --git a/IFlytopLTC/libstdc++-6.dll b/appenv/libstdc++-6.dll similarity index 100% rename from IFlytopLTC/libstdc++-6.dll rename to appenv/libstdc++-6.dll diff --git a/IFlytopLTC/libwinpthread-1.dll b/appenv/libwinpthread-1.dll similarity index 100% rename from IFlytopLTC/libwinpthread-1.dll rename to appenv/libwinpthread-1.dll diff --git a/IFlytopLTC/platforms/qdirect2d.dll b/appenv/platforms/qdirect2d.dll similarity index 100% rename from IFlytopLTC/platforms/qdirect2d.dll rename to appenv/platforms/qdirect2d.dll diff --git a/IFlytopLTC/platforms/qminimal.dll b/appenv/platforms/qminimal.dll similarity index 100% rename from IFlytopLTC/platforms/qminimal.dll rename to appenv/platforms/qminimal.dll diff --git a/IFlytopLTC/platforms/qoffscreen.dll b/appenv/platforms/qoffscreen.dll similarity index 100% rename from IFlytopLTC/platforms/qoffscreen.dll rename to appenv/platforms/qoffscreen.dll diff --git a/IFlytopLTC/platforms/qwebgl.dll b/appenv/platforms/qwebgl.dll similarity index 100% rename from IFlytopLTC/platforms/qwebgl.dll rename to appenv/platforms/qwebgl.dll diff --git a/IFlytopLTC/platforms/qwindows.dll b/appenv/platforms/qwindows.dll similarity index 100% rename from IFlytopLTC/platforms/qwindows.dll rename to appenv/platforms/qwindows.dll diff --git a/IFlytopLTC/styles/qwindowsvistastyled.dll b/appenv/styles/qwindowsvistastyled.dll similarity index 100% rename from IFlytopLTC/styles/qwindowsvistastyled.dll rename to appenv/styles/qwindowsvistastyled.dll diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..aaffe30 --- /dev/null +++ b/build.bat @@ -0,0 +1,6 @@ +cd build +make -j8 +cd .. +copy build\CameraLightingController.exe appenv\app.exe +@REM #打包指令 +.\makesfx.exe -ic -mf -ft -we -di -un -oo .\appenv\ .\dist\app.exe .\logo.ico .\appenv\app.exe \ No newline at end of file diff --git a/init.bat b/init.bat new file mode 100644 index 0000000..ea13546 --- /dev/null +++ b/init.bat @@ -0,0 +1 @@ +"C:\Program Files\CMake\bin\cmake.exe" -B "build" "-GMinGW Makefiles" "-DCMAKE_BUILD_TYPE:STRING=Release" "-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=C:/Qt/Qt5.12.12/Tools/QtCreator/share/qtcreator/package-manager/auto-setup.cmake" "-DQT_QMAKE_EXECUTABLE:STRING=C:/Qt/Qt5.12.12/5.12.12/mingw73_64/bin/qmake.exe" "-DCMAKE_PREFIX_PATH:STRING=C:/Qt/Qt5.12.12/5.12.12/mingw73_64" "-DCMAKE_C_COMPILER:STRING=C:/Qt/Qt5.12.12/Tools/mingw730_64/bin/gcc.exe" "-DCMAKE_CXX_COMPILER:STRING=C:/Qt/Qt5.12.12/Tools/mingw730_64/bin/g++.exe" diff --git a/mainwindow.cpp b/mainwindow.cpp index f5c4d19..2a9cd24 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -166,7 +166,6 @@ zaf_error_code_t MainWindow::updatePage() { #define UPDATE(index) \ src = InternalSig(ui->LightSrcX_TriSrc_##index->currentText().toStdString()); \ - delay = ui->LightSrcX_TriggerModePluseDelay_##index->text().toUInt(); \ width = ui->LightSrcX_TriggerModePluseWidth_##index->text().toUInt(); \ offset = ui->LightSrcX_TriggerModeFirstPluseOffset_##index->text().toUInt(); \ duty = ui->LightSrcX_LightIntensityDuty_##index->text().toFloat(); \ @@ -174,7 +173,6 @@ zaf_error_code_t MainWindow::updatePage() { DO(m_clstc->LightSrcX_setTriSrc(index, src)); \ DO(m_clstc->LightSrcX_setTriggerModePluseWidth(index, width)); \ DO(m_clstc->LightSrcX_setTriggerModeFirstPluseOffset(index, offset)); \ - DO(m_clstc->LightSrcX_setTriggerModePluseDelay(index, delay)); \ DO(m_clstc->LightSrcX_setLightIntensityDuty(index, duty)); \ DO(m_clstc->LightSrcX_setLightDriverFreq(index, freq)); @@ -402,7 +400,6 @@ 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_TriggerModePluseDelay_##index->setText(QString::number(delay)); \ ui->LightSrcX_LightIntensityDuty_##index->setText(QString::number(duty, 'f', 3)); \ ui->LightSrcX_LightDriverFreq_##index->setText(QString::number(freq, 'f', 2)); diff --git a/mainwindow.ui b/mainwindow.ui index 0ddb6b1..5489175 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -3044,8 +3044,8 @@ QGroupBox:title { 光源3 - - + + 0 @@ -3065,37 +3065,11 @@ QGroupBox:title { - 输入信号周期探测(us) - - - - - - - - 0 - 25 - - - - - - - - - 1 - 0 - - - - - 0 - 25 - + 光源驱动器状态 - + @@ -3121,7 +3095,7 @@ QGroupBox:title { - + 0 @@ -3130,33 +3104,18 @@ QGroupBox:title { - - - - - 0 - 0 - - + + 0 25 - - - 16777215 - 25 - - - - 脉冲偏移(100ns) - - - + + 0 @@ -3165,18 +3124,39 @@ QGroupBox:title { - - + + + + + 0 + 0 + + 0 25 + + + 16777215 + 25 + + + + 脉冲宽度(100ns) + - - + + + + + 1 + 0 + + 0 @@ -3185,8 +3165,8 @@ QGroupBox:title { - - + + 0 @@ -3195,15 +3175,15 @@ QGroupBox:title { - + Qt::Horizontal - - + + 0 @@ -3212,8 +3192,8 @@ QGroupBox:title { - - + + 0 @@ -3233,12 +3213,12 @@ QGroupBox:title { - 光源亮度(%) + 输入信号周期探测(us) - - + + 0 @@ -3258,12 +3238,12 @@ QGroupBox:title { - 光源驱动频率(HZ) + 脉冲偏移(100ns) - - + + 0 @@ -3272,7 +3252,17 @@ QGroupBox:title { - + + + + + 0 + 25 + + + + + Qt::Vertical @@ -3285,31 +3275,6 @@ QGroupBox:title { - - - - - 0 - 0 - - - - - 0 - 25 - - - - - 16777215 - 25 - - - - 光源驱动器状态 - - - @@ -3335,8 +3300,8 @@ QGroupBox:title { - - + + 0 @@ -3356,12 +3321,12 @@ QGroupBox:title { - 脉冲宽度(100ns) + 光源驱动频率(HZ) - - + + 0 @@ -3381,7 +3346,7 @@ QGroupBox:title { - 脉冲延迟(1ms) + 光源亮度(%) @@ -3406,8 +3371,24 @@ QGroupBox:title { 光源1 - - + + + + + 1 + 0 + + + + + 0 + 25 + + + + + + 0 @@ -3427,11 +3408,11 @@ QGroupBox:title { - 光源驱动频率(HZ) + 输入信号周期探测(us) - + @@ -3456,33 +3437,38 @@ QGroupBox:title { - - - - - 0 - 0 - - + + 0 25 - + + + + + - 16777215 + 0 25 - - 脉冲宽度(100ns) + + + + + + + 0 + 25 + - - + + 0 @@ -3502,22 +3488,12 @@ QGroupBox:title { - 光源驱动器状态 - - - - - - - - 0 - 25 - + 脉冲宽度(100ns) - - + + 0 @@ -3537,12 +3513,12 @@ QGroupBox:title { - 输入信号周期探测(us) + 光源驱动器状态 - - + + 0 @@ -3551,11 +3527,11 @@ QGroupBox:title { - - + + - 1 + 0 0 @@ -3572,12 +3548,12 @@ QGroupBox:title { - 触发源 + 光源亮度(%) - - + + 0 @@ -3586,7 +3562,7 @@ QGroupBox:title { - + Qt::Vertical @@ -3599,7 +3575,7 @@ QGroupBox:title { - + @@ -3609,7 +3585,7 @@ QGroupBox:title { - + @@ -3619,18 +3595,8 @@ QGroupBox:title { - - - - - 0 - 25 - - - - - - + + 0 @@ -3650,15 +3616,15 @@ QGroupBox:title { - 脉冲偏移(100ns) + 光源驱动频率(HZ) - - + + - 0 + 1 0 @@ -3675,45 +3641,12 @@ QGroupBox:title { - 光源亮度(%) - - - - - - - - 1 - 0 - - - - - 0 - 25 - - - - - - - - Qt::Horizontal - - - - - - - - 0 - 25 - + 触发源 - - + + 0 @@ -3733,17 +3666,14 @@ QGroupBox:title { - 脉冲延迟(1ms) + 脉冲偏移(100ns) - - - - - 0 - 25 - + + + + Qt::Horizontal @@ -3768,18 +3698,8 @@ QGroupBox:title { 光源2 - - - - - 0 - 25 - - - - - - + + 0 @@ -3799,12 +3719,12 @@ QGroupBox:title { - 光源亮度(%) + 输入信号周期探测(us) - - + + 0 @@ -3824,40 +3744,7 @@ QGroupBox:title { - 输入信号周期探测(us) - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 0 - 25 - - - - - - - - - 0 - 25 - + 光源驱动频率(HZ) @@ -3877,8 +3764,8 @@ QGroupBox:title { - - + + 0 @@ -3898,12 +3785,12 @@ QGroupBox:title { - 光源驱动器状态 + 脉冲宽度(100ns) - - + + 0 @@ -3923,29 +3810,12 @@ QGroupBox:title { - 输出信号周期探测(us) - - - - - - - - 0 - 25 - - - - - - - - Qt::Horizontal + 光源驱动器状态 - - + + 0 @@ -3965,25 +3835,15 @@ QGroupBox:title { - 光源驱动频率(HZ) - - - - - - - - 0 - 25 - + 输出信号周期探测(us) - - + + - 0 + 1 0 @@ -4000,15 +3860,15 @@ QGroupBox:title { - 脉冲宽度(100ns) + 触发源 - - + + - 1 + 0 0 @@ -4025,37 +3885,42 @@ QGroupBox:title { - 触发源 + 光源亮度(%) - - - - - 0 - 0 - - + + 0 25 - + + + + + - 16777215 + 0 25 - - 脉冲偏移(100ns) - - + + + + 0 + 25 + + + + + + 0 @@ -4064,8 +3929,15 @@ QGroupBox:title { + + + + Qt::Horizontal + + + - + 0 @@ -4074,8 +3946,21 @@ QGroupBox:title { - - + + + + Qt::Vertical + + + + 20 + 40 + + + + + + 0 @@ -4084,8 +3969,8 @@ QGroupBox:title { - - + + 0 @@ -4105,7 +3990,17 @@ QGroupBox:title { - 脉冲延迟(1ms) + 脉冲偏移(100ns) + + + + + + + + 0 + 25 + @@ -4130,18 +4025,8 @@ QGroupBox:title { 光源4 - - - - - 0 - 25 - - - - - - + + 0 @@ -4150,24 +4035,18 @@ QGroupBox:title { - - + + - Qt::Vertical - - - - 20 - 40 - + Qt::Horizontal - + - - + + - 1 + 0 0 @@ -4184,12 +4063,25 @@ QGroupBox:title { - 触发源 + 输出信号周期探测(us) - - + + + + Qt::Vertical + + + + 20 + 40 + + + + + + 0 @@ -4209,37 +4101,22 @@ QGroupBox:title { - 脉冲偏移(100ns) + 输入信号周期探测(us) - - - - - 0 - 0 - - + + 0 25 - - - 16777215 - 25 - - - - 光源驱动器状态 - - + 0 @@ -4259,37 +4136,22 @@ QGroupBox:title { - 光源亮度(%) + 光源驱动频率(HZ) - - - - - 0 - 0 - - + + 0 25 - - - 16777215 - 25 - - - - 输出信号周期探测(us) - - - + + 0 @@ -4309,18 +4171,11 @@ QGroupBox:title { - 输入信号周期探测(us) - - - - - - - Qt::Horizontal + 光源亮度(%) - + @@ -4345,7 +4200,7 @@ QGroupBox:title { - + @@ -4355,11 +4210,11 @@ QGroupBox:title { - - + + - 0 + 1 0 @@ -4376,12 +4231,12 @@ QGroupBox:title { - 光源驱动频率(HZ) + 触发源 - - + + 0 @@ -4390,8 +4245,14 @@ QGroupBox:title { - - + + + + + 1 + 0 + + 0 @@ -4401,7 +4262,7 @@ QGroupBox:title { - + 0 @@ -4410,24 +4271,33 @@ QGroupBox:title { - - + + + + + 0 + 0 + + 0 25 + + + 16777215 + 25 + + + + 脉冲偏移(100ns) + - - - - - 1 - 0 - - + + 0 @@ -4436,8 +4306,8 @@ QGroupBox:title { - - + + 0 @@ -4457,17 +4327,7 @@ QGroupBox:title { - 脉冲延迟(1ms) - - - - - - - - 0 - 25 - + 光源驱动器状态 diff --git a/makesfx.exe b/makesfx.exe new file mode 100644 index 0000000..d5d6cb1 Binary files /dev/null and b/makesfx.exe differ diff --git a/release/IFlytopLTC_V19.exe b/release/IFlytopLTC_V19.exe deleted file mode 100644 index 268c752..0000000 Binary files a/release/IFlytopLTC_V19.exe and /dev/null differ diff --git a/release/IFlytopLTC_v20.exe b/release/IFlytopLTC_v20.exe deleted file mode 100644 index 111deb0..0000000 Binary files a/release/IFlytopLTC_v20.exe and /dev/null differ diff --git a/release/RELEASE17/光源和时序控制器V17.exe b/release/RELEASE17/光源和时序控制器V17.exe new file mode 100644 index 0000000..1b53a6f Binary files /dev/null and b/release/RELEASE17/光源和时序控制器V17.exe differ diff --git a/release/IFlytopLTC_V21.exe b/release/RELEASE21/IFlytopLTC_V21.exe similarity index 100% rename from release/IFlytopLTC_V21.exe rename to release/RELEASE21/IFlytopLTC_V21.exe diff --git a/src/camera_light_src_timing_controller/clst_controler.cpp b/src/camera_light_src_timing_controller/clst_controler.cpp index e1c6ff6..e0405d1 100644 --- a/src/camera_light_src_timing_controller/clst_controler.cpp +++ b/src/camera_light_src_timing_controller/clst_controler.cpp @@ -593,18 +593,21 @@ zaf_error_code_t CLSTControler::LightSrcX_setTriggerModePluseWidth(int32_t index return reg_write(kreg_light_ctrol_module1_trigger_mode_pluse_width + (index - 1) * 32, width * 10); // 0.1us } -zaf_error_code_t CLSTControler::LightSrcX_setTriggerModePluseDelay(int32_t index, uint32_t delay) { // - if (index < 1 || index > 4) return kaf_ec_param_error; - return reg_write(kreg_light_ctrol_module1_trigger_mode_pluse_delay + (index - 1) * 32, delay); // 0.1us -} - zaf_error_code_t CLSTControler::LightSrcX_setTriggerModeFirstPluseOffset(int32_t index, uint32_t offset) { // if (index < 1 || index > 4) return kaf_ec_param_error; return reg_write(kreg_light_ctrol_module1_trigger_mode_first_pluse_offset + (index - 1) * 32, offset * 10); // 0.1us } zaf_error_code_t CLSTControler::LightSrcX_setLightIntensityDuty(int32_t index, float duty) { // if (index < 1 || index > 4) return kaf_ec_param_error; - duty=duty*0.4; + + // + // !!!! 占空比预修正 !!!! + // + // duty = duty * 0.4; //旧设备 + // duty = (0.767 - duty / 100.0 * 0.25 * 4.13 * 0.74) * 100 / 5 / 0.26; 新设备 ==> duty = 59- 0.58773 * duty + + // + duty = 59- 0.58773 * duty; uint32_t freqcnt = 0; DO_CMD(reg_read(kreg_light_ctrol_module1_light_driver_freq_cnt + (index - 1) * 32, freqcnt)); @@ -669,7 +672,7 @@ zaf_error_code_t CLSTControler::LightSrcX_getLightIntensityDuty(int32_t index, f DO_CMD(reg_read(kreg_light_ctrol_module1_light_intensity_cnt + (index - 1) * 32, cnt)); duty = (cnt * 100.0 / freqcnt); - duty=duty/0.4; + duty = duty / 0.4; 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 13a090d..273d363 100644 --- a/src/camera_light_src_timing_controller/clst_controler.hpp +++ b/src/camera_light_src_timing_controller/clst_controler.hpp @@ -143,7 +143,6 @@ class CLSTControler { * 光源控制 * *******************************************************************************/ zaf_error_code_t LightSrcX_setTriSrc(int32_t index, InternalSig src); - zaf_error_code_t LightSrcX_setTriggerModePluseDelay(int32_t index, uint32_t delay); zaf_error_code_t LightSrcX_setTriggerModePluseWidth(int32_t index, uint32_t width); zaf_error_code_t LightSrcX_setTriggerModeFirstPluseOffset(int32_t index, uint32_t offset); zaf_error_code_t LightSrcX_setLightIntensityDuty(int32_t index, float duty); diff --git a/src/version.h b/src/version.h index e8a1811..28fb6b1 100644 --- a/src/version.h +++ b/src/version.h @@ -1,4 +1,4 @@ #pragma once -#define VERSION 21 +#define VERSION 22 #define MAUFACTURER "iflytop" \ No newline at end of file diff --git a/单文件制作_x64.exe b/单文件制作_x64.exe deleted file mode 100644 index 0e66444..0000000 Binary files a/单文件制作_x64.exe and /dev/null differ