This commit is contained in:
curtis
2024-11-28 13:38:22 +08:00
parent 9b6889d259
commit 80bbc13c78
6 changed files with 174 additions and 140 deletions

View File

@@ -1,10 +1,11 @@
import QtQuick 2.0
import TcpSocket 2.0
import BCIManager 2.0
Item {
property int hitIndex: -1
property bool bStimulate: false
property int responseTime: 10*1000
property int responseTime: 10
property bool bTest: true
property bool bConnect: false;
@@ -25,7 +26,20 @@ Item {
"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",
"qrc:/DependFile/Source/brainTrain/upTest/upper_stretch_R15.png"
"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"
]
property int currentIndexTwelevHz: 0
@@ -120,7 +134,7 @@ Item {
Timer {
id: hitTimer
interval: responseTime;
interval: responseTime*1000;
repeat: false
onTriggered: {
clearHit();
@@ -142,14 +156,17 @@ Item {
{
ssvepTenHzTimer.start();
hitTimer.start();
bci.startTrain(0,responseTime);
}else if(index === "1")
{
ssvepTwelveHzTimer.start();
hitTimer.start();
bci.startTrain(1,responseTime);
}else if(index === "2")
{
ssvepFifteenHzTimer.start();
hitTimer.start();
bci.startTrain(2,responseTime);
}else
{
return;
@@ -172,7 +189,6 @@ Item {
}
function onExit(){
console.log("1222222222222222");
if(bConnect)
{
clientSocket.writeBytes(getIntArr("2"));
@@ -187,7 +203,7 @@ Item {
Component.onCompleted:
{
//BCIManager.signalQmlStopLinkerPrograme.connect(onExit);
bci.initTrain();
}
TcpSocket{
id: clientSocket
@@ -228,6 +244,10 @@ Item {
console.info("Client socket disconnected")
}
}
BCIManager
{
id:bci;
}
Rectangle{
anchors.top: parent.top
@@ -356,7 +376,7 @@ Item {
anchors.bottom: parent.bottom
Timer {
id: ssvepTenHzTimer
interval: 300;
interval: 70;
repeat: true
onTriggered: {
currentIndexTenHz = (currentIndexTenHz + 1) % imageFilesTenHz.length;
@@ -726,7 +746,7 @@ Item {
{
anchors.fill: parent
onClicked: {
ssvepHit(0);
ssvepHit("0");
stopStimulate();
}
}
@@ -764,7 +784,7 @@ Item {
{
anchors.fill: parent
onClicked: {
ssvepHit(1);
ssvepHit("1");
stopStimulate();
}
}
@@ -802,7 +822,7 @@ Item {
{
anchors.fill: parent
onClicked: {
ssvepHit(2);
ssvepHit("2");
stopStimulate();
}
}