阻抗弹窗

This commit is contained in:
zxj
2024-11-29 17:47:45 +08:00
parent d5f31c8108
commit 4ce8544582
997 changed files with 255048 additions and 1110 deletions

View File

@@ -1,13 +1,15 @@
import QtQuick 2.0
import QtQuick.Controls 2.0
import TcpSocket 2.0
import BCIManager 2.0
Item {
property int hitIndex: -1
property bool bStimulate: false
property int responseTime: 10
property bool bTest: true
property bool bConnect: false;
property var brainTrainForm: null
property int currentIndexTenHz: 0
property var imageFilesTenHz:
@@ -91,6 +93,7 @@ Item {
}
}
function stopStimulate()
{
if(animationTenHz.running)
@@ -110,6 +113,7 @@ Item {
}
}
function clearHit()
{
if(hitIndex === 0)
@@ -156,17 +160,17 @@ Item {
{
ssvepTenHzTimer.start();
hitTimer.start();
bci.startTrain(0,responseTime);
bci.startTrain(0,responseTime-1);
}else if(index === "1")
{
ssvepTwelveHzTimer.start();
hitTimer.start();
bci.startTrain(1,responseTime);
bci.startTrain(1,responseTime-1);
}else if(index === "2")
{
ssvepFifteenHzTimer.start();
hitTimer.start();
bci.startTrain(2,responseTime);
bci.startTrain(2,responseTime-1);
}else
{
return;
@@ -205,6 +209,7 @@ Item {
{
bci.initTrain();
}
TcpSocket{
id: clientSocket
peer: "127.0.0.1"
@@ -667,6 +672,7 @@ Item {
}
}
Rectangle
{
width: 286;
@@ -680,6 +686,7 @@ Item {
border.color: "#41B962"
radius: 10;
Text {
id:stimulateText
text: qsTr("开始训练")
@@ -827,4 +834,56 @@ Item {
}
}
}
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: {
}
}
}
}

View File

@@ -0,0 +1,157 @@
import QtQuick 2.0
import QtQuick.Controls 2.0
Popup {
id: popup // 弹出窗口的唯一标识
x:510
y:80
width: bgRect.width
height: bgRect.height
background: Item {
implicitWidth: bgRect.width
implicitHeight: bgRect.height
}
modal: true
focus: true
closePolicy: /*Popup.CloseOnEscape | */Popup.CloseOnPressOutsideParent
// 弹出窗口的内容项
Rectangle
{
id: bgRect
width: 900
height: 720
radius: 20
x:0
y:0
color: "#FFFFFF" // 设置矩形的背景颜色
// 文本显示在矩形中
//标题
Rectangle {
id: titleRect
width: parent.width
height: 120
color: "#F5F7F9"
radius: parent.radius
Text {
id: titleText
color: "#333333"
font.pixelSize: 24
text: qsTr("阻抗")
font.weight: Font.Bold
anchors.left: parent.left
anchors.leftMargin: 30
anchors.verticalCenter: parent.verticalCenter
z:2
}
Image {
id: closeImg
source: "qrc:DependFile/Source/dialog/close.png"
sourceSize: Qt.size(34,34)
anchors.right: parent.right
anchors.rightMargin: 50
anchors.verticalCenter: parent.verticalCenter
MouseArea
{
anchors.fill: parent
onClicked: {
popup.visible = false;
}
}
}
}
Rectangle {
id: buttonRect
x:0
y:100
width: parent.width
height: 600
color: "#FFFFFF"
Text {
id: buttonText
color: "#666666"
font.pixelSize: 20
text: qsTr("请保存安静,正在进行阻抗检测")
y:44
anchors.horizontalCenter: parent.horizontalCenter
z:2
}
Image {
id: impedanceImg
source: "qrc:/DependFile/Source/brainTrain/popup_Z_bg.png"
sourceSize: Qt.size(602,290)
y:114
anchors.horizontalCenter: parent.horizontalCenter
}
}
Rectangle {
id: cancel
x:270
y:600
width: 160
height: 64
color: "#FFFFFF"
border.color: "#0D9DDB"
border.width:1
radius:8
Text {
id: cancelText
color: "#0D9DDB"
font.pixelSize: 28
font.weight: Font.Bold
text: qsTr("取消")
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
z:2
}
MouseArea
{
anchors.fill: parent
onClicked: {
popup.visible = false;
}
}
}
Rectangle {
id: confirm
x:470
y:600
width: 160
height: 64
color: "#0D9DDB"
radius:8
Text {
id: confirmText
color: "#FFFFFF"
font.pixelSize: 28
font.weight: Font.Bold
text: qsTr("确定")
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
z:2
}
MouseArea
{
anchors.fill: parent
onClicked: {
popup.visible = false;
}
}
}
}
}