Skip to content
This repository was archived by the owner on Jul 31, 2026. It is now read-only.

Commit 46ce149

Browse files
feat(hw): motor test panel — run/stop + 5 speed levels in Hardware section
- POST /api/servo/test {us} — writes servo PWM directly, bypasses workflow - POST /api/servo/test {stop:true} — stops test, resumes normal workflow - servoTestActive flag freezes updateServoWorkflow() during test - UI: panel visible only when motorConnected + motorEnabled - Speed 1–5 → 1530/1580/1650/1750/1900 µs - Run button → black ▶, running → red ⏸ Stop - Fixed: data-i18n removed from label (managed by JS to survive applyTranslations polls) - i18n: motorTest / motorTestRun / motorTestStop in all 9 locales Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ea70033 commit 46ce149

13 files changed

Lines changed: 271 additions & 27 deletions

File tree

‎data/www/index.html‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,24 @@ <h1>TigerScale</h1>
186186
<span class="ios-switch-track"></span>
187187
</label>
188188
</div>
189+
<!-- Motor test panel (visible only if motor connected + enabled) -->
190+
<div class="motor-test-panel" id="motorTestPanel" style="display:none">
191+
<div class="motor-test-header">
192+
<svg class="icon" style="flex-shrink:0"><use href="#icon-rotate-cw"></use></svg>
193+
<span data-i18n="motorTest">Motor test</span>
194+
</div>
195+
<div class="motor-test-speeds">
196+
<button class="motor-speed-btn" data-speed="1" onclick="setMotorTestSpeed(1)">1</button>
197+
<button class="motor-speed-btn active" data-speed="2" onclick="setMotorTestSpeed(2)">2</button>
198+
<button class="motor-speed-btn" data-speed="3" onclick="setMotorTestSpeed(3)">3</button>
199+
<button class="motor-speed-btn" data-speed="4" onclick="setMotorTestSpeed(4)">4</button>
200+
<button class="motor-speed-btn" data-speed="5" onclick="setMotorTestSpeed(5)">5</button>
201+
</div>
202+
<button class="motor-test-run-btn" id="motorTestRunBtn" onclick="toggleMotorTest()">
203+
<svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" id="motorTestIcon"><polygon points="5,3 19,12 5,21"/></svg>
204+
<span id="motorTestLabel">Run</span>
205+
</button>
206+
</div>
189207
<div class="divider"></div>
190208
<!-- Spool detection info (read-only, updated from /api/status) -->
191209
<div class="setting-row">

‎data/www/locales/de.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,8 @@
100100
"spoolDetected": "Spule erkannt",
101101
"spoolPosition": "Position",
102102
"yes": "Ja",
103-
"no": "Nein"
103+
"no": "Nein",
104+
"motorTest": "Motortest",
105+
"motorTestRun": "Starten",
106+
"motorTestStop": "Stoppen"
104107
}

‎data/www/locales/en.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,8 @@
101101
"spoolDetected": "Spool detected",
102102
"spoolPosition": "Position",
103103
"yes": "Yes",
104-
"no": "No"
104+
"no": "No",
105+
"motorTest": "Motor test",
106+
"motorTestRun": "Run",
107+
"motorTestStop": "Stop"
105108
}

‎data/www/locales/es.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,8 @@
100100
"spoolDetected": "Bobina detectada",
101101
"spoolPosition": "Posición",
102102
"yes": "Sí",
103-
"no": "No"
103+
"no": "No",
104+
"motorTest": "Test motor",
105+
"motorTestRun": "Iniciar",
106+
"motorTestStop": "Detener"
104107
}

‎data/www/locales/fr.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,8 @@
101101
"spoolDetected": "Bobine détectée",
102102
"spoolPosition": "Position",
103103
"yes": "Oui",
104-
"no": "Non"
104+
"no": "Non",
105+
"motorTest": "Test moteur",
106+
"motorTestRun": "Démarrer",
107+
"motorTestStop": "Arrêter"
105108
}

‎data/www/locales/it.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,8 @@
100100
"spoolDetected": "Bobina rilevata",
101101
"spoolPosition": "Posizione",
102102
"yes": "Sì",
103-
"no": "No"
103+
"no": "No",
104+
"motorTest": "Test motore",
105+
"motorTestRun": "Avvia",
106+
"motorTestStop": "Ferma"
104107
}

‎data/www/locales/pl.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,8 @@
100100
"spoolDetected": "Szpula wykryta",
101101
"spoolPosition": "Pozycja",
102102
"yes": "Tak",
103-
"no": "Nie"
103+
"no": "Nie",
104+
"motorTest": "Test silnika",
105+
"motorTestRun": "Uruchom",
106+
"motorTestStop": "Zatrzymaj"
104107
}

‎data/www/locales/pt-pt.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,8 @@
100100
"spoolDetected": "Bobina detetada",
101101
"spoolPosition": "Posição",
102102
"yes": "Sim",
103-
"no": "Não"
103+
"no": "Não",
104+
"motorTest": "Teste do motor",
105+
"motorTestRun": "Iniciar",
106+
"motorTestStop": "Parar"
104107
}

‎data/www/locales/pt.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,8 @@
100100
"spoolDetected": "Carretel detectado",
101101
"spoolPosition": "Posição",
102102
"yes": "Sim",
103-
"no": "Não"
103+
"no": "Não",
104+
"motorTest": "Teste do motor",
105+
"motorTestRun": "Iniciar",
106+
"motorTestStop": "Parar"
104107
}

‎data/www/locales/zh.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,8 @@
100100
"spoolDetected": "检测到料盘",
101101
"spoolPosition": "位置",
102102
"yes": "是",
103-
"no": "否"
103+
"no": "否",
104+
"motorTest": "电机测试",
105+
"motorTestRun": "运行",
106+
"motorTestStop": "停止"
104107
}

0 commit comments

Comments
 (0)