Animated icons (#866)

* Add animation Icons

* 2D dimensional array

* Added animation to GUI

* Added Adnimation Speed setting

* Added loop

* Added Loop switch

* Use Checkbox instead of +/-

* Animations can now be turned off

* Optimize animation code

* Move animation options to UI settings
This commit is contained in:
PlayDay
2021-03-15 08:01:12 +01:00
committed by GitHub
parent c7d69b37c5
commit 2796f095af
34 changed files with 1174 additions and 239 deletions

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -290,6 +290,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -290,6 +290,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"minimale" "minimale"
], ],
"desc": "Tension minimale autorisée par cellule <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Tension minimale autorisée par cellule <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -290,6 +290,20 @@
"napięcie" "napięcie"
], ],
"desc": "Minimalne dozwolone napięcie na komórkę <W woltach> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimalne dozwolone napięcie na komórkę <W woltach> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"напр." "напр."
], ],
"desc": "Минимальное разрешенное напряжение на ячейку <В вольтах> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Минимальное разрешенное напряжение на ячейку <В вольтах> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Зацикленная",
"анимация"
],
"desc": "Зацикленная анимация иконок в главном меню"
},
"AnimSpeed": {
"text2": [
"Скорость",
"анимации"
],
"desc": "Скорость анимации иконок в главном меню <Милисекунды> <О=Отключено, Н=Низкий, С=Средний, В=Высокий>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -307,6 +307,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -289,6 +289,20 @@
"напруга" "напруга"
], ],
"desc": "Мінімальна дозволена напруга на комірку <В вольтах> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Мінімальна дозволена напруга на комірку <В вольтах> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Зациклена",
"анімація"
],
"desc": "Зациклена анімація іконок в головному меню"
},
"AnimSpeed": {
"text2": [
"Швидкість",
"анімації"
],
"desc": "Швидкість анімації іконок у головному меню <Мілісекунди> <В=Вимк, Н=Низькa, С=Середня, М=Макс>"
} }
} }
} }

View File

@@ -290,6 +290,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -290,6 +290,20 @@
"voltage" "voltage"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>"
},
"AnimLoop": {
"text2": [
"Anim.",
"loop"
],
"desc": "Loop icon animations in root menu"
},
"AnimSpeed": {
"text2": [
"Anim.",
"speed"
],
"desc": "Speed of icon animations in root menu <Miliseconds> <O=off | L=low | M=medium | H=high>"
} }
} }
} }

View File

@@ -362,6 +362,16 @@ var def =
"id": "MinVolCell", "id": "MinVolCell",
"maxLen": 4, "maxLen": 4,
"maxLen2": 9 "maxLen2": 9
},
{
"id": "AnimLoop",
"maxLen": 6,
"maxLen2": 13
},
{
"id": "AnimSpeed",
"maxLen": 6,
"maxLen2": 13
} }
] ]
} }

View File

@@ -147,10 +147,88 @@ const uint8_t disconnectedTipIcon[] = {
/* /*
* 16x16 icons * 16x16 icons
* 32 * 3 = Frame size * Frame count
* */ * */
const uint8_t SettingsMenuIcons[] = { const uint8_t SettingsMenuIcons[][32 * 3] = {
// Power // Power
// 3 frames
// width = 16
// height = 16
{
// Power 1 frame
// width = 16
// height = 16
0xC0,
0xB0,
0x8C,
0x83,
0x01,
0x01,
0x21,
0x31,
0xB9,
0xFD,
0xFF,
0xFE,
0xFE,
0xDE,
0xCE,
0x06,
0x60,
0x58,
0x26,
0x11,
0x08,
0xC4,
0xF2,
0x7D,
0x3F,
0x1F,
0x0F,
0x07,
0x03,
0x01,
0x00,
0x00,
// Power 2 frame
// width = 16
// height = 16
0xC0,
0xF0,
0xFC,
0xFF,
0xFF,
0xFF,
0xFF,
0xFF,
0xEF,
0x67,
0x03,
0x42,
0x62,
0x52,
0xCA,
0x06,
0x60,
0x78,
0x3E,
0x1F,
0x0F,
0xC7,
0xB3,
0x4D,
0x23,
0x10,
0x08,
0x04,
0x02,
0x01,
0x00,
0x00,
// Power final frame
// width = 16 // width = 16
// height = 16 // height = 16
0xC0, 0xC0,
@@ -185,44 +263,200 @@ const uint8_t SettingsMenuIcons[] = {
0x01, 0x01,
0x00, 0x00,
0x00, 0x00,
},
// Soldering // Soldering
// 3 frames
// width = 16
// height = 16
{
// Soldering 1 frame
// width = 16 // width = 16
// height = 16 // height = 16
0x00, 0x00,
0x02,
0x04,
0x08,
0x12,
0x24,
0xC4,
0x42,
0x82,
0x04,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x80,
0x00, 0x40,
0x00, 0xE0,
0x00,
0x00,
0x00,
0x00,
0x01,
0x02,
0x07,
0x0A,
0x14,
0x28,
0x50, 0x50,
0x60, 0x28,
0x14,
0x0A,
0x06,
0x00,
0x00,
0x40,
0x20,
0x10,
0x08,
0x04,
0x03,
0x02,
0x01,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00, 0x00,
// Soldering 2 frame
// width = 16
// height = 16
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x80,
0x40,
0xE0,
0x50,
0x28,
0x14,
0x0A,
0x06,
0x00,
0x00,
0x48,
0x26,
0x10,
0x08,
0x04,
0x03,
0x02,
0x01,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
// Soldering final frame
// width = 16
// height = 16
0x00,
0x80,
0x40,
0x00,
0x00,
0x00,
0x00,
0x80,
0x40,
0xE0,
0x50,
0x28,
0x14,
0x0A,
0x06,
0x00,
0x00,
0x49,
0x26,
0x10,
0x08,
0x04,
0x03,
0x02,
0x01,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
},
// Sleep // Sleep
// 3 frames
// width = 16
// height = 16
{
// Sleep 1 frame
// width = 16
// height = 16
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x44,
0x64,
0x74,
0x5C,
0x4C,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
// Sleep 2 frame
// width = 16
// height = 16
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x40,
0x40,
0xC0,
0xC0,
0xC0,
0x00,
0x00,
0x00,
0x00,
0x00,
0x44,
0x64,
0x74,
0x5C,
0x4C,
0x00,
0x06,
0x07,
0x07,
0x05,
0x04,
0x00,
// Sleep final frame
// width = 16 // width = 16
// height = 16 // height = 16
0x00, 0x00,
@@ -257,8 +491,86 @@ const uint8_t SettingsMenuIcons[] = {
0x05, 0x05,
0x04, 0x04,
0x00, 0x00,
},
// Menu // Menu
// 3 frames
// width = 16
// height = 16
{
// Menu 1 frame
// width = 16
// height = 16
0x00,
0x80,
0x06,
0x06,
0x06,
0x06,
0x86,
0x86,
0x86,
0x86,
0x86,
0x86,
0x86,
0x86,
0x86,
0x00,
0x00,
0x00,
0x60,
0x60,
0x00,
0x00,
0x61,
0x61,
0x61,
0x61,
0x61,
0x61,
0x61,
0x61,
0x61,
0x00,
// Menu 2 frame
// width = 16
// height = 16
0x00,
0x80,
0x06,
0x06,
0x06,
0x06,
0x86,
0x86,
0x86,
0x86,
0x86,
0x86,
0x86,
0x86,
0x86,
0x00,
0x00,
0x00,
0x61,
0x60,
0x00,
0x00,
0x61,
0x61,
0x61,
0x61,
0x61,
0x61,
0x61,
0x61,
0x61,
0x00,
// Menu final frame
// width = 16 // width = 16
// height = 16 // height = 16
0x00, 0x00,
@@ -293,8 +605,86 @@ const uint8_t SettingsMenuIcons[] = {
0x61, 0x61,
0x61, 0x61,
0x00, 0x00,
},
// Wrench // Wrench
// 3 frames
/// width = 16
// height = 16
{
// Wrench 1 frame
/// width = 16
// height = 16
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x18,
0x30,
0x32,
0x7E,
0x7C,
0xF0,
0xC0,
// Wrench 2 frame
/// width = 16
// height = 16
0x00,
0x00,
0x00,
0x00,
0xC0,
0x80,
0x90,
0xF0,
0xE0,
0x80,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x01,
0x01,
0x03,
0x03,
0x07,
0x0E,
0x1C,
0x78,
0xF0,
0xF0,
0x60,
// Wrench final frame
/// width = 16 /// width = 16
// height = 16 // height = 16
0x00, 0x00,
@@ -329,8 +719,87 @@ const uint8_t SettingsMenuIcons[] = {
0x0C, 0x0C,
0x18, 0x18,
0x00, 0x00,
},
#ifdef NOTUSED #ifdef NOTUSED
// Calibration (Not used, kept for future menu layouts) // Calibration (Not used, kept for future menu layouts)
// 3 frames
// width = 16
// height = 16
{
// Calibration 1 frame (Not used, kept for future menu layouts)
// width = 16
// height = 16
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x80,
0xC0,
0xE0,
0x70,
0x3A,
0x1E,
0x0E,
0x1C,
0x30,
0x00,
0x00,
0x10,
0x3A,
0x1C,
0x1E,
0x17,
0x23,
0x01,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
// Calibration 2 frame (Not used, kept for future menu layouts)
// width = 16
// height = 16
0x00,
0x00,
0x00,
0x00,
0x00,
0x40,
0x80,
0xC0,
0xE0,
0x70,
0x3A,
0x1E,
0x0E,
0x1C,
0x30,
0x00,
0x00,
0x10,
0x38,
0x1C,
0x0E,
0x07,
0x03,
0x03,
0x02,
0x04,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
// Calibration final frame (Not used, kept for future menu layouts)
// width = 16 // width = 16
// height = 16 // height = 16
0x00, 0x00,
@@ -365,6 +834,7 @@ const uint8_t SettingsMenuIcons[] = {
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
}
#endif #endif
}; };

View File

@@ -10,7 +10,7 @@
#ifndef SETTINGS_H_ #ifndef SETTINGS_H_
#define SETTINGS_H_ #define SETTINGS_H_
#include <stdint.h> #include <stdint.h>
#define SETTINGSVERSION (0x26) #define SETTINGSVERSION (0x28)
/*Change this if you change the struct below to prevent people getting \ /*Change this if you change the struct below to prevent people getting \
out of sync*/ out of sync*/
@@ -29,6 +29,8 @@ typedef struct {
uint8_t QCIdealVoltage; // Desired QC3.0 voltage (9,12,20V) uint8_t QCIdealVoltage; // Desired QC3.0 voltage (9,12,20V)
uint8_t OrientationMode : 2; // Selects between Auto,Right and left handed layouts uint8_t OrientationMode : 2; // Selects between Auto,Right and left handed layouts
uint8_t sensitivity : 4; // Sensitivity of accelerometer (5 bits) uint8_t sensitivity : 4; // Sensitivity of accelerometer (5 bits)
uint8_t animationLoop : 1; // Animation loop switch
uint16_t animationSpeed; // Animation speed (in miliseconds)
uint8_t autoStartMode : 2; // Should the unit automatically jump straight uint8_t autoStartMode : 2; // Should the unit automatically jump straight
// into soldering mode when power is applied // into soldering mode when power is applied
uint8_t ShutdownTime; // Time until unit shuts down if left alone uint8_t ShutdownTime; // Time until unit shuts down if left alone

View File

@@ -12,8 +12,8 @@ extern const uint8_t USER_FONT_12[];
extern const uint8_t USER_FONT_6x8[]; extern const uint8_t USER_FONT_6x8[];
extern const bool HasFahrenheit; extern const bool HasFahrenheit;
extern const char *SettingsShortNames[29][2]; extern const char *SettingsShortNames[31][2];
extern const char *SettingsDescriptions[29]; extern const char *SettingsDescriptions[31];
extern const char *SettingsMenuEntries[5]; extern const char *SettingsMenuEntries[5];
extern const char *SettingsCalibrationDone; extern const char *SettingsCalibrationDone;

View File

@@ -70,6 +70,8 @@ void resetSettings() {
systemSettings.coolingTempBlink = COOLING_TEMP_BLINK; // Blink the temperature on the cooling screen when its > 50C systemSettings.coolingTempBlink = COOLING_TEMP_BLINK; // Blink the temperature on the cooling screen when its > 50C
systemSettings.temperatureInF = TEMPERATURE_INF; // default to 0 systemSettings.temperatureInF = TEMPERATURE_INF; // default to 0
systemSettings.descriptionScrollSpeed = DESCRIPTION_SCROLL_SPEED; // default to slow systemSettings.descriptionScrollSpeed = DESCRIPTION_SCROLL_SPEED; // default to slow
systemSettings.animationLoop = ANIMATION_LOOP; // Default false
systemSettings.animationSpeed = ANIMATION_SPEED; // Default 400 ms (Medium)
systemSettings.CalibrationOffset = CALIBRATION_OFFSET; // the adc offset in uV systemSettings.CalibrationOffset = CALIBRATION_OFFSET; // the adc offset in uV
systemSettings.powerLimit = POWER_LIMIT; // 30 watts default limit systemSettings.powerLimit = POWER_LIMIT; // 30 watts default limit
systemSettings.ReverseButtonTempChangeEnabled = REVERSE_BUTTON_TEMP_CHANGE; // systemSettings.ReverseButtonTempChangeEnabled = REVERSE_BUTTON_TEMP_CHANGE; //

View File

@@ -70,6 +70,10 @@ static void settings_displayTempChangeLongStep(void);
static bool settings_setTempChangeLongStep(void); static bool settings_setTempChangeLongStep(void);
static void settings_displayPowerPulse(void); static void settings_displayPowerPulse(void);
static bool settings_setPowerPulse(void); static bool settings_setPowerPulse(void);
static void settings_displayAnimationSpeed(void);
static bool settings_setAnimationSpeed(void);
static void settings_displayAnimationLoop(void);
static bool settings_setAnimationLoop(void);
#ifdef HALL_SENSOR #ifdef HALL_SENSOR
static void settings_displayHallEffect(void); static void settings_displayHallEffect(void);
static bool settings_setHallEffect(void); static bool settings_setHallEffect(void);
@@ -185,6 +189,8 @@ const menuitem UIMenu[] = {
{(const char *)SettingsDescriptions[10], settings_setCoolingBlinkEnabled, settings_displayCoolingBlinkEnabled}, /*Cooling blink warning*/ {(const char *)SettingsDescriptions[10], settings_setCoolingBlinkEnabled, settings_displayCoolingBlinkEnabled}, /*Cooling blink warning*/
{(const char *)SettingsDescriptions[15], settings_setScrollSpeed, settings_displayScrollSpeed}, /*Scroll Speed for descriptions*/ {(const char *)SettingsDescriptions[15], settings_setScrollSpeed, settings_displayScrollSpeed}, /*Scroll Speed for descriptions*/
{(const char *)SettingsDescriptions[21], settings_setReverseButtonTempChangeEnabled, settings_displayReverseButtonTempChangeEnabled}, /* Reverse Temp change buttons + - */ {(const char *)SettingsDescriptions[21], settings_setReverseButtonTempChangeEnabled, settings_displayReverseButtonTempChangeEnabled}, /* Reverse Temp change buttons + - */
{(const char *)SettingsDescriptions[30], settings_setAnimationSpeed, settings_displayAnimationSpeed}, /*Animation Speed adjustment */
{(const char *)SettingsDescriptions[29], settings_setAnimationLoop, settings_displayAnimationLoop}, /*Animation Loop switch */
{NULL, NULL, NULL} // end of menu marker. DO NOT REMOVE {NULL, NULL, NULL} // end of menu marker. DO NOT REMOVE
}; };
const menuitem PowerSavingMenu[] = { const menuitem PowerSavingMenu[] = {
@@ -213,6 +219,8 @@ const menuitem advancedMenu[] = {
* Calibrate Input V * Calibrate Input V
* Reset Settings * Reset Settings
* Power Pulse * Power Pulse
* Animation Loop
* Animation Speed
*/ */
{(const char *)SettingsDescriptions[20], settings_setPowerLimit, settings_displayPowerLimit}, /*Power limit*/ {(const char *)SettingsDescriptions[20], settings_setPowerLimit, settings_displayPowerLimit}, /*Power limit*/
{(const char *)SettingsDescriptions[6], settings_setAdvancedIDLEScreens, settings_displayAdvancedIDLEScreens}, /* Advanced idle screen*/ {(const char *)SettingsDescriptions[6], settings_setAdvancedIDLEScreens, settings_displayAdvancedIDLEScreens}, /* Advanced idle screen*/
@@ -894,6 +902,52 @@ static void settings_displayPowerPulse(void) {
OLED::print(OffString); OLED::print(OffString);
} }
} }
static bool settings_setAnimationLoop(void) {
systemSettings.animationLoop = !systemSettings.animationLoop;
return false;
}
static void settings_displayAnimationLoop(void) {
printShortDescription(29, 7);
OLED::drawCheckbox(systemSettings.animationLoop);
}
static bool settings_setAnimationSpeed(void) {
switch (systemSettings.animationSpeed) {
case 0:
systemSettings.animationSpeed = TICKS_100MS * 5;
break;
case TICKS_100MS * 5:
systemSettings.animationSpeed = TICKS_100MS * 4;
break;
case TICKS_100MS * 4:
systemSettings.animationSpeed = TICKS_100MS * 3;
break;
default:
systemSettings.animationSpeed = 0;
break;
}
return systemSettings.animationSpeed == TICKS_100MS * 3;
}
static void settings_displayAnimationSpeed(void) {
printShortDescription(30, 7);
switch (systemSettings.animationSpeed) {
case TICKS_100MS * 5:
OLED::print(SettingSensitivityLow);
break;
case TICKS_100MS * 4:
OLED::print(SettingSensitivityMedium);
break;
case TICKS_100MS * 3:
OLED::print(SettingSensitivityHigh);
break;
default:
OLED::print(SettingSensitivityOff);
break;
}
}
#ifdef HALL_SENSOR #ifdef HALL_SENSOR
static void settings_displayHallEffect(void) { static void settings_displayHallEffect(void) {
printShortDescription(26, 7); printShortDescription(26, 7);
@@ -921,6 +975,9 @@ static bool settings_setHallEffect(void) {
return systemSettings.hallEffectSensitivity == 3; return systemSettings.hallEffectSensitivity == 3;
} }
#endif #endif
static bool animOpenState = false;
static void displayMenu(size_t index) { static void displayMenu(size_t index) {
// Call into the menu // Call into the menu
const char *textPtr = SettingsMenuEntries[index]; const char *textPtr = SettingsMenuEntries[index];
@@ -937,7 +994,19 @@ static void displayMenu(size_t index) {
// Draw symbol // Draw symbol
// 16 pixel wide image // 16 pixel wide image
// 2 pixel wide scrolling indicator // 2 pixel wide scrolling indicator
OLED::drawArea(96 - 16 - 2, 0, 16, 16, (&SettingsMenuIcons[(16 * 2) * index])); static TickType_t menuSwitchLoopTick = 0;
static size_t menuCurrentIndex = sizeof(rootSettingsMenu) + 1;
static size_t currentFrame = 0;
if (!animOpenState) {
if (menuCurrentIndex != index) {
menuCurrentIndex = index;
currentFrame = systemSettings.animationSpeed ? 0 : 2;
menuSwitchLoopTick = xTaskGetTickCount();
}
if (systemSettings.animationSpeed && (systemSettings.animationLoop || currentFrame != 2))
currentFrame = ((xTaskGetTickCount() - menuSwitchLoopTick) / systemSettings.animationSpeed) % 3;
OLED::drawArea(OLED_WIDTH - 16 - 2, 0, 16, 16, (&SettingsMenuIcons[index][(16 * 2) * currentFrame]));
}
} }
static void settings_displayCalibrateVIN(void) { printShortDescription(13, 5); } static void settings_displayCalibrateVIN(void) { printShortDescription(13, 5); }
@@ -993,6 +1062,7 @@ void gui_Menu(const menuitem *menu) {
// Then we play a transition from the current primary // Then we play a transition from the current primary
// framebuffer to the new buffer. // framebuffer to the new buffer.
// The extra buffer is discarded at the end of the transition. // The extra buffer is discarded at the end of the transition.
animOpenState = true;
OLED::useSecondaryFramebuffer(true); OLED::useSecondaryFramebuffer(true);
OLED::setFont(0); OLED::setFont(0);
OLED::setCursor(0, 0); OLED::setCursor(0, 0);
@@ -1000,6 +1070,7 @@ void gui_Menu(const menuitem *menu) {
menu[currentScreen].draw(); menu[currentScreen].draw();
OLED::useSecondaryFramebuffer(false); OLED::useSecondaryFramebuffer(false);
OLED::transitionSecondaryFramebuffer(true); OLED::transitionSecondaryFramebuffer(true);
animOpenState = false;
} }
while ((menu[currentScreen].draw != NULL) && earlyExit == false) { while ((menu[currentScreen].draw != NULL) && earlyExit == false) {

View File

@@ -92,6 +92,8 @@
#define RECOM_VOL_CELL 33 // Minimum voltage per cell (Recommended 3.3V (33)) #define RECOM_VOL_CELL 33 // Minimum voltage per cell (Recommended 3.3V (33))
#define TEMPERATURE_INF 0 // default to 0 #define TEMPERATURE_INF 0 // default to 0
#define DESCRIPTION_SCROLL_SPEED 0 // 0: Slow 1: Fast - default to slow #define DESCRIPTION_SCROLL_SPEED 0 // 0: Slow 1: Fast - default to slow
#define ANIMATION_LOOP 0 // 0: off 1: on
#define ANIMATION_SPEED 400 // 0: off, 300: High, 400: Medium, 500: Low
#define OP_AMP_Rf_TS100 750 * 1000 // 750 Kilo-ohms -> From schematic, R1 #define OP_AMP_Rf_TS100 750 * 1000 // 750 Kilo-ohms -> From schematic, R1
#define OP_AMP_Rin_TS100 2370 // 2.37 Kilo-ohms -> From schematic, R2 #define OP_AMP_Rin_TS100 2370 // 2.37 Kilo-ohms -> From schematic, R2