yy1717
2020-03-05 f430073ef8e63884eff78d57084f89e93fa0c1f0
app/src/main/java/safeluck/drive/evaluation/app.java
@@ -46,6 +46,7 @@
import safeluck.drive.evaluation.DB.failitems.FailedProj_select;
import safeluck.drive.evaluation.DB.gps.GpsInfoWorker;
import safeluck.drive.evaluation.DB.rtktb.RTKConfig;
import safeluck.drive.evaluation.DB.rtktb.RTKConfigUpdateWorker;
import safeluck.drive.evaluation.DB.rtktb.RTKWorkRepository;
import safeluck.drive.evaluation.bean.ExamPlatformData;
import safeluck.drive.evaluation.cEventCenter.CEvent;
@@ -140,6 +141,7 @@
    }
    private String lastStr;
    private String lastSn;
    @Override
    public void callBackMsg(final int cmd, String json) {
        String strConent = String.format("收到命令[%d],Json内容为%s", cmd, json);
@@ -264,6 +266,22 @@
                CEventCenter.dispatchEvent(Constant.BIND_DEBUG_TXT,cmd,0,json);
                break;
            case Constant.MCU_SN:
                String sn = null;
                try {
                    JSONObject rtkConfigUpdtea = new JSONObject(json);
                    sn = rtkConfigUpdtea.getString("sn");
                    sn = rtkConfigUpdtea.put(safeluck.drive.evaluation.DB.Constant.RTK_CONFIG_SN,sn).toString();
                } catch (JSONException e) {
                    e.printStackTrace();
                }
                if (sn.equalsIgnoreCase(lastSn)){
                }else{
                    lastSn = sn;
                    Data data = new Data.Builder().putString(safeluck.drive.evaluation.DB.Constant.RTK_CONFIG_UPDATE_JSON,sn).build();
                    OneTimeWorkRequest rtkConfigUpdateWorker= new OneTimeWorkRequest.Builder(RTKConfigUpdateWorker.class).setInputData(data).build();
                    WorkManager.getInstance(getAppContext()).enqueue(rtkConfigUpdateWorker);
                }
                CEventCenter.dispatchEvent(Constant.BIND_MCUINFO_TOPIC,cmd,0,json);
                break;
            case Constant.IC_ID:
@@ -277,7 +295,6 @@
                    double longitude = jsSpeed.getDouble("longitude");
                    double altitude = jsSpeed.getDouble("altitude");
                    double speed = jsSpeed.getDouble("speed");
                    Log.i(TAG, "RTK info speed: "+speed);
                    int  qf = jsSpeed.getInt("qf");
                    double track_ture = jsSpeed.getDouble("track_ture");
                    String utc = jsSpeed.getString("utc");
@@ -298,9 +315,7 @@
                    AttachInfo attachInfo = new AttachInfo();
                    attachInfo.attach_message_id = Integer.parseInt(String.valueOf(0x40));
                    attachInfo.attach_message_length = 4;
                    Log.i(TAG, "attachInfo.attach_message_id ="+attachInfo.attach_message_id );
                    if (attachInfo.attach_message_id == 0x41){
                        Log.i(TAG, "onClick: 41");
                        attachInfo.attach_data="00000000";
                    }else{
@@ -309,7 +324,6 @@
                    }
                    jkMessage0206.attachInfo = attachInfo;
                    Log.i(TAG, "位置上报="+jkMessage0206.toString());
                    MessageProcessor.getInstance().sendMessage(jkMessage0206);
                } catch (JSONException e) {