feat: add power control

This commit is contained in:
2025-05-20 19:11:29 +08:00
parent 46621fdb40
commit dc64a65702
5 changed files with 273 additions and 4 deletions

View File

@@ -46,9 +46,16 @@
</div>
<div class="divider"></div>
<h1 class="font-bold text-center text-2xl">外设</h1>
<div class="flex flex-row">
<input type="checkbox" class="checkbox" :checked="eqps.enableMatrixKey" @change="handleMatrixkeyCheckboxChange" />
<p class="mx-2">启用矩阵键盘</p>
<div class="flex flex-row justify-around">
<div class="flex flex-row">
<input type="checkbox" class="checkbox" :checked="eqps.enableMatrixKey"
@change="handleMatrixkeyCheckboxChange" />
<p class="mx-2">启用矩阵键盘</p>
</div>
<div class="flex flex-row">
<input type="checkbox" class="checkbox" :checked="eqps.enablePower" @change="handlePowerCheckboxChange" />
<p class="mx-2">启用电源</p>
</div>
</div>
</div>
</template>
@@ -119,6 +126,16 @@ async function handleMatrixkeyCheckboxChange(event: Event) {
}
}
async function handlePowerCheckboxChange(event: Event) {
const target = event.target as HTMLInputElement;
const ret = await eqps.powerSetOnOff(target.checked);
if (target.checked) {
eqps.enablePower = ret;
} else {
eqps.enablePower = !ret;
}
}
async function toggleJtagBoundaryScan() {
if (eqps.jtagClientMutex.isLocked()) {
dialog.warn("Jtag正在被占用");