| | |
| | | View view = inflater.inflate(R.layout.layout_base_datas, container, false); |
| | | initView(view); |
| | | rtkConfigViewModel= ViewModelProviders.of(this).get(RTKConfigViewModel.class); |
| | | rtkConfigViewModel.getRTKConfig().observe(this, new Observer<RTKConfig>() { |
| | | @Override |
| | | public void onChanged(RTKConfig rtkConfig) { |
| | | if (rtkConfig != null){ |
| | | Log.i(TAG, "RTKConfig Changed: "+rtkConfig.toString()); |
| | | mRtkConfig = rtkConfig; |
| | | et_ip_rtk.setText(rtkConfig.getIp()); |
| | | et_city_id.setText(String.valueOf(rtkConfig.getCity())); |
| | | et_city_province.setText(String.valueOf(rtkConfig.getProvince())); |
| | | et_port_rtk.setText(String.valueOf(rtkConfig.getPort())); |
| | | et_phone.setText(rtkConfig.getPhone()); |
| | | ExamPlatformData.getInstance().setRTKPort(rtkConfig.getPort()); |
| | | ExamPlatformData.getInstance().setRTKIP(rtkConfig.getIp()); |
| | | |
| | | } |
| | | |
| | | rtkConfigViewModel.getRTKConfig().observe(this, rtkConfig -> { |
| | | if (rtkConfig != null){ |
| | | Log.i(TAG, "RTKConfig Changed: "+rtkConfig.toString()); |
| | | mRtkConfig = rtkConfig; |
| | | et_ip_rtk.setText(rtkConfig.getIp()); |
| | | et_city_id.setText(String.valueOf(rtkConfig.getCity())); |
| | | et_city_province.setText(String.valueOf(rtkConfig.getProvince())); |
| | | et_port_rtk.setText(String.valueOf(rtkConfig.getPort())); |
| | | et_phone.setText(rtkConfig.getPhone()); |
| | | ExamPlatformData.getInstance().setRTKPort(rtkConfig.getPort()); |
| | | ExamPlatformData.getInstance().setRTKIP(rtkConfig.getIp()); |
| | | |
| | | } |
| | | |
| | | |
| | | }); |
| | | |
| | | |
| | |
| | | final Uri uri= data.getData(); |
| | | Log.i(TAG, "onActivityResult: "+uri.getPath()); |
| | | ExamPlatformData.getInstance().setNewMapPath(uri.getPath()); |
| | | CThreadPoolExecutor.runInBackground(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | CThreadPoolExecutor.runInBackground(()-> { |
| | | |
| | | byte[] fileContent = FileUtil.readFile(uri.getPath()); |
| | | if (fileContent != null){ |
| | | String str = new String(fileContent); |
| | | Log.i(TAG, "文件内容:"+str); |
| | | AYSdk.getInstance().sendCmd(Constant.PUSH_MAP_INFO,str); |
| | | } |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | |
| | | final Uri uri= data.getData(); |
| | | Log.i(TAG, "onActivityResult: "+uri.getPath()); |
| | | ExamPlatformData.getInstance().setCarModelPath(uri.getPath()); |
| | | CThreadPoolExecutor.runInBackground(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | CThreadPoolExecutor.runInBackground(()-> { |
| | | |
| | | byte[] fileContent = FileUtil.readFile(uri.getPath()); |
| | | if (fileContent != null){ |
| | | String str = new String(fileContent); |
| | | Log.i(TAG, "文件内容:"+str); |
| | | AYSdk.getInstance().sendCmd(Constant.PUSH_VECHILE_PROFILE,str); |
| | | } |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | |
| | | final Uri uri= data.getData(); |
| | | Log.i(TAG, "onActivityResult: "+uri.getPath()); |
| | | ExamPlatformData.getInstance().setNewRoadMapPath(uri.getPath()); |
| | | CThreadPoolExecutor.runInBackground(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | byte[] fileContent = FileUtil.readFile(uri.getPath()); |
| | | if (fileContent != null){ |
| | | String str = new String(fileContent); |
| | | Log.i(TAG, "文件内容:"+str); |
| | | AYSdk.getInstance().sendCmd(Constant.PUSH_ROAD_MAP_INFO,str); |
| | | } |
| | | CThreadPoolExecutor.runInBackground(() -> { |
| | | byte[] fileContent = FileUtil.readFile(uri.getPath()); |
| | | if (fileContent != null){ |
| | | String str = new String(fileContent); |
| | | Log.i(TAG, "文件内容:"+str); |
| | | AYSdk.getInstance().sendCmd(Constant.PUSH_ROAD_MAP_INFO,str); |
| | | } |
| | | }); |
| | | } |