12/3
This commit is contained in:
parent
f4e520d795
commit
02c2b7d8ea
@ -6,7 +6,7 @@ Item {
|
|||||||
property int hitIndex: -1
|
property int hitIndex: -1
|
||||||
property bool bStimulate: false
|
property bool bStimulate: false
|
||||||
property int responseTime: 10
|
property int responseTime: 10
|
||||||
property bool bTest: true
|
property bool bTest: false
|
||||||
property bool bConnect: false;
|
property bool bConnect: false;
|
||||||
property var brainTrainForm: null
|
property var brainTrainForm: null
|
||||||
property string red: "#EE6352"
|
property string red: "#EE6352"
|
||||||
@ -78,7 +78,7 @@ Item {
|
|||||||
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R14.png",
|
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R14.png",
|
||||||
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R15.png",
|
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R15.png",
|
||||||
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R16.png",
|
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R16.png",
|
||||||
]
|
];
|
||||||
|
|
||||||
|
|
||||||
function startStimulate()
|
function startStimulate()
|
||||||
@ -89,11 +89,8 @@ Item {
|
|||||||
if(!bConnect)
|
if(!bConnect)
|
||||||
{
|
{
|
||||||
clientSocket.connectToHost();
|
clientSocket.connectToHost();
|
||||||
bConnect = true;
|
|
||||||
}else
|
|
||||||
{
|
|
||||||
clientSocket.writeBytes(getIntArr("1"));
|
|
||||||
}
|
}
|
||||||
|
clientSocket.writeBytes(getIntArr("1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -149,6 +146,15 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: connectTimer
|
||||||
|
interval: 3*1000;
|
||||||
|
onTriggered: {
|
||||||
|
clientSocket.connected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function ssvepHit(index)
|
function ssvepHit(index)
|
||||||
{
|
{
|
||||||
if(!bStimulate)
|
if(!bStimulate)
|
||||||
@ -211,8 +217,10 @@ Item {
|
|||||||
Component.onCompleted:
|
Component.onCompleted:
|
||||||
{
|
{
|
||||||
bci.initTrain();
|
bci.initTrain();
|
||||||
|
clientSocket.connectToHost();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TcpSocket{
|
TcpSocket{
|
||||||
id: clientSocket
|
id: clientSocket
|
||||||
peer: "127.0.0.1"
|
peer: "127.0.0.1"
|
||||||
@ -232,12 +240,18 @@ Item {
|
|||||||
onConnected:
|
onConnected:
|
||||||
{
|
{
|
||||||
console.info("Client socket connected");
|
console.info("Client socket connected");
|
||||||
writeBytes(getIntArr("1"));
|
bConnect = true;
|
||||||
|
bci.deviceStatus(true);
|
||||||
|
if(connectTimer.running)
|
||||||
|
{
|
||||||
|
connectTimer.stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
onDisconnected:
|
onDisconnected:
|
||||||
{
|
{
|
||||||
console.info("Client socket disconnected");
|
console.info("Client socket disconnected");
|
||||||
bConnect = false;
|
bConnect = false;
|
||||||
|
bci.deviceStatus(false);
|
||||||
}
|
}
|
||||||
onPeerChanged:
|
onPeerChanged:
|
||||||
{
|
{
|
||||||
@ -249,7 +263,11 @@ Item {
|
|||||||
}
|
}
|
||||||
onError:
|
onError:
|
||||||
{
|
{
|
||||||
console.info("Client socket disconnected")
|
console.info("Client socket error",socketError);
|
||||||
|
if(socketError === 0 || socketError === 1)
|
||||||
|
{
|
||||||
|
connectTimer.start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BCIManager
|
BCIManager
|
||||||
@ -881,10 +899,8 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: {
|
onClicked: {
|
||||||
popimpedance.show()
|
popimpedance.show()
|
||||||
popimpedance.colorChange(5,green)
|
popimpedance.colorChange(2,green)
|
||||||
|
popimpedance.colorChange(3,green)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -892,12 +908,5 @@ Item {
|
|||||||
PopImpedance{
|
PopImpedance{
|
||||||
id:popimpedance
|
id:popimpedance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
ZBD_IIIDL_S_Project/DependFile/Source/signal/icon_brain_off.png
Normal file
BIN
ZBD_IIIDL_S_Project/DependFile/Source/signal/icon_brain_off.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
@ -10,6 +10,7 @@
|
|||||||
#include "ccommunicateapi.h"
|
#include "ccommunicateapi.h"
|
||||||
#include "currentuserdata.h"
|
#include "currentuserdata.h"
|
||||||
#include "loginwidget.h"
|
#include "loginwidget.h"
|
||||||
|
#include "BCIManager.h"
|
||||||
|
|
||||||
TitleWidget::TitleWidget(QWidget *parent) :
|
TitleWidget::TitleWidget(QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
@ -17,27 +18,27 @@ TitleWidget::TitleWidget(QWidget *parent) :
|
|||||||
checkTimer(nullptr)
|
checkTimer(nullptr)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
connect(ui->back1_Btn,SIGNAL(clicked()),this,SLOT(slotBackClicked()));
|
connect(ui->back1_Btn, SIGNAL(clicked()), this, SLOT(slotBackClicked()));
|
||||||
connect(ui->back2_Btn,SIGNAL(clicked()),this,SLOT(slotBackClicked()));
|
connect(ui->back2_Btn, SIGNAL(clicked()), this, SLOT(slotBackClicked()));
|
||||||
|
|
||||||
ui->user_Btn->setIcon(QIcon(":/DependFile/Source/User/user1.png"));
|
ui->user_Btn->setIcon(QIcon(":/DependFile/Source/User/user1.png"));
|
||||||
ui->user_Btn->setIconSize(QSize(40,40));
|
ui->user_Btn->setIconSize(QSize(40, 40));
|
||||||
|
|
||||||
setBackBtnVisible(false);
|
setBackBtnVisible(false);
|
||||||
|
|
||||||
checkTimer = new QTimer();
|
checkTimer = new QTimer();
|
||||||
checkTimer->setInterval(3000);
|
checkTimer->setInterval(3000);
|
||||||
connect(checkTimer,SIGNAL(timeout()),this,SLOT(slotCheckTimer()));
|
connect(checkTimer, SIGNAL(timeout()), this, SLOT(slotCheckTimer()));
|
||||||
checkTimer->start();
|
checkTimer->start();
|
||||||
|
|
||||||
connect(CCommunicateAPI::getInstance(),SIGNAL(signalCommunicateChanged(QString)),this,SLOT(slotStateChanged(QString)));
|
connect(CCommunicateAPI::getInstance(), SIGNAL(signalCommunicateChanged(QString)), this, SLOT(slotStateChanged(QString)));
|
||||||
|
|
||||||
ui->signal_Label->setVisible(false);
|
ui->signal_Label->setVisible(false);
|
||||||
ui->wifiSignal2_Label->setVisible(true);
|
ui->wifiSignal2_Label->setVisible(true);
|
||||||
ui->brainSignal_Labe->move(1550,30);
|
ui->brainSignal_Labe->move(1550, 30);
|
||||||
ui->sound_Button->move(1480,30);
|
ui->sound_Button->move(1480, 30);
|
||||||
|
|
||||||
ui->wifiSignal_Label->move(1620,30);
|
ui->wifiSignal_Label->move(1620, 30);
|
||||||
|
|
||||||
|
|
||||||
ui->title_Label->setText(tr("功能选择")); //默认汉字
|
ui->title_Label->setText(tr("功能选择")); //默认汉字
|
||||||
@ -47,6 +48,9 @@ TitleWidget::TitleWidget(QWidget *parent) :
|
|||||||
ui->back2_Btn->setVisible(true);
|
ui->back2_Btn->setVisible(true);
|
||||||
|
|
||||||
m_soundDialog = new SoundDialog();
|
m_soundDialog = new SoundDialog();
|
||||||
|
|
||||||
|
|
||||||
|
connect(&BCIManager::getInstance(), &BCIManager::signalDeviceStatus, this, &TitleWidget::slotBciDeviceStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
TitleWidget::~TitleWidget()
|
TitleWidget::~TitleWidget()
|
||||||
@ -64,63 +68,69 @@ void TitleWidget::slotBackClicked()
|
|||||||
{
|
{
|
||||||
|
|
||||||
int currentPage = MainWindowPageControl::getInstance()->getCurrentPageIndex();
|
int currentPage = MainWindowPageControl::getInstance()->getCurrentPageIndex();
|
||||||
if(!(currentPage>=MainPage_E && currentPage <=visionTrain))
|
if(!(currentPage >= MainPage_E && currentPage <= visionTrain))
|
||||||
currentPage = MainPage_E;//初始化异常值276795792,设置当前页索引为0
|
{
|
||||||
qDebug()<<"当前页"<<currentPage;
|
currentPage = MainPage_E; //初始化异常值276795792,设置当前页索引为0
|
||||||
|
}
|
||||||
|
qDebug() << "当前页" << currentPage;
|
||||||
switch(currentPage)
|
switch(currentPage)
|
||||||
{
|
{
|
||||||
case MainPage_E:
|
case MainPage_E:
|
||||||
{
|
{
|
||||||
LoginWidget login;//
|
LoginWidget login;//
|
||||||
login.setWindowModality(Qt::WindowModal);//
|
login.setWindowModality(Qt::WindowModal);//
|
||||||
login.exec(); //
|
login.exec(); //
|
||||||
// MainWindowPageControl::getInstance()->setCurrentPage(LoginPage_E);
|
// MainWindowPageControl::getInstance()->setCurrentPage(LoginPage_E);
|
||||||
// qDebug()<<"开始跳转";
|
// qDebug()<<"开始跳转";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BrainTraining:
|
case BrainTraining:
|
||||||
case UserPage_E:
|
case UserPage_E:
|
||||||
case SettingPage_E:
|
case SettingPage_E:
|
||||||
case BicycleParamSet_E:
|
case BicycleParamSet_E:
|
||||||
case FesBicycleParamSet_E:
|
case FesBicycleParamSet_E:
|
||||||
MainWindowPageControl::getInstance()->setCurrentPage(MainPage_E);
|
|
||||||
break;
|
|
||||||
case FesParamSet_E:
|
|
||||||
{
|
|
||||||
|
|
||||||
//分两种情况
|
|
||||||
switch(m_trainType)
|
|
||||||
{
|
|
||||||
case 0://1、直接选择的FES训练跳到主界面
|
|
||||||
MainWindowPageControl::getInstance()->setCurrentPage(MainPage_E);
|
MainWindowPageControl::getInstance()->setCurrentPage(MainPage_E);
|
||||||
break;
|
break;
|
||||||
case 1://2、从踏车界面跳转到FES界面,跳到踏车界面
|
case FesParamSet_E:
|
||||||
MainWindowPageControl::getInstance()->setCurrentPage(BicycleParamSet_E);
|
{
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case BicycleToFes_E:
|
|
||||||
MainWindowPageControl::getInstance()->setCurrentPage(FesBicycleParamSet_E);
|
|
||||||
break;
|
|
||||||
case TrainingParamSetting_E:
|
|
||||||
{
|
|
||||||
if(m_trainType == 0)
|
|
||||||
MainWindowPageControl::getInstance()->setCurrentPage(BicycleParamSet_E);
|
|
||||||
else if(m_trainType == 1)
|
|
||||||
MainWindowPageControl::getInstance()->setCurrentPage(FesBicycleParamSet_E);
|
|
||||||
|
|
||||||
//qDebug() <<"Hello";
|
//分两种情况
|
||||||
}
|
switch(m_trainType)
|
||||||
break;
|
{
|
||||||
case visionTrain:
|
case 0://1、直接选择的FES训练跳到主界面
|
||||||
MainWindowPageControl::getInstance()->setCurrentPage(BrainTraining);
|
MainWindowPageControl::getInstance()->setCurrentPage(MainPage_E);
|
||||||
break;
|
break;
|
||||||
|
case 1://2、从踏车界面跳转到FES界面,跳到踏车界面
|
||||||
|
MainWindowPageControl::getInstance()->setCurrentPage(BicycleParamSet_E);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case BicycleToFes_E:
|
||||||
|
MainWindowPageControl::getInstance()->setCurrentPage(FesBicycleParamSet_E);
|
||||||
|
break;
|
||||||
|
case TrainingParamSetting_E:
|
||||||
|
{
|
||||||
|
if(m_trainType == 0)
|
||||||
|
{
|
||||||
|
MainWindowPageControl::getInstance()->setCurrentPage(BicycleParamSet_E);
|
||||||
|
}
|
||||||
|
else if(m_trainType == 1)
|
||||||
|
{
|
||||||
|
MainWindowPageControl::getInstance()->setCurrentPage(FesBicycleParamSet_E);
|
||||||
|
}
|
||||||
|
|
||||||
|
//qDebug() <<"Hello";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case visionTrain:
|
||||||
|
MainWindowPageControl::getInstance()->setCurrentPage(BrainTraining);
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//设置当前用户
|
//设置当前用户
|
||||||
void TitleWidget::setUser(const ST_PatientMsg& st_patientMsg)
|
void TitleWidget::setUser(const ST_PatientMsg &st_patientMsg)
|
||||||
{
|
{
|
||||||
ui->user_Btn->setText(st_patientMsg.name);
|
ui->user_Btn->setText(st_patientMsg.name);
|
||||||
}
|
}
|
||||||
@ -136,52 +146,52 @@ void TitleWidget::setTitleByPage(E_PAGENAME pageType)
|
|||||||
QString title;
|
QString title;
|
||||||
switch(pageType)
|
switch(pageType)
|
||||||
{
|
{
|
||||||
case MainPage_E:
|
case MainPage_E:
|
||||||
title = tr("功能选择");
|
title = tr("功能选择");
|
||||||
setBackBtnVisible(true);
|
setBackBtnVisible(true);
|
||||||
ui->quit_Btn->setVisible(false);
|
ui->quit_Btn->setVisible(false);
|
||||||
//只修改pageIndex,不发送槽函数
|
//只修改pageIndex,不发送槽函数
|
||||||
MainWindowPageControl::getInstance()->setPageIndex(MainPage_E);
|
MainWindowPageControl::getInstance()->setPageIndex(MainPage_E);
|
||||||
break;
|
break;
|
||||||
case TrainingPage_E:
|
case TrainingPage_E:
|
||||||
title = tr("");//上肢、下肢、四肢训练
|
title = tr("");//上肢、下肢、四肢训练
|
||||||
setBackBtnVisible(false);
|
setBackBtnVisible(false);
|
||||||
ui->quit_Btn->setVisible(false);
|
ui->quit_Btn->setVisible(false);
|
||||||
break;
|
break;
|
||||||
case UserPage_E:
|
case UserPage_E:
|
||||||
title = tr("用户管理");
|
title = tr("用户管理");
|
||||||
setBackBtnVisible(true);
|
setBackBtnVisible(true);
|
||||||
break;
|
break;
|
||||||
case SettingPage_E:
|
case SettingPage_E:
|
||||||
title = tr("软件设置");
|
title = tr("软件设置");
|
||||||
setBackBtnVisible(true);
|
setBackBtnVisible(true);
|
||||||
break;
|
break;
|
||||||
case BicycleParamSet_E:
|
case BicycleParamSet_E:
|
||||||
title = tr("参数设置");
|
title = tr("参数设置");
|
||||||
setBackBtnVisible(true);
|
setBackBtnVisible(true);
|
||||||
break;
|
break;
|
||||||
case FesParamSet_E:
|
case FesParamSet_E:
|
||||||
setBackBtnVisible(true);
|
setBackBtnVisible(true);
|
||||||
title = tr("FES参数");
|
title = tr("FES参数");
|
||||||
break;
|
break;
|
||||||
case FesBicycleParamSet_E:
|
case FesBicycleParamSet_E:
|
||||||
setBackBtnVisible(true);
|
setBackBtnVisible(true);
|
||||||
title = tr("踏车参数");
|
title = tr("踏车参数");
|
||||||
break;
|
break;
|
||||||
case TrainingParamSetting_E:
|
case TrainingParamSetting_E:
|
||||||
setBackBtnVisible(true);
|
setBackBtnVisible(true);
|
||||||
title = tr("参数设置");
|
title = tr("参数设置");
|
||||||
break;
|
break;
|
||||||
case BrainTraining:
|
case BrainTraining:
|
||||||
setBackBtnVisible(true);
|
setBackBtnVisible(true);
|
||||||
title = tr("脑控康复");
|
title = tr("脑控康复");
|
||||||
break;
|
break;
|
||||||
case visionTrain:
|
case visionTrain:
|
||||||
setBackBtnVisible(true);
|
setBackBtnVisible(true);
|
||||||
title = tr("视觉脑机康复训练");
|
title = tr("视觉脑机康复训练");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ui->title_Label->setText(title);
|
ui->title_Label->setText(title);
|
||||||
}
|
}
|
||||||
@ -210,15 +220,15 @@ void TitleWidget::showWIFI()
|
|||||||
dwError = WlanOpenHandle(1, NULL, &dwNegotiatedVersion, &hClientHandle);
|
dwError = WlanOpenHandle(1, NULL, &dwNegotiatedVersion, &hClientHandle);
|
||||||
if (dwError != ERROR_SUCCESS)
|
if (dwError != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
WlanCloseHandle(hClientHandle,NULL);
|
WlanCloseHandle(hClientHandle, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PWLAN_INTERFACE_INFO_LIST pInterfaceList = NULL;
|
PWLAN_INTERFACE_INFO_LIST pInterfaceList = NULL;
|
||||||
dwError = WlanEnumInterfaces(hClientHandle, NULL,&pInterfaceList);
|
dwError = WlanEnumInterfaces(hClientHandle, NULL, &pInterfaceList);
|
||||||
if ( dwError != ERROR_SUCCESS )
|
if ( dwError != ERROR_SUCCESS )
|
||||||
{
|
{
|
||||||
WlanFreeMemory(pInterfaceList);
|
WlanFreeMemory(pInterfaceList);
|
||||||
WlanCloseHandle(hClientHandle,NULL);
|
WlanCloseHandle(hClientHandle, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,44 +236,44 @@ void TitleWidget::showWIFI()
|
|||||||
PWLAN_AVAILABLE_NETWORK_LIST pWLAN_AVAILABLE_NETWORK_LIST = NULL;
|
PWLAN_AVAILABLE_NETWORK_LIST pWLAN_AVAILABLE_NETWORK_LIST = NULL;
|
||||||
|
|
||||||
dwError = WlanGetAvailableNetworkList(hClientHandle, &guid,
|
dwError = WlanGetAvailableNetworkList(hClientHandle, &guid,
|
||||||
2,NULL, &pWLAN_AVAILABLE_NETWORK_LIST);
|
2, NULL, &pWLAN_AVAILABLE_NETWORK_LIST);
|
||||||
if (dwError != ERROR_SUCCESS)
|
if (dwError != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
WlanFreeMemory(pInterfaceList);
|
WlanFreeMemory(pInterfaceList);
|
||||||
WlanFreeMemory(pWLAN_AVAILABLE_NETWORK_LIST);
|
WlanFreeMemory(pWLAN_AVAILABLE_NETWORK_LIST);
|
||||||
WlanCloseHandle(hClientHandle,NULL);
|
WlanCloseHandle(hClientHandle, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
WLAN_AVAILABLE_NETWORK wlanAN;
|
WLAN_AVAILABLE_NETWORK wlanAN;
|
||||||
bool isConnected=false;
|
bool isConnected = false;
|
||||||
int numberOfItems = pWLAN_AVAILABLE_NETWORK_LIST->dwNumberOfItems;
|
int numberOfItems = pWLAN_AVAILABLE_NETWORK_LIST->dwNumberOfItems;
|
||||||
if (numberOfItems > 0)
|
if (numberOfItems > 0)
|
||||||
{
|
{
|
||||||
for(int i = 0; i <numberOfItems; i++)
|
for(int i = 0; i < numberOfItems; i++)
|
||||||
{
|
{
|
||||||
wlanAN = pWLAN_AVAILABLE_NETWORK_LIST->Network[i];
|
wlanAN = pWLAN_AVAILABLE_NETWORK_LIST->Network[i];
|
||||||
if(wlanAN.dwFlags & 1)
|
if(wlanAN.dwFlags & 1)
|
||||||
{
|
{
|
||||||
isConnected=true;
|
isConnected = true;
|
||||||
|
|
||||||
int wifiQuality=(int)wlanAN.wlanSignalQuality;
|
int wifiQuality = (int)wlanAN.wlanSignalQuality;
|
||||||
|
|
||||||
if(wifiQuality>75)
|
if(wifiQuality > 75)
|
||||||
{
|
{
|
||||||
QPixmap pixmapWireless(":/DependFile/Source/signal/wifi3.png");
|
QPixmap pixmapWireless(":/DependFile/Source/signal/wifi3.png");
|
||||||
ui->wifiSignal_Label->setPixmap(pixmapWireless);
|
ui->wifiSignal_Label->setPixmap(pixmapWireless);
|
||||||
}
|
}
|
||||||
else if(wifiQuality>50&&wifiQuality<=75)
|
else if(wifiQuality > 50 && wifiQuality <= 75)
|
||||||
{
|
{
|
||||||
QPixmap pixmapWireless(":/DependFile/Source/signal/wifi2.png");
|
QPixmap pixmapWireless(":/DependFile/Source/signal/wifi2.png");
|
||||||
ui->wifiSignal_Label->setPixmap(pixmapWireless);
|
ui->wifiSignal_Label->setPixmap(pixmapWireless);
|
||||||
}
|
}
|
||||||
else if(wifiQuality>25&&wifiQuality<=50)
|
else if(wifiQuality > 25 && wifiQuality <= 50)
|
||||||
{
|
{
|
||||||
QPixmap pixmapWireless(":/DependFile/Source/signal/wifi1.png");
|
QPixmap pixmapWireless(":/DependFile/Source/signal/wifi1.png");
|
||||||
ui->wifiSignal_Label->setPixmap(pixmapWireless);
|
ui->wifiSignal_Label->setPixmap(pixmapWireless);
|
||||||
}
|
}
|
||||||
else if(wifiQuality>0&&wifiQuality<=25)
|
else if(wifiQuality > 0 && wifiQuality <= 25)
|
||||||
{
|
{
|
||||||
QPixmap pixmapWireless(":/icons/WirelessIcon3.png");
|
QPixmap pixmapWireless(":/icons/WirelessIcon3.png");
|
||||||
ui->wifiSignal_Label->setPixmap(pixmapWireless);
|
ui->wifiSignal_Label->setPixmap(pixmapWireless);
|
||||||
@ -279,7 +289,7 @@ void TitleWidget::showWIFI()
|
|||||||
}
|
}
|
||||||
WlanFreeMemory(pInterfaceList);
|
WlanFreeMemory(pInterfaceList);
|
||||||
WlanFreeMemory(pWLAN_AVAILABLE_NETWORK_LIST);
|
WlanFreeMemory(pWLAN_AVAILABLE_NETWORK_LIST);
|
||||||
WlanCloseHandle(hClientHandle,NULL);
|
WlanCloseHandle(hClientHandle, NULL);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
@ -289,7 +299,9 @@ void TitleWidget::showWIFI()
|
|||||||
pixmap.load(":/DependFile/Source/signal/deviceConnected.png");
|
pixmap.load(":/DependFile/Source/signal/deviceConnected.png");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
pixmap.load(":/DependFile/Source/signal/deviceDisconnected.png");
|
pixmap.load(":/DependFile/Source/signal/deviceDisconnected.png");
|
||||||
|
}
|
||||||
|
|
||||||
ui->wifiSignal_Label->setPixmap(pixmap);
|
ui->wifiSignal_Label->setPixmap(pixmap);
|
||||||
#endif
|
#endif
|
||||||
@ -325,21 +337,25 @@ void TitleWidget::slotSaveUpPicture()
|
|||||||
QString dirPath = QApplication::applicationDirPath() + "/DependFile/Source/trainDisplayPage";
|
QString dirPath = QApplication::applicationDirPath() + "/DependFile/Source/trainDisplayPage";
|
||||||
QDir resultDir(dirPath);
|
QDir resultDir(dirPath);
|
||||||
if(!resultDir.exists())
|
if(!resultDir.exists())
|
||||||
qDebug()<<"保存图片失败";
|
{
|
||||||
|
qDebug() << "保存图片失败";
|
||||||
|
}
|
||||||
if(upPicture.save(dirPath + "/upPicture.png"))
|
if(upPicture.save(dirPath + "/upPicture.png"))
|
||||||
qDebug() <<dirPath + "/upPicture.png";
|
{
|
||||||
|
qDebug() << dirPath + "/upPicture.png";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TitleWidget::changeEvent(QEvent* event)
|
void TitleWidget::changeEvent(QEvent *event)
|
||||||
{
|
{
|
||||||
switch (event->type())
|
switch (event->type())
|
||||||
{
|
{
|
||||||
case QEvent::LanguageChange:
|
case QEvent::LanguageChange:
|
||||||
ui->retranslateUi(this);
|
ui->retranslateUi(this);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
QWidget::changeEvent(event);
|
QWidget::changeEvent(event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
setUser(CurrentUserData::getInstace()->getCurrentPatientMsg());
|
setUser(CurrentUserData::getInstace()->getCurrentPatientMsg());
|
||||||
|
|
||||||
@ -353,6 +369,18 @@ void TitleWidget::on_sound_Button_clicked()
|
|||||||
m_soundDialog->show();
|
m_soundDialog->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TitleWidget::slotBciDeviceStatus(bool bConnected)
|
||||||
|
{
|
||||||
|
if(bConnected)
|
||||||
|
{
|
||||||
|
ui->brainSignal_Labe->setStyleSheet("QLabel#brainSignal_Labe{border-image:url(:/DependFile/Source/signal/icon_brain_on.png);}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->brainSignal_Labe->setStyleSheet("QLabel#brainSignal_Labe{border-image:url(:/DependFile/Source/signal/icon_brain_off.png);}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,8 +8,9 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include "sounddialog.h"
|
#include "sounddialog.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui
|
||||||
class TitleWidget;
|
{
|
||||||
|
class TitleWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
class TitleWidget : public QWidget
|
class TitleWidget : public QWidget
|
||||||
@ -21,7 +22,7 @@ public:
|
|||||||
~TitleWidget();
|
~TitleWidget();
|
||||||
|
|
||||||
//设置当前用户
|
//设置当前用户
|
||||||
void setUser(const ST_PatientMsg&);
|
void setUser(const ST_PatientMsg &);
|
||||||
//设置wifi信号强度
|
//设置wifi信号强度
|
||||||
void setSignalStrength(int value);
|
void setSignalStrength(int value);
|
||||||
//设置标题
|
//设置标题
|
||||||
@ -34,9 +35,9 @@ public:
|
|||||||
void setTrainType(int8_t type);
|
void setTrainType(int8_t type);
|
||||||
|
|
||||||
void setBackBtnVisible(bool);
|
void setBackBtnVisible(bool);
|
||||||
void slotSaveUpPicture();//保存上截图
|
void slotSaveUpPicture();//保存上截图
|
||||||
protected:
|
protected:
|
||||||
virtual void changeEvent(QEvent* event);
|
virtual void changeEvent(QEvent *event);
|
||||||
signals:
|
signals:
|
||||||
void signalCloseWindow();
|
void signalCloseWindow();
|
||||||
private slots:
|
private slots:
|
||||||
@ -50,7 +51,7 @@ private slots:
|
|||||||
|
|
||||||
//void on_back1_Btn_clicked();
|
//void on_back1_Btn_clicked();
|
||||||
|
|
||||||
// void on_pushButton_clicked();
|
// void on_pushButton_clicked();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -62,6 +63,8 @@ private slots:
|
|||||||
|
|
||||||
//void on_back1_Btn_clicked();
|
//void on_back1_Btn_clicked();
|
||||||
|
|
||||||
|
void slotBciDeviceStatus(bool bConnected);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void showWIFI();
|
void showWIFI();
|
||||||
private:
|
private:
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
<font>
|
<font>
|
||||||
<family>黑体</family>
|
<family>黑体</family>
|
||||||
<pointsize>28</pointsize>
|
<pointsize>28</pointsize>
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
@ -224,7 +223,7 @@ border:2px;</string>
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">border-image: url(:/DependFile/Source/signal/icon_brain_on.png);</string>
|
<string notr="true">border-image: url(:/DependFile/Source/signal/icon_brain_off.png);</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
|
@ -76,6 +76,8 @@ void BCIManager::initTrain()
|
|||||||
m_st_bicycleParam.resistance = 0; //阻力 Nm 0~20挡
|
m_st_bicycleParam.resistance = 0; //阻力 Nm 0~20挡
|
||||||
m_st_bicycleParam.spasmType = 0; //默认逆向
|
m_st_bicycleParam.spasmType = 0; //默认逆向
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connect(this, &BCIManager::signalDeviceStatus, &getInstance(), &BCIManager::signalDeviceStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCIManager::slotLinkerProgrameReadyReadStandardOutput()
|
void BCIManager::slotLinkerProgrameReadyReadStandardOutput()
|
||||||
@ -138,7 +140,7 @@ void BCIManager::startTrain(int Part, int Time)
|
|||||||
//状态控制 0-停止 1启动 2-暂停 3-继续
|
//状态控制 0-停止 1启动 2-暂停 3-继续
|
||||||
m_st_bicycleParam.controlState = 1;
|
m_st_bicycleParam.controlState = 1;
|
||||||
m_st_bicycleParam.bodyPart = Part; //训练部位 0-上肢 1-下肢 2-四肢 3-垂直上肢
|
m_st_bicycleParam.bodyPart = Part; //训练部位 0-上肢 1-下肢 2-四肢 3-垂直上肢
|
||||||
if(Part==2)
|
if(Part == 2)
|
||||||
{
|
{
|
||||||
m_st_bicycleParam.trainMode = 4;
|
m_st_bicycleParam.trainMode = 4;
|
||||||
}
|
}
|
||||||
@ -181,3 +183,8 @@ void BCIManager::continueTrain()
|
|||||||
CCommunicateAPI::getInstance()->sendBicycleParam(m_st_bicycleParam);
|
CCommunicateAPI::getInstance()->sendBicycleParam(m_st_bicycleParam);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BCIManager::deviceStatus(bool bConnected)
|
||||||
|
{
|
||||||
|
emit signalDeviceStatus(bConnected);
|
||||||
|
}
|
||||||
|
@ -33,6 +33,7 @@ public:
|
|||||||
Q_INVOKABLE void stopTrain();
|
Q_INVOKABLE void stopTrain();
|
||||||
Q_INVOKABLE void pauseTrain();
|
Q_INVOKABLE void pauseTrain();
|
||||||
Q_INVOKABLE void continueTrain();
|
Q_INVOKABLE void continueTrain();
|
||||||
|
Q_INVOKABLE void deviceStatus(bool bConnected);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
//Linker程序的标准输出
|
//Linker程序的标准输出
|
||||||
@ -48,6 +49,8 @@ private slots:
|
|||||||
signals:
|
signals:
|
||||||
void signalQmlStopLinkerPrograme();
|
void signalQmlStopLinkerPrograme();
|
||||||
|
|
||||||
|
void signalDeviceStatus(bool bConnected);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QProcess *m_pCmd = nullptr;
|
QProcess *m_pCmd = nullptr;
|
||||||
|
|
||||||
|
@ -290,5 +290,6 @@
|
|||||||
<file>DependFile/Source/brainTrain/popup_Z_bg.png</file>
|
<file>DependFile/Source/brainTrain/popup_Z_bg.png</file>
|
||||||
<file>DependFile/Source/brainTrain/btn_Z.png</file>
|
<file>DependFile/Source/brainTrain/btn_Z.png</file>
|
||||||
<file>DependFile/QML/PopImpedance.qml</file>
|
<file>DependFile/QML/PopImpedance.qml</file>
|
||||||
|
<file>DependFile/Source/signal/icon_brain_off.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user