@ -286,34 +286,41 @@ void MainWindow::construct_reg_table() { //
push_reg ( ui - > gridLayoutWidget , regoff + + , " ttlout4_sig_in_freq_detect " , reg : : kreg_ttlout4_sig_in_freq_detect , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " ttlout4_sig_out_freq_detect " , reg : : kreg_ttlout4_sig_out_freq_detect , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " external_genlock_module " , reg : : external_genlock_module , 0 , kreg_val_type_hex ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " external_genlock_freq_detect_bias " , reg : : external_genlock_freq_detect_bias , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " external_genlock_freq " , reg : : external_genlock_freq , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " internal_genlock_module " , reg : : internal_genlock_module , 0 , kreg_val_type_hex ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " internal_genlock_ctrl_mode " , reg : : internal_genlock_ctrl_mode , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " internal_genlock_en " , reg : : internal_genlock_en , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " internal_genlock_format " , reg : : internal_genlock_format , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " internal_genlock_freq " , reg : : internal_genlock_freq , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " sys_genlock_module " , reg : : sys_genlock_module , 0 , kreg_val_type_hex ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " sys_genlock_source " , reg : : sys_genlock_source , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " sys_genlock_freq_detect_bias " , reg : : sys_genlock_freq_detect_bias , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " sys_genlock_freq " , reg : : sys_genlock_freq , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " internal_clock_module " , reg : : internal_clock_module , 0 , kreg_val_type_hex ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " internal_clock_ctrl_mode " , reg : : internal_clock_ctrl_mode , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " internal_clock_en " , reg : : internal_clock_en , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " internal_clock_freq " , reg : : internal_clock_freq , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " sys_clock_module " , reg : : sys_clock_module , 0 , kreg_val_type_hex ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " sys_clock_source " , reg : : sys_clock_source , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " sys_clock_freq_division_ctrl " , reg : : sys_clock_freq_division_ctrl , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " sys_clock_freq_multiplication_ctrl " , reg : : sys_clock_freq_multiplication_ctrl , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " sys_clock_freq_detect_bias " , reg : : sys_clock_freq_detect_bias , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " sys_clock_trigger_edge_select " , reg : : sys_clock_trigger_edge_select , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " sys_clock_infreq_detect " , reg : : sys_clock_infreq_detect , 0 , kreg_val_type_decimal ) ;
push_reg ( ui - > gridLayoutWidget , regoff + + , " sys_clock_outfreq_detect " , reg : : sys_clock_outfreq_detect , 0 , kreg_val_type_decimal ) ;
auto qrect = ui - > gridLayoutWidget - > geometry ( ) ;
qrect . setHeight ( 31 * regoff - 1 ) ;
ui - > scrollAreaWidgetContents - > setMinimumHeight ( 31 * ( regoff + 10 ) - 1 ) ;
ui - > gridLayoutWidget - > setGeometry ( qrect ) ;
}
//
void MainWindow : : UI_TTLOutputMoudleConstruct ( ) {
ui - > TTLOutputMoudle_ID - > clear ( ) ;
for ( int i = 1 ; i < = 4 ; i + + ) {
ui - > TTLOutputMoudle_ID - > addItem ( QString : : number ( i ) ) ;
}
}
void MainWindow : : UI_SigGeneratorConstruct ( ) {
ui - > SigGenerator_ControlMode - > clear ( ) ;
for ( auto & str : sig_generator_module : : ControlModeStrSet ( ) ) {
ui - > SigGenerator_ControlMode - > addItem ( QString : : fromStdString ( str ) ) ;
}
ui - > SigGenerator_GenlockFormat - > clear ( ) ;
for ( auto & str : GenlockFormatStrSet ( ) ) {
ui - > SigGenerator_GenlockFormat - > addItem ( QString : : fromStdString ( str ) ) ;
}
ui - > SigGenerator_TimecodeFormat - > clear ( ) ;
for ( auto & str : TimecodeFormatStrSet ( ) ) {
ui - > SigGenerator_TimecodeFormat - > addItem ( QString : : fromStdString ( str ) ) ;
}
}
void MainWindow : : UI_TimecodePageConstruct ( ) {
ui - > InternalTimecode_Format - > clear ( ) ;
@ -333,10 +340,6 @@ void MainWindow::UI_TimecodePageConstruct() {
ui - > SysTimecode_Source - > clear ( ) ;
ui - > SysTimecode_Source - > addItem ( QString : : fromStdString ( " 0 " ) ) ;
ui - > SysTimecode_Source - > addItem ( QString : : fromStdString ( " 1 " ) ) ;
}
void MainWindow : : UI_CameraSyncPacketGeneratorModuleConstruct ( ) {
@ -346,7 +349,46 @@ void MainWindow::UI_CameraSyncPacketGeneratorModuleConstruct() {
}
}
void MainWindow : : UI_TTLInModuleConstruct ( ) { }
void MainWindow : : UI_TTLPageConstruct ( ) {
QStringList list ;
list . push_back ( QString : : fromStdString ( SignalType2Str ( SIGNAL_LOGIC0 ) ) ) ;
list . push_back ( QString : : fromStdString ( SignalType2Str ( SIGNAL_LOGIC1 ) ) ) ;
list . push_back ( QString : : fromStdString ( SignalType2Str ( SIGNAL_TTLIN1 ) ) ) ;
list . push_back ( QString : : fromStdString ( SignalType2Str ( SIGNAL_TTLIN2 ) ) ) ;
list . push_back ( QString : : fromStdString ( SignalType2Str ( SIGNAL_TTLIN3 ) ) ) ;
list . push_back ( QString : : fromStdString ( SignalType2Str ( SIGNAL_TTLIN4 ) ) ) ;
list . push_back ( QString : : fromStdString ( SignalType2Str ( SIGNAL_SYS_CLK_OUTPUT ) ) ) ;
list . push_back ( QString : : fromStdString ( SignalType2Str ( SIGNAL_SYS_GENLOCK_OUTPUT ) ) ) ;
list . push_back ( QString : : fromStdString ( SignalType2Str ( SIGNAL_SYS_TIMECODE_FREQ_OUTPUT ) ) ) ;
list . push_back ( QString : : fromStdString ( SignalType2Str ( SIGNAL_BUSINESS_RECORD_SIG ) ) ) ;
list . push_back ( QString : : fromStdString ( SignalType2Str ( SIGNAL_BUSINESS_RECORD_EXPOSURE_SIG ) ) ) ;
ui - > TTLOutputModule_SrcSigType_1 - > clear ( ) ;
ui - > TTLOutputModule_SrcSigType_1 - > addItems ( list ) ;
ui - > TTLOutputModule_SrcSigType_2 - > clear ( ) ;
ui - > TTLOutputModule_SrcSigType_2 - > addItems ( list ) ;
ui - > TTLOutputModule_SrcSigType_3 - > clear ( ) ;
ui - > TTLOutputModule_SrcSigType_3 - > addItems ( list ) ;
ui - > TTLOutputModule_SrcSigType_4 - > clear ( ) ;
ui - > TTLOutputModule_SrcSigType_4 - > addItems ( list ) ;
}
void MainWindow : : UI_GenlockPageConstruct ( ) {
//
// ui->ExternalGenlock_Source->clear();
ui - > InternalGenlock_Format - > clear ( ) ;
for ( auto & str : GenlockFormatStrSet ( ) ) {
ui - > InternalGenlock_Format - > addItem ( QString : : fromStdString ( str ) ) ;
}
ui - > SysGenlock_Src - > clear ( ) ;
ui - > SysGenlock_Src - > addItem ( QString : : fromStdString ( " 0 " ) ) ;
ui - > SysGenlock_Src - > addItem ( QString : : fromStdString ( " 1 " ) ) ;
}
MainWindow : : MainWindow ( QWidget * parent ) : QMainWindow ( parent ) , ui ( new Ui : : MainWindow ) {
ui - > setupUi ( this ) ;
@ -357,12 +399,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
*/
construct_reg_table ( ) ;
qInstallMessageHandler ( log_output ) ;
UI_TTLOutputMoudleConstruct ( ) ;
UI_SigGeneratorConstruct ( ) ;
UI_TimecodePageConstruct ( ) ;
UI_CameraSyncPacketGeneratorModuleConstruct ( ) ;
// UI_TimecodeInModuleConstruct();
UI_TTLInModul eConstruct ( ) ;
UI_TTLPageConstruct ( ) ;
UI_GenlockPag eConstruct ( ) ;
/*******************************************************************************
* 连 接 信 号 与 槽 *
@ -443,13 +483,6 @@ void MainWindow::on_Connect2XsyncButton_clicked() { //
ZLOGI ( TAG , " connect %s ecode:%s " , ui - > IpInput - > text ( ) . toStdString ( ) . c_str ( ) , xs_error_code_2_str ( ecode ) ) ;
}
void MainWindow : : mainWindowsRun ( ) { //
// auto xsudp = XSyncUdpFactoryImpl::Ins()->createXSUDP();
// XS_ASSERT(xsudp->initialize("0.0.0.0", 9999));
// xsudp->startReceive([this, xsudp](XsyncNetAdd &from, uint8_t *data, size_t length) {
// // ZLOGI(TAG, "receive from <%s:%d> (%d) :%s", from.ip.c_str(), from.port, data, length);
// xsudp->sendto(from, "hello\n", 5, NULL);
// });
}
# define DO_XSYNC_FUNC(exptr) \
@ -470,66 +503,6 @@ void MainWindow::on_ChangeNetCfg_clicked() { //
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . Basic_changeNetworkConfig ( ui - > ChangeNetCfg_ip - > text ( ) . toStdString ( ) , ui - > ChangeNetCfg_mask - > text ( ) . toStdString ( ) , ui - > ChangeNetCfg_gateway - > text ( ) . toStdString ( ) ) ) ;
}
// void MainWindow::on_WriteReg_clicked() {
// uint32_t regadd = str2int(ui->RegAdd->text());
// uint32_t regval = str2int(ui->RegVal->text());
// ZLOGI(TAG, "write reg 0x%08x %d", regadd, regval);
// uint32_t readbakval = 0;
// DO_XSYNC_FUNC(Xsync::Ins().reg_write(regadd, regval, readbakval));
// ZLOGI(TAG, "write reg 0x%08x 0x%08x ,readback:0x%08x success", regadd, regval, readbakval);
// ui->RegVal->setText(QString(fmt("0x%08x", readbakval)));
// }
// void MainWindow::on_ReadReg_clicked() {
// uint32_t regadd = str2int(ui->RegAdd->text());
// uint32_t regval = 0;
// DO_XSYNC_FUNC(Xsync::Ins().reg_read(regadd, regval));
// ZLOGI(TAG, "read reg 0x%08x 0x%08x success", regadd, regval);
// ui->RegVal->setText(QString(fmt("0x%08x", regval)));
// }
// void MainWindow::on_TimecodePage_Read_clicked() {
// int32_t ID = //
// ui->TTLOutputMoudle_ID->currentText().toInt();
// auto InputSigType = //
// ttlout_module::Str2TriggerSigType(ui->TTLOutputMoudle_InputSigType->currentText().toStdString());
// auto OutputSigType = //
// ttlout_module::Str2OutputSigType(ui->TTLOutputMoudle_OutputSigType->currentText().toStdString());
// uint32_t TriggerModePulseWidth = //
// ui->TTLOutputMoudle_TriggerModePulseWidth->text().toUInt();
// uint32_t TriggerModePulseDelay = //
// ui->TTLOutputMoudle_TriggerModePulseDelay->text().toUInt();
// ZLOGI(TAG, "on_TTLOutputMoudle_Update_clicked ID:%d InputSigType:%d OutputSigType:%d TriggerModePulseWidth:%d TriggerModePulseDelay:%d", //
// ID, InputSigType, OutputSigType, TriggerModePulseWidth, TriggerModePulseDelay);
// DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule_setInputSigType(ID, InputSigType));
// DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule_setOutputSigType(ID, OutputSigType));
// DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule_setTriggerModePulseWidth(ID, TriggerModePulseWidth));
// DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule_setTriggerModePulseDelay(ID, TriggerModePulseDelay));
// }
// void MainWindow::on_TTLOutputMoudle_Read_clicked() {
// ttlout_module::TriggerSigType_t InputSigType;
// ttlout_module::OutputSigType_t OutputSigType;
// uint32_t TriggerModePulseWidth;
// uint32_t TriggerModePulseDelay;
// int32_t ID = //
// ui->TTLOutputMoudle_ID->currentText().toInt();
// DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule_getInputSigType(ID, InputSigType));
// DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule_getOutputSigType(ID, OutputSigType));
// DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule_getTriggerModePulseWidth(ID, TriggerModePulseWidth));
// DO_XSYNC_FUNC(Xsync::Ins().TTLOutputModule_getTriggerModePulseDelay(ID, TriggerModePulseDelay));
// ui->TTLOutputMoudle_InputSigType->setCurrentText(QString::fromStdString(ttlout_module::TriggerSigType2Str(InputSigType)));
// ui->TTLOutputMoudle_OutputSigType->setCurrentText(QString::fromStdString(ttlout_module::OutputSigType2Str(OutputSigType)));
// ui->TTLOutputMoudle_TriggerModePulseWidth->setText(QString::number(TriggerModePulseWidth));
// ui->TTLOutputMoudle_TriggerModePulseDelay->setText(QString::number(TriggerModePulseDelay));
// }
void MainWindow : : on_TimecodePage_Read_clicked ( ) {
TimecodeFormat_t InternalTimecode_Format ;
XsyncTimecode_t InternalTimecode_Code ;
@ -540,7 +513,6 @@ 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 ) ) ;
@ -573,73 +545,6 @@ void MainWindow::on_TimecodePage_Update_clicked() {
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . SysTimecode_setSource ( SysTimecode_Source ) ) ;
}
void MainWindow : : on_SigGenerator_Read_clicked ( ) {
sig_generator_module : : ControlMode_t ControlMode ;
GenlockFormat_t GenlockFormat ;
TimecodeFormat_t TimecodeFormat ;
XsyncTimecode_t Timecode ;
XsyncTimecode_t AutoStartTimecode ;
uint32_t WorkState ;
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . SigGenerator_getControlMode ( ControlMode ) ) ;
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . SigGenerator_getGenlockFormat ( GenlockFormat ) ) ;
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . SigGenerator_getTimecodeFormat ( TimecodeFormat ) ) ;
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . SigGenerator_getTimecode ( Timecode ) ) ;
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . SigGenerator_getAutoStartTimecode ( AutoStartTimecode ) ) ;
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . SigGenerator_getWorkState ( WorkState ) ) ;
ui - > SigGenerator_ControlMode - > setCurrentText ( QString : : fromStdString ( sig_generator_module : : ControlMode2Str ( ControlMode ) ) ) ;
ui - > SigGenerator_GenlockFormat - > setCurrentText ( QString : : fromStdString ( GenlockFormatToStr ( GenlockFormat ) ) ) ;
ui - > SigGenerator_TimecodeFormat - > setCurrentText ( QString : : fromStdString ( TimecodeFormatToStr ( TimecodeFormat ) ) ) ;
ui - > SigGenerator_Timecode - > setText ( QString ( XsyncTimecodeToStr ( Timecode ) . c_str ( ) ) ) ;
ui - > SigGenerator_AutoStartTimecode - > setText ( QString ( XsyncTimecodeToStr ( AutoStartTimecode ) . c_str ( ) ) ) ;
ui - > SigGenerator_WorkState - > setText ( QString : : number ( WorkState ) ) ;
}
void MainWindow : : on_SigGenerator_Update_clicked ( ) {
auto ControlMode = sig_generator_module : : Str2ControlMode ( ui - > SigGenerator_ControlMode - > currentText ( ) . toStdString ( ) ) ;
auto GenlockFormat = Str2GenlockFormat ( ui - > SigGenerator_GenlockFormat - > currentText ( ) . toStdString ( ) ) ;
auto TimecodeFormat = Str2TimecodeFormat ( ui - > SigGenerator_TimecodeFormat - > currentText ( ) . toStdString ( ) ) ;
XsyncTimecode_t timecode = Str2XsyncTimecode ( ui - > SigGenerator_Timecode - > text ( ) . toStdString ( ) ) ;
XsyncTimecode_t autoStartTimecode = Str2XsyncTimecode ( ui - > SigGenerator_AutoStartTimecode - > text ( ) . toStdString ( ) ) ;
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . SigGenerator_setControlMode ( ControlMode ) ) ;
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . SigGenerator_setGenlockFormat ( GenlockFormat ) ) ;
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . SigGenerator_setTimecodeFormat ( TimecodeFormat ) ) ;
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . SigGenerator_setTimecode ( timecode ) ) ;
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . SigGenerator_setAutoStartTimecode ( autoStartTimecode ) ) ;
}
void MainWindow : : on_SigGenerator_Start_clicked ( ) { DO_XSYNC_FUNC ( Xsync : : Ins ( ) . SigGenerator_manualStart ( ) ) ; }
void MainWindow : : on_SigGenerator_Stop_clicked ( ) { DO_XSYNC_FUNC ( Xsync : : Ins ( ) . SigGenerator_manualStop ( ) ) ; }
// void MainWindow::on_TimecodeOutputModule_Read_clicked() {
// timecode_output_module::TriggerSigType_t TimecodeSrcSelect;
// timecode_output_module::OutputSigLevelType_t BncOutputLevel;
// timecode_output_module::OutputSigLevelType_t HeadphoneOutputLevel;
// TimecodeFormat_t TimecodeFormat;
// XsyncTimecode_t TimecodeNow;
// DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_getTimecodeSrcSelect(TimecodeSrcSelect));
// DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_getBncOutputLevel(BncOutputLevel));
// DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_getHeadphoneOutputLevel(HeadphoneOutputLevel));
// DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_getTimecodeFormat(TimecodeFormat));
// DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_getTimecodeNow(TimecodeNow));
// ui->TimecodeOutputModule_TimecodeSrcSelect->setCurrentText(QString::fromStdString(timecode_output_module::TriggerSigType2Str(TimecodeSrcSelect)));
// ui->TimecodeOutputModule_BncOutputLevel->setCurrentText(QString::fromStdString(timecode_output_module::OutputSigLevelType2Str(BncOutputLevel)));
// ui->TimecodeOutputModule_HeadphoneOutputLevel->setCurrentText(QString::fromStdString(timecode_output_module::OutputSigLevelType2Str(HeadphoneOutputLevel)));
// ui->TimecodeOutputModule_TimecodeFormat->setCurrentText(QString::fromStdString(TimecodeFormatToStr(TimecodeFormat)));
// ui->TimecodeOutputModule_TimecodeNow->setText(QString(XsyncTimecodeToStr(TimecodeNow).c_str()));
// }
// void MainWindow::on_TimecodeOutputModule_Update_clicked() {
// auto TimecodeSrcSelect = timecode_output_module::Str2TriggerSigType(ui->TimecodeOutputModule_TimecodeSrcSelect->currentText().toStdString());
// auto BncOutputLevel = timecode_output_module::Str2OutputSigLevelType(ui->TimecodeOutputModule_BncOutputLevel->currentText().toStdString());
// auto HeadphoneOutputLevel = timecode_output_module::Str2OutputSigLevelType(ui->TimecodeOutputModule_HeadphoneOutputLevel->currentText().toStdString());
// DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_setTimecodeSrcSelect(TimecodeSrcSelect));
// DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_setBncOutputLevel(BncOutputLevel));
// DO_XSYNC_FUNC(Xsync::Ins().TimecodeOutputModule_setHeadphoneOutputLevel(HeadphoneOutputLevel));
// }
void MainWindow : : on_CameraSyncPacketGeneratorModule_Update_clicked ( ) {
auto TriggerSig = camera_sync_packet_generator_module : : Str2TriggerSigType ( ui - > CameraSyncPacketGeneratorModule_TriggerSig - > currentText ( ) . toStdString ( ) ) ;
auto ReportPeriod = ui - > CameraSyncPacketGeneratorModule_ReportPeriod - > text ( ) . toUInt ( ) ;
@ -666,7 +571,18 @@ void MainWindow::on_CameraSyncPacketGeneratorModule_ClearPacketIndex_clicked() {
on_CameraSyncPacketGeneratorModule_Read_clicked ( ) ;
}
void MainWindow : : on_TTLInputModule_Read_clicked ( ) {
void MainWindow : : on_tabWidget_currentChanged ( int index ) {
on_RefreshRegsButton_clicked ( ) ;
on_CameraSyncPacketGeneratorModule_Read_clicked ( ) ;
on_TimecodePage_Read_clicked ( ) ;
on_TTLPage_Read_clicked ( ) ;
}
void MainWindow : : on_TTLInputModule_Index_currentIndexChanged ( int index ) { }
void MainWindow : : on_TTLOutputMoudle_ID_currentIndexChanged ( int index ) { }
void MainWindow : : on_TTLPage_Read_clicked ( ) {
{
uint32_t freq1 = 0 ;
uint32_t freq2 = 0 ;
uint32_t freq3 = 0 ;
@ -685,14 +601,145 @@ void MainWindow::on_TTLInputModule_Read_clicked() {
ui - > TTLinModule_ttl_freq_3 - > setText ( QString : : number ( freq3 ) ) ;
ui - > TTLinModule_ttl_freq_4 - > setText ( QString : : number ( freq4 ) ) ;
}
void MainWindow : : on_TTLInputModule_Update_clicked ( ) { }
void MainWindow : : on_tabWidget_currentChanged ( int index ) {
on_RefreshRegsButton_clicked ( ) ;
on_SigGenerator_Read_clicked ( ) ;
on_CameraSyncPacketGeneratorModule_Read_clicked ( ) ;
on_TTLInputModule_Read_clicked ( ) ;
on_TimecodePage_Read_clicked ( ) ;
SignalType_t source ;
uint32_t div ;
uint32_t multi ;
float infreq ;
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 ) ) ;
ui - > TTLOutputModule_SrcSigType_1 - > setCurrentText ( QString : : fromStdString ( SignalType2Str ( source ) ) ) ;
ui - > TTLOutputModule_FreqDivision_1 - > setText ( QString : : number ( div ) ) ;
ui - > TTLOutputModule_FreqMultiplication_1 - > setText ( QString : : number ( multi ) ) ;
ui - > TTLOutputModule_InFreq_1 - > setText ( QString : : number ( infreq , ' f ' , 2 ) ) ;
ui - > TTLOutputModule_OutFreq_1 - > setText ( QString : : number ( outfreq , ' f ' , 2 ) ) ;
}
void MainWindow : : on_TTLInputModule_Index_currentIndexChanged ( int index ) { }
void MainWindow : : on_TTLOutputMoudle_ID_currentIndexChanged ( int index ) { }
{
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 ) ) ;
ui - > TTLOutputModule_SrcSigType_2 - > setCurrentText ( QString : : fromStdString ( SignalType2Str ( source ) ) ) ;
ui - > TTLOutputModule_FreqDivision_2 - > setText ( QString : : number ( div ) ) ;
ui - > TTLOutputModule_FreqMultiplication_2 - > setText ( QString : : number ( multi ) ) ;
ui - > TTLOutputModule_InFreq_2 - > setText ( QString : : number ( infreq , ' f ' , 2 ) ) ;
ui - > TTLOutputModule_OutFreq_2 - > setText ( QString : : number ( outfreq , ' f ' , 2 ) ) ;
}
{
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 ) ) ;
ui - > TTLOutputModule_SrcSigType_3 - > setCurrentText ( QString : : fromStdString ( SignalType2Str ( source ) ) ) ;
ui - > TTLOutputModule_FreqDivision_3 - > setText ( QString : : number ( div ) ) ;
ui - > TTLOutputModule_FreqMultiplication_3 - > setText ( QString : : number ( multi ) ) ;
ui - > TTLOutputModule_InFreq_3 - > setText ( QString : : number ( infreq , ' f ' , 2 ) ) ;
ui - > TTLOutputModule_OutFreq_3 - > setText ( QString : : number ( outfreq , ' f ' , 2 ) ) ;
}
{
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 ) ) ;
ui - > TTLOutputModule_SrcSigType_4 - > setCurrentText ( QString : : fromStdString ( SignalType2Str ( source ) ) ) ;
ui - > TTLOutputModule_FreqDivision_4 - > setText ( QString : : number ( div ) ) ;
ui - > TTLOutputModule_FreqMultiplication_4 - > setText ( QString : : number ( multi ) ) ;
ui - > TTLOutputModule_InFreq_4 - > setText ( QString : : number ( infreq , ' f ' , 2 ) ) ;
ui - > TTLOutputModule_OutFreq_4 - > setText ( QString : : number ( outfreq , ' f ' , 2 ) ) ;
}
}
void MainWindow : : on_TTLPage_Write_clicked ( ) {
{
auto source = Str2SignalType ( ui - > TTLOutputModule_SrcSigType_1 - > currentText ( ) . toStdString ( ) ) ;
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 ) ) ;
}
{
auto source = Str2SignalType ( ui - > TTLOutputModule_SrcSigType_2 - > currentText ( ) . toStdString ( ) ) ;
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 ) ) ;
}
{
auto source = Str2SignalType ( ui - > TTLOutputModule_SrcSigType_3 - > currentText ( ) . toStdString ( ) ) ;
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 ) ) ;
}
{
auto source = Str2SignalType ( ui - > TTLOutputModule_SrcSigType_4 - > currentText ( ) . toStdString ( ) ) ;
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 ) ) ;
}
}
void MainWindow : : on_GenlockPage_Read_clicked ( ) {
{
GenlockFormat_t format ;
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . InternalGenlock_getFormat ( format ) ) ;
ui - > InternalGenlock_Format - > setCurrentText ( QString : : fromStdString ( GenlockFormatToStr ( format ) ) ) ;
}
{
float freq ;
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . ExternalGenlock_detectFreq ( freq ) ) ;
ui - > ExternalGenlock_Freq - > setText ( QString : : number ( freq , ' f ' , 2 ) ) ;
}
{
uint32_t src ;
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . SysGenlock_getSrc ( src ) ) ;
ui - > SysGenlock_Src - > setCurrentText ( QString : : number ( src ) ) ;
}
{
float freq ;
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . 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 ) ) ;
}
{
auto src = ui - > SysGenlock_Src - > currentText ( ) . toUInt ( ) ;
DO_XSYNC_FUNC ( Xsync : : Ins ( ) . SysGenlock_setSrc ( src ) ) ;
}
}