- Added test fix for vibrate-func.

- Changed order of the patterns.
This commit is contained in:
Eugene Serb 2022-08-09 14:16:15 +03:00
parent 504a5750de
commit 699b58ce16
2 changed files with 90 additions and 89 deletions

View File

@ -1,57 +1,116 @@
[ [
{ {
"name": "Dotted Weak", "name": "Constant Weak",
"type": "Simple", "type": "Simple",
"icon": "😌", "icon": "😏",
"pattern": [ "pattern": [
{ {
"startDelay": 200, "startDelay": 0,
"duration": 100, "duration": 1000,
"weakMagnitude": 1.0, "weakMagnitude": 1.0,
"strongMagnitude": 0.0 "strongMagnitude": 0.0
} }
] ]
}, },
{ {
"name": "Dotted Strong", "name": "Constant Strong",
"type": "Simple", "type": "Simple",
"icon": "😉", "icon": "🤩",
"pattern": [ "pattern": [
{ {
"startDelay": 200, "startDelay": 0,
"duration": 100, "duration": 1000,
"weakMagnitude": 0.0, "weakMagnitude": 0.0,
"strongMagnitude": 1.0 "strongMagnitude": 1.0
} }
] ]
}, },
{ {
"name": "Dotted Max", "name": "Constant Max",
"type": "Simple", "type": "Simple",
"icon": "🙃", "icon": "😍",
"pattern": [ "pattern": [
{ {
"startDelay": 200, "startDelay": 0,
"duration": 100, "duration": 1000,
"weakMagnitude": 1.0, "weakMagnitude": 1.0,
"strongMagnitude": 1.0 "strongMagnitude": 1.0
} }
] ]
}, },
{ {
"name": "Dotted AC", "name": "Constant AC",
"type": "Complex", "type": "Complex",
"icon": "🤨", "icon": "😵",
"pattern": [
{
"startDelay": 0,
"duration": 1000,
"weakMagnitude": 1.0,
"strongMagnitude": 0.0
},
{
"startDelay": 0,
"duration": 1000,
"weakMagnitude": 0.0,
"strongMagnitude": 1.0
}
]
},
{
"name": "Long Dashed Weak",
"type": "Simple",
"icon": "😋",
"pattern": [ "pattern": [
{ {
"startDelay": 200, "startDelay": 200,
"duration": 100, "duration": 500,
"weakMagnitude": 1.0,
"strongMagnitude": 0.0
}
]
},
{
"name": "Long Dashed Strong",
"type": "Simple",
"icon": "😜",
"pattern": [
{
"startDelay": 100,
"duration": 500,
"weakMagnitude": 0.0,
"strongMagnitude": 1.0
}
]
},
{
"name": "Long Dashed Max",
"type": "Simple",
"icon": "🤪",
"pattern": [
{
"startDelay": 200,
"duration": 500,
"weakMagnitude": 1.0,
"strongMagnitude": 1.0
}
]
},
{
"name": "Long Dashed AC",
"type": "Complex",
"icon": "😝",
"pattern": [
{
"startDelay": 200,
"duration": 500,
"weakMagnitude": 1.0, "weakMagnitude": 1.0,
"strongMagnitude": 0.0 "strongMagnitude": 0.0
}, },
{ {
"startDelay": 200, "startDelay": 200,
"duration": 100, "duration": 500,
"weakMagnitude": 0.0, "weakMagnitude": 0.0,
"strongMagnitude": 1.0 "strongMagnitude": 1.0
} }
@ -116,116 +175,58 @@
] ]
}, },
{ {
"name": "Long Dashed Weak", "name": "Dotted Weak",
"type": "Simple", "type": "Simple",
"icon": "😋", "icon": "😌",
"pattern": [ "pattern": [
{ {
"startDelay": 200, "startDelay": 200,
"duration": 500, "duration": 100,
"weakMagnitude": 1.0, "weakMagnitude": 1.0,
"strongMagnitude": 0.0 "strongMagnitude": 0.0
} }
] ]
}, },
{ {
"name": "Long Dashed Strong", "name": "Dotted Strong",
"type": "Simple", "type": "Simple",
"icon": "😜", "icon": "😉",
"pattern": [ "pattern": [
{ {
"startDelay": 100, "startDelay": 200,
"duration": 500, "duration": 100,
"weakMagnitude": 0.0, "weakMagnitude": 0.0,
"strongMagnitude": 1.0 "strongMagnitude": 1.0
} }
] ]
}, },
{ {
"name": "Long Dashed Max", "name": "Dotted Max",
"type": "Simple", "type": "Simple",
"icon": "🤪", "icon": "🙃",
"pattern": [ "pattern": [
{ {
"startDelay": 200, "startDelay": 200,
"duration": 500, "duration": 100,
"weakMagnitude": 1.0, "weakMagnitude": 1.0,
"strongMagnitude": 1.0 "strongMagnitude": 1.0
} }
] ]
}, },
{ {
"name": "Long Dashed AC", "name": "Dotted AC",
"type": "Complex", "type": "Complex",
"icon": "😝", "icon": "🤨",
"pattern": [ "pattern": [
{ {
"startDelay": 200, "startDelay": 200,
"duration": 500, "duration": 100,
"weakMagnitude": 1.0, "weakMagnitude": 1.0,
"strongMagnitude": 0.0 "strongMagnitude": 0.0
}, },
{ {
"startDelay": 200, "startDelay": 200,
"duration": 500, "duration": 100,
"weakMagnitude": 0.0,
"strongMagnitude": 1.0
}
]
},
{
"name": "Constant Weak",
"type": "Simple",
"icon": "😏",
"pattern": [
{
"startDelay": 0,
"duration": 1000,
"weakMagnitude": 1.0,
"strongMagnitude": 0.0
}
]
},
{
"name": "Constant Strong",
"type": "Simple",
"icon": "🤩",
"pattern": [
{
"startDelay": 0,
"duration": 1000,
"weakMagnitude": 0.0,
"strongMagnitude": 1.0
}
]
},
{
"name": "Constant Max",
"type": "Simple",
"icon": "😍",
"pattern": [
{
"startDelay": 0,
"duration": 1000,
"weakMagnitude": 1.0,
"strongMagnitude": 1.0
}
]
},
{
"name": "Constant AC",
"type": "Complex",
"icon": "😵",
"pattern": [
{
"startDelay": 0,
"duration": 1000,
"weakMagnitude": 1.0,
"strongMagnitude": 0.0
},
{
"startDelay": 0,
"duration": 1000,
"weakMagnitude": 0.0, "weakMagnitude": 0.0,
"strongMagnitude": 1.0 "strongMagnitude": 1.0
} }

View File

@ -38,7 +38,7 @@ class Vibrator implements IVibrator {
for (let i = 0; i < this.pattern.length; i++) { for (let i = 0; i < this.pattern.length; i++) {
if (this.isVibrating === true) { if (this.isVibrating === true) {
this.unit.vibrationActuator.playEffect('dual-rumble', this.pattern[i]); this.unit.vibrationActuator.playEffect('dual-rumble', this.pattern[i]);
await this.sleep(this.pattern[i].startDelay + this.pattern[i].duration); await this.sleep(this.pattern[i].startDelay + this.pattern[i].duration - 10);
} else { } else {
return; return;
} }