Browse Source

update

master
zhaohe 1 year ago
parent
commit
c28ccd639e
  1. 2
      CMakeLists.txt
  2. 234
      CMakeLists.txt.user
  3. 2
      libxsync
  4. 199
      mainwindow.cpp
  5. 2
      src/xsync_udp_factory_impl.hpp

2
CMakeLists.txt

@ -25,7 +25,7 @@ set(PROJECT_SOURCES
mainwindow.cpp mainwindow.cpp
mainwindow.h mainwindow.h
mainwindow.ui mainwindow.ui
libxsync/xsync.cpp
libxsync/src/xsync_v2.cpp
src/xsync_udp_factory_impl.cpp src/xsync_udp_factory_impl.cpp
libxsync/src/xsync_v2_sig_type.cpp libxsync/src/xsync_v2_sig_type.cpp
libxsync/src/xsync_utils.cpp libxsync/src/xsync_utils.cpp

234
CMakeLists.txt.user

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 5.0.2, 2024-01-12T20:22:04. -->
<!-- Written by QtCreator 5.0.2, 2024-03-06T14:20:04. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
@ -308,8 +308,238 @@
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>ProjectExplorer.Project.Target.1</variable>
<valuemap type="QVariantMap">
<value type="QString" key="DeviceType">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.12.12 MSVC2017 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.12.12 MSVC2017 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.51212.win64_msvc2017_64_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="CMake.Build.Type">Debug</value>
<value type="QString" key="CMake.Initial.Parameters">-GMinGW Makefiles
-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake
-DCMAKE_SYSROOT:PATH=C:/Qt/Qt5.12.12/Tools/mingw730_64
-DCMAKE_C_COMPILER_TARGET:STRING=x86_64-w64-mingw32
-DCMAKE_CXX_COMPILER_TARGET:STRING=x86_64-w64-mingw32
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\workspace\p_lusterinc\build-xsync_pc-Desktop_Qt_5_12_12_MSVC2017_64bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="CMake.Build.Type">Release</value>
<value type="QString" key="CMake.Initial.Parameters">-GMinGW Makefiles
-DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake
-DCMAKE_SYSROOT:PATH=C:/Qt/Qt5.12.12/Tools/mingw730_64
-DCMAKE_C_COMPILER_TARGET:STRING=x86_64-w64-mingw32
-DCMAKE_CXX_COMPILER_TARGET:STRING=x86_64-w64-mingw32
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\workspace\p_lusterinc\build-xsync_pc-Desktop_Qt_5_12_12_MSVC2017_64bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="QString" key="CMake.Build.Type">RelWithDebInfo</value>
<value type="QString" key="CMake.Initial.Parameters">-GMinGW Makefiles
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake
-DCMAKE_SYSROOT:PATH=C:/Qt/Qt5.12.12/Tools/mingw730_64
-DCMAKE_C_COMPILER_TARGET:STRING=x86_64-w64-mingw32
-DCMAKE_CXX_COMPILER_TARGET:STRING=x86_64-w64-mingw32
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\workspace\p_lusterinc\build-xsync_pc-Desktop_Qt_5_12_12_MSVC2017_64bit-RelWithDebInfo</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release with Debug Information</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
<value type="QString" key="CMake.Build.Type">MinSizeRel</value>
<value type="QString" key="CMake.Initial.Parameters">-GMinGW Makefiles
-DCMAKE_BUILD_TYPE:STRING=MinSizeRel
-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake
-DCMAKE_SYSROOT:PATH=C:/Qt/Qt5.12.12/Tools/mingw730_64
-DCMAKE_C_COMPILER_TARGET:STRING=x86_64-w64-mingw32
-DCMAKE_CXX_COMPILER_TARGET:STRING=x86_64-w64-mingw32
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\workspace\p_lusterinc\build-xsync_pc-Desktop_Qt_5_12_12_MSVC2017_64bit-MinSizeRel</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Minimum Size Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">4</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">xsync</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeRunConfiguration.xsync</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">xsync</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">D:/workspace/p_lusterinc/build-xsync_pc-Desktop_Qt_5_12_12_MSVC2017_64bit-Debug</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable> <variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
<value type="int">2</value>
</data> </data>
<data> <data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable> <variable>ProjectExplorer.Project.Updater.FileVersion</variable>

2
libxsync

@ -1 +1 @@
Subproject commit f8327e9440e782a383ca78c43ddec2d52ccf7ae9
Subproject commit 54470f7943cabd75ee211f72263177feb4ee8bbc

199
mainwindow.cpp

@ -128,7 +128,7 @@ void MainWindow::push_reg(QWidget *parent, int off, const char *regname, int32_t
ZLOGI(TAG, "write reg 0x%04x %d", regadd, regval); ZLOGI(TAG, "write reg 0x%04x %d", regadd, regval);
uint32_t readbackval = 0; uint32_t readbackval = 0;
auto ecode = Xsync::Ins().reg_write(regadd, regval, readbackval);
auto ecode = XsyncIns()->reg_write(regadd, regval, readbackval);
if (ecode == kxs_ec_success) { if (ecode == kxs_ec_success) {
ZLOGI(TAG, "write reg 0x%04x %d success", regadd, regval); ZLOGI(TAG, "write reg 0x%04x %d success", regadd, regval);
m_regdisplayer[regadd]->regvalcache = readbackval; m_regdisplayer[regadd]->regvalcache = readbackval;
@ -470,19 +470,20 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
// m_xsync.reset(new Xsync()); // m_xsync.reset(new Xsync());
Xsync::Ins().initialize(XSyncUdpFactoryImpl::Ins());
Xsync::Ins().registerOnTimecodeMsgCallback([this](XsyncTimecode_t *timecode_msg) { //
// XsyncIns()->initialize(XSyncUdpFactoryImpl::Ins());
XsyncInit(XSyncUdpFactoryImpl::Ins(), "192.168.8.10");
XsyncIns()->registerOnTimecodeMsgCallback([this](XsyncTimecode_t *timecode_msg) { //
XsyncTimecode_t timecode = *timecode_msg; XsyncTimecode_t timecode = *timecode_msg;
QString text = QString(fmt("%02d:%02d:%02d:%02d", timecode.hour, timecode.minute, timecode.second, timecode.frame)); QString text = QString(fmt("%02d:%02d:%02d:%02d", timecode.hour, timecode.minute, timecode.second, timecode.frame));
updateUI_timeCodeInfo_signal(text); updateUI_timeCodeInfo_signal(text);
}); });
Xsync::Ins().registerOnCameraSyncMsgCallback([this](xysnc_camera_sync_data_t *camera_sync_msg) { //
XsyncIns()->registerOnCameraSyncMsgCallback([this](xysnc_camera_sync_data_t *camera_sync_msg) { //
xysnc_camera_sync_data_t camera_sync_data = *camera_sync_msg; xysnc_camera_sync_data_t camera_sync_data = *camera_sync_msg;
updateUI_cameraSyncInfo_signal(QString(fmt("%d", camera_sync_data.frameIndex))); updateUI_cameraSyncInfo_signal(QString(fmt("%d", camera_sync_data.frameIndex)));
}); });
Xsync::Ins().registerOnRecordSigChangeMsgCallback([this](uint32_t recordSig, XsyncTimecode_t *timecode_msg) { //
XsyncIns()->registerOnRecordSigChangeMsgCallback([this](uint32_t recordSig, XsyncTimecode_t *timecode_msg) { //
XsyncTimecode_t timecodecpy = *timecode_msg; XsyncTimecode_t timecodecpy = *timecode_msg;
QString timecodeStr = QString(fmt("%02d:%02d:%02d:%02d", timecodecpy.hour, timecodecpy.minute, timecodecpy.second, timecodecpy.frame)); QString timecodeStr = QString(fmt("%02d:%02d:%02d:%02d", timecodecpy.hour, timecodecpy.minute, timecodecpy.second, timecodecpy.frame));
emit doinui_signal(QFunction([this, recordSig, timecodeStr]() { emit doinui_signal(QFunction([this, recordSig, timecodeStr]() {
@ -511,7 +512,7 @@ void MainWindow::on_RefreshRegsButton_clicked() { //
bool suc = true; bool suc = true;
for (auto &reg : m_regdisplayer) { for (auto &reg : m_regdisplayer) {
uint32_t regValue = 0; uint32_t regValue = 0;
auto ecode = Xsync::Ins().reg_read(reg.first, regValue);
auto ecode = XsyncIns()->reg_read(reg.first, regValue);
int regoff = reg.first; int regoff = reg.first;
if (ecode == kxs_ec_success) { if (ecode == kxs_ec_success) {
@ -531,9 +532,7 @@ void MainWindow::on_ClearLogButton_clicked() { //
ui->logbrowser->clear(); ui->logbrowser->clear();
} }
void MainWindow::on_Connect2XsyncButton_clicked() { // void MainWindow::on_Connect2XsyncButton_clicked() { //
ZLOGI(TAG, "connect %s", ui->IpInput->text().toStdString().c_str());
xs_error_code_t ecode = Xsync::Ins().connect(ui->IpInput->text().toStdString());
ZLOGI(TAG, "connect %s ecode:%s", ui->IpInput->text().toStdString().c_str(), xs_error_code_2_str(ecode));
XsyncIns()->changeXsyncIp(ui->IpInput->text().toStdString());
} }
void MainWindow::mainWindowsRun() { // void MainWindow::mainWindowsRun() { //
} }
@ -549,11 +548,11 @@ void MainWindow::mainWindowsRun() { //
} \ } \
} }
void MainWindow::on_GenNewMac_clicked() { DO_XSYNC_FUNC(Xsync::Ins().generatorNewMac()); }
void MainWindow::on_FactoryReset_clicked() { DO_XSYNC_FUNC(Xsync::Ins().factoryReset()); }
void MainWindow::on_Reboot_clicked() { DO_XSYNC_FUNC(Xsync::Ins().reboot()); }
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() { // void MainWindow::on_ChangeNetCfg_clicked() { //
DO_XSYNC_FUNC(Xsync::Ins().changeNetworkConfig(ui->ChangeNetCfg_ip->text().toStdString(), ui->ChangeNetCfg_mask->text().toStdString(), ui->ChangeNetCfg_gateway->text().toStdString()));
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() { void MainWindow::on_TimecodePage_Read_clicked() {
@ -566,14 +565,14 @@ void MainWindow::on_TimecodePage_Read_clicked() {
TimecodeFormat_t SysTimecode_Format; TimecodeFormat_t SysTimecode_Format;
XsyncTimecode_t SysTimecode_Code; XsyncTimecode_t SysTimecode_Code;
DO_XSYNC_FUNC(Xsync::Ins().InternalTimecode_getFormat(InternalTimecode_Format));
DO_XSYNC_FUNC(Xsync::Ins().InternalTimecode_getCode(InternalTimecode_Code));
DO_XSYNC_FUNC(Xsync::Ins().ExternalTimecode_getFormat(ExternalTimecode_Format));
DO_XSYNC_FUNC(Xsync::Ins().ExternalTimecode_getSource(ExternalTimecode_Source));
DO_XSYNC_FUNC(Xsync::Ins().ExternalTimecode_readCode(ExternalTimecode_Code));
DO_XSYNC_FUNC(Xsync::Ins().SysTimecode_getSource(SysTimecode_Source));
DO_XSYNC_FUNC(Xsync::Ins().SysTimecode_readFormat(SysTimecode_Format));
DO_XSYNC_FUNC(Xsync::Ins().SysTimecode_readCode(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_Format->setCurrentText(QString::fromStdString(TimecodeFormatToStr(InternalTimecode_Format)));
ui->InternalTimecode_Code->setText(QString(XsyncTimecodeToStr(InternalTimecode_Code).c_str())); ui->InternalTimecode_Code->setText(QString(XsyncTimecodeToStr(InternalTimecode_Code).c_str()));
@ -591,15 +590,15 @@ void MainWindow::on_TimecodePage_Update_clicked() {
InputInterface_t ExternalTimecode_Source = Str2InputInterface(ui->ExternalTimecode_Source->currentText().toStdString()); InputInterface_t ExternalTimecode_Source = Str2InputInterface(ui->ExternalTimecode_Source->currentText().toStdString());
uint32_t SysTimecode_Source = ui->SysTimecode_Source->currentText().toInt(); uint32_t SysTimecode_Source = ui->SysTimecode_Source->currentText().toInt();
DO_XSYNC_FUNC(Xsync::Ins().InternalTimecode_setFormat(InternalTimecode_Format));
DO_XSYNC_FUNC(Xsync::Ins().InternalTimecode_setCode(InternalTimecode_Code));
DO_XSYNC_FUNC(Xsync::Ins().ExternalTimecode_setFormat(ExternalTimecode_Format));
DO_XSYNC_FUNC(Xsync::Ins().ExternalTimecode_setSource(ExternalTimecode_Source));
DO_XSYNC_FUNC(Xsync::Ins().SysTimecode_setSource(SysTimecode_Source));
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() { // void MainWindow::on_CameraSyncPacketGeneratorModule_ClearPacketIndex_clicked() {
// DO_XSYNC_FUNC(Xsync::Ins().CameraSyncPacketGeneratorModule_clearPacketIndex());
// DO_XSYNC_FUNC(XsyncIns()->CameraSyncPacketGeneratorModule_clearPacketIndex());
// on_CameraSyncPacketGeneratorModule_Read_clicked(); // on_CameraSyncPacketGeneratorModule_Read_clicked();
// } // }
@ -623,10 +622,10 @@ void MainWindow::on_TTLPage_Read_clicked() {
uint32_t freq4 = 0; uint32_t freq4 = 0;
bool En; bool En;
DO_XSYNC_FUNC(Xsync::Ins().TTLInputModule1_detectFreq(freq1));
DO_XSYNC_FUNC(Xsync::Ins().TTLInputModule2_detectFreq(freq2));
DO_XSYNC_FUNC(Xsync::Ins().TTLInputModule3_detectFreq(freq3));
DO_XSYNC_FUNC(Xsync::Ins().TTLInputModule4_detectFreq(freq4));
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));
ZLOGI(TAG, "freq1:%d freq2:%d freq3:%d freq4:%d", freq1, freq2, freq3, freq4); ZLOGI(TAG, "freq1:%d freq2:%d freq3:%d freq4:%d", freq1, freq2, freq3, freq4);
@ -643,11 +642,11 @@ void MainWindow::on_TTLPage_Read_clicked() {
float outfreq; float outfreq;
{ {
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule1_getSrcSigType(source));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule1_getFreqDivision(div));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule1_getFreqMultiplication(multi));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule1_readInFreq(infreq));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule1_readOutFreq(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_SrcSigType_1->setCurrentText(QString::fromStdString(SignalType2Str(source)));
ui->TTLOutputModule_FreqDivision_1->setText(QString::number(div)); ui->TTLOutputModule_FreqDivision_1->setText(QString::number(div));
@ -657,11 +656,11 @@ void MainWindow::on_TTLPage_Read_clicked() {
} }
{ {
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule2_getSrcSigType(source));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule2_getFreqDivision(div));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule2_getFreqMultiplication(multi));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule2_readInFreq(infreq));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule2_readOutFreq(outfreq));
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_SrcSigType_2->setCurrentText(QString::fromStdString(SignalType2Str(source)));
ui->TTLOutputModule_FreqDivision_2->setText(QString::number(div)); ui->TTLOutputModule_FreqDivision_2->setText(QString::number(div));
@ -671,11 +670,11 @@ void MainWindow::on_TTLPage_Read_clicked() {
} }
{ {
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule3_getSrcSigType(source));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule3_getFreqDivision(div));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule3_getFreqMultiplication(multi));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule3_readInFreq(infreq));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule3_readOutFreq(outfreq));
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_SrcSigType_3->setCurrentText(QString::fromStdString(SignalType2Str(source)));
ui->TTLOutputModule_FreqDivision_3->setText(QString::number(div)); ui->TTLOutputModule_FreqDivision_3->setText(QString::number(div));
@ -685,11 +684,11 @@ void MainWindow::on_TTLPage_Read_clicked() {
} }
{ {
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule4_getSrcSigType(source));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule4_getFreqDivision(div));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule4_getFreqMultiplication(multi));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule4_readInFreq(infreq));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule4_readOutFreq(outfreq));
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_SrcSigType_4->setCurrentText(QString::fromStdString(SignalType2Str(source)));
ui->TTLOutputModule_FreqDivision_4->setText(QString::number(div)); ui->TTLOutputModule_FreqDivision_4->setText(QString::number(div));
@ -704,9 +703,9 @@ void MainWindow::on_TTLPage_Write_clicked() {
auto div = ui->TTLOutputModule_FreqDivision_1->text().toUInt(); auto div = ui->TTLOutputModule_FreqDivision_1->text().toUInt();
auto multi = ui->TTLOutputModule_FreqMultiplication_1->text().toUInt(); auto multi = ui->TTLOutputModule_FreqMultiplication_1->text().toUInt();
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule1_setSrcSigType(source));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule1_setFreqDivision(div));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule1_setFreqMultiplication(multi));
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule1_setSrcSigType(source));
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule1_setFreqDivision(div));
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule1_setFreqMultiplication(multi));
} }
{ {
@ -714,9 +713,9 @@ void MainWindow::on_TTLPage_Write_clicked() {
auto div = ui->TTLOutputModule_FreqDivision_2->text().toUInt(); auto div = ui->TTLOutputModule_FreqDivision_2->text().toUInt();
auto multi = ui->TTLOutputModule_FreqMultiplication_2->text().toUInt(); auto multi = ui->TTLOutputModule_FreqMultiplication_2->text().toUInt();
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule2_setSrcSigType(source));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule2_setFreqDivision(div));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule2_setFreqMultiplication(multi));
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule2_setSrcSigType(source));
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule2_setFreqDivision(div));
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule2_setFreqMultiplication(multi));
} }
{ {
@ -724,9 +723,9 @@ void MainWindow::on_TTLPage_Write_clicked() {
auto div = ui->TTLOutputModule_FreqDivision_3->text().toUInt(); auto div = ui->TTLOutputModule_FreqDivision_3->text().toUInt();
auto multi = ui->TTLOutputModule_FreqMultiplication_3->text().toUInt(); auto multi = ui->TTLOutputModule_FreqMultiplication_3->text().toUInt();
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule3_setSrcSigType(source));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule3_setFreqDivision(div));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule3_setFreqMultiplication(multi));
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule3_setSrcSigType(source));
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule3_setFreqDivision(div));
DO_XSYNC_FUNC(XsyncIns()->TTLOutputModule3_setFreqMultiplication(multi));
} }
{ {
@ -734,105 +733,105 @@ void MainWindow::on_TTLPage_Write_clicked() {
auto div = ui->TTLOutputModule_FreqDivision_4->text().toUInt(); auto div = ui->TTLOutputModule_FreqDivision_4->text().toUInt();
auto multi = ui->TTLOutputModule_FreqMultiplication_4->text().toUInt(); auto multi = ui->TTLOutputModule_FreqMultiplication_4->text().toUInt();
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule4_setSrcSigType(source));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule4_setFreqDivision(div));
DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule4_setFreqMultiplication(multi));
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() { void MainWindow::on_GenlockPage_Read_clicked() {
{ {
GenlockFormat_t format; GenlockFormat_t format;
DO_XSYNC_FUNC(Xsync::Ins().InternalGenlock_getFormat(format));
DO_XSYNC_FUNC(XsyncIns()->InternalGenlock_getFormat(format));
ui->InternalGenlock_Format->setCurrentText(QString::fromStdString(GenlockFormatToStr(format))); ui->InternalGenlock_Format->setCurrentText(QString::fromStdString(GenlockFormatToStr(format)));
} }
{ {
float freq; float freq;
DO_XSYNC_FUNC(Xsync::Ins().ExternalGenlock_detectFreq(freq));
DO_XSYNC_FUNC(XsyncIns()->ExternalGenlock_detectFreq(freq));
ui->ExternalGenlock_Freq->setText(QString::number(freq, 'f', 2)); ui->ExternalGenlock_Freq->setText(QString::number(freq, 'f', 2));
} }
{ {
uint32_t src; uint32_t src;
DO_XSYNC_FUNC(Xsync::Ins().SysGenlock_getSrc(src));
DO_XSYNC_FUNC(XsyncIns()->SysGenlock_getSrc(src));
ui->SysGenlock_Src->setCurrentText(QString::number(src)); ui->SysGenlock_Src->setCurrentText(QString::number(src));
} }
{ {
float freq; float freq;
DO_XSYNC_FUNC(Xsync::Ins().SysGenlock_readFreq(freq));
DO_XSYNC_FUNC(XsyncIns()->SysGenlock_readFreq(freq));
ui->SysGenlock_Freq->setText(QString::number(freq, 'f', 2)); ui->SysGenlock_Freq->setText(QString::number(freq, 'f', 2));
} }
} }
void MainWindow::on_GenlockPage_Write_clicked() { void MainWindow::on_GenlockPage_Write_clicked() {
{ {
auto format = Str2GenlockFormat(ui->InternalGenlock_Format->currentText().toStdString()); auto format = Str2GenlockFormat(ui->InternalGenlock_Format->currentText().toStdString());
DO_XSYNC_FUNC(Xsync::Ins().InternalGenlock_setFormat(format));
DO_XSYNC_FUNC(XsyncIns()->InternalGenlock_setFormat(format));
} }
{ {
auto src = ui->SysGenlock_Src->currentText().toUInt(); auto src = ui->SysGenlock_Src->currentText().toUInt();
DO_XSYNC_FUNC(Xsync::Ins().SysGenlock_setSrc(src));
DO_XSYNC_FUNC(XsyncIns()->SysGenlock_setSrc(src));
} }
} }
void MainWindow::on_SysClockPage_Read_clicked() { void MainWindow::on_SysClockPage_Read_clicked() {
{ {
float freq; float freq;
DO_XSYNC_FUNC(Xsync::Ins().InternalClock_getFreq(freq));
DO_XSYNC_FUNC(XsyncIns()->InternalClock_getFreq(freq));
ui->InternalClock_Freq->setText(QString::number(freq, 'f', 2)); ui->InternalClock_Freq->setText(QString::number(freq, 'f', 2));
} }
{ {
SignalType_t src; SignalType_t src;
DO_XSYNC_FUNC(Xsync::Ins().SysClock_getSrc(src));
DO_XSYNC_FUNC(XsyncIns()->SysClock_getSrc(src));
ui->SysClock_Src->setCurrentText(QString::fromStdString(SignalType2Str(src))); ui->SysClock_Src->setCurrentText(QString::fromStdString(SignalType2Str(src)));
} }
{ {
uint32_t div; uint32_t div;
DO_XSYNC_FUNC(Xsync::Ins().SysClock_geFreqtDivision(div));
DO_XSYNC_FUNC(XsyncIns()->SysClock_geFreqtDivision(div));
ui->SysClock_FreqtDivision->setText(QString::number(div)); ui->SysClock_FreqtDivision->setText(QString::number(div));
} }
{ {
uint32_t multi; uint32_t multi;
DO_XSYNC_FUNC(Xsync::Ins().SysClock_getFreqMultiplication(multi));
DO_XSYNC_FUNC(XsyncIns()->SysClock_getFreqMultiplication(multi));
ui->SysClock_FreqMultiplication->setText(QString::number(multi)); ui->SysClock_FreqMultiplication->setText(QString::number(multi));
} }
{ {
float freq; float freq;
DO_XSYNC_FUNC(Xsync::Ins().SysClock_readInSigFreq(freq));
DO_XSYNC_FUNC(XsyncIns()->SysClock_readInSigFreq(freq));
ui->SysClock_InSigFreq->setText(QString::number(freq, 'f', 2)); ui->SysClock_InSigFreq->setText(QString::number(freq, 'f', 2));
} }
{ {
float freq; float freq;
DO_XSYNC_FUNC(Xsync::Ins().SysClock_readOutSigFreq(freq));
DO_XSYNC_FUNC(XsyncIns()->SysClock_readOutSigFreq(freq));
ui->SysClock_OutSigFreq->setText(QString::number(freq, 'f', 2)); ui->SysClock_OutSigFreq->setText(QString::number(freq, 'f', 2));
} }
} }
void MainWindow::on_SysClockPage_Wirte_clicked() { void MainWindow::on_SysClockPage_Wirte_clicked() {
{ {
auto freq = ui->InternalClock_Freq->text().toFloat(); auto freq = ui->InternalClock_Freq->text().toFloat();
DO_XSYNC_FUNC(Xsync::Ins().InternalClock_setFreq(freq));
DO_XSYNC_FUNC(XsyncIns()->InternalClock_setFreq(freq));
} }
{ {
auto src = Str2SignalType(ui->SysClock_Src->currentText().toStdString()); auto src = Str2SignalType(ui->SysClock_Src->currentText().toStdString());
DO_XSYNC_FUNC(Xsync::Ins().SysClock_setSrc(src));
DO_XSYNC_FUNC(XsyncIns()->SysClock_setSrc(src));
} }
{ {
auto div = ui->SysClock_FreqtDivision->text().toUInt(); auto div = ui->SysClock_FreqtDivision->text().toUInt();
DO_XSYNC_FUNC(Xsync::Ins().SysClock_setFreqDivision(div));
DO_XSYNC_FUNC(XsyncIns()->SysClock_setFreqDivision(div));
} }
{ {
auto multi = ui->SysClock_FreqMultiplication->text().toUInt(); auto multi = ui->SysClock_FreqMultiplication->text().toUInt();
DO_XSYNC_FUNC(Xsync::Ins().SysClock_setFreqMultiplication(multi));
DO_XSYNC_FUNC(XsyncIns()->SysClock_setFreqMultiplication(multi));
} }
} }
@ -849,16 +848,16 @@ void MainWindow::on_RecordSigGen_Read_clicked() {
uint32_t state; uint32_t state;
XsyncTimecode_t timecode_snapshot; XsyncTimecode_t timecode_snapshot;
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_getContrlMode(mode));
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_getAutoStartTimecode(autoStartTimecode));
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_getAutoStopTimecode(autoStopTimecode));
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_getTimecodeCtrlFlag(autoStart, autoStop));
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_getExternalTTLTriggerSrc(ttlPortNum));
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_getExternalTTLTriggerPolarity(polarity));
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_getRecordExposureTime(exposureTime));
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_getRecordExposureOffsetTime(exposureOffsetTime));
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_getRecordState(state));
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_readTimecodeSnapshot(timecode_snapshot));
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_ContrlMode->setCurrentText(QString::fromStdString(ControlMode2Str(mode)));
ui->RecordSigGenerator_AutoStartTimecode->setText(QString(XsyncTimecodeToStr(autoStartTimecode).c_str())); ui->RecordSigGenerator_AutoStartTimecode->setText(QString(XsyncTimecodeToStr(autoStartTimecode).c_str()));
@ -885,14 +884,14 @@ void MainWindow::on_RecordSigGen_Write_clicked() {
// RecordSigGenerator_readTimecodeSnapshot // RecordSigGenerator_readTimecodeSnapshot
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_setContrlMode(mode));
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_setAutoStartTimecode(autoStartTimecode));
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_setAutoStopTimecode(autoStopTimecode));
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_setTimecodeCtrlFlag(autoStart, autoStop));
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_setExternalTTLTriggerSrc(ttlPortNum));
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_setExternalTTLTriggerPolarity(polarity));
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_setRecordExposureTime(exposureTime));
DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_setRecordExposureOffsetTime(exposureOffsetTime));
}
void MainWindow::on_RecordSigGenerator_manualStart_clicked() { DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_manualStart()); }
void MainWindow::on_RecordSigGenerator_manualStop_clicked() { DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_manualStop()); }
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()); }

2
src/xsync_udp_factory_impl.hpp

@ -10,7 +10,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "libxsync\xsync.hpp"
#include "xsync_v2.hpp"
namespace xsync { namespace xsync {
using namespace std; using namespace std;

Loading…
Cancel
Save