|
@@ -23,6 +23,24 @@
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
+
|
|
|
+
|
|
|
+ <span class="desSty">游戏指标</span>
|
|
|
+ <el-select
|
|
|
+ v-model="gameTarget"
|
|
|
+ placeholder="请选择"
|
|
|
+ class="selectSty"
|
|
|
+ size="mini"
|
|
|
+ @change="gameDiffFun"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in gameTargetObj"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
|
|
|
<span class="desSty">游戏难度</span>
|
|
|
<el-select
|
|
@@ -393,10 +411,27 @@ export default {
|
|
|
pulseFlag: "未连接",
|
|
|
widthIframe: 900,
|
|
|
heightIframe: 600,
|
|
|
+ //游戏指标
|
|
|
+ gameTarget: 1,
|
|
|
+ gameTargetObj: [
|
|
|
+ {
|
|
|
+ value: 1,
|
|
|
+ label: "专注度",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 2,
|
|
|
+ label: "放松度",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 3,
|
|
|
+ label: "心率变异性",
|
|
|
+ },
|
|
|
+ ],
|
|
|
|
|
|
flag: 1,
|
|
|
//游戏场景
|
|
|
gameScene: 1,
|
|
|
+
|
|
|
optionsGame: [
|
|
|
{
|
|
|
value: 1,
|
|
@@ -707,6 +742,21 @@ export default {
|
|
|
that.attentionTime = setInterval(that.sendAtten, 1000);
|
|
|
|
|
|
that.ecgTimeFlag = setInterval(that.readFile, 5000);
|
|
|
+
|
|
|
+ //刚进来后判断选的是脑电还是心电
|
|
|
+ if (this.equipment == 1) {
|
|
|
+ this.gameTargetObj = [
|
|
|
+ {
|
|
|
+ value: 1,
|
|
|
+ label: "专注度",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 2,
|
|
|
+ label: "放松度",
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.gameTarget = 1;
|
|
|
+ }
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
clearTimeout(this.attentionTime);
|
|
@@ -1121,12 +1171,18 @@ export default {
|
|
|
|
|
|
// this.send(Math.random()*10)
|
|
|
// console.log(arg["_c"].get("Attention")/100)
|
|
|
- this.attentionAnimation = arg["_c"].get("Attention");
|
|
|
+ if (this.gameTarget == 1) {
|
|
|
+ this.attentionAnimation = arg["_c"].get("Attention");
|
|
|
+ }
|
|
|
+
|
|
|
this.attentionData.push(arg["_c"].get("Attention"));
|
|
|
this.attentionDataAll.push(arg["_c"].get("Attention"));
|
|
|
if (this.attentionData.length > ll) {
|
|
|
this.attentionData.shift();
|
|
|
}
|
|
|
+ if (this.gameTarget == 2) {
|
|
|
+ this.attentionAnimation = arg["_c"].get("Meditation");
|
|
|
+ }
|
|
|
this.meditationData.push(arg["_c"].get("Meditation"));
|
|
|
this.meditationDataAll.push(arg["_c"].get("Meditation"));
|
|
|
if (this.meditationData.length > ll) {
|
|
@@ -1321,12 +1377,18 @@ export default {
|
|
|
// console.log(arg["_c"].get("Attention")/100)
|
|
|
|
|
|
//设置一个公共变量 注意力的公共变量
|
|
|
- this.attentionSecondAnimation = arg["_c"].get("Attention");
|
|
|
+ if (this.gameTarget == 1) {
|
|
|
+ this.attentionSecondAnimation = arg["_c"].get("Attention");
|
|
|
+ }
|
|
|
+
|
|
|
this.attentionDataSecond.push(arg["_c"].get("Attention"));
|
|
|
this.attentionDataAllSecond.push(arg["_c"].get("Attention"));
|
|
|
if (this.attentionDataSecond.length > ll) {
|
|
|
this.attentionDataSecond.shift();
|
|
|
}
|
|
|
+ if (this.gameTarget == 2) {
|
|
|
+ this.attentionSecondAnimation = arg["_c"].get("Meditation");
|
|
|
+ }
|
|
|
this.meditationDataSecond.push(arg["_c"].get("Meditation"));
|
|
|
this.meditationDataAllSecond.push(arg["_c"].get("Meditation"));
|
|
|
if (this.meditationDataSecond.length > ll) {
|
|
@@ -1960,6 +2022,29 @@ export default {
|
|
|
this.attentionAnimation = 0;
|
|
|
//脑电--第二个人的测试数据
|
|
|
this.attentionSecondAnimation = 0;
|
|
|
+
|
|
|
+ //判断当前是脑电还是心电
|
|
|
+ if (val == 1) {
|
|
|
+ this.gameTargetObj = [
|
|
|
+ {
|
|
|
+ value: 1,
|
|
|
+ label: "专注度",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 2,
|
|
|
+ label: "放松度",
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.gameTarget = 1;
|
|
|
+ } else {
|
|
|
+ this.gameTargetObj = [
|
|
|
+ {
|
|
|
+ value: 3,
|
|
|
+ label: "心率变异性",
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.gameTarget = 3;
|
|
|
+ }
|
|
|
//先判断当选择的设备是否连接
|
|
|
//如果已连接,则继续测试
|
|
|
//如果未连接则提示连接设备
|
|
@@ -2421,7 +2506,7 @@ export default {
|
|
|
text: "心电信号",
|
|
|
subtext: "",
|
|
|
left: "center",
|
|
|
- bottom:'20'
|
|
|
+ bottom: "20",
|
|
|
},
|
|
|
grid: {
|
|
|
bottom: 80,
|
|
@@ -2511,7 +2596,7 @@ export default {
|
|
|
text: "心电信号",
|
|
|
subtext: "",
|
|
|
left: "center",
|
|
|
- bottom:'20'
|
|
|
+ bottom: "20",
|
|
|
},
|
|
|
grid: {
|
|
|
bottom: 80,
|