11/27
This commit is contained in:
parent
caa9a4f9df
commit
ca411bb07b
@ -171,6 +171,24 @@ Item {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onExit(){
|
||||||
|
console.log("1222222222222222");
|
||||||
|
if(bConnect)
|
||||||
|
{
|
||||||
|
clientSocket.writeBytes(getIntArr("2"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function onConnectAndExit(){
|
||||||
|
clientSocket.connectToHost();
|
||||||
|
clientSocket.writeBytes(getIntArr("2"));
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted:
|
||||||
|
{
|
||||||
|
//BCIManager.signalQmlStopLinkerPrograme.connect(onExit);
|
||||||
|
}
|
||||||
TcpSocket{
|
TcpSocket{
|
||||||
id: clientSocket
|
id: clientSocket
|
||||||
peer: "127.0.0.1"
|
peer: "127.0.0.1"
|
||||||
|
@ -31,7 +31,7 @@ private slots:
|
|||||||
void slotLinkerProgrameReadyReadStandardError();
|
void slotLinkerProgrameReadyReadStandardError();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
void signalQmlStopLinkerPrograme();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QProcess *m_pCmd = nullptr;
|
QProcess *m_pCmd = nullptr;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "eyetrainwidget.h"
|
#include "eyetrainwidget.h"
|
||||||
#include "ui_eyetrainwidget.h"
|
#include "ui_eyetrainwidget.h"
|
||||||
#include "BCIManager.h"
|
#include "BCIManager.h"
|
||||||
|
#include <QQmlContext>
|
||||||
|
|
||||||
eyeTrainWidget::eyeTrainWidget(QWidget *parent) :
|
eyeTrainWidget::eyeTrainWidget(QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
@ -24,7 +25,7 @@ eyeTrainWidget::eyeTrainWidget(QWidget *parent) :
|
|||||||
m_st_bicycleParam.spasmType = 0; //默认逆向
|
m_st_bicycleParam.spasmType = 0; //默认逆向
|
||||||
|
|
||||||
BCIManager::getInstance().startLinkerPrograme();
|
BCIManager::getInstance().startLinkerPrograme();
|
||||||
|
ui->quickWidget->setSource(QUrl("qrc:/DependFile/QML/Ssvep.qml"));
|
||||||
|
|
||||||
// int8_t controlState;//状态控制 0-停止 1启动 2-暂停 3-继续
|
// int8_t controlState;//状态控制 0-停止 1启动 2-暂停 3-继续
|
||||||
// int8_t bodyPart; //训练部位 0-上肢 1-下肢 2-四肢 3-垂直上肢
|
// int8_t bodyPart; //训练部位 0-上肢 1-下肢 2-四肢 3-垂直上肢
|
||||||
@ -48,6 +49,17 @@ eyeTrainWidget::~eyeTrainWidget()
|
|||||||
|
|
||||||
heartTimer->stop();
|
heartTimer->stop();
|
||||||
delete ui;
|
delete ui;
|
||||||
|
QVariant retVal;
|
||||||
|
QMetaObject::invokeMethod(ui->quickWidget->rootObject(),
|
||||||
|
"onExit",
|
||||||
|
Qt::DirectConnection,
|
||||||
|
Q_RETURN_ARG(QVariant, retVal));
|
||||||
|
if(!retVal.toBool())
|
||||||
|
{
|
||||||
|
QMetaObject::invokeMethod(ui->quickWidget->rootObject(),
|
||||||
|
"onConnectAndExit",
|
||||||
|
Qt::DirectConnection);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
void eyeTrainWidget::startTrain(int8_t Part, uint8_t Time)
|
void eyeTrainWidget::startTrain(int8_t Part, uint8_t Time)
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user