fix: matrix key not work
This commit is contained in:
@@ -38,16 +38,6 @@ export const useEquipments = defineStore('equipments', () => {
|
||||
if (true === enableJtagBoundaryScan.value) jtagBoundaryScan();
|
||||
});
|
||||
|
||||
watchPostEffect(async () => {
|
||||
if (true === enableMatrixKey.value) {
|
||||
const ret = await matrixKeypadSetKeyStates(matrixKeyStates)
|
||||
if (!ret) {
|
||||
dialog.error("设置矩阵键盘失败")
|
||||
enableMatrixKey.value = false;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// Parse and Set
|
||||
function setAddr(address: string | undefined): boolean {
|
||||
if (isString(address) && z.string().ip("4").safeParse(address).success) {
|
||||
@@ -76,7 +66,6 @@ export const useEquipments = defineStore('equipments', () => {
|
||||
}
|
||||
|
||||
function setMatrixKey(keyNum: number | string | undefined, keyValue: boolean): boolean {
|
||||
|
||||
let _keyNum: number;
|
||||
if (isString(keyNum)) {
|
||||
_keyNum = toNumber(keyNum);
|
||||
@@ -180,11 +169,12 @@ export const useEquipments = defineStore('equipments', () => {
|
||||
|
||||
async function matrixKeypadSetKeyStates(keyStates: boolean[]) {
|
||||
const release = await matrixKeypadClientMutex.acquire();
|
||||
console.log("set Key !!!!!!!!!!!!");
|
||||
try {
|
||||
const resp = await matrixKeypadClient.setMatrixKeyStatus(
|
||||
boardAddr.value,
|
||||
boardPort.value,
|
||||
matrixKeyStates
|
||||
keyStates
|
||||
);
|
||||
return resp;
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user