Browse Source

update

master
zhaohe 1 year ago
parent
commit
ad87e30dcd
  1. 2
      libxsync
  2. 73
      mainwindow.cpp
  3. 12
      mainwindow.h
  4. 299
      mainwindow.ui

2
libxsync

@ -1 +1 @@
Subproject commit 36482b04079dbc550fdc524bccd76324b8b8cefa
Subproject commit e493c4b01222c9c9072dc91f658438641043a9a1

73
mainwindow.cpp

@ -390,6 +390,18 @@ void MainWindow::UI_GenlockPageConstruct() {
ui->SysGenlock_Src->addItem(QString::fromStdString("1")); ui->SysGenlock_Src->addItem(QString::fromStdString("1"));
} }
void MainWindow::UI_SysClockPageConstruct() {
ui->SysClock_Src->clear();
ui->SysClock_Src->addItem(QString::fromStdString(SignalType2Str(SIGNAL_TTLIN1)));
ui->SysClock_Src->addItem(QString::fromStdString(SignalType2Str(SIGNAL_TTLIN2)));
ui->SysClock_Src->addItem(QString::fromStdString(SignalType2Str(SIGNAL_TTLIN3)));
ui->SysClock_Src->addItem(QString::fromStdString(SignalType2Str(SIGNAL_TTLIN4)));
ui->SysClock_Src->addItem(QString::fromStdString(SignalType2Str(SIGNAL_INTERNAL_CLOCK_SIG)));
ui->SysClock_Src->addItem(QString::fromStdString(SignalType2Str(SIGNAL_SYS_GENLOCK_OUTPUT)));
ui->SysClock_Src->addItem(QString::fromStdString(SignalType2Str(SIGNAL_SYS_TIMECODE_FREQ_OUTPUT)));
}
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) {
ui->setupUi(this); ui->setupUi(this);
m_mainWindow = this; m_mainWindow = this;
@ -403,6 +415,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
UI_CameraSyncPacketGeneratorModuleConstruct(); UI_CameraSyncPacketGeneratorModuleConstruct();
UI_TTLPageConstruct(); UI_TTLPageConstruct();
UI_GenlockPageConstruct(); UI_GenlockPageConstruct();
UI_SysClockPageConstruct();
/******************************************************************************* /*******************************************************************************
* * * *
@ -707,7 +720,6 @@ void MainWindow::on_TTLPage_Write_clicked() {
} }
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(Xsync::Ins().InternalGenlock_getFormat(format));
@ -743,3 +755,62 @@ void MainWindow::on_GenlockPage_Write_clicked() {
DO_XSYNC_FUNC(Xsync::Ins().SysGenlock_setSrc(src)); DO_XSYNC_FUNC(Xsync::Ins().SysGenlock_setSrc(src));
} }
} }
void MainWindow::on_SysClockPage_Read_clicked() {
{
float freq;
DO_XSYNC_FUNC(Xsync::Ins().InternalClock_getFreq(freq));
ui->InternalClock_Freq->setText(QString::number(freq, 'f', 2));
}
{
SignalType_t src;
DO_XSYNC_FUNC(Xsync::Ins().SysClock_getSrc(src));
ui->SysClock_Src->setCurrentText(QString::fromStdString(SignalType2Str(src)));
}
{
uint32_t div;
DO_XSYNC_FUNC(Xsync::Ins().SysClock_geFreqtDivision(div));
ui->SysClock_FreqtDivision->setText(QString::number(div));
}
{
uint32_t multi;
DO_XSYNC_FUNC(Xsync::Ins().SysClock_getFreqMultiplication(multi));
ui->SysClock_FreqMultiplication->setText(QString::number(multi));
}
{
float freq;
DO_XSYNC_FUNC(Xsync::Ins().SysClock_readInSigFreq(freq));
ui->SysClock_InSigFreq->setText(QString::number(freq, 'f', 2));
}
{
float freq;
DO_XSYNC_FUNC(Xsync::Ins().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));
}
{
auto src = Str2SignalType(ui->SysClock_Src->currentText().toStdString());
DO_XSYNC_FUNC(Xsync::Ins().SysClock_setSrc(src));
}
{
auto div = ui->SysClock_FreqtDivision->text().toUInt();
DO_XSYNC_FUNC(Xsync::Ins().SysClock_setFreqDivision(div));
}
{
auto multi = ui->SysClock_FreqMultiplication->text().toUInt();
DO_XSYNC_FUNC(Xsync::Ins().SysClock_setFreqMultiplication(multi));
}
}

12
mainwindow.h

@ -102,7 +102,6 @@ class MainWindow : public QMainWindow {
void on_CameraSyncPacketGeneratorModule_Read_clicked(); void on_CameraSyncPacketGeneratorModule_Read_clicked();
void on_CameraSyncPacketGeneratorModule_ClearPacketIndex_clicked(); void on_CameraSyncPacketGeneratorModule_ClearPacketIndex_clicked();
void on_TimecodePage_Read_clicked(); void on_TimecodePage_Read_clicked();
void on_TimecodePage_Update_clicked(); void on_TimecodePage_Update_clicked();
@ -118,10 +117,12 @@ class MainWindow : public QMainWindow {
void on_GenlockPage_Read_clicked(); void on_GenlockPage_Read_clicked();
void on_GenlockPage_Write_clicked(); void on_GenlockPage_Write_clicked();
// InternalGenlock_Format
// ExternalGenlock_Freq
// SysGenlock_Src
// SysGenlock_Freq
void on_SysClockPage_Read_clicked();
void on_SysClockPage_Wirte_clicked();
signals: signals:
void append_log_signal(QString str); void append_log_signal(QString str);
void updateUI_timeCodeInfo_signal(QString); void updateUI_timeCodeInfo_signal(QString);
@ -133,6 +134,7 @@ class MainWindow : public QMainWindow {
void mainWindowsRun(); void mainWindowsRun();
void updateUI_reg(uint32_t regoff); void updateUI_reg(uint32_t regoff);
void UI_SysClockPageConstruct();
void UI_TTLOutputMoudleConstruct(); void UI_TTLOutputMoudleConstruct();
void UI_TimecodePageConstruct(); void UI_TimecodePageConstruct();
void UI_GenlockPageConstruct(); void UI_GenlockPageConstruct();

299
mainwindow.ui

@ -141,7 +141,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>3</number>
<number>4</number>
</property> </property>
<widget class="QWidget" name="tab_2"> <widget class="QWidget" name="tab_2">
<attribute name="title"> <attribute name="title">
@ -1747,6 +1747,303 @@
</widget> </widget>
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>SysClock</string>
</attribute>
<widget class="QGroupBox" name="groupBox_13">
<property name="geometry">
<rect>
<x>130</x>
<y>170</y>
<width>401</width>
<height>211</height>
</rect>
</property>
<property name="title">
<string>SYS_CLK</string>
</property>
<widget class="QLabel" name="label_54">
<property name="geometry">
<rect>
<x>20</x>
<y>30</y>
<width>61</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>source</string>
</property>
</widget>
<widget class="QComboBox" name="SysClock_Src">
<property name="geometry">
<rect>
<x>70</x>
<y>30</y>
<width>211</width>
<height>31</height>
</rect>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
<widget class="QLineEdit" name="SysClock_FreqtDivision">
<property name="geometry">
<rect>
<x>70</x>
<y>70</y>
<width>211</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string/>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
<widget class="QLineEdit" name="SysClock_FreqMultiplication">
<property name="geometry">
<rect>
<x>70</x>
<y>110</y>
<width>211</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string/>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="label_55">
<property name="geometry">
<rect>
<x>20</x>
<y>70</y>
<width>61</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>分频</string>
</property>
</widget>
<widget class="QLabel" name="label_56">
<property name="geometry">
<rect>
<x>20</x>
<y>110</y>
<width>61</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>倍频</string>
</property>
</widget>
<widget class="QLineEdit" name="SysClock_InSigFreq">
<property name="geometry">
<rect>
<x>110</x>
<y>160</y>
<width>61</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string/>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
<widget class="QLineEdit" name="SysClock_OutSigFreq">
<property name="geometry">
<rect>
<x>320</x>
<y>160</y>
<width>61</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string/>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="label_57">
<property name="geometry">
<rect>
<x>20</x>
<y>160</y>
<width>81</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>输入信号频率</string>
</property>
</widget>
<widget class="QLabel" name="label_58">
<property name="geometry">
<rect>
<x>230</x>
<y>160</y>
<width>81</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>输出信号频率</string>
</property>
</widget>
</widget>
<widget class="QGroupBox" name="groupBox_12">
<property name="geometry">
<rect>
<x>390</x>
<y>40</y>
<width>221</width>
<height>81</height>
</rect>
</property>
<property name="title">
<string>内部时钟发生器</string>
</property>
<widget class="QLabel" name="label_53">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>41</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Freq</string>
</property>
</widget>
<widget class="QLineEdit" name="InternalClock_Freq">
<property name="geometry">
<rect>
<x>50</x>
<y>20</y>
<width>151</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string/>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</widget>
<widget class="QGroupBox" name="groupBox_14">
<property name="geometry">
<rect>
<x>40</x>
<y>40</y>
<width>71</width>
<height>41</height>
</rect>
</property>
<property name="title">
<string>TTL_IN</string>
</property>
</widget>
<widget class="QGroupBox" name="groupBox_16">
<property name="geometry">
<rect>
<x>130</x>
<y>40</y>
<width>91</width>
<height>41</height>
</rect>
</property>
<property name="title">
<string>SYS_GENLOCK</string>
</property>
</widget>
<widget class="QGroupBox" name="groupBox_15">
<property name="geometry">
<rect>
<x>230</x>
<y>40</y>
<width>101</width>
<height>41</height>
</rect>
</property>
<property name="title">
<string>SYS_TIMECODE</string>
</property>
</widget>
<widget class="QPushButton" name="SysClockPage_Read">
<property name="geometry">
<rect>
<x>660</x>
<y>30</y>
<width>81</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Read</string>
</property>
</widget>
<widget class="QPushButton" name="SysClockPage_Wirte">
<property name="geometry">
<rect>
<x>660</x>
<y>70</y>
<width>81</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Write</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="tab_6"> <widget class="QWidget" name="tab_6">
<attribute name="title"> <attribute name="title">
<string>相机同步消息上报6</string> <string>相机同步消息上报6</string>

Loading…
Cancel
Save