| | |
| | | |
| | | private static final String TAG = SetArgumentsFragment.class.getSimpleName(); |
| | | private static final int REQUEST_CODE_MAP = 100; |
| | | private static final int REQUEST_CODE_ROADMAP = 102; |
| | | private static final int REQUEST_CODE_CAR = 101; |
| | | private int request_code = REQUEST_CODE_MAP; |
| | | private Button btn_config_signal; |
| | | private Button btn_mcu_upgrade,btn_map_select; |
| | | private Button btn_mcu_upgrade,btn_map_select,btn_roadmap_select; |
| | | private EditText et_ip,et_port,et_simulte_ip,et_simulate_port; |
| | | private Gson gson = new Gson(); |
| | | private EditText et_ip_rtk,et_port_rtk,et_city_id,et_city_province,et_phone; |
| | | private RTKConfigViewModel rtkConfigViewModel; |
| | | private RTKConfig mRtkConfig; |
| | | private Toolbar toolbar; |
| | | private boolean needSendRtk = false; |
| | | |
| | | public static SetArgumentsFragment newInstance() { |
| | |
| | | et_port.setText(ExamPlatformData.getInstance().getPlatformPort()+""); |
| | | btn_mcu_upgrade = view.findViewById(R.id.btn_mcu_upgrade); |
| | | btn_map_select = view.findViewById(R.id.btn_map_select); |
| | | btn_roadmap_select = view.findViewById(R.id.btn_roadmap_select); |
| | | view.findViewById(R.id.btn_car_select).setOnClickListener(this); |
| | | btn_mcu_upgrade.setOnClickListener(this); |
| | | btn_map_select.setOnClickListener(this); |
| | | btn_roadmap_select.setOnClickListener(this); |
| | | btn_config_signal = view.findViewById(R.id.btn_signal_conf); |
| | | btn_config_signal.setOnClickListener(this); |
| | | |
| | |
| | | request_code = REQUEST_CODE_MAP; |
| | | openFileMgr(); |
| | | break; |
| | | case R.id.btn_roadmap_select: |
| | | request_code = REQUEST_CODE_ROADMAP; |
| | | openFileMgr(); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | }else if (REQUEST_CODE_ROADMAP == requestCode){ |
| | | if (data != null){ |
| | | 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); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |