|
@@ -11,6 +11,7 @@ import com.hanghui.senic.service.usbserialdemo.utile.ConfigManager;
|
|
import com.hanghui.senic.service.usbserialdemo.utile.FaceScenicUtile;
|
|
import com.hanghui.senic.service.usbserialdemo.utile.FaceScenicUtile;
|
|
import com.hanghui.senic.service.usbserialdemo.utile.StringIsNull;
|
|
import com.hanghui.senic.service.usbserialdemo.utile.StringIsNull;
|
|
import com.hanghui.senic.service.usbserialdemo.utile.StringUtils;
|
|
import com.hanghui.senic.service.usbserialdemo.utile.StringUtils;
|
|
|
|
+import com.hanghui.senic.service.usbserialdemo.utile.X5.X5RelaysAndLedUtile;
|
|
import com.hanghui.senic.service.usbserialdemo.utile.devicesUI.Constants;
|
|
import com.hanghui.senic.service.usbserialdemo.utile.devicesUI.Constants;
|
|
import com.hanghui.senic.service.usbserialdemo.utile.devicesUI.DeviceUtils;
|
|
import com.hanghui.senic.service.usbserialdemo.utile.devicesUI.DeviceUtils;
|
|
import com.hanghui.senic.service.usbserialdemo.utile.loacat.AppLogUtils;
|
|
import com.hanghui.senic.service.usbserialdemo.utile.loacat.AppLogUtils;
|
|
@@ -36,8 +37,7 @@ public class RelaysAndLedUtile {
|
|
//继电器开关
|
|
//继电器开关
|
|
public void isOpenRelays(int newValue) {
|
|
public void isOpenRelays(int newValue) {
|
|
if (DeviceUtils.getDeviceModel().equals(Constants.DeviceModel.ZP) ||
|
|
if (DeviceUtils.getDeviceModel().equals(Constants.DeviceModel.ZP) ||
|
|
- DeviceUtils.getDeviceModel().equals(Constants.DeviceModel.ZP_A10) ||
|
|
|
|
- DeviceUtils.getDeviceModel().equals(Constants.DeviceModel.ZP_A50)) {
|
|
|
|
|
|
+ DeviceUtils.getDeviceModel().equals(Constants.DeviceModel.ZP_A10)) {
|
|
if (newValue == 1) {
|
|
if (newValue == 1) {
|
|
AppLogUtils.e(false, "硬件处理—X1继电器 ", "打开继电器 ");
|
|
AppLogUtils.e(false, "硬件处理—X1继电器 ", "打开继电器 ");
|
|
Intent intent = new Intent();
|
|
Intent intent = new Intent();
|
|
@@ -51,7 +51,9 @@ public class RelaysAndLedUtile {
|
|
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
|
|
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
|
|
MyAppliction.getContext().sendBroadcast(intent);
|
|
MyAppliction.getContext().sendBroadcast(intent);
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
|
|
+ } else if (DeviceUtils.getDeviceModel().equals(Constants.DeviceModel.ZP_A50)){
|
|
|
|
+ X5RelaysAndLedUtile.getInstance().isOpenRelays(newValue);
|
|
|
|
+ }else {
|
|
AppLogUtils.e(false, "硬件处理—非X1继电器 ", "执行继电器打开或关闭操作 newValue " + newValue);
|
|
AppLogUtils.e(false, "硬件处理—非X1继电器 ", "执行继电器打开或关闭操作 newValue " + newValue);
|
|
PosUtil.setRelayPower(newValue);//1-开门 or 0-关门
|
|
PosUtil.setRelayPower(newValue);//1-开门 or 0-关门
|
|
}
|
|
}
|
|
@@ -88,7 +90,8 @@ public class RelaysAndLedUtile {
|
|
}
|
|
}
|
|
return;
|
|
return;
|
|
} else if (DeviceUtils.getDeviceModel().equals(Constants.DeviceModel.ZP_A50)){
|
|
} else if (DeviceUtils.getDeviceModel().equals(Constants.DeviceModel.ZP_A50)){
|
|
- CommonUtil.setLedLight(isOpenLedLight);
|
|
|
|
|
|
+ X5RelaysAndLedUtile.getInstance().setLedLight(Type,isOpenLedLight);
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
switch (Type) {
|
|
switch (Type) {
|
|
case "open":
|
|
case "open":
|