2025-03-13T17:27:30
This commit is contained in:
parent
adca7786c4
commit
d1c95336e1
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
Global::Global()
|
Global::Global()
|
||||||
{
|
{
|
||||||
_mode = Global::Mode::ANALYZE;
|
_mode = Global::Mode::Analysis;
|
||||||
|
_deviceConnectStatus = Global::DeviceConnectionStatus::Disconnected;
|
||||||
}
|
}
|
||||||
|
|
||||||
Global *Global::instance()
|
Global *Global::instance()
|
||||||
@ -18,3 +19,13 @@ void Global::setMode(const Global::Mode mode)
|
|||||||
emit sigModeModify(mode);
|
emit sigModeModify(mode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
void Global::setDeviceConnectionStatus(const Global::DeviceConnectionStatus status)
|
||||||
|
{
|
||||||
|
if(status != _deviceConnectStatus){
|
||||||
|
_deviceConnectStatus = status;
|
||||||
|
emit sigDeviceConnnectionStatusModify(status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
19
src/global.h
19
src/global.h
@ -11,16 +11,31 @@ public:
|
|||||||
static Global* instance();
|
static Global* instance();
|
||||||
|
|
||||||
enum Mode{
|
enum Mode{
|
||||||
EXPERIMENT,
|
Analysis,
|
||||||
ANALYZE
|
ConnectedToDev,
|
||||||
|
ExperimentStart
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void setMode(const Mode);
|
void setMode(const Mode);
|
||||||
|
Mode getMode(){return _mode;}
|
||||||
|
|
||||||
|
enum DeviceConnectionStatus{
|
||||||
|
Disconnected,
|
||||||
|
Connected
|
||||||
|
};
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
void setDeviceConnectionStatus(const DeviceConnectionStatus);
|
||||||
|
DeviceConnectionStatus getDeviceConnectionStatus(){return _deviceConnectStatus;}
|
||||||
|
#endif
|
||||||
signals:
|
signals:
|
||||||
void sigModeModify(const Mode);
|
void sigModeModify(const Mode);
|
||||||
|
void sigDeviceConnnectionStatusModify(const DeviceConnectionStatus);
|
||||||
public slots:
|
public slots:
|
||||||
private:
|
private:
|
||||||
Mode _mode;
|
Mode _mode;
|
||||||
|
DeviceConnectionStatus _deviceConnectStatus;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GLOBAL_H
|
#endif // GLOBAL_H
|
||||||
|
|||||||
@ -2,5 +2,8 @@
|
|||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>images/start.png</file>
|
<file>images/start.png</file>
|
||||||
<file>images/stop.png</file>
|
<file>images/stop.png</file>
|
||||||
|
<file>images/connect.png</file>
|
||||||
|
<file>images/new.png</file>
|
||||||
|
<file>images/real_time_widget.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
BIN
src/images/connect.png
Normal file
BIN
src/images/connect.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
BIN
src/images/new.png
Normal file
BIN
src/images/new.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
BIN
src/images/real_time_widget.png
Normal file
BIN
src/images/real_time_widget.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 7.4 KiB |
@ -1,7 +1,10 @@
|
|||||||
|
#include <qmessagebox.h>
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "serialport.h"
|
#include "serialport.h"
|
||||||
|
#include "dataparser.h"
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
: QMainWindow(parent)
|
: QMainWindow(parent)
|
||||||
@ -9,9 +12,12 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
, _centralWidget(new CentralWidget)
|
, _centralWidget(new CentralWidget)
|
||||||
,_leftWidget(new LeftWidget)
|
,_leftWidget(new LeftWidget)
|
||||||
,_expertmentSettingForm(new ExperimentSettingForm)
|
,_expertmentSettingForm(new ExperimentSettingForm)
|
||||||
|
,_realTimeDataForm(new RealTimeDataForm)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
setActionEnable(false);
|
||||||
|
|
||||||
this->setToolTip(".....");
|
this->setToolTip(".....");
|
||||||
// resize(2222,1111);
|
// resize(2222,1111);
|
||||||
|
|
||||||
@ -29,9 +35,6 @@ MainWindow::~MainWindow()
|
|||||||
void MainWindow::connections()
|
void MainWindow::connections()
|
||||||
{
|
{
|
||||||
//ui
|
//ui
|
||||||
// connect(ui->actionshitu,&QAction::triggered,
|
|
||||||
// [&]{_expertmentSettingForm->show();});
|
|
||||||
|
|
||||||
connect(_expertmentSettingForm,&ExperimentSettingForm::sigConnectToDevice,
|
connect(_expertmentSettingForm,&ExperimentSettingForm::sigConnectToDevice,
|
||||||
SerialPort::instance(),&SerialPort::slotConnectToDevice);
|
SerialPort::instance(),&SerialPort::slotConnectToDevice);
|
||||||
//dynamic data
|
//dynamic data
|
||||||
@ -42,8 +45,56 @@ void MainWindow::connections()
|
|||||||
_centralWidget,&CentralWidget::slotModeModify);
|
_centralWidget,&CentralWidget::slotModeModify);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::setActionEnable(const bool flag)
|
||||||
void MainWindow::on_actionstart_triggered()
|
|
||||||
{
|
{
|
||||||
|
if(flag){
|
||||||
|
ui->actionNew->setEnabled(true);
|
||||||
|
ui->actionStart->setEnabled(true);
|
||||||
|
ui->actionStop->setEnabled(true);
|
||||||
|
ui->actionRealTimeWidget->setEnabled(true);
|
||||||
|
}else{
|
||||||
|
ui->actionNew->setEnabled(false);
|
||||||
|
ui->actionStart->setEnabled(false);
|
||||||
|
ui->actionStop->setEnabled(false);
|
||||||
|
ui->actionRealTimeWidget->setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_actionStop_triggered()
|
||||||
|
{
|
||||||
|
QByteArray ba = DataParser::setDeviceStartStop(DeviceStartMode::Stop);
|
||||||
|
SerialPort::instance()->slotSendData(ba);
|
||||||
|
SerialPort::instance()->slotCloseSp();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_actionNew_triggered()
|
||||||
|
{
|
||||||
|
_expertmentSettingForm->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_actionStart_triggered()
|
||||||
|
{
|
||||||
|
QByteArray ba = DataParser::setDeviceStartStop(DeviceStartMode::Start);
|
||||||
|
SerialPort::instance()->slotSendData(ba);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_actionReadOnly_triggered()
|
||||||
|
{
|
||||||
|
Global::instance()->setMode(Global::Mode::ExperimentStart);
|
||||||
|
SerialPort::instance()->openSp();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_actionRealTimeWidget_triggered()
|
||||||
|
{
|
||||||
|
_realTimeDataForm->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_actionConnectToDev_triggered()
|
||||||
|
{
|
||||||
|
if(SerialPort::instance()->openSp()){
|
||||||
|
setActionEnable(true);
|
||||||
|
Global::instance()->setMode(Global::Mode::ConnectedToDev);
|
||||||
|
}else{
|
||||||
|
QMessageBox::warning(this, "warnning", "Serial Port open failed.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
#include "centralwidget.h"
|
#include "centralwidget.h"
|
||||||
#include "leftwidget.h"
|
#include "leftwidget.h"
|
||||||
#include "experimentsettingform.h"
|
#include "experimentsettingform.h"
|
||||||
|
#include "realtimedataform.h"
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
namespace Ui { class MainWindow; }
|
namespace Ui { class MainWindow; }
|
||||||
@ -19,14 +20,20 @@ public:
|
|||||||
MainWindow(QWidget *parent = nullptr);
|
MainWindow(QWidget *parent = nullptr);
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
private slots:
|
private slots:
|
||||||
void on_actionstart_triggered();
|
void on_actionConnectToDev_triggered();
|
||||||
|
void on_actionNew_triggered();
|
||||||
|
void on_actionStart_triggered();
|
||||||
|
void on_actionStop_triggered();
|
||||||
|
void on_actionReadOnly_triggered();
|
||||||
|
void on_actionRealTimeWidget_triggered();
|
||||||
private:
|
private:
|
||||||
void connections();
|
void connections();
|
||||||
|
void setActionEnable(const bool);
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
CentralWidget *_centralWidget;
|
CentralWidget *_centralWidget;
|
||||||
LeftWidget*_leftWidget;
|
LeftWidget*_leftWidget;
|
||||||
ExperimentSettingForm *_expertmentSettingForm;
|
ExperimentSettingForm *_expertmentSettingForm;
|
||||||
|
RealTimeDataForm* _realTimeDataForm;
|
||||||
};
|
};
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
|||||||
@ -27,13 +27,13 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>文件</string>
|
<string>文件</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="action_new"/>
|
<addaction name="actionNew"/>
|
||||||
<addaction name="action22"/>
|
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menu_2">
|
<widget class="QMenu" name="menu_2">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>视图</string>
|
<string>视图</string>
|
||||||
</property>
|
</property>
|
||||||
|
<addaction name="actionRealTimeWidget"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menu_3">
|
<widget class="QMenu" name="menu_3">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@ -73,8 +73,14 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>toolBar</string>
|
<string>toolBar</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>22</width>
|
||||||
|
<height>22</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="toolButtonStyle">
|
<property name="toolButtonStyle">
|
||||||
<enum>Qt::ToolButtonIconOnly</enum>
|
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="toolBarArea">
|
<attribute name="toolBarArea">
|
||||||
<enum>TopToolBarArea</enum>
|
<enum>TopToolBarArea</enum>
|
||||||
@ -82,25 +88,64 @@
|
|||||||
<attribute name="toolBarBreak">
|
<attribute name="toolBarBreak">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</attribute>
|
</attribute>
|
||||||
<addaction name="actionstart"/>
|
<addaction name="actionConnectToDev"/>
|
||||||
|
<addaction name="actionNew"/>
|
||||||
|
<addaction name="actionStart"/>
|
||||||
|
<addaction name="actionStop"/>
|
||||||
|
<addaction name="actionRealTimeWidget"/>
|
||||||
|
<addaction name="actionReadOnly"/>
|
||||||
</widget>
|
</widget>
|
||||||
<action name="action_new">
|
<action name="actionNew">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="images.qrc">
|
||||||
|
<normaloff>:/images/new.png</normaloff>:/images/new.png</iconset>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>新建</string>
|
<string>新建</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="action22">
|
<action name="actionStart">
|
||||||
<property name="text">
|
|
||||||
<string>22</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionstart">
|
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="images.qrc">
|
<iconset resource="images.qrc">
|
||||||
<normaloff>:/images/start.png</normaloff>:/images/start.png</iconset>
|
<normaloff>:/images/start.png</normaloff>:/images/start.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>start</string>
|
<string>开始</string>
|
||||||
|
</property>
|
||||||
|
<property name="visible">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionReadOnly">
|
||||||
|
<property name="text">
|
||||||
|
<string>只读数据</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionStop">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="images.qrc">
|
||||||
|
<normaloff>:/images/stop.png</normaloff>:/images/stop.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>停止</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionRealTimeWidget">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="images.qrc">
|
||||||
|
<normaloff>:/images/real_time_widget.png</normaloff>:/images/real_time_widget.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>实时窗口</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionConnectToDev">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="images.qrc">
|
||||||
|
<normaloff>:/images/connect.png</normaloff>:/images/connect.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>连接设备</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
#include "defines.h"
|
#include "defines.h"
|
||||||
#include "dataparser.h"
|
#include "dataparser.h"
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -94,7 +95,7 @@ void SerialPort::slotReadData()
|
|||||||
{
|
{
|
||||||
QByteArray ba = _sp->readAll();
|
QByteArray ba = _sp->readAll();
|
||||||
|
|
||||||
#if 1
|
#if 0
|
||||||
// 将 QByteArray 转换为十六进制字符串
|
// 将 QByteArray 转换为十六进制字符串
|
||||||
QString hexData = ba.toHex(' '); // ' ' 作为分隔符,可选参数
|
QString hexData = ba.toHex(' '); // ' ' 作为分隔符,可选参数
|
||||||
qDebug() << "receive info (hex):" << hexData;
|
qDebug() << "receive info (hex):" << hexData;
|
||||||
@ -120,7 +121,9 @@ void SerialPort::slotReadData()
|
|||||||
QString formattedColdTemp = QString::number(cd.cold_temp, 'f', 3);
|
QString formattedColdTemp = QString::number(cd.cold_temp, 'f', 3);
|
||||||
qDebug() << "cold temp:" << formattedColdTemp;
|
qDebug() << "cold temp:" << formattedColdTemp;
|
||||||
|
|
||||||
|
if(Global::Mode::ExperimentStart == Global::instance()->getMode()){
|
||||||
emit sigSendCommonData(cd);
|
emit sigSendCommonData(cd);
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
CommonData *serialPortData =
|
CommonData *serialPortData =
|
||||||
@ -137,8 +140,12 @@ void SerialPort::slotReadData()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void SerialPort::openSp()
|
bool SerialPort::openSp()
|
||||||
{
|
{
|
||||||
|
if(_sp != nullptr && _sp->isOpen()){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
|
foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
|
||||||
{
|
{
|
||||||
u16 pid = info.productIdentifier();
|
u16 pid = info.productIdentifier();
|
||||||
@ -154,7 +161,7 @@ void SerialPort::openSp()
|
|||||||
if (_sp == nullptr)
|
if (_sp == nullptr)
|
||||||
{
|
{
|
||||||
qDebug() << "Device not found.";
|
qDebug() << "Device not found.";
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置波特率和读写方向
|
// 设置波特率和读写方向
|
||||||
@ -173,7 +180,7 @@ void SerialPort::openSp()
|
|||||||
if (!_sp->open(QIODevice::ReadWrite))
|
if (!_sp->open(QIODevice::ReadWrite))
|
||||||
{
|
{
|
||||||
qDebug() << "open failed." << _sp->error();
|
qDebug() << "open failed." << _sp->error();
|
||||||
exit(0);
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -181,8 +188,10 @@ void SerialPort::openSp()
|
|||||||
// 设置 DTR 信号为就绪状态(true 表示低电平)
|
// 设置 DTR 信号为就绪状态(true 表示低电平)
|
||||||
_sp->setDataTerminalReady(true);
|
_sp->setDataTerminalReady(true);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SerialPort::sendCmd(const SerialPort::E_CMD_TYPE e)
|
void SerialPort::sendCmd(const SerialPort::E_CMD_TYPE e)
|
||||||
{
|
{
|
||||||
#if 1
|
#if 1
|
||||||
@ -335,7 +344,14 @@ void SerialPort::slotSendData(const QByteArray &ba)
|
|||||||
{
|
{
|
||||||
qDebug() << "slotSendData:" << ba.size();
|
qDebug() << "slotSendData:" << ba.size();
|
||||||
|
|
||||||
|
if(_sp != nullptr && _sp->isOpen()){
|
||||||
_sp->write(ba);
|
_sp->write(ba);
|
||||||
|
}else{
|
||||||
|
qDebug()<<"sp not open.";
|
||||||
|
// qErrnoWarning("sp not open.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// 将 QByteArray 转换为十六进制字符串
|
// 将 QByteArray 转换为十六进制字符串
|
||||||
QString hexData = ba.toHex(' '); // ' ' 作为分隔符,可选参数
|
QString hexData = ba.toHex(' '); // ' ' 作为分隔符,可选参数
|
||||||
@ -362,5 +378,7 @@ void SerialPort::slotSendData(const QByteArray &ba)
|
|||||||
|
|
||||||
void SerialPort::slotCloseSp()
|
void SerialPort::slotCloseSp()
|
||||||
{
|
{
|
||||||
|
if(_sp != nullptr && _sp->isOpen()){
|
||||||
_sp->close();
|
_sp->close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,7 @@ public:
|
|||||||
|
|
||||||
void sendCmd(const E_CMD_TYPE e);
|
void sendCmd(const E_CMD_TYPE e);
|
||||||
static void parserTest();
|
static void parserTest();
|
||||||
|
bool openSp();
|
||||||
public slots:
|
public slots:
|
||||||
void slotConnectToDevice(const QByteArray&);
|
void slotConnectToDevice(const QByteArray&);
|
||||||
void slotSendData(const QByteArray&);
|
void slotSendData(const QByteArray&);
|
||||||
@ -34,7 +35,6 @@ protected:
|
|||||||
private slots:
|
private slots:
|
||||||
void slotReadData();
|
void slotReadData();
|
||||||
private:
|
private:
|
||||||
void openSp();
|
|
||||||
void to_hex(char* in_char, int char_length, char* out_char);
|
void to_hex(char* in_char, int char_length, char* out_char);
|
||||||
void displayPortInfo();
|
void displayPortInfo();
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -36,7 +36,7 @@ CentralWidget::CentralWidget(QWidget *parent)
|
|||||||
|
|
||||||
void CentralWidget::slotModeModify(const Global::Mode mode)
|
void CentralWidget::slotModeModify(const Global::Mode mode)
|
||||||
{
|
{
|
||||||
if (Global::Mode::EXPERIMENT == mode)
|
if (Global::Mode::ExperimentStart == mode)
|
||||||
{
|
{
|
||||||
// 创建画布,设置画布上的点数据
|
// 创建画布,设置画布上的点数据
|
||||||
_customPlot->addGraph();
|
_customPlot->addGraph();
|
||||||
@ -48,7 +48,7 @@ void CentralWidget::slotModeModify(const Global::Mode mode)
|
|||||||
_customPlot->xAxis->setRange(0, 400);
|
_customPlot->xAxis->setRange(0, 400);
|
||||||
_customPlot->yAxis->setRange(-20, 20);
|
_customPlot->yAxis->setRange(-20, 20);
|
||||||
}
|
}
|
||||||
else if (Global::Mode::ANALYZE == mode)
|
else if (Global::Mode::Analysis == mode)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,12 +21,10 @@ ExperimentSettingForm::ExperimentSettingForm(QWidget *parent) :
|
|||||||
connect(ui->checkBox_phase_4,&QCheckBox::clicked,
|
connect(ui->checkBox_phase_4,&QCheckBox::clicked,
|
||||||
this,&ExperimentSettingForm::slotPhase4StateChanged);
|
this,&ExperimentSettingForm::slotPhase4StateChanged);
|
||||||
|
|
||||||
connect(ui->pushButton_connect_to_device,&QPushButton::clicked,
|
// connect(ui->pushButton_connect_to_device,&QPushButton::clicked,
|
||||||
this,&ExperimentSettingForm::slotConnectToDevice);
|
// this,&ExperimentSettingForm::slotConnectToDevice);
|
||||||
connect(ui->pushButton_cancel,&QPushButton::clicked,
|
connect(ui->pushButton_cancel,&QPushButton::clicked,
|
||||||
this,&ExperimentSettingForm::slotCancel);
|
this,&ExperimentSettingForm::slotCancel);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ExperimentSettingForm::~ExperimentSettingForm()
|
ExperimentSettingForm::~ExperimentSettingForm()
|
||||||
@ -170,7 +168,7 @@ void ExperimentSettingForm::slotConnectToDevice()
|
|||||||
qDebug()<<"ba size:"<<ba.size();
|
qDebug()<<"ba size:"<<ba.size();
|
||||||
emit sigConnectToDevice(ba);
|
emit sigConnectToDevice(ba);
|
||||||
|
|
||||||
Global::instance()->setMode(Global::Mode::EXPERIMENT);
|
Global::instance()->setMode(Global::Mode::ConnectedToDev);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
QByteArray startBa = DataParser::setDeviceStartStop(DeviceStartMode::Start);
|
QByteArray startBa = DataParser::setDeviceStartStop(DeviceStartMode::Start);
|
||||||
@ -182,7 +180,7 @@ void ExperimentSettingForm::slotConnectToDevice()
|
|||||||
|
|
||||||
void ExperimentSettingForm::slotCancel()
|
void ExperimentSettingForm::slotCancel()
|
||||||
{
|
{
|
||||||
|
hide();
|
||||||
}
|
}
|
||||||
void ExperimentSettingForm::slotPhaseCheck()
|
void ExperimentSettingForm::slotPhaseCheck()
|
||||||
{
|
{
|
||||||
@ -225,4 +223,7 @@ void ExperimentSettingForm::slotPhaseCheck()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ExperimentSettingForm::on_pushButton_connect_to_device_clicked()
|
||||||
|
{
|
||||||
|
slotConnectToDevice();
|
||||||
|
}
|
||||||
|
|||||||
@ -17,6 +17,9 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void sigConnectToDevice(const QByteArray&);
|
void sigConnectToDevice(const QByteArray&);
|
||||||
|
private slots:
|
||||||
|
void on_pushButton_connect_to_device_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void uiReset();
|
void uiReset();
|
||||||
//slot
|
//slot
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user