-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
增加对外部OpenOCD进程的支持;解决选择窗口的文件名重复和变量缺失问题;选择窗口添加加载状态显示和刷新按钮;添加高级配置窗口,允许配置…
…串口、采样频率和GDB/OCD参数;完善tooltip说明;版本号更新至1.3.0
- Loading branch information
1 parent
ba95366
commit acf23d0
Showing
23 changed files
with
689 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#include "configwindow.h" | ||
#include "ui_configwindow.h" | ||
#include <qdebug.h> | ||
|
||
ConfigWindow::ConfigWindow(QWidget *parent) : | ||
QDialog(parent), | ||
ui(new Ui::ConfigWindow) | ||
{ | ||
ui->setupUi(this); | ||
setWindowTitle("高级设置"); | ||
} | ||
|
||
ConfigWindow::~ConfigWindow() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void ConfigWindow::setParam(ConfigWindowParam ¶m) | ||
{ | ||
ui->sb_baudrate->setValue(param.baudrate); | ||
ui->cb_databit->setCurrentText(QString("%1").arg(param.databits)); | ||
ui->cb_stopbit->setCurrentText(param.stopbits==1 ? "1" : (param.stopbits==2?"2":"1.5")); | ||
ui->cb_parity->setCurrentText(param.parity==0 ? "无" : (param.parity==2?"偶校验":"奇校验")); | ||
ui->cb_sample_freq->setCurrentText(QString("%1Hz").arg(param.sampleFreq)); | ||
ui->sb_gdb_port->setValue(param.gdbPort); | ||
ui->et_gdb_param->setText(param.gdbParam); | ||
ui->et_ocd_param->setText(param.ocdParam); | ||
} | ||
|
||
void ConfigWindow::getParam(ConfigWindowParam ¶m) | ||
{ | ||
param.baudrate=ui->sb_baudrate->value(); | ||
param.databits=(QSerialPort::DataBits)ui->cb_databit->currentText().toInt(); | ||
param.stopbits=(QSerialPort::StopBits)QList<int>{1,3,2}.at(ui->cb_stopbit->currentIndex()); | ||
param.parity=(QSerialPort::Parity)QList<int>{0,2,3}.at(ui->cb_parity->currentIndex()); | ||
param.sampleFreq=QList<int>{100,50,20,10,5,2,1}.at(ui->cb_sample_freq->currentIndex()); | ||
param.gdbPort=ui->sb_gdb_port->value(); | ||
param.gdbParam=ui->et_gdb_param->text(); | ||
param.ocdParam=ui->et_ocd_param->text(); | ||
} | ||
|
||
void ConfigWindow::on_bt_ok_clicked() | ||
{ | ||
accept(); | ||
} | ||
|
||
void ConfigWindow::on_bt_cancel_clicked() | ||
{ | ||
close(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#ifndef CONFIGWINDOW_H | ||
#define CONFIGWINDOW_H | ||
|
||
#include <QDialog> | ||
#include <QSerialPort> | ||
|
||
namespace Ui { | ||
class ConfigWindow; | ||
} | ||
|
||
struct ConfigWindowParam { | ||
qint32 baudrate; | ||
QSerialPort::DataBits databits; | ||
QSerialPort::StopBits stopbits; | ||
QSerialPort::Parity parity; | ||
int sampleFreq; | ||
int gdbPort; | ||
QString gdbParam; | ||
QString ocdParam; | ||
}; | ||
|
||
class ConfigWindow : public QDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit ConfigWindow(QWidget *parent = nullptr); | ||
~ConfigWindow(); | ||
void setParam(ConfigWindowParam ¶m); | ||
void getParam(ConfigWindowParam ¶m); | ||
|
||
private slots: | ||
void on_bt_ok_clicked(); | ||
void on_bt_cancel_clicked(); | ||
|
||
private: | ||
Ui::ConfigWindow *ui; | ||
}; | ||
|
||
#endif // CONFIGWINDOW_H |
Oops, something went wrong.