diff --git a/CMakeLists.txt b/CMakeLists.txt index 8842f39..729329f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ set(PROJECT_SOURCES mainwindow.cpp mainwindow.h mainwindow.ui - libxsync/xsync.cpp + libxsync/src/xsync_v2.cpp src/xsync_udp_factory_impl.cpp libxsync/src/xsync_v2_sig_type.cpp libxsync/src/xsync_utils.cpp diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user index 479c5c3..b1dc064 100644 --- a/CMakeLists.txt.user +++ b/CMakeLists.txt.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -308,8 +308,238 @@ + ProjectExplorer.Project.Target.1 + + Desktop + Desktop Qt 5.12.12 MSVC2017 64bit + Desktop Qt 5.12.12 MSVC2017 64bit + qt.qt5.51212.win64_msvc2017_64_kit + 0 + 0 + 0 + + Debug + -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} + D:\workspace\p_lusterinc\build-xsync_pc-Desktop_Qt_5_12_12_MSVC2017_64bit-Debug + + + + all + + true + Build + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + Build + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Debug + CMakeProjectManager.CMakeBuildConfiguration + + + Release + -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} + D:\workspace\p_lusterinc\build-xsync_pc-Desktop_Qt_5_12_12_MSVC2017_64bit-Release + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Release + CMakeProjectManager.CMakeBuildConfiguration + + + RelWithDebInfo + -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} + D:\workspace\p_lusterinc\build-xsync_pc-Desktop_Qt_5_12_12_MSVC2017_64bit-RelWithDebInfo + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Release with Debug Information + CMakeProjectManager.CMakeBuildConfiguration + + + MinSizeRel + -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} + D:\workspace\p_lusterinc\build-xsync_pc-Desktop_Qt_5_12_12_MSVC2017_64bit-MinSizeRel + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Minimum Size Release + CMakeProjectManager.CMakeBuildConfiguration + + 4 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + true + + 2 + + xsync + CMakeProjectManager.CMakeRunConfiguration.xsync + xsync + false + true + true + false + true + D:/workspace/p_lusterinc/build-xsync_pc-Desktop_Qt_5_12_12_MSVC2017_64bit-Debug + + 1 + + + ProjectExplorer.Project.TargetCount - 1 + 2 ProjectExplorer.Project.Updater.FileVersion diff --git a/libxsync b/libxsync index f8327e9..54470f7 160000 --- a/libxsync +++ b/libxsync @@ -1 +1 @@ -Subproject commit f8327e9440e782a383ca78c43ddec2d52ccf7ae9 +Subproject commit 54470f7943cabd75ee211f72263177feb4ee8bbc diff --git a/mainwindow.cpp b/mainwindow.cpp index 68839af..adf6402 100644 --- a/mainwindow.cpp +++ b/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); 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) { ZLOGI(TAG, "write reg 0x%04x %d success", regadd, regval); m_regdisplayer[regadd]->regvalcache = readbackval; @@ -470,19 +470,20 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi // 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; QString text = QString(fmt("%02d:%02d:%02d:%02d", timecode.hour, timecode.minute, timecode.second, timecode.frame)); 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; 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; QString timecodeStr = QString(fmt("%02d:%02d:%02d:%02d", timecodecpy.hour, timecodecpy.minute, timecodecpy.second, timecodecpy.frame)); emit doinui_signal(QFunction([this, recordSig, timecodeStr]() { @@ -511,7 +512,7 @@ void MainWindow::on_RefreshRegsButton_clicked() { // bool suc = true; for (auto ® : m_regdisplayer) { 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; if (ecode == kxs_ec_success) { @@ -531,9 +532,7 @@ void MainWindow::on_ClearLogButton_clicked() { // ui->logbrowser->clear(); } 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() { // } @@ -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() { // - 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() { @@ -566,14 +565,14 @@ void MainWindow::on_TimecodePage_Read_clicked() { TimecodeFormat_t SysTimecode_Format; 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_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()); 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() { -// DO_XSYNC_FUNC(Xsync::Ins().CameraSyncPacketGeneratorModule_clearPacketIndex()); +// DO_XSYNC_FUNC(XsyncIns()->CameraSyncPacketGeneratorModule_clearPacketIndex()); // on_CameraSyncPacketGeneratorModule_Read_clicked(); // } @@ -623,10 +622,10 @@ void MainWindow::on_TTLPage_Read_clicked() { uint32_t freq4 = 0; 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); @@ -643,11 +642,11 @@ void MainWindow::on_TTLPage_Read_clicked() { 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_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_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_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_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 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 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 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 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() { { 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))); } { 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)); } { 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)); } { 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)); } } void MainWindow::on_GenlockPage_Write_clicked() { { 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(); - DO_XSYNC_FUNC(Xsync::Ins().SysGenlock_setSrc(src)); + DO_XSYNC_FUNC(XsyncIns()->SysGenlock_setSrc(src)); } } void MainWindow::on_SysClockPage_Read_clicked() { { 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)); } { 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))); } { 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)); } { 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)); } { 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)); } { 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)); } } void MainWindow::on_SysClockPage_Wirte_clicked() { { 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()); - DO_XSYNC_FUNC(Xsync::Ins().SysClock_setSrc(src)); + DO_XSYNC_FUNC(XsyncIns()->SysClock_setSrc(src)); } { 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(); - 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; 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_AutoStartTimecode->setText(QString(XsyncTimecodeToStr(autoStartTimecode).c_str())); @@ -885,14 +884,14 @@ void MainWindow::on_RecordSigGen_Write_clicked() { // 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)); + 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(Xsync::Ins().RecordSigGenerator_manualStart()); } -void MainWindow::on_RecordSigGenerator_manualStop_clicked() { DO_XSYNC_FUNC(Xsync::Ins().RecordSigGenerator_manualStop()); } +void MainWindow::on_RecordSigGenerator_manualStart_clicked() { DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_manualStart()); } +void MainWindow::on_RecordSigGenerator_manualStop_clicked() { DO_XSYNC_FUNC(XsyncIns()->RecordSigGenerator_manualStop()); } diff --git a/src/xsync_udp_factory_impl.hpp b/src/xsync_udp_factory_impl.hpp index ece8993..42409f1 100644 --- a/src/xsync_udp_factory_impl.hpp +++ b/src/xsync_udp_factory_impl.hpp @@ -10,7 +10,7 @@ #include #include -#include "libxsync\xsync.hpp" +#include "xsync_v2.hpp" namespace xsync { using namespace std;