Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
取消了命名空间,增加了图标(cmake宏定义命名空间和图标有冲突)
  • Loading branch information
supine0703 committed Mar 18, 2024
1 parent 8062f3b commit 52ef47a
Show file tree
Hide file tree
Showing 43 changed files with 73 additions and 82 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ dkms.conf
!/proj/proteus/*.pdsprj
!/proj/hex/*.hex
/qt/build*/
/qt/Release
/qt/Release
*.7z
Binary file modified qt/Release.7z
Binary file not shown.
19 changes: 3 additions & 16 deletions qt/power_carrier/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ set(GLOBAL_DEFINED
DB_PATH="${FILES_PATH}/db"
)

string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPERCASE)
set(PROJECT_NAMESPACE_DEFINED
PROJECT_NAMESPACE_NAME=${PROJECT_NAME}
PROJECT_BEGIN_NAMESPACE=namespace\ ${PROJECT_NAME}\ \{
PROJECT_USING_NAMESPACE=using\ namespace\ ${PROJECT_NAME}
PROJECT_END_NAMESPACE=\}
)

set(INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/include")
set(SRC_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(UI_PATH "${CMAKE_CURRENT_SOURCE_DIR}/ui")
Expand All @@ -44,7 +36,6 @@ list(APPEND CMAKE_AUTOUIC_SEARCH_PATHS
)

include_directories(
"${CMAKE_CURRENT_SOURCE_DIR}"
"${INCLUDE_PATH}"
"${INCLUDE_PATH}/dialog"
"${INCLUDE_PATH}/widget"
Expand All @@ -63,18 +54,15 @@ file(GLOB_RECURSE ISU_FILES
# file(GLOB UI_FILES "${UI_PATH}/*.ui")

set(PROJECT_SOURCES
${ISU_FILES}
_res.qrc
${ISU_FILES}
res/_res.qrc
res/_app.rc
)

if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(${PROJECT_NAME}
MANUAL_FINALIZATION
${PROJECT_SOURCES}

# safetools.h safetools.cpp
# testruntime.hpp

)
# Define target properties for Android with Qt 6 as:
# set_property(TARGET power_carrier APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
Expand All @@ -96,7 +84,6 @@ endif()

target_compile_definitions(${PROJECT_NAME} PRIVATE
${GLOBAL_DEFINED}
${PROJECT_NAMESPACE_DEFINED}
)
target_link_libraries(${PROJECT_NAME} PRIVATE
Qt${QT_VERSION_MAJOR}::Widgets
Expand Down
9 changes: 0 additions & 9 deletions qt/power_carrier/_res.qrc

This file was deleted.

2 changes: 1 addition & 1 deletion qt/power_carrier/abandon/communication.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "communication.h"

PROJECT_USING_NAMESPACE;


Communication::Communication(quint8 pc_address)
: addr(pc_address)
Expand Down
4 changes: 2 additions & 2 deletions qt/power_carrier/abandon/communication.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <QtTypes>

PROJECT_BEGIN_NAMESPACE

class Communication
{
Expand All @@ -16,6 +16,6 @@ class Communication
quint8 addr;
};

PROJECT_END_NAMESPACE

#endif // COMMUNICATION_H
2 changes: 1 addition & 1 deletion qt/power_carrier/abandon/mainwindow_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <QFrame>
#include <QTableView>

PROJECT_USING_NAMESPACE;


MainWindow_2::MainWindow_2(QWidget* parent)
: QMainWindow{parent}
Expand Down
4 changes: 2 additions & 2 deletions qt/power_carrier/abandon/mainwindow_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <QMainWindow>

PROJECT_BEGIN_NAMESPACE

class SerialPortWidget;

Expand Down Expand Up @@ -33,6 +33,6 @@ class MainWindow_2 : public QMainWindow
signals:
};

PROJECT_END_NAMESPACE

#endif // MAINWINDOW_2_H
2 changes: 1 addition & 1 deletion qt/power_carrier/abandon/serialport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <QMessageBox>
#include <QMetaEnum>

PROJECT_USING_NAMESPACE;


SerialPort::SerialPort(QObject* parent) : QObject {parent}
{
Expand Down
4 changes: 2 additions & 2 deletions qt/power_carrier/abandon/serialport.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <QObject>
#include <QSerialPort>

PROJECT_BEGIN_NAMESPACE

class SerialPort : public QObject
{
Expand Down Expand Up @@ -46,6 +46,6 @@ public slots:
void receiveStr(QString);
};

PROJECT_END_NAMESPACE

#endif // SERIALPORT_H
File renamed without changes.
4 changes: 2 additions & 2 deletions qt/power_carrier/include/dialog/addslavedialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class AddSlaveDialog;

class QTableWidgetItem;

PROJECT_BEGIN_NAMESPACE

class AddSlaveDialog : public QDialog
{
Expand Down Expand Up @@ -70,6 +70,6 @@ private slots:
void updateInfo(QStringList, QStringList, QStringList);
};

PROJECT_END_NAMESPACE

#endif // ADDSLAVEDIALOG_H
4 changes: 2 additions & 2 deletions qt/power_carrier/include/dialog/comrangedialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Ui {
class ComRangeDialog;
}

PROJECT_BEGIN_NAMESPACE

class ComRangeDialog : public QDialog
{
Expand Down Expand Up @@ -37,6 +37,6 @@ private slots:
signals:
};

PROJECT_END_NAMESPACE

#endif // COMRANGEDIALOG_H
4 changes: 2 additions & 2 deletions qt/power_carrier/include/dialog/newdbfiledialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Ui {
class NewDBFileDialog;
}

PROJECT_BEGIN_NAMESPACE

class NewDBFileDialog : public QDialog
{
Expand Down Expand Up @@ -43,6 +43,6 @@ private slots:
QString f;
};

PROJECT_END_NAMESPACE

#endif // NEWDBFILEDIALOG_H
4 changes: 2 additions & 2 deletions qt/power_carrier/include/model/sqltablemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <QSqlQueryModel>

PROJECT_BEGIN_NAMESPACE

class SqlTableModel : public QSqlQueryModel
{
Expand All @@ -15,6 +15,6 @@ class SqlTableModel : public QSqlQueryModel
QVariant data(const QModelIndex& index, int role) const override;
};

PROJECT_END_NAMESPACE

#endif // SQLTABLEMODEL_H
4 changes: 2 additions & 2 deletions qt/power_carrier/include/object/comlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class QThread;
class QComboBox;


PROJECT_BEGIN_NAMESPACE

class SerialPortManager;

Expand Down Expand Up @@ -49,6 +49,6 @@ private slots:
void currentComChanged();
};

PROJECT_END_NAMESPACE

#endif // COMLIST_H
4 changes: 2 additions & 2 deletions qt/power_carrier/include/object/configurations.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#define ICON_FONT Configurations::LoadIconFont

PROJECT_BEGIN_NAMESPACE

class Configurations
{
Expand Down Expand Up @@ -56,6 +56,6 @@ class Configurations

#define _MAIN_WIDGET_WIDTH_ "/widget/width"

PROJECT_END_NAMESPACE

#endif // CONFIGURATIONS_H
4 changes: 2 additions & 2 deletions qt/power_carrier/include/object/crc16.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <QByteArray>

PROJECT_BEGIN_NAMESPACE

class CRC16
{
Expand All @@ -19,6 +19,6 @@ class CRC16
static quint16* t1021;
};

PROJECT_END_NAMESPACE

#endif // CRC16_H
4 changes: 2 additions & 2 deletions qt/power_carrier/include/object/serialportmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class QMutex;
class QTimer;


PROJECT_BEGIN_NAMESPACE

class SerialPortManager : public QObject
{
Expand Down Expand Up @@ -47,6 +47,6 @@ public slots:
void availablePortsChanged();
};

PROJECT_END_NAMESPACE

#endif // SERIALPORTMANAGER_H
4 changes: 2 additions & 2 deletions qt/power_carrier/include/object/serialportworker.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class QSerialPort;
class QMutex;

PROJECT_BEGIN_NAMESPACE

class SerialPortWorker : public QObject
{
Expand Down Expand Up @@ -73,6 +73,6 @@ private slots:
void errorLog(QString);
};

PROJECT_END_NAMESPACE

#endif // SERIALPORTWORKER_H
4 changes: 2 additions & 2 deletions qt/power_carrier/include/widget/mainwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class MainWidget;
class QStatusBar;


PROJECT_BEGIN_NAMESPACE

class SerialPortWidget;
class SQLiteWidget;
Expand Down Expand Up @@ -49,6 +49,6 @@ class MainWidget : public QWidget
SQLiteWidget* sqlWidget;
};

PROJECT_END_NAMESPACE

#endif // MAINWIDGET_H
4 changes: 2 additions & 2 deletions qt/power_carrier/include/widget/serialportwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class SerialPortWidget;
class QMessageBox;


PROJECT_BEGIN_NAMESPACE

class ComList;
class ComRangeDialog;
Expand Down Expand Up @@ -136,6 +136,6 @@ private slots:
void slaveStateUpdate(quint8, quint8);
};

PROJECT_END_NAMESPACE

#endif // SERIALPORTWIDGET_H
4 changes: 2 additions & 2 deletions qt/power_carrier/include/widget/sqlitewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class QDataWidgetMapper;
class QItemSelectionModel;
class QSortFilterProxyModel;

PROJECT_BEGIN_NAMESPACE

class NewDBFileDialog;
class AddSlaveDialog;
Expand Down Expand Up @@ -85,6 +85,6 @@ private slots:
void slaveStateChange(quint8 ,quint8);
};

PROJECT_END_NAMESPACE

#endif // SQLITEWIDGET_H
10 changes: 10 additions & 0 deletions qt/power_carrier/res/_res.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<RCC>
<qresource prefix="/icon">
<file>iconfont/iconfont.ttf</file>
<file>img/AppIcon.ico</file>
</qresource>
<qresource prefix="/font">
<file>font_family/JetBrainsMono-Medium.ttf</file>
<file>font_family/YouSheYuFeiTeJianKangTi-2.ttf</file>
</qresource>
</RCC>
Empty file.
Binary file added qt/power_carrier/res/img/AppIcon.ico
Binary file not shown.
Binary file added qt/power_carrier/res/img/PowerCarrier.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions qt/power_carrier/share/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ parity_index=3
[log_settings]
log1_selector=true
log2_selector=false
log1_eyes_state=true
log1_eyes_state=false
log2_eyes_state=false

[group_settings]
group1_hidden=true
group2_hidden=false
group3_hidden=false
group2_hidden=true
group3_hidden=true
log_splitter_state=@ByteArray(\0\0\0\xff\0\0\0\x1\0\0\0\x2\xff\xff\xff\xff\xff\xff\xff\xff\0\xff\xff\xff\xff\x1\0\0\0\x2\x1)

[left_tool]
sp_assistant_hidden=false

[widget]
left_tool_index=0
left_tool_index=-1
size=@Size(815 708)
width=815

Expand Down
2 changes: 1 addition & 1 deletion qt/power_carrier/src/dialog/addslavedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <QMessageBox>

PROJECT_USING_NAMESPACE;



AddSlaveDialog::AddSlaveDialog(QWidget* parent)
Expand Down
Loading

0 comments on commit 52ef47a

Please sign in to comment.