| | |
| | | import android.os.Bundle; |
| | | import android.os.Handler; |
| | | import android.os.Message; |
| | | import android.serialport.SerialPortFinder; |
| | | import android.text.SpannableString; |
| | | import android.text.Spanned; |
| | | import android.text.TextUtils; |
| | |
| | | import com.doumee.keyCabinet.event.OpenGridOneResultEvent; |
| | | import com.doumee.keyCabinet.event.TimeClockEvent; |
| | | import com.doumee.keyCabinet.ui.face.ActivationActivity; |
| | | import com.doumee.keyCabinet.ui.face.ChoseActivationActivity; |
| | | import com.doumee.keyCabinet.ui.face.FaceActivity; |
| | | import com.doumee.keyCabinet.ui.keyCabinet.ChangeUrlActivity; |
| | | import com.doumee.keyCabinet.ui.keyCabinet.KeyCabinetActivity; |
| | |
| | | import com.doumee.keyCabinet.utils.CircularQueue; |
| | | import com.doumee.keyCabinet.utils.CrashHandler; |
| | | import com.doumee.keyCabinet.utils.LMobileInfo; |
| | | import com.doumee.keyCabinet.utils.MCUtils; |
| | | import com.doumee.keyCabinet.utils.TimeUtils; |
| | | import com.doumee.keyCabinet.utils.face.FaceSDKManager; |
| | | import com.doumee.keyCabinet.utils.face.FaceUtils; |
| | |
| | | import com.doumee.lib_coremodel.util.StringUtil; |
| | | import com.doumee.lib_coremodel.view.ToastView; |
| | | import com.example.datalibrary.api.FaceApi; |
| | | import com.example.datalibrary.db.DBManager; |
| | | import com.example.datalibrary.listener.DBLoadListener; |
| | | import com.example.datalibrary.listener.SdkInitListener; |
| | | import com.example.datalibrary.model.ImportFeatureResult; |
| | | import com.example.datalibrary.model.User; |
| | | import com.example.datalibrary.utils.ToastUtils; |
| | | import com.example.datalibrary.view.PreviewTexture; |
| | | import com.innohi.YNHAPI; |
| | | import com.mc.enjoysdk.McHome; |
| | | import com.mc.enjoysdk.McSystemUi; |
| | | import com.mc.enjoysdk.transform.McSystemUiFlag; |
| | | import com.yanzhenjie.permission.runtime.Permission; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | |
| | | private int downCount = 0; |
| | | private Long lastDownTime; |
| | | private Long showTime; |
| | | private McSystemUi mcSystemUi; |
| | | private McHome mcHome; |
| | | |
| | | private Handler handler = new Handler(){ |
| | | @Override |
| | |
| | | startService(intent2);*/ |
| | | getPermission(); |
| | | Timber.tag("====>").d(LMobileInfo.getDeviceUniqueId()); |
| | | mcSystemUi = McSystemUi.getInstance(this); |
| | | mcHome = McHome.getInstance(this); |
| | | } |
| | | |
| | | private void initM(){ |
| | |
| | | @Override |
| | | public void onChanged(List<FaceUserBean> beans) { |
| | | //更新人脸数据 |
| | | getVM().addInfo("更新人脸数据======》beans = "+beans); |
| | | if(beans!=null&&beans.size()>0){ |
| | | initModel(beans); |
| | | } |
| | |
| | | }else { |
| | | getDB().nsv.setVisibility(View.VISIBLE); |
| | | } |
| | | YNHAPI mAPI = YNHAPI.getInstance(); |
| | | mAPI.setNavigationBarVisibility(YNHAPI.NavigationBarVisibility.VISIBLE); |
| | | //显示状态栏 |
| | | mcSystemUi.temporarilySwitchStatusBar(true); |
| | | //显示导航栏 |
| | | mcSystemUi.temporarilySwitchNavigation(true); |
| | | } |
| | | }); |
| | | upErrInfo(); |
| | |
| | | } |
| | | setJiuConfig(); |
| | | initPort(); |
| | | EventBus.getDefault().post(new GetFacesEvent()); |
| | | } |
| | | } |
| | | }); |
| | |
| | | |
| | | private SpannableString getErrPhoneText(){ |
| | | String phone = MApplication.getConfigBean().getLinkPhone(); |
| | | if(phone==null){ |
| | | String text = "如有问题请联系管理员"; |
| | | SpannableString styledText = new SpannableString(text); |
| | | styledText.setSpan(new TextAppearanceSpan(this, R.style.style_tip3), 0, text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
| | | return styledText; |
| | | } |
| | | String text = "如有问题请联系管理员"+phone; |
| | | SpannableString styledText = new SpannableString(text); |
| | | styledText.setSpan(new TextAppearanceSpan(this, R.style.style_tip3), 0, text.length()-phone.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
| | |
| | | protected void onResume() { |
| | | super.onResume(); |
| | | isShowing = true; |
| | | YNHAPI mAPI = YNHAPI.getInstance(); |
| | | mAPI.setNavigationBarVisibility(YNHAPI.NavigationBarVisibility.ALWAYS_INVISIBLE); |
| | | mAPI.setBootLaunchApk("com.doumee.keyCabinet", true); |
| | | getVM().setSubmit(true); |
| | | MCUtils.hind(mcSystemUi); |
| | | mcHome.setHomePackage("com.doumee.keyCabinet"); |
| | | showTime = System.currentTimeMillis(); |
| | | if(!isFaceOk) { |
| | | initLicense(); |
| | |
| | | if (future != null && !future.isDone()) { |
| | | future.cancel(true); |
| | | } |
| | | FaceApi.getInstance().cleanRecords(); |
| | | if(isFaceOk) { |
| | | //激活了才处理 |
| | | FaceApi.getInstance().cleanRecords(); |
| | | } |
| | | handler.removeCallbacksAndMessages(null); |
| | | handler = null; |
| | | faceHandler.removeCallbacksAndMessages(null); |
| | |
| | | |
| | | @Subscribe |
| | | public void GetFacesEvent(GetFacesEvent event){ |
| | | getVM().addInfo("查询人脸数据======》"); |
| | | if(!isFinishing()&&!isUpdatingFace){ |
| | | getVM().addInfo("查询人脸数据======》isDBLoad = "+isDBLoad); |
| | | if(isDBLoad){ |
| | | isNeedUpdateFace = false; |
| | | //查询人脸 |
| | |
| | | /* |
| | | *要执行的操作*/ |
| | | |
| | | startActivity(new Intent(mContext, ActivationActivity.class)); |
| | | startActivity(new Intent(mContext, ChoseActivationActivity.class)); |
| | | } |
| | | }; |
| | | Timer timer = new Timer(); |
| | |
| | | @Override |
| | | public void run() { |
| | | FaceApi.getInstance().setUsers(users); |
| | | isDBLoad = true; |
| | | initFaceSDKManager(null); |
| | | if (successCount > 5000 || successCount == 0) { |
| | | getDB().progressGroup.setVisibility(View.GONE); |
| | | isDBLoad = true; |
| | | isFaceOk = true; |
| | | } |
| | | } |
| | |
| | | |
| | | private void initModel(List<FaceUserBean> userBeans) { |
| | | if (com.example.datalibrary.manager.FaceSDKManager.initStatus == com.example.datalibrary.manager.FaceSDKManager.SDK_MODEL_LOAD_SUCCESS) { |
| | | getVM().addInfo("更新人脸===》开始更新"); |
| | | waitUpdate(userBeans); |
| | | }else { |
| | | getVM().addInfo("更新人脸===》初始化"); |
| | | initFaceSDKManager(userBeans); |
| | | } |
| | | } |
| | |
| | | super.onPause(); |
| | | showTime = null; |
| | | isShowing = false; |
| | | getVM().setSubmit(false); |
| | | } |
| | | |
| | | private int finishCount; |
| | |
| | | } |
| | | }; |
| | | |
| | | private void waitUpdate(List<FaceUserBean> userBeans){ |
| | | if(isUpdatingFace){ |
| | | //正在更新 |
| | | waitBeans.addAll(userBeans); |
| | | }else { |
| | | private UserInfoManager.UserInfoListener mUserListListener = new UserInfoManager.UserInfoListener(){ |
| | | @Override |
| | | public void userListQuerySuccess(String userName, List<User> listUserInfo) { |
| | | selectBeans.clear(); |
| | | selectBeans.addAll(waitBeans); |
| | | waitBeans.clear(); |
| | |
| | | //删除不存在用户 |
| | | List<User> users = FaceApi.getInstance().getAllUserList(); |
| | | List<User> dels = new ArrayList<>(); |
| | | StringBuilder sb = new StringBuilder(); |
| | | for(User u:users){ |
| | | String key = u.getUserId()+"_"+u.getGroupId(); |
| | | if(!uMap.containsKey(key)){ |
| | | u.setChecked(true); |
| | | dels.add(u); |
| | | if(sb.length()>0){ |
| | | sb.append(","); |
| | | } |
| | | sb.append(u.getUserName()); |
| | | } |
| | | } |
| | | getVM().addInfo("更新人脸》》》》》》》》》》》》》》》》》》"); |
| | | if(dels.size()>0){ |
| | | UserInfoManager.getInstance().deleteUserListInfo(dels, |
| | | "", new UserInfoManager.UserInfoListener() { |
| | | getVM().addInfo("准备删除用户:"+sb.toString()); |
| | | UserInfoManager.getInstance().deleteUserListInfo(users, |
| | | "1", new UserInfoManager.UserInfoListener() { |
| | | @Override |
| | | public void userListDeleteSuccess() { |
| | | // 用户列表删除成功 |
| | | faceHandler.sendEmptyMessage(0); |
| | | getVM().addInfo("删除用户成功:"); |
| | | } |
| | | |
| | | @Override |
| | | public void userListDeleteFailure(String message) { |
| | | // 用户列表删除失败 |
| | | faceHandler.sendEmptyMessage(0); |
| | | getVM().addInfo("删除用户失败:"+message); |
| | | |
| | | getVM().addInfo("删除用户列表:"+sb.toString()); |
| | | } |
| | | }, |
| | | new DBLoadListener() { |
| | |
| | | faceHandler.sendEmptyMessage(0); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void userListQueryFailure(String message) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void userListDeleteSuccess() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void userListDeleteFailure(String message) { |
| | | |
| | | } |
| | | }; |
| | | |
| | | private List<FaceUserBean> userBeans = new ArrayList<>(); |
| | | private void waitUpdate(List<FaceUserBean> userBeans){ |
| | | if(isUpdatingFace){ |
| | | //正在更新 |
| | | waitBeans.addAll(userBeans); |
| | | getVM().addInfo("正在更新、等待 《《《《《《《《"); |
| | | }else { |
| | | getVM().addInfo("初始化人脸库 《《《《《《《《"); |
| | | com.example.datalibrary.manager.FaceSDKManager.getInstance().initDataBases(MainActivity.this); |
| | | this.userBeans.clear(); |
| | | this.userBeans.addAll(userBeans); |
| | | UserInfoManager.getInstance().getUserListInfo(null, mUserListListener); |
| | | } |
| | | } |
| | | |
| | | private int repeatCount = 0; |
| | | private void updateFace(FaceUserBean bean){ |
| | | Timber.d("==UpdatingFace==>完成数量 "+finishCount); |
| | | //getVM().addInfo("==UpdatingFace==>完成数量 " + finishCount); |
| | | if (TextUtils.isEmpty(bean.getFaceImg())||bean.getFaceImg().endsWith("null")) { |
| | | finishCount++; |
| | | faceHandler.sendEmptyMessage(0); |
| | |
| | | isSave = FaceApi.getInstance().registerUserIntoDBmanager(newDo.getGroupId(), |
| | | newDo.getUserId(), newDo.getUserName(), newDo.getImageName(), newDo.getUserInfo(), newDo.getFeature()); |
| | | //System.out.println("==isOk==>保存成功"); |
| | | //getVM().addInfo("新增人脸==》"+newDo.getUserName()+" 结果:"+isSave); |
| | | } else { |
| | | //更新 |
| | | user.setUserName(newDo.getUserName()); |
| | | user.setImageName(newDo.getImageName()); |
| | | user.setFeature(newDo.getFeature()); |
| | | isSave = FaceApi.getInstance().userUpdateOnly(user); |
| | | //getVM().addInfo("更新人脸==》"+newDo.getUserName()+" 结果:"+isSave); |
| | | //System.out.println("==isOk==>更新成功"); |
| | | } |
| | | |
| | |
| | | SingleBaseConfig.getBaseConfig().setRBGCameraId(index); |
| | | SingleBaseConfig.getBaseConfig().setRgbRevert(true); |
| | | SingleBaseConfig.getBaseConfig().setRgbDetectDirection(90); |
| | | SingleBaseConfig.getBaseConfig().setRgbVideoDirection(270); |
| | | SingleBaseConfig.getBaseConfig().setRgbVideoDirection(90); |
| | | GateConfigUtils.modityJson(); |
| | | RegisterConfigUtils.modityJson(); |
| | | } |
| | |
| | | getVM().devLogin(); |
| | | getPermission(); |
| | | getVM().devHeart(); |
| | | EventBus.getDefault().post(new GetFacesEvent()); |
| | | }else { |
| | | loopDownCount--; |
| | | } |
| | |
| | | } |
| | | |
| | | getVM().updateGrids(updateList); |
| | | EventBus.getDefault().post(new KeyResultEvent()); |
| | | EventBus.getDefault().post(new KeyResultEvent(bh+"")); |
| | | } |
| | | |
| | | private SerialPortModel jiuPort; |
| | |
| | | return; |
| | | } |
| | | runOnUiThread(() -> { |
| | | getVM().addInfo("获取到门数据:" + SportUtils.bytesToHexSimple(bytes)); |
| | | getVM().addInfo("获取到数据:" + SportUtils.bytesToHexSimple(bytes)); |
| | | }); |
| | | String data = SportUtils.bytesToHexSimple(bytes); |
| | | if(startIndex==1){ |
| | | gridPath = path; |
| | | getVM().addInfo("设置门串口路径:" + path); |
| | | SpUtil.saveString("port_grid",path); |
| | | if(data.toLowerCase().startsWith("80")){ |
| | | gridPath = path; |
| | | getVM().addInfo("设置门串口路径:=====XXXXX===>" + path); |
| | | SpUtil.saveString("port_grid",path); |
| | | } |
| | | }else if(startIndex==2){ |
| | | keyPath = path; |
| | | getVM().addInfo("设置钥匙串口路径:" + path); |
| | | SpUtil.saveString("port_key",path); |
| | | if(data.toLowerCase().startsWith("cc")){ |
| | | keyPath = path; |
| | | getVM().addInfo("设置钥匙串口路径:====XXXX====>" + path); |
| | | SpUtil.saveString("port_key",path); |
| | | } |
| | | }else if(startIndex==3){ |
| | | jiuPath = path; |
| | | getVM().addInfo("设置酒精串口路径:" + path); |
| | | SpUtil.saveString("port_jiu",path); |
| | | String data2 = new String(bytes); |
| | | if(data2.toLowerCase().startsWith("mic")) { |
| | | jiuPath = path; |
| | | getVM().addInfo("设置酒精串口路径:====XXXX====>" + path); |
| | | SpUtil.saveString("port_jiu", path); |
| | | } |
| | | } |
| | | } |
| | | }; |
| | |
| | | switch (msg.what){ |
| | | case 0: |
| | | if(index>=1&&!checkEnd()){ |
| | | path = ports.get(index); |
| | | index--; |
| | | path = ports.get(index); |
| | | portHandler.sendEmptyMessage(4); |
| | | }else if(checkEnd()){ |
| | | initPort(); |
| | |
| | | private boolean isInitPort; |
| | | //初始化串口 |
| | | private void initPort(){ |
| | | //SpUtil.setString("port_grid","/dev/ttyS7"); |
| | | //SpUtil.setString("port_key","/dev/ttyS1"); |
| | | //SpUtil.setString("port_jiu","/dev/ttyS2"); |
| | | gridPath = SpUtil.getString("port_grid"); |
| | | getVM().addInfo("门串口链接:"+gridPath); |
| | | keyPath = SpUtil.getString("port_key"); |
| | | getVM().addInfo("钥匙串口链接:"+keyPath); |
| | | jiuPath = SpUtil.getString("port_jiu"); |
| | | getVM().addInfo("酒精串口链接:"+jiuPath); |
| | | if(!TextUtils.isEmpty(SpUtil.getString("port_grid"))&& |
| | | !TextUtils.isEmpty(SpUtil.getString("port_key"))&& |
| | | !TextUtils.isEmpty(SpUtil.getString("port_jiu"))){ |
| | | if(isInitPort){ |
| | | return; |
| | | } |
| | | xhCount=0; |
| | | closePort(chosePort); |
| | | if(!TextUtils.isEmpty(SpUtil.getString("port_grid"))){ |
| | | String path = SpUtil.getString("port_grid"); |
| | | closePort(gridPort); |
| | | getVM().addInfo("门串口链接:"+path); |
| | | gridPort = new SerialPortModel(path,9600 ,8 |
| | | ,1 , 0,gridReadObserver); |
| | | boolean isSucc = gridPort.open(); |
| | | if(isSucc) { |
| | | isInitPort = true; |
| | | getVM().addInfo("门串口链接成功:"+path); |
| | | String msg = isSucc ? "成功" : "失败"; |
| | | //getVM().append("串口 "+ settingBean.getDevicePath() + " -连接"+msg); |
| | | gridPort.startRead(); |
| | | //查询所有柜格门信息 |
| | | checkGridStatus(300); |
| | | }else { |
| | | getVM().addInfo("门串口链接失败:"+path); |
| | | try { |
| | | /*SpUtil.setString("port_grid","/dev/ttyS0"); |
| | | SpUtil.setString("port_key","/dev/ttyS4"); |
| | | SpUtil.setString("port_jiu","/dev/ttyS9");*/ |
| | | |
| | | gridPath = SpUtil.getString("port_grid"); |
| | | getVM().addInfo("门串口链接:"+gridPath); |
| | | keyPath = SpUtil.getString("port_key"); |
| | | getVM().addInfo("钥匙串口链接:"+keyPath); |
| | | jiuPath = SpUtil.getString("port_jiu"); |
| | | getVM().addInfo("酒精串口链接:"+jiuPath); |
| | | if(!TextUtils.isEmpty(SpUtil.getString("port_grid"))&& |
| | | !TextUtils.isEmpty(SpUtil.getString("port_key"))&& |
| | | !TextUtils.isEmpty(SpUtil.getString("port_jiu"))){ |
| | | if(isInitPort){ |
| | | return; |
| | | } |
| | | } |
| | | if(!TextUtils.isEmpty(SpUtil.getString("port_key"))){ |
| | | String path = SpUtil.getString("port_key"); |
| | | closePort(keyPort); |
| | | keyPort = new SerialPortModel(path,115200 ,8 |
| | | ,1 , 0,keyReadObserver); |
| | | boolean isSucc = keyPort.open(); |
| | | if(isSucc) { |
| | | isInitPort = true; |
| | | getVM().addInfo("钥匙串口链接成功:"+path); |
| | | String msg = isSucc ? "成功" : "失败"; |
| | | //getVM().append("串口 "+ settingBean.getDevicePath() + " -连接"+msg); |
| | | keyPort.startRead(); |
| | | checkKeyStatus(1500); |
| | | }else { |
| | | getVM().addInfo("钥匙串口链接失败:"+path); |
| | | xhCount=0; |
| | | closePort(chosePort); |
| | | if(!TextUtils.isEmpty(SpUtil.getString("port_grid"))){ |
| | | String path = SpUtil.getString("port_grid"); |
| | | closePort(gridPort); |
| | | getVM().addInfo("门串口链接:"+path); |
| | | gridPort = new SerialPortModel(path,9600 ,8 |
| | | ,1 , 0,gridReadObserver); |
| | | boolean isSucc = gridPort.open(); |
| | | if(isSucc) { |
| | | isInitPort = true; |
| | | getVM().addInfo("门串口链接成功:"+path); |
| | | String msg = isSucc ? "成功" : "失败"; |
| | | //getVM().append("串口 "+ settingBean.getDevicePath() + " -连接"+msg); |
| | | gridPort.startRead(); |
| | | //查询所有柜格门信息 |
| | | checkGridStatus(300); |
| | | }else { |
| | | getVM().addInfo("门串口链接失败:"+path); |
| | | } |
| | | } |
| | | } |
| | | if(!TextUtils.isEmpty(SpUtil.getString("port_jiu"))){ |
| | | String path = SpUtil.getString("port_jiu"); |
| | | closePort(jiuPort); |
| | | jiuPort = new SerialPortModel(path,9600 ,8 |
| | | ,1 , 0,jiuReadObserver); |
| | | boolean isSucc = jiuPort.open(); |
| | | if(isSucc) { |
| | | isInitPort = true; |
| | | getVM().addInfo("酒精串口链接成功:"+path); |
| | | String msg = isSucc ? "成功" : "失败"; |
| | | //getVM().append("串口 "+ settingBean.getDevicePath() + " -连接"+msg); |
| | | jiuPort.startRead(); |
| | | }else { |
| | | getVM().addInfo("酒精串口链接失败:"+path); |
| | | if(!TextUtils.isEmpty(SpUtil.getString("port_key"))){ |
| | | String path = SpUtil.getString("port_key"); |
| | | closePort(keyPort); |
| | | keyPort = new SerialPortModel(path,115200 ,8 |
| | | ,1 , 0,keyReadObserver); |
| | | boolean isSucc = keyPort.open(); |
| | | if(isSucc) { |
| | | isInitPort = true; |
| | | getVM().addInfo("钥匙串口链接成功:"+path); |
| | | String msg = isSucc ? "成功" : "失败"; |
| | | //getVM().append("串口 "+ settingBean.getDevicePath() + " -连接"+msg); |
| | | keyPort.startRead(); |
| | | checkKeyStatus(1500); |
| | | }else { |
| | | getVM().addInfo("钥匙串口链接失败:"+path); |
| | | } |
| | | } |
| | | } |
| | | }else { |
| | | if(xhCount>2){ |
| | | return; |
| | | } |
| | | xhCount++; |
| | | ports = SportUtils.getSerialPortPaths(this); |
| | | if(ports==null){ |
| | | getVM().addInfo("未查询到串口列表"); |
| | | if(!TextUtils.isEmpty(SpUtil.getString("port_jiu"))){ |
| | | String path = SpUtil.getString("port_jiu"); |
| | | closePort(jiuPort); |
| | | jiuPort = new SerialPortModel(path,9600 ,8 |
| | | ,1 , 0,jiuReadObserver); |
| | | boolean isSucc = jiuPort.open(); |
| | | if(isSucc) { |
| | | isInitPort = true; |
| | | getVM().addInfo("酒精串口链接成功:"+path); |
| | | String msg = isSucc ? "成功" : "失败"; |
| | | //getVM().append("串口 "+ settingBean.getDevicePath() + " -连接"+msg); |
| | | jiuPort.startRead(); |
| | | }else { |
| | | getVM().addInfo("酒精串口链接失败:"+path); |
| | | } |
| | | } |
| | | }else { |
| | | getVM().addInfo("串口列表:"+ports.size()); |
| | | if(xhCount>2){ |
| | | return; |
| | | } |
| | | xhCount++; |
| | | ports = SportUtils.getSerialPortPaths(this); |
| | | if(ports==null){ |
| | | getVM().addInfo("未查询到串口列表"); |
| | | }else { |
| | | getVM().addInfo("串口列表:"+ports.size()); |
| | | } |
| | | if(ports.size()>0){ |
| | | index = ports.size(); |
| | | portHandler.sendEmptyMessage(0); |
| | | } |
| | | } |
| | | if(ports.size()>0){ |
| | | index = ports.size()-1; |
| | | portHandler.sendEmptyMessage(0); |
| | | } |
| | | }catch (RuntimeException e){ |
| | | Toast.makeText(mContext, e.getMessage(), Toast.LENGTH_SHORT).show(); |
| | | }catch (Exception e){ |
| | | Toast.makeText(mContext, e.getMessage(), Toast.LENGTH_SHORT).show(); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | private boolean checkEnd(){ |
| | | if(TextUtils.isEmpty(gridPath)){ |
| | | getVM().addInfo("门错误"); |
| | | getVM().addInfo("门错误<<<<<<<<<<<<<<<<<<<"); |
| | | startIndex=0; |
| | | return false; |
| | | } |
| | | if(TextUtils.isEmpty(keyPath)){ |
| | | getVM().addInfo("钥匙错误"); |
| | | getVM().addInfo("钥匙错误<<<<<<<<<<<<<<<<<<<"); |
| | | startIndex=1; |
| | | return false; |
| | | } |
| | | if(TextUtils.isEmpty(jiuPath)){ |
| | | getVM().addInfo("酒精错误"); |
| | | getVM().addInfo("酒精错误<<<<<<<<<<<<<<<<<<<"); |
| | | startIndex=2; |
| | | return false; |
| | | } |
| | |
| | | if(handler.hasMessages(2)){ |
| | | handler.removeMessages(2); |
| | | } |
| | | |
| | | HashMap<String,String> copyMap = new HashMap<>(); |
| | | copyMap.putAll(closeMap); |
| | | closeMap.clear(); |
| | |
| | | } |
| | | if(!isFail){ |
| | | //关门成功 |
| | | EventBus.getDefault().post(new HttpEvent(StringUtil.DateToStrSS(new Date())+"门关闭成功***************************>目标:"+gridDo.getKeyCode()+",当前:"+gridDo.getCurKeyCode())); |
| | | getVM().closeGrid(gridDo); |
| | | boolean isSend = false; |
| | | String bh = gridDo.getGridKey().substring(0,2); |
| | | if("1".equals(e.getType())){ |
| | | //1号板 |
| | | if("01".equals(bh)){ |
| | | isSend = true; |
| | | } |
| | | }else if("2".equals(e.getType())){ |
| | | //2号板 |
| | | if("02".equals(bh)){ |
| | | isSend = true; |
| | | } |
| | | }else { |
| | | isSend = true; |
| | | } |
| | | if(isSend) { |
| | | EventBus.getDefault().post(new HttpEvent(StringUtil.DateToStrSS(new Date()) + "门关闭成功***************************>目标:" + gridDo.getKeyCode() + ",当前:" + gridDo.getCurKeyCode())); |
| | | getVM().closeGrid(gridDo); |
| | | } |
| | | } |
| | | } |
| | | } |