| | |
| | | CEventCenter.dispatchEvent(Constant.BIND_SPEED_TOPIC,cmd,0,json); |
| | | break; |
| | | case Constant.RTK_INFO: |
| | | JSONObject jsonObject = null; |
| | | try { |
| | | jsonObject = new JSONObject(json); |
| | | int qf = jsonObject.getInt("qf"); |
| | | int satNum = jsonObject.getInt("sat_num"); |
| | | if (lastSatEqualNow(satNum)){ |
| | | |
| | | }else{ |
| | | String[] rtk_strs = new String[2]; |
| | | rtk_strs[0] = Constant.RTK_INFO_SAT_QF; |
| | | rtk_strs[1] = json; |
| | | Data rtkInfoData = new Data.Builder().putStringArray(Constant.APP_STATUS,rtk_strs).build(); |
| | | OneTimeWorkRequest appStatusWorker = new OneTimeWorkRequest.Builder(AppStatusWorker.class).setInputData(rtkInfoData).build(); |
| | | WorkManager.getInstance(getApplicationContext()).enqueue(appStatusWorker); |
| | | } |
| | | if (lastQfEqualNow(qf)){ |
| | | |
| | | }else{ |
| | | String[] rtk_strs = new String[2]; |
| | | rtk_strs[0] = Constant.RTK_INFO_SAT_QF; |
| | | rtk_strs[1] = json; |
| | | Data rtkInfoData = new Data.Builder().putStringArray(Constant.APP_STATUS,rtk_strs).build(); |
| | | OneTimeWorkRequest appStatusWorker = new OneTimeWorkRequest.Builder(AppStatusWorker.class).setInputData(rtkInfoData).build(); |
| | | WorkManager.getInstance(getApplicationContext()).enqueue(appStatusWorker); |
| | | } |
| | | } catch (JSONException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | if (ExamPlatformData.getInstance().getExamplatformStatus()==ExamPlatformData.DEV_LOGIN){ |
| | | try { |
| | | JSONObject jsSpeed = new JSONObject(json); |
| | |
| | | |
| | | } |
| | | |
| | | private int lastSatNum= 0; |
| | | private int lastQf = 0; |
| | | |
| | | private boolean lastSatEqualNow(int satNum) { |
| | | if (lastSatNum == satNum){ |
| | | return true; |
| | | }else{ |
| | | lastSatNum = satNum; |
| | | } |
| | | return false; |
| | | } |
| | | private boolean lastQfEqualNow(int qf) { |
| | | if (lastQf == qf){ |
| | | return true; |
| | | }else{ |
| | | lastQf = qf; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private void sendVechileInfo() { |
| | | new Thread(new Runnable() { |
| | | @Override |