| | |
| | | @Override |
| | | public void onCEvent(String topic, int msgCode, int resultCode, Object obj) { |
| | | //,"coord_x":0.974,"coord_x_dir":"N","coord_y":-0.191,"c |
| | | if (iLoadListener != null){ |
| | | CollectPointResult collectPointResult = new CollectPointResult(); |
| | | try { |
| | | JSONObject jsonObject = new JSONObject((String)obj); |
| | | double x = jsonObject.getDouble("coord_x"); |
| | | double y = jsonObject.getDouble("coord_y"); |
| | | if (msgCode==Constant.RTK_INFO){ |
| | | if (iLoadListener != null){ |
| | | CollectPointResult collectPointResult = new CollectPointResult(); |
| | | try { |
| | | JSONObject jsonObject = new JSONObject((String)obj); |
| | | double x = jsonObject.getDouble("coord_x"); |
| | | double y = jsonObject.getDouble("coord_y"); |
| | | |
| | | Log.i(TAG,String.format("采集到的点【x=%f,y=%f]",x,y)); |
| | | collectPointResult.setX(Utils.getdouble(x,4)); |
| | | collectPointResult.setY(Utils.getdouble(y,4)); |
| | | iLoadListener.finishCollectItem(collectPointResult); |
| | | } catch (JSONException e) { |
| | | e.printStackTrace(); |
| | | Log.i(TAG,String.format("采集到的点【x=%f,y=%f]",x,y)); |
| | | collectPointResult.setX(Utils.getdouble(x,4)); |
| | | collectPointResult.setY(Utils.getdouble(y,4)); |
| | | iLoadListener.finishCollectItem(collectPointResult); |
| | | } catch (JSONException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | if (msgCode == Constant.ENTER_OR_EXIT_ROAD_ID){ |
| | | Log.i(TAG,"道路消息"+(String)obj); |
| | | } |
| | | |
| | | if (msgCode == Constant.ENTER_OR_EXIT_ROADCROSS_ID){ |
| | | Log.i(TAG,"路口消息"+(String)obj); |
| | | } |
| | | |
| | | } |
| | | }; |
| | | |