Skip to content

Commit

Permalink
修复在部分电脑上打不开帮助文件的问题;解决需重启软件才能切换为默认样式的问题;版本号修改为1.0.4.0;添加License
Browse files Browse the repository at this point in the history
  • Loading branch information
Skythinker616 committed Jan 5, 2022
1 parent 49ecd74 commit 493a412
Show file tree
Hide file tree
Showing 9 changed files with 693 additions and 18 deletions.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions QT/MotorController.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ CONFIG += c++11
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS \
APP_BUILD_DATE=\\\"2021.9.20\\\"
APP_BUILD_DATE=\\\"2021.12.16\\\"

# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

VERSION = 1.0.3.0
VERSION = 1.0.4.0

SOURCES += \
aboutdialog.cpp \
Expand Down
2 changes: 1 addition & 1 deletion QT/MotorController.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.11.0, 2021-10-22T11:57:55. -->
<!-- Written by QtCreator 4.11.0, 2021-12-16T11:43:35. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down
2 changes: 0 additions & 2 deletions QT/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,5 +216,3 @@
##### 修改界面样式

`菜单`中可以进行界面样式的选择,除默认样式外还有明亮和黑暗两种样式可以选择,该项设置在软件重启后仍保持有效

> 若由其他样式修改为默认样式,需在设置后重启软件
5 changes: 1 addition & 4 deletions QT/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" href="file:///c:\Users\Skythinker\.vscode\extensions\shd101wyy.markdown-preview-enhanced-0.6.0\node_modules\@shd101wyy\mume\dependencies\katex\katex.min.css">
<link rel="stylesheet" href="file:///c:\Users\Skythinker\.vscode\extensions\shd101wyy.markdown-preview-enhanced-0.6.1\node_modules\@shd101wyy\mume\dependencies\katex\katex.min.css">



Expand Down Expand Up @@ -619,9 +619,6 @@ <h5 class="mume-header" id="%E5%90%8C%E6%AD%A5%E8%87%B3%E4%B8%8B%E4%BD%8D%E6%9C%
<h5 class="mume-header" id="%E4%BF%AE%E6%94%B9%E7%95%8C%E9%9D%A2%E6%A0%B7%E5%BC%8F">&#x4FEE;&#x6539;&#x754C;&#x9762;&#x6837;&#x5F0F;</h5>

<p>&#x5728;<code>&#x83DC;&#x5355;</code>&#x4E2D;&#x53EF;&#x4EE5;&#x8FDB;&#x884C;&#x754C;&#x9762;&#x6837;&#x5F0F;&#x7684;&#x9009;&#x62E9;&#xFF0C;&#x9664;&#x9ED8;&#x8BA4;&#x6837;&#x5F0F;&#x5916;&#x8FD8;&#x6709;&#x660E;&#x4EAE;&#x548C;&#x9ED1;&#x6697;&#x4E24;&#x79CD;&#x6837;&#x5F0F;&#x53EF;&#x4EE5;&#x9009;&#x62E9;&#xFF0C;&#x8BE5;&#x9879;&#x8BBE;&#x7F6E;&#x5728;&#x8F6F;&#x4EF6;&#x91CD;&#x542F;&#x540E;&#x4ECD;&#x4FDD;&#x6301;&#x6709;&#x6548;</p>
<blockquote>
<p>&#x82E5;&#x7531;&#x5176;&#x4ED6;&#x6837;&#x5F0F;&#x4FEE;&#x6539;&#x4E3A;&#x9ED8;&#x8BA4;&#x6837;&#x5F0F;&#xFF0C;&#x9700;&#x5728;&#x8BBE;&#x7F6E;&#x540E;&#x91CD;&#x542F;&#x8F6F;&#x4EF6;</p>
</blockquote>

</div>

Expand Down
13 changes: 6 additions & 7 deletions QT/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,9 @@ void MainWindow::setAppStyle(AppStyle style)
ui->action_light_blue_style->setChecked(false);
ui->action_dark_blue_style->setChecked(false);

if(style==Style_Default)//切换为默认样式(只能写入配置等用户重启程序)
if(style==Style_Default)//切换为默认样式
{
qApp->setStyleSheet("");
ui->action_default_style->setChecked(true);
}
else if(style==Style_LightBlue)//切换为LightBlue样式
Expand Down Expand Up @@ -763,21 +764,21 @@ void MainWindow::on_action_sync_triggered()
void MainWindow::on_action_ports_help_triggered()
{
//调用系统默认方式打开图片
ShellExecuteA(NULL,"open",(QCoreApplication::applicationDirPath()+"/img/BoardC-Ports.png").toStdString().c_str(),NULL,NULL,SW_HIDE);
QDesktopServices::openUrl(QUrl("file:///"+QCoreApplication::applicationDirPath()+"/img/BoardC-Ports.png",QUrl::TolerantMode));
}

//PWM说明菜单项点击时调用
void MainWindow::on_action_pwm_help_triggered()
{
//调用系统默认方式打开图片
ShellExecuteA(NULL,"open",(QCoreApplication::applicationDirPath()+"/img/BoardC-Pwm.png").toStdString().c_str(),NULL,NULL,SW_HIDE);
QDesktopServices::openUrl(QUrl("file:///"+QCoreApplication::applicationDirPath()+"/img/BoardC-Pwm.png",QUrl::TolerantMode));
}

//CAN说明菜单项点击时调用
void MainWindow::on_action_can_help_triggered()
{
//调用系统默认方式打开图片
ShellExecuteA(NULL,"open",(QCoreApplication::applicationDirPath()+"/img/BoardC-Can.png").toStdString().c_str(),NULL,NULL,SW_HIDE);
QDesktopServices::openUrl(QUrl("file:///"+QCoreApplication::applicationDirPath()+"/img/BoardC-Can.png",QUrl::TolerantMode));
}

//关于菜单项点击时调用
Expand All @@ -792,14 +793,12 @@ void MainWindow::on_action_about_triggered()
void MainWindow::on_action_help_triggered()
{
//调用系统默认方式打开HTML文档
ShellExecuteA(NULL,"open",(QCoreApplication::applicationDirPath()+"/help.html").toStdString().c_str(),NULL,NULL,SW_HIDE);
QDesktopServices::openUrl(QUrl("file:///"+QCoreApplication::applicationDirPath()+"/help.html",QUrl::TolerantMode));
}

//默认界面样式菜单项点击时调用
void MainWindow::on_action_default_style_triggered()
{
if(appStyle!=Style_Default)
QMessageBox::information(NULL,"提示","切换为默认样式需重启软件后生效");
setAppStyle(Style_Default);
}

Expand Down
1 change: 1 addition & 0 deletions QT/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <QTime>
#include <windows.h>
#include <aboutdialog.h>
#include <qdesktopservices.h>

#define FRAME_HEADER 0xAA

Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@

---

#### 介绍
## 介绍

专门为RoboMaster比赛相关电机编写的控制程序,用户可以很方便地使用电脑软件操控电机的动作

---

#### 详细说明
## 软件界面

![UI](readme-imgs/ui.png)

---

## 详细说明

[转到使用说明](QT/README.md)

Expand Down
Binary file added readme-imgs/ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 493a412

Please sign in to comment.