|
|
@@ -96,9 +96,9 @@ class CtrlActivity : ComponentActivity() {
|
|
|
val status = dev.deviceStatus as DeviceStatusKeySlot
|
|
|
Column {
|
|
|
Row(modifier = Modifier.padding(horizontal = 10.dp)) {
|
|
|
- Button({ dev.ctrlSlotLockAndCharge(-1, false, false).writeByFrame() }) { Text("全开") }
|
|
|
+ Button({ dev.ctrlSlotLockAndCharge(-1, false, false) }) { Text("全开") }
|
|
|
Spacer(modifier = Modifier.width(10.dp))
|
|
|
- Button({ dev.ctrlSlotLockAndCharge(-1, true, true).writeByFrame() }) { Text("全关") }
|
|
|
+ Button({ dev.ctrlSlotLockAndCharge(-1, true, true) }) { Text("全关") }
|
|
|
}
|
|
|
LazyVerticalGrid(
|
|
|
columns = GridCells.Adaptive(minSize = 180.dp),
|
|
|
@@ -122,7 +122,7 @@ class CtrlActivity : ComponentActivity() {
|
|
|
if (it.isChanged && rfid.value.isNotEmpty() && rfid.value != lastRFID) {
|
|
|
lastRFID = rfid.value
|
|
|
// 硬件逻辑已经存在
|
|
|
- dev.ctrlSlotLockAndCharge(state.ch, true, true).writeByFrame()
|
|
|
+ dev.ctrlSlotLockAndCharge(state.ch, true, true)
|
|
|
} else if (rfid.value.isEmpty()) {
|
|
|
lastRFID = ""
|
|
|
}
|
|
|
@@ -157,23 +157,23 @@ class CtrlActivity : ComponentActivity() {
|
|
|
Spacer(modifier = Modifier.weight(1f))
|
|
|
Row {
|
|
|
Button(
|
|
|
- { dev.ctrlSlotLockAndCharge(state.ch, false, false).writeByFrame() },
|
|
|
+ { dev.ctrlSlotLockAndCharge(state.ch, false, false) },
|
|
|
contentPadding = PaddingValues(horizontal = 6.dp, vertical = 0.dp)
|
|
|
) { Text("打开锁") }
|
|
|
Spacer(modifier = Modifier.weight(1f))
|
|
|
Button(
|
|
|
- { dev.ctrlSlotLockAndCharge(state.ch, true, true).writeByFrame() },
|
|
|
+ { dev.ctrlSlotLockAndCharge(state.ch, true, true) },
|
|
|
contentPadding = PaddingValues(horizontal = 6.dp, vertical = 0.dp)
|
|
|
) { Text("关闭锁") }
|
|
|
}
|
|
|
Row {
|
|
|
Button(
|
|
|
- { dev.ctrlSlotCharge(state.ch, true).writeByFrame() },
|
|
|
+ { dev.ctrlSlotCharge(state.ch, true) },
|
|
|
contentPadding = PaddingValues(horizontal = 6.dp, vertical = 0.dp)
|
|
|
) { Text("开充电") }
|
|
|
Spacer(modifier = Modifier.weight(1f))
|
|
|
Button(
|
|
|
- { dev.ctrlSlotCharge(state.ch, false).writeByFrame() },
|
|
|
+ { dev.ctrlSlotCharge(state.ch, false) },
|
|
|
contentPadding = PaddingValues(horizontal = 6.dp, vertical = 0.dp)
|
|
|
) { Text("关充电") }
|
|
|
}
|
|
|
@@ -193,9 +193,9 @@ class CtrlActivity : ComponentActivity() {
|
|
|
val status = ArrayList((dev.deviceStatus as DeviceStatusLockSlot).slotList)
|
|
|
Column {
|
|
|
Row(modifier = Modifier.padding(horizontal = 10.dp)) {
|
|
|
- Button({ dev.ctrlSlotLock(-1, false).writeByFrame() }) { Text("全开") }
|
|
|
+ Button({ dev.ctrlSlotLock(-1, false) }) { Text("全开") }
|
|
|
Spacer(modifier = Modifier.width(10.dp))
|
|
|
- Button({ dev.ctrlSlotLock(-1, true).writeByFrame() }) { Text("全关") }
|
|
|
+ Button({ dev.ctrlSlotLock(-1, true) }) { Text("全关") }
|
|
|
}
|
|
|
LazyVerticalGrid(
|
|
|
columns = GridCells.Adaptive(minSize = 100.dp),
|
|
|
@@ -260,7 +260,7 @@ class CtrlActivity : ComponentActivity() {
|
|
|
Switch(
|
|
|
isLock.value, { value ->
|
|
|
isLock.value = value
|
|
|
- dev.ctrlSlotLock(state.ch, value).writeByFrame()
|
|
|
+ dev.ctrlSlotLock(state.ch, value)
|
|
|
}, modifier = Modifier
|
|
|
.graphicsLayer(scaleX = 0.5f, 0.5f)
|
|
|
.offset(30.dp, 30.dp)
|