2024-11-25 17:15:44 +08:00
|
|
|
import QtQuick 2.0
|
2024-11-29 17:47:45 +08:00
|
|
|
import QtQuick.Controls 2.0
|
2024-11-26 16:21:02 +08:00
|
|
|
import TcpSocket 2.0
|
2024-11-28 13:38:22 +08:00
|
|
|
import BCIManager 2.0
|
2024-11-25 17:15:44 +08:00
|
|
|
Item {
|
2024-11-26 13:43:59 +08:00
|
|
|
property int hitIndex: -1
|
|
|
|
property bool bStimulate: false
|
2024-11-28 13:38:22 +08:00
|
|
|
property int responseTime: 10
|
2024-11-26 13:43:59 +08:00
|
|
|
property bool bTest: true
|
2024-11-26 16:21:02 +08:00
|
|
|
property bool bConnect: false;
|
2024-11-29 17:47:45 +08:00
|
|
|
property var brainTrainForm: null
|
2024-12-02 17:31:09 +08:00
|
|
|
property string red: "#EE6352"
|
|
|
|
property string green: "#41B962"
|
|
|
|
property string yellow: "#F8C434"
|
2024-11-29 17:47:45 +08:00
|
|
|
|
2024-11-25 17:15:44 +08:00
|
|
|
|
2024-11-26 13:43:59 +08:00
|
|
|
property int currentIndexTenHz: 0
|
|
|
|
property var imageFilesTenHz:
|
|
|
|
[
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R01.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R02.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R03.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R04.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R05.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R06.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R07.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R08.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R09.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R10.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R11.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R12.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R13.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R14.png",
|
2024-11-28 13:38:22 +08:00
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R15.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R14.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R13.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R12.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R11.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R10.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R09.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R08.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R07.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R06.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R05.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R04.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R03.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R02.png"
|
2024-11-26 13:43:59 +08:00
|
|
|
]
|
2024-11-25 17:15:44 +08:00
|
|
|
|
2024-11-26 13:43:59 +08:00
|
|
|
property int currentIndexTwelevHz: 0
|
|
|
|
property var imageFilesTwelevHz:
|
|
|
|
[
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest2D/upper_stretch_R01.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest2D/upper_stretch_R02.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest2D/upper_stretch_R03.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest2D/upper_stretch_R04.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest2D/upper_stretch_R05.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest2D/upper_stretch_R06.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest2D/upper_stretch_R07.png"
|
|
|
|
]
|
2024-11-25 17:15:44 +08:00
|
|
|
|
2024-11-26 13:43:59 +08:00
|
|
|
property int currentIndexFifteenHz: 0
|
|
|
|
property var imageFilesFifteenHz:
|
|
|
|
[
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R01.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R02.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R03.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R04.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R05.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R06.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R07.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R08.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R09.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R10.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R11.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R12.png",
|
|
|
|
"qrc:/DependFile/Source/brainTrain/upTest3/upper_stretch_R13.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_R16.png",
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
function startStimulate()
|
|
|
|
{
|
|
|
|
animationTenHz.start();
|
|
|
|
animationTwelveHz.start();
|
|
|
|
animationFifteenHz.start();
|
2024-11-26 16:21:02 +08:00
|
|
|
if(!bConnect)
|
|
|
|
{
|
|
|
|
clientSocket.connectToHost();
|
|
|
|
bConnect = true;
|
|
|
|
}else
|
|
|
|
{
|
|
|
|
clientSocket.writeBytes(getIntArr("1"));
|
|
|
|
}
|
2024-11-26 13:43:59 +08:00
|
|
|
}
|
|
|
|
|
2024-11-29 17:47:45 +08:00
|
|
|
|
2024-11-26 13:43:59 +08:00
|
|
|
function stopStimulate()
|
|
|
|
{
|
|
|
|
if(animationTenHz.running)
|
|
|
|
{
|
|
|
|
animationTenHz.stop();
|
|
|
|
flashingImageTenHz.opacity = 1;
|
|
|
|
}
|
|
|
|
if(animationTwelveHz.running)
|
|
|
|
{
|
|
|
|
animationTwelveHz.stop();
|
|
|
|
flashingImageTwelveHz.opacity = 1;
|
|
|
|
}
|
|
|
|
if(animationFifteenHz.running)
|
|
|
|
{
|
|
|
|
animationFifteenHz.stop();
|
|
|
|
flashingImageFifteenHz.opacity = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-11-29 17:47:45 +08:00
|
|
|
|
2024-11-26 13:43:59 +08:00
|
|
|
function clearHit()
|
|
|
|
{
|
|
|
|
if(hitIndex === 0)
|
|
|
|
{
|
|
|
|
ssvepTenHzTimer.stop();
|
|
|
|
imageTenHz.source = imageFilesTenHz[0];
|
|
|
|
}else if(hitIndex === 1)
|
|
|
|
{
|
|
|
|
ssvepTwelveHzTimer.stop();
|
|
|
|
imageTwelveHz.source = imageFilesTwelevHz[0];
|
|
|
|
}else if(hitIndex === 2)
|
|
|
|
{
|
|
|
|
ssvepFifteenHzTimer.stop();
|
|
|
|
imageFifteenHz.source = imageFilesFifteenHz[0];
|
|
|
|
}
|
|
|
|
if(hitTimer.running)
|
|
|
|
{
|
|
|
|
hitTimer.stop();
|
|
|
|
}
|
|
|
|
hitIndex = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
Timer {
|
|
|
|
id: hitTimer
|
2024-11-28 13:38:22 +08:00
|
|
|
interval: responseTime*1000;
|
2024-11-26 13:43:59 +08:00
|
|
|
repeat: false
|
|
|
|
onTriggered: {
|
|
|
|
clearHit();
|
|
|
|
startStimulate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function ssvepHit(index)
|
|
|
|
{
|
|
|
|
if(!bStimulate)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if(hitIndex !== -1)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2024-11-26 16:21:02 +08:00
|
|
|
if(index === "0")
|
2024-11-26 13:43:59 +08:00
|
|
|
{
|
|
|
|
ssvepTenHzTimer.start();
|
|
|
|
hitTimer.start();
|
2024-11-29 17:47:45 +08:00
|
|
|
bci.startTrain(0,responseTime-1);
|
2024-11-26 16:21:02 +08:00
|
|
|
}else if(index === "1")
|
2024-11-26 13:43:59 +08:00
|
|
|
{
|
|
|
|
ssvepTwelveHzTimer.start();
|
|
|
|
hitTimer.start();
|
2024-11-29 17:47:45 +08:00
|
|
|
bci.startTrain(1,responseTime-1);
|
2024-11-26 16:21:02 +08:00
|
|
|
}else if(index === "2")
|
2024-11-26 13:43:59 +08:00
|
|
|
{
|
|
|
|
ssvepFifteenHzTimer.start();
|
|
|
|
hitTimer.start();
|
2024-11-29 17:47:45 +08:00
|
|
|
bci.startTrain(2,responseTime-1);
|
2024-11-26 13:43:59 +08:00
|
|
|
}else
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
hitIndex = index;
|
|
|
|
}
|
|
|
|
|
2024-11-26 16:21:02 +08:00
|
|
|
function getStr(intArr){
|
|
|
|
var str = "";
|
|
|
|
for(var i=0;i<intArr.length;i++)
|
|
|
|
str += String.fromCharCode(intArr[i]);
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getIntArr(str){
|
|
|
|
var ret = [];
|
|
|
|
for(var i=0;i<str.length;i++)
|
|
|
|
ret.push(str.charCodeAt(i));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2024-11-27 11:21:05 +08:00
|
|
|
function onExit(){
|
|
|
|
if(bConnect)
|
|
|
|
{
|
|
|
|
clientSocket.writeBytes(getIntArr("2"));
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
function onConnectAndExit(){
|
|
|
|
clientSocket.connectToHost();
|
|
|
|
clientSocket.writeBytes(getIntArr("2"));
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted:
|
|
|
|
{
|
2024-11-28 13:38:22 +08:00
|
|
|
bci.initTrain();
|
2024-11-27 11:21:05 +08:00
|
|
|
}
|
2024-11-29 17:47:45 +08:00
|
|
|
|
2024-11-26 16:21:02 +08:00
|
|
|
TcpSocket{
|
|
|
|
id: clientSocket
|
|
|
|
peer: "127.0.0.1"
|
|
|
|
port: 8099
|
|
|
|
onBytesReceived:
|
|
|
|
{
|
|
|
|
var cmd = getStr(bytes);
|
|
|
|
console.info("Client received: " + cmd);
|
|
|
|
if(cmd !== "0" && cmd !== "1" && cmd !== "2")
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
ssvepHit(cmd);
|
|
|
|
stopStimulate();
|
|
|
|
|
|
|
|
}
|
|
|
|
onConnected:
|
|
|
|
{
|
|
|
|
console.info("Client socket connected");
|
|
|
|
writeBytes(getIntArr("1"));
|
|
|
|
}
|
|
|
|
onDisconnected:
|
|
|
|
{
|
|
|
|
console.info("Client socket disconnected");
|
|
|
|
bConnect = false;
|
|
|
|
}
|
|
|
|
onPeerChanged:
|
|
|
|
{
|
|
|
|
console.info("Client socket peer changed: " + peer);
|
|
|
|
}
|
|
|
|
onPortChanged:
|
|
|
|
{
|
|
|
|
console.info("Client socket port changed: " + port);
|
|
|
|
}
|
|
|
|
onError:
|
|
|
|
{
|
|
|
|
console.info("Client socket disconnected")
|
|
|
|
}
|
|
|
|
}
|
2024-11-28 13:38:22 +08:00
|
|
|
BCIManager
|
|
|
|
{
|
|
|
|
id:bci;
|
|
|
|
}
|
2024-11-26 16:21:02 +08:00
|
|
|
|
2024-11-26 13:43:59 +08:00
|
|
|
Rectangle{
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 42
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 100
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 100
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: 178
|
|
|
|
Row
|
|
|
|
{
|
|
|
|
anchors.centerIn: parent
|
|
|
|
spacing: 80
|
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
id:ssvepTenHz
|
|
|
|
width: 520;
|
|
|
|
height: 760;
|
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
width: 520;
|
|
|
|
height: 450;
|
|
|
|
anchors.top: parent.top
|
|
|
|
color:"#F9FAFD";
|
|
|
|
border.width: 1
|
|
|
|
border.color: "#ADCFDD"
|
|
|
|
radius: 20;
|
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
id:tenHzHit
|
|
|
|
visible: ssvepTenHzTimer.running
|
|
|
|
width: 100;
|
|
|
|
height: 36;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 40;
|
|
|
|
anchors.right: parent.right;
|
|
|
|
anchors.rightMargin: 40;
|
|
|
|
color:Qt.rgba(52,196,163,0.1);
|
|
|
|
border.width: 1;
|
|
|
|
border.color: "#34C4A3";
|
|
|
|
radius: 18;
|
|
|
|
|
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
width: 14;
|
|
|
|
height: 14;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 11;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 14;
|
|
|
|
color:"#34C4A3";
|
|
|
|
border.width: 1;
|
|
|
|
border.color: "#34C4A3";
|
|
|
|
radius: 7;
|
|
|
|
}
|
|
|
|
Text {
|
|
|
|
text: qsTr("训练中")
|
|
|
|
width: 72;
|
|
|
|
height: 26;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 4;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 32;
|
|
|
|
color: "#10275A";
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
font.pixelSize: 18
|
|
|
|
font.family: "Medium"
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: qsTr("上肢训练")
|
|
|
|
width: 144;
|
|
|
|
height: 46;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 34;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 40;
|
|
|
|
color: "#10275A";
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
font.pixelSize: 36;
|
|
|
|
font.family: "Medium";
|
|
|
|
font.bold: true;
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: qsTr("Upper Limbs Training")
|
|
|
|
width: 194;
|
|
|
|
height: 28;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 84;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 40;
|
|
|
|
color: "#8586A9";
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
font.pixelSize: 20;
|
|
|
|
font.family: "Medium";
|
|
|
|
}
|
|
|
|
Image {
|
|
|
|
id: flashingImageTenHz
|
|
|
|
width: 238;
|
|
|
|
height: 238;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 162;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 141;
|
|
|
|
source: "qrc:/DependFile/Source/brainTrain/vision_img_board.png"
|
|
|
|
opacity: 1
|
|
|
|
SequentialAnimation on opacity {
|
|
|
|
id: animationTenHz
|
|
|
|
running: false;
|
|
|
|
loops: Animation.Infinite
|
|
|
|
NumberAnimation { to: 0; duration: 50 }
|
|
|
|
NumberAnimation { to: 1; duration: 50 }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Item {
|
|
|
|
width: 520;
|
|
|
|
height: 280;
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
Timer {
|
|
|
|
id: ssvepTenHzTimer
|
2024-11-28 13:38:22 +08:00
|
|
|
interval: 70;
|
2024-11-26 13:43:59 +08:00
|
|
|
repeat: true
|
|
|
|
onTriggered: {
|
|
|
|
currentIndexTenHz = (currentIndexTenHz + 1) % imageFilesTenHz.length;
|
|
|
|
imageTenHz.source = imageFilesTenHz[currentIndexTenHz];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Image {
|
|
|
|
id: imageTenHz
|
|
|
|
anchors.centerIn: parent
|
|
|
|
source: imageFilesTenHz[0]
|
|
|
|
}
|
|
|
|
Image {
|
|
|
|
visible: !ssvepTenHzTimer.running
|
|
|
|
anchors.centerIn: parent
|
|
|
|
source: "qrc:/DependFile/Source/brainTrain/vision_btn_start.png"
|
|
|
|
z:1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
id:ssvepTwelveHz
|
|
|
|
width: 520;
|
|
|
|
height: 760;
|
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
width: 520;
|
|
|
|
height: 450;
|
|
|
|
anchors.top: parent.top
|
|
|
|
color:"#F9FAFD";
|
|
|
|
border.width: 1
|
|
|
|
border.color: "#ADCFDD"
|
|
|
|
radius: 20;
|
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
id:twelveHzHit
|
|
|
|
visible: ssvepTwelveHzTimer.running
|
|
|
|
width: 100;
|
|
|
|
height: 36;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 40;
|
|
|
|
anchors.right: parent.right;
|
|
|
|
anchors.rightMargin: 40;
|
|
|
|
color:Qt.rgba(52,196,163,0.1);
|
|
|
|
border.width: 1;
|
|
|
|
border.color: "#34C4A3";
|
|
|
|
radius: 18;
|
|
|
|
|
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
width: 14;
|
|
|
|
height: 14;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 11;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 14;
|
|
|
|
color:"#34C4A3";
|
|
|
|
border.width: 1;
|
|
|
|
border.color: "#34C4A3";
|
|
|
|
radius: 7;
|
|
|
|
}
|
|
|
|
Text {
|
|
|
|
text: qsTr("训练中")
|
|
|
|
width: 72;
|
|
|
|
height: 26;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 4;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 32;
|
|
|
|
color: "#10275A";
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
font.pixelSize: 18
|
|
|
|
font.family: "Medium"
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: qsTr("下肢训练")
|
|
|
|
width: 144;
|
|
|
|
height: 46;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 34;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 40;
|
|
|
|
color: "#10275A";
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
font.pixelSize: 36;
|
|
|
|
font.family: "Medium";
|
|
|
|
font.bold: true;
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: qsTr("Lower Limbs Training")
|
|
|
|
width: 194;
|
|
|
|
height: 28;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 84;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 40;
|
|
|
|
color: "#8586A9";
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
font.pixelSize: 20;
|
|
|
|
font.family: "Medium";
|
|
|
|
}
|
|
|
|
Image {
|
|
|
|
id: flashingImageTwelveHz
|
|
|
|
width: 238;
|
|
|
|
height: 238;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 162;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 141;
|
|
|
|
source: "qrc:/DependFile/Source/brainTrain/vision_img_board.png"
|
|
|
|
opacity: 1
|
|
|
|
SequentialAnimation on opacity {
|
|
|
|
id: animationTwelveHz
|
|
|
|
running: false;
|
|
|
|
loops: Animation.Infinite
|
|
|
|
NumberAnimation { to: 0; duration: 42 }
|
|
|
|
NumberAnimation { to: 1; duration: 42 }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Item {
|
|
|
|
width: 520;
|
|
|
|
height: 280;
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
Timer {
|
|
|
|
id: ssvepTwelveHzTimer
|
|
|
|
interval: 30;
|
|
|
|
repeat: true
|
|
|
|
onTriggered: {
|
|
|
|
currentIndexTwelevHz = (currentIndexTwelevHz + 1) % imageFilesTwelevHz.length;
|
|
|
|
imageTwelveHz.source = imageFilesTwelevHz[currentIndexTwelevHz];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Image {
|
|
|
|
id: imageTwelveHz
|
|
|
|
anchors.centerIn: parent
|
|
|
|
source: imageFilesTwelevHz[0]
|
|
|
|
}
|
|
|
|
Image {
|
|
|
|
visible: !ssvepTwelveHzTimer.running
|
|
|
|
anchors.centerIn: parent
|
|
|
|
source: "qrc:/DependFile/Source/brainTrain/vision_btn_start.png"
|
|
|
|
z:1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
id:ssvepFifteenHz
|
|
|
|
width: 520;
|
|
|
|
height: 760;
|
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
width: 520;
|
|
|
|
height: 450;
|
|
|
|
anchors.top: parent.top
|
|
|
|
color:"#F9FAFD";
|
|
|
|
border.width: 1
|
|
|
|
border.color: "#ADCFDD"
|
|
|
|
radius: 20;
|
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
id:fifteenHzHit
|
|
|
|
visible: ssvepFifteenHzTimer.running
|
|
|
|
width: 100;
|
|
|
|
height: 36;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 40;
|
|
|
|
anchors.right: parent.right;
|
|
|
|
anchors.rightMargin: 40;
|
|
|
|
color:Qt.rgba(52,196,163,0.1);
|
|
|
|
border.width: 1;
|
|
|
|
border.color: "#34C4A3";
|
|
|
|
radius: 18;
|
|
|
|
|
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
width: 14;
|
|
|
|
height: 14;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 11;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 14;
|
|
|
|
color:"#34C4A3";
|
|
|
|
border.width: 1;
|
|
|
|
border.color: "#34C4A3";
|
|
|
|
radius: 7;
|
|
|
|
}
|
|
|
|
Text {
|
|
|
|
text: qsTr("训练中")
|
|
|
|
width: 72;
|
|
|
|
height: 26;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 4;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 32;
|
|
|
|
color: "#10275A";
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
font.pixelSize: 18
|
|
|
|
font.family: "Medium"
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: qsTr("上下肢训练")
|
|
|
|
width: 144;
|
|
|
|
height: 46;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 34;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 40;
|
|
|
|
color: "#10275A";
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
font.pixelSize: 36;
|
|
|
|
font.family: "Medium";
|
|
|
|
font.bold: true;
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: qsTr("Upper and Lower Limb")
|
|
|
|
width: 194;
|
|
|
|
height: 28;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 84;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 40;
|
|
|
|
color: "#8586A9";
|
|
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
font.pixelSize: 20;
|
|
|
|
font.family: "Medium";
|
|
|
|
}
|
|
|
|
Image {
|
|
|
|
id: flashingImageFifteenHz
|
|
|
|
width: 238;
|
|
|
|
height: 238;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 162;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 141;
|
|
|
|
source: "qrc:/DependFile/Source/brainTrain/vision_img_board.png"
|
|
|
|
opacity: 1
|
|
|
|
SequentialAnimation on opacity {
|
|
|
|
id: animationFifteenHz
|
|
|
|
running: false;
|
|
|
|
loops: Animation.Infinite
|
|
|
|
NumberAnimation { to: 0; duration: 33 }
|
|
|
|
NumberAnimation { to: 1; duration: 33 }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Item {
|
|
|
|
width: 520;
|
|
|
|
height: 280;
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
Timer {
|
|
|
|
id: ssvepFifteenHzTimer
|
|
|
|
interval: 30;
|
|
|
|
repeat: true
|
|
|
|
onTriggered: {
|
|
|
|
currentIndexFifteenHz = (currentIndexFifteenHz + 1) % imageFilesFifteenHz.length;
|
|
|
|
imageFifteenHz.source = imageFilesFifteenHz[currentIndexFifteenHz];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Image {
|
|
|
|
id: imageFifteenHz
|
|
|
|
anchors.centerIn: parent
|
|
|
|
source: imageFilesFifteenHz[0]
|
|
|
|
}
|
|
|
|
Image {
|
|
|
|
visible: !ssvepFifteenHzTimer.running
|
|
|
|
anchors.centerIn: parent
|
|
|
|
source: "qrc:/DependFile/Source/brainTrain/vision_btn_start.png"
|
|
|
|
z:1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-11-29 17:47:45 +08:00
|
|
|
|
2024-11-26 13:43:59 +08:00
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
width: 286;
|
|
|
|
height: 88;
|
|
|
|
anchors.bottom: parent.bottom;
|
|
|
|
anchors.bottomMargin: 60;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 817;
|
|
|
|
color:"#41B962";
|
|
|
|
border.width: 1
|
|
|
|
border.color: "#41B962"
|
|
|
|
radius: 10;
|
|
|
|
|
2024-11-29 17:47:45 +08:00
|
|
|
|
2024-11-26 13:43:59 +08:00
|
|
|
Text {
|
|
|
|
id:stimulateText
|
|
|
|
text: qsTr("开始训练")
|
|
|
|
width: 144;
|
|
|
|
height: 51;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 18;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 71;
|
|
|
|
color: "#FFFFFF";
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
font.pixelSize: 36;
|
|
|
|
font.family: "Medium";
|
|
|
|
}
|
|
|
|
MouseArea
|
|
|
|
{
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
|
|
|
if(bStimulate)
|
|
|
|
{
|
|
|
|
stimulateText.text = "继续";
|
|
|
|
stopStimulate();
|
|
|
|
clearHit();
|
|
|
|
}else
|
|
|
|
{
|
|
|
|
stimulateText.text = "暂停";
|
|
|
|
startStimulate();
|
|
|
|
}
|
|
|
|
bStimulate = !bStimulate;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
width: 86;
|
|
|
|
height: 88;
|
|
|
|
visible: bTest
|
|
|
|
anchors.bottom: parent.bottom;
|
|
|
|
anchors.bottomMargin: 60;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 1200;
|
|
|
|
color:"#41B962";
|
|
|
|
border.width: 1
|
|
|
|
border.color: "#41B962"
|
|
|
|
radius: 10;
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: qsTr("0")
|
|
|
|
width: 86;
|
|
|
|
height: 51;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 18;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 0;
|
|
|
|
color: "#FFFFFF";
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
font.pixelSize: 36;
|
|
|
|
font.family: "Medium";
|
|
|
|
}
|
|
|
|
MouseArea
|
|
|
|
{
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
2024-11-28 13:38:22 +08:00
|
|
|
ssvepHit("0");
|
2024-11-26 13:43:59 +08:00
|
|
|
stopStimulate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
width: 86;
|
|
|
|
height: 88;
|
|
|
|
visible: bTest
|
|
|
|
anchors.bottom: parent.bottom;
|
|
|
|
anchors.bottomMargin: 60;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 1300;
|
|
|
|
color:"#41B962";
|
|
|
|
border.width: 1
|
|
|
|
border.color: "#41B962"
|
|
|
|
radius: 10;
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: qsTr("1")
|
|
|
|
width: 86;
|
|
|
|
height: 51;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 18;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 0;
|
|
|
|
color: "#FFFFFF";
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
font.pixelSize: 36;
|
|
|
|
font.family: "Medium";
|
|
|
|
}
|
|
|
|
MouseArea
|
|
|
|
{
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
2024-11-28 13:38:22 +08:00
|
|
|
ssvepHit("1");
|
2024-11-26 13:43:59 +08:00
|
|
|
stopStimulate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
width: 86;
|
|
|
|
height: 88;
|
|
|
|
visible: bTest
|
|
|
|
anchors.bottom: parent.bottom;
|
|
|
|
anchors.bottomMargin: 60;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 1400;
|
|
|
|
color:"#41B962";
|
|
|
|
border.width: 1
|
|
|
|
border.color: "#41B962"
|
|
|
|
radius: 10;
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: qsTr("2")
|
|
|
|
width: 86;
|
|
|
|
height: 51;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 18;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 0;
|
|
|
|
color: "#FFFFFF";
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
font.pixelSize: 36;
|
|
|
|
font.family: "Medium";
|
|
|
|
}
|
|
|
|
MouseArea
|
|
|
|
{
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
2024-11-28 13:38:22 +08:00
|
|
|
ssvepHit("2");
|
2024-11-26 13:43:59 +08:00
|
|
|
stopStimulate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-11-29 17:47:45 +08:00
|
|
|
Rectangle
|
|
|
|
{
|
|
|
|
width: 160;
|
|
|
|
height: 70;
|
|
|
|
anchors.bottom: parent.bottom;
|
|
|
|
anchors.bottomMargin: 60;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 100;
|
|
|
|
color:"#EEF7FD";
|
|
|
|
// border.width: 1
|
|
|
|
// border.color: "#41B962"
|
|
|
|
radius: 10;
|
|
|
|
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id:impedance
|
|
|
|
text: qsTr("阻抗")
|
|
|
|
width: 31;
|
|
|
|
height: 32;
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 18;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 71;
|
|
|
|
color: "#0D9DDB";
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
font.pixelSize: 32;
|
|
|
|
font.family: "Medium";
|
|
|
|
}
|
|
|
|
Image {
|
|
|
|
id:impedance_image
|
|
|
|
width:32
|
|
|
|
height: 32
|
|
|
|
anchors.top: parent.top;
|
|
|
|
anchors.topMargin: 18;
|
|
|
|
anchors.left: parent.left;
|
|
|
|
anchors.leftMargin: 20;
|
|
|
|
source: "qrc:/DependFile/Source/brainTrain/btn_Z.png"
|
|
|
|
}
|
|
|
|
MouseArea
|
|
|
|
{
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
2024-12-02 17:07:29 +08:00
|
|
|
popimpedance.show()
|
2024-12-02 17:31:09 +08:00
|
|
|
popimpedance.colorChange(5,green)
|
|
|
|
|
2024-11-29 17:47:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2024-12-02 17:07:29 +08:00
|
|
|
PopImpedance{
|
|
|
|
id:popimpedance
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-11-29 17:47:45 +08:00
|
|
|
|
|
|
|
|
2024-11-25 17:15:44 +08:00
|
|
|
}
|
2024-11-29 17:47:45 +08:00
|
|
|
|