commit c2718091162d963b7a9213e1666d7d1250f0cf66 Author: leo Date: Thu Jul 31 19:11:29 2025 +0800 Init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..59b9c39 --- /dev/null +++ b/.gitignore @@ -0,0 +1,82 @@ +# This file is used to ignore files which are generated +# ---------------------------------------------------------------------------- + +*~ +*.autosave +*.a +*.core +*.moc +*.o +*.obj +*.orig +*.rej +*.so +*.so.* +*_pch.h.cpp +*_resource.rc +*.qm +.#* +*.*# +core +!core/ +tags +.DS_Store +.directory +*.debug +Makefile* +*.prl +*.app +moc_*.cpp +ui_*.h +qrc_*.cpp +Thumbs.db +*.res +*.rc +/.qmake.cache +/.qmake.stash + +# qtcreator generated files +*.pro.user* +*.qbs.user* +CMakeLists.txt.user* + +# xemacs temporary files +*.flc + +# Vim temporary files +.*.swp + +# Visual Studio generated files +*.ib_pdb_index +*.idb +*.ilk +*.pdb +*.sln +*.suo +*.vcproj +*vcproj.*.*.user +*.ncb +*.sdf +*.opensdf +*.vcxproj +*vcxproj.* + +# MinGW generated files +*.Debug +*.Release + +# Python byte code +*.pyc + +# Binaries +# -------- +*.dll +*.exe + +# Directories with generated files +.moc/ +.obj/ +.pch/ +.rcc/ +.uic/ +/build*/ SP713_Upper.pro.* diff --git a/SP713_Upper.pro b/SP713_Upper.pro new file mode 100644 index 0000000..4a534b1 --- /dev/null +++ b/SP713_Upper.pro @@ -0,0 +1,27 @@ +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++17 + +# You can make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + dialogcalibrate.cpp \ + main.cpp \ + mainwindow.cpp + +HEADERS += \ + dialogcalibrate.h \ + mainwindow.h + +FORMS += \ + dialogcalibrate.ui \ + mainwindow.ui + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target diff --git a/calibrate.cpp b/calibrate.cpp new file mode 100644 index 0000000..81b896e --- /dev/null +++ b/calibrate.cpp @@ -0,0 +1,5 @@ +#include "calibrate.h" + +Calibrate::Calibrate(QWidget *parent) + : QWidget{parent} +{} diff --git a/calibrate.h b/calibrate.h new file mode 100644 index 0000000..1b14325 --- /dev/null +++ b/calibrate.h @@ -0,0 +1,15 @@ +#ifndef CALIBRATE_H +#define CALIBRATE_H + +#include + +class Calibrate : public QWidget +{ + Q_OBJECT +public: + explicit Calibrate(QWidget *parent = nullptr); + +signals: +}; + +#endif // CALIBRATE_H diff --git a/dialogcalibrate.cpp b/dialogcalibrate.cpp new file mode 100644 index 0000000..0a75128 --- /dev/null +++ b/dialogcalibrate.cpp @@ -0,0 +1,20 @@ +#include "dialogcalibrate.h" +#include "ui_dialogcalibrate.h" + +DialogCalibrate::DialogCalibrate(QWidget *parent) + : QDialog(parent) + , ui(new Ui::DialogCalibrate) +{ + ui->setupUi(this); +} + +DialogCalibrate::~DialogCalibrate() +{ + delete ui; +} + +void DialogCalibrate::on_pushButton_clicked() +{ + deleteLater(); +} + diff --git a/dialogcalibrate.h b/dialogcalibrate.h new file mode 100644 index 0000000..05abed3 --- /dev/null +++ b/dialogcalibrate.h @@ -0,0 +1,25 @@ +#ifndef DIALOGCALIBRATE_H +#define DIALOGCALIBRATE_H + +#include + +namespace Ui { +class DialogCalibrate; +} + +class DialogCalibrate : public QDialog +{ + Q_OBJECT + +public: + explicit DialogCalibrate(QWidget *parent = nullptr); + ~DialogCalibrate(); + +private slots: + void on_pushButton_clicked(); + +private: + Ui::DialogCalibrate *ui; +}; + +#endif // DIALOGCALIBRATE_H diff --git a/dialogcalibrate.ui b/dialogcalibrate.ui new file mode 100644 index 0000000..99e2e91 --- /dev/null +++ b/dialogcalibrate.ui @@ -0,0 +1,134 @@ + + + DialogCalibrate + + + + 0 + 0 + 720 + 773 + + + + Dialog + + + + + + Turntable + + + + + + + Camera + + + + + + + Power + + + + + + + + 0 + 0 + + + + Algorithm + + + + + + Parameter 3: + + + + + + + Parameter 4: + + + + + + + + + + Parameter 1: + + + + + + + Parameter 0: + + + + + + + + + + + + + Select + + + + + + + + + + + + + + + + Parameter 5: + + + + + + + + + + Parameter 2: + + + + + + + + + + Close + + + + + + + + diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..fd3e533 --- /dev/null +++ b/main.cpp @@ -0,0 +1,11 @@ +#include "mainwindow.h" + +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/mainwindow.cpp b/mainwindow.cpp new file mode 100644 index 0000000..dbe1686 --- /dev/null +++ b/mainwindow.cpp @@ -0,0 +1,27 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent) + , ui(new Ui::MainWindow) +{ + ui->setupUi(this); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + +void MainWindow::on_pushButton_14_clicked() +{ + dc= new DialogCalibrate(this); + dc->show(); +} + + +void MainWindow::on_comboBox_activated(int index) +{ + ui->stackedWidget->setCurrentIndex(ui->comboBox->currentIndex()); +} + diff --git a/mainwindow.h b/mainwindow.h new file mode 100644 index 0000000..df2354c --- /dev/null +++ b/mainwindow.h @@ -0,0 +1,31 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include "dialogcalibrate.h" + + +QT_BEGIN_NAMESPACE +namespace Ui { +class MainWindow; +} +QT_END_NAMESPACE + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + +private slots: + void on_pushButton_14_clicked(); + + void on_comboBox_activated(int index); + +private: + Ui::MainWindow *ui; + DialogCalibrate *dc; +}; +#endif // MAINWINDOW_H diff --git a/mainwindow.ui b/mainwindow.ui new file mode 100644 index 0000000..b7c80ad --- /dev/null +++ b/mainwindow.ui @@ -0,0 +1,618 @@ + + + MainWindow + + + + 0 + 0 + 839 + 808 + + + + MainWindow + + + + + + + + 0 + 0 + + + + 0 + + + + + + + + 0 + 0 + + + + UART + + + + + + Open + + + + + + + Refresh + + + + + + + Close + + + + + + + Save Setting + + + + + + + 0 + + + + + + + Timeout(ms): + + + Qt::AlignCenter + + + + + + + + + + + + + Data Bit: + + + Qt::AlignCenter + + + + + + + Stop Bit: + + + Qt::AlignCenter + + + + + + + + + + + + + Baud Rate: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Parity Bit: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + + + + UART Device List: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + + + SPI + + + + + + SPI Device List: + + + Qt::AlignCenter + + + + + + + + + + DataBits: + + + Qt::AlignCenter + + + + + + + Open + + + + + + + SPI Mode: + + + Qt::AlignCenter + + + + + + + + + + + + + + 0 + 0 + + + + Save Setting + + + + + + + + + + + + + LSB/MSB + + + Qt::AlignCenter + + + + + + + Clock: + + + Qt::AlignCenter + + + + + + + Refresh + + + + + + + Close + + + + + + + + + + + + + + + 0 + 0 + + + + Mode Swtich: + + + + + + + Voltage Check + + + + + + Import Voltage From File + + + + + + + Read Voltage From Chip + + + + + + + 16 + + + 16 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Start Calibrate + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Log + + + + + + true + + + + 0 + 0 + + + + + + + + Clear + + + + + + + + + + + UART + + + + + SPI + + + + + + + + + 0 + 0 + + + + Chip Test + + + + + + FBK_EN + + + + + + + Reg Value + + + + + + + + + Reg 3: + + + + + + + Reg 6: + + + + + + + + + + + + + Reg 2: + + + + + + + + + + + + + Reg 5: + + + + + + + + + + Reg 4: + + + + + + + Reg 1: + + + + + + + + + + TRIG_TADC + + + + + + + + + + Read Reg + + + + + + + + + + DAC #: + + + + + + + TEST_EN + + + + + + + + + + + + + DAC Zone: + + + + + + + ICON18: + + + + + + + EN_TADC + + + + + + + TEMPTEST_EN + + + + + + + Write Reg + + + + + + + N_CLKDIV18: + + + + + + + + + + + + 0 + 0 + 839 + 21 + + + + + + + +