|
@@ -1786,15 +1786,25 @@ class MainActivity :BaseActivity<MainActivityPresenter, MainActivityLayoutBindin
|
|
}else if(tcpModel.action==TcpAction.DeviceAction.OPEN_DEBUG) { //打开设备网络调试
|
|
}else if(tcpModel.action==TcpAction.DeviceAction.OPEN_DEBUG) { //打开设备网络调试
|
|
AppUpdateHelper.openNetWorkDebug()
|
|
AppUpdateHelper.openNetWorkDebug()
|
|
}else if (tcpModel.action==TcpAction.DeviceAction.S485_POWER_RESET) { //控制485线路板通断 0_1 重启第一路 0_1_0 关闭第一路 0_1_1 打开第一路 0_0_0关闭板上所有电路
|
|
}else if (tcpModel.action==TcpAction.DeviceAction.S485_POWER_RESET) { //控制485线路板通断 0_1 重启第一路 0_1_0 关闭第一路 0_1_1 打开第一路 0_0_0关闭板上所有电路
|
|
|
|
+ if (tcpModel.data == null) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
val pwcontrol = tcpModel.data.toString().split('_')
|
|
val pwcontrol = tcpModel.data.toString().split('_')
|
|
DeviceUtil.s485PowerResetSuccess(Constant.DEVICE_ID,tcpModel.data.toString(),tcpModel.tid)
|
|
DeviceUtil.s485PowerResetSuccess(Constant.DEVICE_ID,tcpModel.data.toString(),tcpModel.tid)
|
|
if(pwcontrol.size==2){
|
|
if(pwcontrol.size==2){
|
|
- PowerControlUtil.controlPowerControl(pwcontrol[0].toInt(),pwcontrol[1].toInt(),true)
|
|
|
|
- AppTool.Time.delay(3000){
|
|
|
|
- PowerControlUtil.controlPowerControl(pwcontrol[0].toInt(),pwcontrol[1].toInt(),false)
|
|
|
|
|
|
+ val lines = pwcontrol[1].split(",")
|
|
|
|
+ for (line in lines) {
|
|
|
|
+ PowerControlUtil.controlPowerControl(pwcontrol[0].toInt(), line.toInt(), true)
|
|
|
|
+ AppTool.Time.delay(3000){
|
|
|
|
+ PowerControlUtil.controlPowerControl(pwcontrol[0].toInt(), line.toInt(),false)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}else if(pwcontrol.size==3){
|
|
}else if(pwcontrol.size==3){
|
|
- PowerControlUtil.controlPowerControl(pwcontrol[0].toInt(),pwcontrol[1].toInt(),pwcontrol[2].toInt()==0)
|
|
|
|
|
|
+ val lines = pwcontrol[1].split(",")
|
|
|
|
+ for (line in lines) {
|
|
|
|
+ PowerControlUtil.controlPowerControl(pwcontrol[0].toInt(), line.toInt(), pwcontrol[2].toInt() == 0)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} /*else if (tcpModel.type == TcpType.BROADCAST) {
|
|
} /*else if (tcpModel.type == TcpType.BROADCAST) {
|