You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 lines
4.0 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3. #include <QMainWindow>
  4. #include <QtCore/QVariant>
  5. #include <QtWidgets/QAction>
  6. #include <QtWidgets/QApplication>
  7. #include <QtWidgets/QGridLayout>
  8. #include <QtWidgets/QLabel>
  9. #include <QtWidgets/QMainWindow>
  10. #include <QtWidgets/QMenu>
  11. #include <QtWidgets/QMenuBar>
  12. #include <QtWidgets/QPushButton>
  13. #include <QtWidgets/QStatusBar>
  14. #include <QtWidgets/QTextBrowser>
  15. #include <QtWidgets/QTextEdit>
  16. #include <QtWidgets/QWidget>
  17. //
  18. #include <fstream>
  19. #include <functional>
  20. #include <iostream>
  21. #include <list>
  22. #include <map>
  23. #include <memory>
  24. #include <set>
  25. #include <sstream>
  26. #include <string>
  27. #include <vector>
  28. //
  29. #include "src/logger.hpp"
  30. #include "src/qfunction.hpp"
  31. #include "src/xsync_udp_factory_impl.hpp"
  32. #include "src/zqthread.hpp"
  33. QT_BEGIN_NAMESPACE
  34. namespace Ui {
  35. class MainWindow;
  36. }
  37. QT_END_NAMESPACE
  38. typedef enum {
  39. kreg_val_type_dotted_hex, // 点分16进制
  40. kreg_val_type_dotted_decimal, // 点分10进制
  41. kreg_val_type_str,
  42. kreg_val_type_hex,
  43. kreg_val_type_decimal,
  44. kreg_val_type_binary,
  45. kreg_val_type_freq,
  46. kreg_val_type_signal,
  47. } reg_val_type_t;
  48. class DispalyRegIterm {
  49. public:
  50. QLabel *label = 0;
  51. QTextBrowser *regBrowser = 0;
  52. QTextEdit *regEditer = 0;
  53. QPushButton *writerButton = 0;
  54. uint32_t regvalcache;
  55. reg_val_type_t regvaltype;
  56. };
  57. class MainWindow : public QMainWindow {
  58. Q_OBJECT
  59. private:
  60. std::map<int32_t, DispalyRegIterm *> m_regdisplayer;
  61. std::unique_ptr<iflytop::ZQThread> m_thread;
  62. public:
  63. Ui::MainWindow *ui;
  64. MainWindow(QWidget *parent = nullptr);
  65. ~MainWindow();
  66. private:
  67. void construct_reg_table();
  68. void push_reg(QWidget *parent, int off, const char *regname, int32_t regadd, int32_t rwflag, reg_val_type_t regvaltype);
  69. /*******************************************************************************
  70. * *
  71. *******************************************************************************/
  72. static void log_output(QtMsgType type, const QMessageLogContext &context, const QString &msg);
  73. private slots:
  74. void append_log_slot(QString);
  75. void on_RefreshRegsButton_clicked();
  76. void on_ClearLogButton_clicked();
  77. void on_Connect2XsyncButton_clicked();
  78. void on_GenNewMac_clicked();
  79. void on_FactoryReset_clicked();
  80. void on_Reboot_clicked();
  81. void on_ChangeNetCfg_clicked();
  82. void updateUI_timeCodeInfo_slot(QString);
  83. void updateUI_cameraSyncInfo_slot(QString);
  84. void updateUI_reg_slot(int32_t regadd, uint32_t regval);
  85. void doinui_slot(QFunction);
  86. // void on_CameraSyncPacketGeneratorModule_Update_clicked();
  87. // void on_CameraSyncPacketGeneratorModule_Read_clicked();
  88. // void on_CameraSyncPacketGeneratorModule_ClearPacketIndex_clicked();
  89. void on_TimecodePage_Read_clicked();
  90. void on_TimecodePage_Update_clicked();
  91. void on_tabWidget_currentChanged(int index);
  92. void on_TTLInputModule_Index_currentIndexChanged(int index);
  93. void on_TTLOutputMoudle_ID_currentIndexChanged(int index);
  94. void on_TTLPage_Read_clicked();
  95. void on_TTLPage_Write_clicked();
  96. void on_GenlockPage_Read_clicked();
  97. void on_GenlockPage_Write_clicked();
  98. void on_SysClockPage_Read_clicked();
  99. void on_SysClockPage_Wirte_clicked();
  100. void on_RecordSigGen_Read_clicked();
  101. void on_RecordSigGen_Write_clicked();
  102. void on_RecordSigGenerator_manualStart_clicked();
  103. void on_RecordSigGenerator_manualStop_clicked();
  104. signals:
  105. void append_log_signal(QString str);
  106. void updateUI_timeCodeInfo_signal(QString);
  107. void updateUI_cameraSyncInfo_signal(QString);
  108. void updateUI_reg_signal(int32_t regadd, uint32_t regval);
  109. void doinui_signal(QFunction);
  110. private:
  111. void mainWindowsRun();
  112. void updateUI_reg(uint32_t regoff);
  113. void UI_SysClockPageConstruct();
  114. void UI_TTLOutputMoudleConstruct();
  115. void UI_TimecodePageConstruct();
  116. void UI_GenlockPageConstruct();
  117. void UI_RecordSigGenConstruct();
  118. // void UI_CameraSyncPacketGeneratorModuleConstruct();
  119. void UI_TTLPageConstruct();
  120. };
  121. #endif // MAINWINDOW_H