diff --git a/doc/基于机器人的物流“智取”系统开发项目的个人自评报告.xlsx b/doc/基于机器人的物流“智取”系统开发项目的个人自评报告.xlsx index b012d08..6485d17 100644 Binary files a/doc/基于机器人的物流“智取”系统开发项目的个人自评报告.xlsx and b/doc/基于机器人的物流“智取”系统开发项目的个人自评报告.xlsx differ diff --git a/doc/基于机器人的物流“智取”系统开发项目的团队自评报告.xlsx b/doc/基于机器人的物流“智取”系统开发项目的团队自评报告.xlsx index d6fee3a..8779f9e 100644 Binary files a/doc/基于机器人的物流“智取”系统开发项目的团队自评报告.xlsx and b/doc/基于机器人的物流“智取”系统开发项目的团队自评报告.xlsx differ diff --git a/doc/基于机器人的物流“智取”系统汇报PPT.pptx b/doc/基于机器人的物流“智取”系统汇报PPT.pptx index e671a23..8304562 100644 Binary files a/doc/基于机器人的物流“智取”系统汇报PPT.pptx and b/doc/基于机器人的物流“智取”系统汇报PPT.pptx differ diff --git a/doc/基于机器人的物流“智取”系统设计规格说明书.doc b/doc/基于机器人的物流“智取”系统设计规格说明书.doc index 5ffc87c..d4b3b34 100644 Binary files a/doc/基于机器人的物流“智取”系统设计规格说明书.doc and b/doc/基于机器人的物流“智取”系统设计规格说明书.doc differ diff --git a/doc/演示视频.mp4 b/doc/演示视频.mp4 new file mode 100644 index 0000000..eb8a91a Binary files /dev/null and b/doc/演示视频.mp4 differ diff --git a/model/设计规格说明书/数据设计/good.png b/model/设计规格说明书/数据设计/good.png index c79e28c..8075ff8 100644 Binary files a/model/设计规格说明书/数据设计/good.png and b/model/设计规格说明书/数据设计/good.png differ diff --git a/model/设计规格说明书/数据设计/good.vsdx b/model/设计规格说明书/数据设计/good.vsdx index be96fef..5249cf6 100644 Binary files a/model/设计规格说明书/数据设计/good.vsdx and b/model/设计规格说明书/数据设计/good.vsdx differ diff --git a/model/设计规格说明书/数据设计/operation.png b/model/设计规格说明书/数据设计/operation.png index da00892..2f7705f 100644 Binary files a/model/设计规格说明书/数据设计/operation.png and b/model/设计规格说明书/数据设计/operation.png differ diff --git a/model/设计规格说明书/数据设计/operation.vsdx b/model/设计规格说明书/数据设计/operation.vsdx index 678a108..d24406a 100644 Binary files a/model/设计规格说明书/数据设计/operation.vsdx and b/model/设计规格说明书/数据设计/operation.vsdx differ diff --git a/model/设计规格说明书/数据设计/user.png b/model/设计规格说明书/数据设计/user.png index b0163ed..542c7b3 100644 Binary files a/model/设计规格说明书/数据设计/user.png and b/model/设计规格说明书/数据设计/user.png differ diff --git a/model/设计规格说明书/数据设计/user.vsdx b/model/设计规格说明书/数据设计/user.vsdx index 7f9609d..c50c5d4 100644 Binary files a/model/设计规格说明书/数据设计/user.vsdx and b/model/设计规格说明书/数据设计/user.vsdx differ diff --git a/model/设计规格说明书/类设计/精化设计类方法.png b/model/设计规格说明书/类设计/精化设计类方法.png index 983f08d..a78e226 100644 Binary files a/model/设计规格说明书/类设计/精化设计类方法.png and b/model/设计规格说明书/类设计/精化设计类方法.png differ diff --git a/model/设计规格说明书/类设计/精化用户界面类关系 - 副本 (2).vsdx b/model/设计规格说明书/类设计/精化设计类方法.vsdx similarity index 77% rename from model/设计规格说明书/类设计/精化用户界面类关系 - 副本 (2).vsdx rename to model/设计规格说明书/类设计/精化设计类方法.vsdx index 9cd3238..a337259 100644 Binary files a/model/设计规格说明书/类设计/精化用户界面类关系 - 副本 (2).vsdx and b/model/设计规格说明书/类设计/精化设计类方法.vsdx differ diff --git a/src/Logistics/.idea/deploymentTargetDropDown.xml b/src/Logistics/.idea/deploymentTargetDropDown.xml index e8919a9..32e4374 100644 --- a/src/Logistics/.idea/deploymentTargetDropDown.xml +++ b/src/Logistics/.idea/deploymentTargetDropDown.xml @@ -7,11 +7,11 @@ - + - + \ No newline at end of file diff --git a/src/Logistics/.idea/misc.xml b/src/Logistics/.idea/misc.xml index 69e6dc4..c485203 100644 --- a/src/Logistics/.idea/misc.xml +++ b/src/Logistics/.idea/misc.xml @@ -30,7 +30,7 @@ - + diff --git a/src/Logistics/app/src/main/java/com/example/logistics/entity/Good.java b/src/Logistics/app/src/main/java/com/example/logistics/entity/Good.java index e2e5c30..10b4192 100644 --- a/src/Logistics/app/src/main/java/com/example/logistics/entity/Good.java +++ b/src/Logistics/app/src/main/java/com/example/logistics/entity/Good.java @@ -2,10 +2,11 @@ package com.example.logistics.entity; public class Good { private int id; - private String phoneNum; - private int shelfNum; - private int floorNum; - private String time; + + private String phoneNum;//货主手机号 + private int shelfNum;//货架号 + private int floorNum;//货架层号 + private String time;//入库时间 public Good(){ diff --git a/src/Logistics/app/src/main/java/com/example/logistics/entity/Operation.java b/src/Logistics/app/src/main/java/com/example/logistics/entity/Operation.java index cb638b0..9d72d45 100644 --- a/src/Logistics/app/src/main/java/com/example/logistics/entity/Operation.java +++ b/src/Logistics/app/src/main/java/com/example/logistics/entity/Operation.java @@ -4,9 +4,9 @@ import android.provider.ContactsContract; public class Operation { private int id; - private String pickUpCode; - private String phoneNum; - private String time; + private String pickUpCode;//取件码 + private String phoneNum;//货主手机号 + private String time;//取件时间 public Operation(){ diff --git a/src/Logistics/app/src/main/java/com/example/logistics/entity/User.java b/src/Logistics/app/src/main/java/com/example/logistics/entity/User.java index bec6082..3a393cd 100644 --- a/src/Logistics/app/src/main/java/com/example/logistics/entity/User.java +++ b/src/Logistics/app/src/main/java/com/example/logistics/entity/User.java @@ -2,9 +2,9 @@ package com.example.logistics.entity; public class User { private int userId; - private String userName; - private String passWord; - private String phoneNum; + private String userName;//用户名 + private String passWord;//密码 + private String phoneNum;//手机吗 public User(){ diff --git a/src/Logistics/app/src/main/java/com/example/logistics/manager/goodManager.java b/src/Logistics/app/src/main/java/com/example/logistics/manager/goodManager.java index 928ead8..cc89738 100644 --- a/src/Logistics/app/src/main/java/com/example/logistics/manager/goodManager.java +++ b/src/Logistics/app/src/main/java/com/example/logistics/manager/goodManager.java @@ -25,24 +25,23 @@ public class goodManager { Log.d(TAG, "search"); HashMap map = new HashMap<>(); - Connection connection = DBOpenHelper.getConn(); + Connection connection = DBOpenHelper.getConn();//DBO连接数据库 int msg = 0; try{ Log.d(TAG, "select goods"); - String sql = "select * from goods where id = ?"; - + String sql = "select * from goods where id = ?";//搜索指定取件码(=id号)的快件信息 if(connection != null){ Log.d(TAG, "connection!"); PreparedStatement ps = connection.prepareStatement(sql); if(ps != null){ Log.e(TAG, "id: " + id); - ps.setInt(1,Integer.parseInt(id)); - ResultSet rs = ps.executeQuery(); + ps.setInt(1,Integer.parseInt(id));//设置sql语句中id号 + ResultSet rs = ps.executeQuery();//执行sql语句并返回结果到rs int count = rs.getMetaData().getColumnCount(); - while(rs.next()){ + while(rs.next()){//遍历返回结果加入map中 for(int i = 1; i <= count; i++){ String field = rs.getMetaData().getColumnName(i); map.put(field, rs.getString(field)); @@ -53,14 +52,14 @@ public class goodManager { if(map.size() != 0){ Log.d(TAG, "map isnot null"); StringBuilder s = new StringBuilder(); - for(String key:map.keySet()){ - if(key.equals("phonenum")){ + for(String key:map.keySet()){//搜索map中的key值 + if(key.equals("phonenum")){//搜索phonenum属性 String strphone = String.valueOf(map.get(key)); Log.d(TAG, strphone); - if(phonenum.equals(strphone.substring(7,11))){ + if(phonenum.equals(strphone.substring(7,11))){//如果手机尾号后四位相等 msg = 1; //phonenum correct Log.d(TAG, "phonenum correct"); - AlertDialog.Builder builder = new AlertDialog.Builder(context); + AlertDialog.Builder builder = new AlertDialog.Builder(context);//弹出快件位置信息 builder.setTitle("快件位置"); builder.setMessage("\n第 "+ map.get("shelfnum")+ " 号货架\n第 " + map.get("floornum")+ " 层"); Looper.prepare(); @@ -89,13 +88,14 @@ public class goodManager { e.printStackTrace(); Log.d(TAG, "search bug: " + e.getMessage()); msg = 0; + } finally { } return msg; } - public boolean delete(String pickupcode){ + public boolean delete(String pickupcode){//根据取件码删除快递 Connection connection = DBOpenHelper.getConn(); try{ @@ -107,9 +107,9 @@ public class goodManager { PreparedStatement ps = connection.prepareStatement(sql); if(ps != null){ Log.e(TAG, "pickupcode: " + pickupcode); - ps.setString(1,pickupcode); + ps.setString(1,pickupcode);//设置参数 - ps.executeUpdate(); + ps.executeUpdate();//删除操作 connection.close(); ps.close(); @@ -132,7 +132,7 @@ public class goodManager { return false; } - public List> nopick(String phonenum){ + public List> nopick(String phonenum){//根据手机号查询未取的件 Connection connection = DBOpenHelper.getConn(); Log.d(TAG, "nopick goods"); @@ -167,7 +167,7 @@ public class goodManager { map.put(field, rs.getString(field)); } } - datalist.add(map); + datalist.add(map);//加入即将显示的列表中 } connection.close(); ps.close(); @@ -186,7 +186,7 @@ public class goodManager { return datalist; } - public int pickup(String pickupcode, String phonenum){ + public int pickup(String pickupcode, String phonenum){//根据取件码与手机号取件 HashMap map = new HashMap<>(); Connection connection = DBOpenHelper.getConn(); @@ -202,7 +202,7 @@ public class goodManager { if(ps != null){ Log.e(TAG, "pickupcode: " + pickupcode); ps.setInt(1,Integer.parseInt(pickupcode)); - ResultSet rs = ps.executeQuery(); + ResultSet rs = ps.executeQuery();//获取要取的件信息 int count = rs.getMetaData().getColumnCount(); while(rs.next()){ @@ -213,12 +213,12 @@ public class goodManager { } connection.close(); ps.close(); - if(map.size() != 0){ + if(map.size() != 0){//如果找不到对应快件 Log.d(TAG, "map has value"); StringBuilder s = new StringBuilder(); for(String key:map.keySet()){ if(key.equals("phonenum")){ - if(phonenum.equals(map.get(key).toString().substring(7,11))){ + if(phonenum.equals(map.get(key).toString().substring(7,11))){//如果手机尾号相等 msg = 1; //password correct }else{ msg = 2; //password incorrect diff --git a/src/Logistics/app/src/main/java/com/example/logistics/manager/operationManager.java b/src/Logistics/app/src/main/java/com/example/logistics/manager/operationManager.java index aa87257..7c928de 100644 --- a/src/Logistics/app/src/main/java/com/example/logistics/manager/operationManager.java +++ b/src/Logistics/app/src/main/java/com/example/logistics/manager/operationManager.java @@ -17,19 +17,17 @@ import java.util.Map; public class operationManager { private static final String TAG = "operationManager"; - public boolean add(String pickupcode, String phonenum){ + public boolean add(String pickupcode, String phonenum){//根据取件码与手机号添加操作记录 HashMap map = new HashMap<>(); Connection connection = DBOpenHelper.getConn(); try{ - SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss"); + Log.d(TAG, "add"); + SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss");//时间格式 Date date = new Date(); - - String time = format1.format(date); - + String time = format1.format(date);//时间格式字符串化 String sql = "insert into operations(pickupcode, phonenum, time) values (?,?,?)"; - if(connection != null){ PreparedStatement ps = connection.prepareStatement(sql); @@ -59,13 +57,16 @@ public class operationManager { } } - public List> history(String phonenum){ + public List> history(String phonenum){//根据手机号查询历史记录 Connection connection = DBOpenHelper.getConn(); - List> datalist; + List> datalist;//查询结果显示列表 datalist = new ArrayList>(); try{ + + Log.d(TAG, "history"); + String sql = "select * from operations where phonenum = ?"; if(connection != null){ diff --git a/src/Logistics/app/src/main/java/com/example/logistics/manager/userManager.java b/src/Logistics/app/src/main/java/com/example/logistics/manager/userManager.java index 8a02005..887d2a1 100644 --- a/src/Logistics/app/src/main/java/com/example/logistics/manager/userManager.java +++ b/src/Logistics/app/src/main/java/com/example/logistics/manager/userManager.java @@ -16,13 +16,16 @@ public class userManager { private static final String TAG = "userManager"; - public int login(String username, String password){ + public int login(String username, String password){//根据用户名与密码登录 HashMap map = new HashMap<>(); Connection connection = DBOpenHelper.getConn(); int msg = 0; try{ + + Log.d(TAG, "login"); + String sql = "select * from users where username = ?"; if(connection != null){ @@ -41,16 +44,16 @@ public class userManager { } connection.close(); ps.close(); - password = MD5Utils.md5(password); + password = MD5Utils.md5(password);//密码md5加密 if(map.size() != 0){ StringBuilder s = new StringBuilder(); for(String key:map.keySet()){ - if(key.equals("password")){ + if(key.equals("password")){//查看password属性 if(password.equals(map.get(key))){ - msg = 1; //password correct + msg = 1; //密码正确 }else{ - msg = 2; //password incorrect + msg = 2; //密码错误 } break; } @@ -68,22 +71,27 @@ public class userManager { msg = 0; } }catch (Exception e){ + e.printStackTrace(); Log.d(TAG, "login bug: " + e.getMessage()); msg = 0; + } finally { } return msg; } - public int loginByPhone(String phonenum, String password){ + public int loginByPhone(String phonenum, String password){//通过手机号登录 HashMap map = new HashMap<>(); Connection connection = DBOpenHelper.getConn(); int msg = 0; try{ + + Log.d(TAG, "loginByPhone"); + String sql = "select * from users where phonenum = ?"; if(connection != null){ @@ -102,6 +110,7 @@ public class userManager { } connection.close(); ps.close(); + password = MD5Utils.md5(password); if(map.size() != 0){ StringBuilder s = new StringBuilder(); @@ -138,11 +147,14 @@ public class userManager { return msg; } - public User findUser(String username){ + public User findUser(String username){//查看是否已有该用户 Connection connection = DBOpenHelper.getConn(); User user = null; try{ + + Log.d(TAG, "findUser"); + String sql = "select * from users where username = ?"; if(connection != null){ PreparedStatement ps = connection.prepareStatement(sql); @@ -156,7 +168,7 @@ public class userManager { String passWord = rs.getString(3); String phoneNum = rs.getString(4); - user = new User(userId, userName, passWord, phoneNum); + user = new User(userId, userName, passWord, phoneNum);//若已有用户,生成用户类并返回 } } } @@ -168,11 +180,14 @@ public class userManager { return user; } - public boolean register(User user){ + public boolean register(User user){//注册功能 HashMap map = new HashMap<>(); Connection connection = DBOpenHelper.getConn(); try{ + + Log.d(TAG, "register"); + String sql = "insert into users(username, password, phonenum) values (?,?,?)"; if(connection != null){ @@ -204,13 +219,16 @@ public class userManager { } } - public int change(String phonenum, String password){ + public int change(String phonenum, String password){//修改密码 HashMap map = new HashMap<>(); Connection connection = DBOpenHelper.getConn(); int msg = 0; try{ + + Log.d(TAG, "change"); + String sql = "update users set password = ? where phonenum = ?"; if(connection != null){ diff --git a/src/Logistics/app/src/main/java/com/example/logistics/tools/DBOpenHelper.java b/src/Logistics/app/src/main/java/com/example/logistics/tools/DBOpenHelper.java index 82b452c..93edf1b 100644 --- a/src/Logistics/app/src/main/java/com/example/logistics/tools/DBOpenHelper.java +++ b/src/Logistics/app/src/main/java/com/example/logistics/tools/DBOpenHelper.java @@ -7,9 +7,9 @@ import java.sql.SQLException; public class DBOpenHelper { private static String diver = "com.mysql.jdbc.Driver"; //加入utf-8是为了后面往表中输入中文,表中不会出现乱码的情况 - private static String url = "jdbc:mysql://192.168.43.139:3306/logistics?characterEncoding=utf-8"; + private static String url = "jdbc:mysql://192.168.43.203:3306/logistics?characterEncoding=utf-8"; private static String user = "root";//用户名 - private static String password = "123...iamfan";//密码 + private static String password = "";//密码 /* * 连接数据库 * */ diff --git a/src/Logistics/app/src/main/java/com/example/logistics/ui/FindUI.java b/src/Logistics/app/src/main/java/com/example/logistics/ui/FindUI.java index 0c5832c..4aed600 100644 --- a/src/Logistics/app/src/main/java/com/example/logistics/ui/FindUI.java +++ b/src/Logistics/app/src/main/java/com/example/logistics/ui/FindUI.java @@ -19,7 +19,7 @@ import androidx.fragment.app.Fragment; import com.example.logistics.R; import com.example.logistics.manager.goodManager; - +//查询快件存放地 public class FindUI extends Fragment implements View.OnClickListener{ private String TAG = "FindUI"; @@ -37,8 +37,9 @@ public class FindUI extends Fragment implements View.OnClickListener{ @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - Log.d(TAG, "onCreate"); - View view = inflater.inflate(R.layout.my_fragment1,container,false); + Log.d(TAG, "onCreateView"); + + View view = inflater.inflate(R.layout.frag_find,container,false); mButton = (Button)view.findViewById(R.id.Sea_Button); mPickUpCode = (EditText)view.findViewById(R.id.Sea_PickUpCode); @@ -67,7 +68,7 @@ public class FindUI extends Fragment implements View.OnClickListener{ @Override public void run(){ goodManager goodManager = new goodManager(); - int msg = goodManager.search(mPickUpCode.getText().toString().trim(), mPhoneNum.getText().toString().trim(), getActivity()); + int msg = goodManager.search(mPickUpCode.getText().toString().trim(), mPhoneNum.getText().toString().trim(), getActivity());//查询快件位置并返回结果 Log.e("Main", "msg"); hand1.sendEmptyMessage(msg); } @@ -78,6 +79,7 @@ public class FindUI extends Fragment implements View.OnClickListener{ final Handler hand1 = new Handler(){ @Override public void handleMessage(Message msg){ + if(msg.what == 0){ Toast.makeText(mContext, "搜索失败", Toast.LENGTH_SHORT).show(); }else if(msg.what == 2){ @@ -85,6 +87,7 @@ public class FindUI extends Fragment implements View.OnClickListener{ }else if(msg.what == 3){ Toast.makeText(mContext, "取件码不存在", Toast.LENGTH_SHORT).show(); } + } }; } diff --git a/src/Logistics/app/src/main/java/com/example/logistics/ui/HistoryUI.java b/src/Logistics/app/src/main/java/com/example/logistics/ui/HistoryUI.java index 3fd1f26..84aea1c 100644 --- a/src/Logistics/app/src/main/java/com/example/logistics/ui/HistoryUI.java +++ b/src/Logistics/app/src/main/java/com/example/logistics/ui/HistoryUI.java @@ -28,6 +28,7 @@ import java.util.Map; public class HistoryUI extends Activity implements OnItemClickListener, OnScrollListener, View.OnClickListener { private String TAG = "HistoryUI"; + //绑定界面元素 private ListView lv_history; private ArrayAdapter arr_adapter; private SimpleAdapter simp_adapter; @@ -37,6 +38,9 @@ public class HistoryUI extends Activity implements OnItemClickListener, OnScroll @Override protected void onCreate(Bundle savedInstanceState) { + + Log.d(TAG, "onCreate"); + super.onCreate(savedInstanceState); setContentView(R.layout.activity_history); sync_his = (ImageButton) findViewById(R.id.sync_his); @@ -52,6 +56,7 @@ public class HistoryUI extends Activity implements OnItemClickListener, OnScroll Intent intent = getIntent(); phonenum = intent.getStringExtra("user"); + Log.d(TAG, "onCreate"); sync(); } @@ -66,12 +71,12 @@ public class HistoryUI extends Activity implements OnItemClickListener, OnScroll public void onClick(View v){ switch(v.getId()){ case R.id.sync_his: - sync(); + sync();//调用同步按钮同步记录 Toast.makeText(this, "同步成功", Toast.LENGTH_SHORT).show(); } } @Override - public void onScrollStateChanged(AbsListView view, int scrollState){ + public void onScrollStateChanged(AbsListView view, int scrollState){//上下划动屏幕查看操作记录 // TODO Auto-generated method stub switch(scrollState){ case SCROLL_STATE_FLING: @@ -94,11 +99,14 @@ public class HistoryUI extends Activity implements OnItemClickListener, OnScroll } public void sync(){ + + Log.d(TAG, "sync"); + new Thread(){ @Override public void run(){ operationManager operationManager = new operationManager(); - dataList = operationManager.history(phonenum); + dataList = operationManager.history(phonenum);//调用operationManager的查询历史记录 int msg = 1; hand1.sendEmptyMessage(msg); diff --git a/src/Logistics/app/src/main/java/com/example/logistics/ui/LoginUI.java b/src/Logistics/app/src/main/java/com/example/logistics/ui/LoginUI.java index 0b8020b..d0bf01d 100644 --- a/src/Logistics/app/src/main/java/com/example/logistics/ui/LoginUI.java +++ b/src/Logistics/app/src/main/java/com/example/logistics/ui/LoginUI.java @@ -20,7 +20,7 @@ import android.widget.Toast; public class LoginUI extends Activity { - private int islogin = 0; + private Button loginButton; private Button signUpButton; private Button forgetButton; @@ -29,6 +29,8 @@ public class LoginUI extends Activity { private Button changeButton; private EditText fphonenum; private EditText fpassword; + + private int islogin = 0; int flag = 0; //flag = 0 是用户名登录;=1是手机号 // 调用Actvity @@ -43,12 +45,13 @@ public class LoginUI extends Activity { forgetButton = (Button) this.findViewById(R.id.forget); phonenumButton = (Button) this.findViewById(R.id.phonenum); - + //设置对话框,引用Activity对象 AlertDialog.Builder builder = new AlertDialog.Builder(LoginUI.this); + //使用别的layout View view2 = View.inflate(LoginUI.this, R.layout.forget, null); - builder.setTitle("取件").setView(view2); + builder.setTitle("忘记密码").setView(view2); alert = builder.create(); @@ -100,6 +103,7 @@ public class LoginUI extends Activity { new View.OnClickListener() { @Override public void onClick(View view) { + //输入提示 userName.setHint("请输入手机号"); flag = 1; } @@ -109,18 +113,22 @@ public class LoginUI extends Activity { } public void change(View view){ + //trim() 方法用于删除字符串的头尾空白符,空白符包括:空格、制表符 tab、换行符等其他空白符等。 String phoneunm = fphonenum.getText().toString().trim(); String password = fpassword.getText().toString().trim(); new Thread() { @Override public void run() { + //后端用来和数据库交互 userManager userManager = new userManager(); + //msg=0代表操作成功 int msg = userManager.change(phoneunm, password); Log.d(TAG, "change"); if(msg != 1){ Log.d(TAG, "pickup,failed"); + //处理异步消息,int类型的msg最终会转化为hander的msg类型 hand2.sendEmptyMessage(msg); return; } @@ -132,6 +140,8 @@ public class LoginUI extends Activity { } public void login(View view){ + + Log.d(TAG, "login"); EditText userName = (EditText) this.findViewById(R.id.UserNameEdit); EditText passWord = (EditText) this.findViewById(R.id.PassWordEdit); @@ -148,10 +158,12 @@ public class LoginUI extends Activity { } Log.e("MAin", "msg"); hand1.sendEmptyMessage(msg); + //msg==1表示登录成功 if(msg == 1){ User owner = userManager.findUser(userName.getText().toString().trim()); Intent intent = new Intent(LoginUI.this, MenuActivity.class); if(flag == 1){ + //不同activity之间传递数据 intent.putExtra("user", userName.getText().toString().trim()); }else{ intent.putExtra("user", owner.getPhoneNum()); diff --git a/src/Logistics/app/src/main/java/com/example/logistics/ui/MenuActivity.java b/src/Logistics/app/src/main/java/com/example/logistics/ui/MenuActivity.java index f4f6724..0a170e4 100644 --- a/src/Logistics/app/src/main/java/com/example/logistics/ui/MenuActivity.java +++ b/src/Logistics/app/src/main/java/com/example/logistics/ui/MenuActivity.java @@ -1,5 +1,4 @@ package com.example.logistics.ui; - import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentTransaction; @@ -18,71 +17,73 @@ import com.example.logistics.R; public class MenuActivity extends AppCompatActivity implements View.OnClickListener{ - private String TAG = "MenuActivity"; - - private LinearLayout ly_one,ly_two,ly_three; - private TextView mTextView1,mTextView2,mTextView3; - private TextView mTextNum1,mTextNum2,mTextNum3; - private ImageView mImageView; + private LinearLayout ly_one,ly_two,ly_three; //线性布局变量 + private TextView mTextView1,mTextView2,mTextView3; //文本框变量 + private TextView mTextNum1,mTextNum2,mTextNum3; //第二类文本框变量 + private ImageView mImageView; //图像视图变量 + //创建一系列成员变量: private Fragment mFrag1; private Fragment mFrag2; private Fragment mFrag3; + //创建Frag变量 - private String owner; + private String owner; //唯一标识用户 @Override protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_menu); + super.onCreate(savedInstanceState); //调用父类的构造函数 + setContentView(R.layout.activity_menu); //将类和布局文件绑定 - bindView(); + bindView(); //调用bindView() Intent intent = getIntent(); owner = intent.getStringExtra("user"); selectTab(0); - } + } //类的构造函数 private void bindView() { ly_one = (LinearLayout)findViewById(R.id.ly_tab_menu_deal); ly_two = (LinearLayout)findViewById(R.id.ly_tab_menu_poi); - ly_three = (LinearLayout)findViewById(R.id.ly_tab_menu_more); + ly_three = (LinearLayout)findViewById(R.id.ly_tab_menu_more); //把三个布局绑定到布局变量上 mTextView1 = (TextView)findViewById(R.id.tab_menu_deal); mTextView2 = (TextView)findViewById(R.id.tab_menu_poi); - mTextView3 = (TextView)findViewById(R.id.tab_menu_more); + mTextView3 = (TextView)findViewById(R.id.tab_menu_more); //把三个文本框绑定到变量上 mTextNum1 = (TextView)findViewById(R.id.tab_menu_deal_num); mTextNum2 = (TextView)findViewById(R.id.tab_menu_poi_num); - mTextNum3 = (TextView)findViewById(R.id.tab_menu_more_num); + mTextNum3 = (TextView)findViewById(R.id.tab_menu_more_num); //把三个第二类文本框绑定到变量上 ly_one.setOnClickListener(this); ly_two.setOnClickListener(this); - ly_three.setOnClickListener(this); - } + ly_three.setOnClickListener(this); //监听器:点击三个区域绑定三个功能 + } //绑定变量和布局元素 - //重置所有文本的选中状态 + //重置所有文本框的选中状态 private void setSelected() { mTextView1.setSelected(false); mTextView2.setSelected(false); mTextView3.setSelected(false); - } + } //每次选中一按钮,先全设为未选中 @Override - public void onClick(View v) { - setSelected(); + public void onClick(View v) { //点击某区域实现某功能 + setSelected(); //全部设为未选中 switch (v.getId()) { - case R.id.ly_tab_menu_deal: - selectTab(0); + case R.id.ly_tab_menu_deal: //倘若点到这个id对应的 + selectTab(0); //使第一个标签变蓝色 break; case R.id.ly_tab_menu_poi: + selectTab(1); break; + case R.id.ly_tab_menu_more: selectTab(2); - break; + break; //分析已点击区域对应的功能 } } diff --git a/src/Logistics/app/src/main/java/com/example/logistics/ui/PickUpUI.java b/src/Logistics/app/src/main/java/com/example/logistics/ui/PickUpUI.java index 37c67c4..cee26ee 100644 --- a/src/Logistics/app/src/main/java/com/example/logistics/ui/PickUpUI.java +++ b/src/Logistics/app/src/main/java/com/example/logistics/ui/PickUpUI.java @@ -52,23 +52,31 @@ public class PickUpUI extends Fragment implements View.OnClickListener{ private int shelfnum = 1; private int floornum = 1; + //后端服务器 private String ws = "ws://192.168.43.203:8080/result"; private String TAG = "PickUpUI"; - int flag = 0; //flag=0:chushi + //flag = 0 代表mbutton为取件;flag = 1 代表mbutton为确认 + int flag = 0; + + public PickUpUI(){ } + //这个注解通常用于消除空指针异常 @Nullable + //用来指定方法重写的,只能修饰方法并且只能用于方法重写,不能修饰其它的元素。它可以强制一个子类必须重写父类方法或者实现接口的方法。 @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View view = inflater.inflate(R.layout.my_fragment2,container,false); + View view = inflater.inflate(R.layout.pickup,container,false); mButton = (Button)view.findViewById(R.id.Pick_Button); mButton.setOnClickListener(this); + + //获得Fragment依附的Activity对象 mContext = getActivity(); Log.i("set", "listner"); @@ -78,6 +86,8 @@ public class PickUpUI extends Fragment implements View.OnClickListener{ } + + void setAlert(){ alert = new android.app.AlertDialog.Builder(mContext) .setTitle("提醒") @@ -93,8 +103,6 @@ public class PickUpUI extends Fragment implements View.OnClickListener{ js.put("op", "confirm"); } catch (JSONException e) { e.printStackTrace(); - } finally { - } flag = 1; @@ -111,12 +119,10 @@ public class PickUpUI extends Fragment implements View.OnClickListener{ JSONObject js = new JSONObject(); try { - js.put("confirm", "no"); + js.put("content", "no"); js.put("op", "confirm"); } catch (JSONException e) { e.printStackTrace(); - } finally { - } client.send(js.toString()); @@ -126,53 +132,7 @@ public class PickUpUI extends Fragment implements View.OnClickListener{ Log.d(TAG, "setAlert"); } - void setWebsocket(){ - URI uri = URI.create(ws); - client = new JWebSocketClient(uri){ - @Override - public void onMessage(String message) { - Log.e("JWebSocketClientService", "收到的消息:" + message); - Log.e("alert",message); - if(message.equals("confirm")){ - alert.dismiss(); - hand2.sendEmptyMessage(3); - Log.e("alert","show"); - } - } - - @Override - public void onOpen(ServerHandshake handshakedata) { - super.onOpen(handshakedata); - Log.e("JWebSocketClientService", "websocket连接成功"); - }; - }; - connect(); - } - - private void connect() { - new Thread() { - @Override - public void run() { - try { - //connectBlocking多出一个等待操作,会先连接再发送,否则未连接发送会报错 - client.connectBlocking(); - } catch (InterruptedException e) { - e.printStackTrace(); - }finally { - - } - } - }.start(); - - } - @SuppressLint("HandlerLeak") - final Handler hand2 = new Handler(){ - @Override - public void handleMessage(Message msg){ - alert.show(); - } - }; @Override public void onClick(View view) { @@ -189,23 +149,7 @@ public class PickUpUI extends Fragment implements View.OnClickListener{ } } - void confirm(){ - JSONObject js = new JSONObject(); - try { - js.put("op","finish"); - client.send(js.toString()); - - flag = 0; - mButton.setText("取件"); - client.onClose(1,"close",true); - Log.d("finish", "over"); - - } catch (JSONException jsonException) { - jsonException.printStackTrace(); - } finally { - } - } public void pickup(){ @@ -214,6 +158,7 @@ public class PickUpUI extends Fragment implements View.OnClickListener{ View view2 = View.inflate(mContext, R.layout.pickup, null); PickUpCode = (EditText) view2.findViewById(R.id.pk_PickUp); + //尾号后四位 PhoneNum = (EditText) view2.findViewById(R.id.pk_PhoneNum); Button button = (Button) view2.findViewById(R.id.pk_button); @@ -236,6 +181,8 @@ public class PickUpUI extends Fragment implements View.OnClickListener{ operationManager operationManager = new operationManager(); goodManager goodManager = new goodManager(); + + //获取menuactivity传来的值 Bundle bundle = getArguments(); String user = bundle.getString("user"); @@ -254,12 +201,9 @@ public class PickUpUI extends Fragment implements View.OnClickListener{ boolean flag1 = operationManager.add(pickupcode, user); boolean flag2 = goodManager.delete(pickupcode); - - if (!flag1) { - msg = 2; - } - if(!flag2){ - msg = 3; + boolean flag = flag1 & flag2; + if (flag) { + msg = 1; } hand1.sendEmptyMessage(msg); @@ -269,6 +213,81 @@ public class PickUpUI extends Fragment implements View.OnClickListener{ }); } + + + void confirm(){ + JSONObject js = new JSONObject(); + try { + js.put("op","finish"); + client.send(js.toString()); + + flag = 0; + mButton.setText("取件"); + client.onClose(1,"close",true); + Log.d("finish", "over"); + + } catch (JSONException jsonException) { + jsonException.printStackTrace(); + } + } + + + + void setWebsocket(){ + URI uri = URI.create(ws); + client = new JWebSocketClient(uri){ + //onMessage()方法在接收到消息时调用 + @Override + public void onMessage(String message) { + Log.e("JWebSocketClientService", "收到的消息:" + message); + Log.e("alert",message); + if(message.equals("confirm")){ + alert.dismiss(); + hand2.sendEmptyMessage(3); + Log.e("alert","show"); + } + } + + //onOpen()方法在websocket连接开启时调用 + @Override + public void onOpen(ServerHandshake handshakedata) { + super.onOpen(handshakedata); + Log.e("JWebSocketClientService", "websocket连接成功"); + } + }; + connect(); + } + + + + + private void connect() { + new Thread() { + @Override + public void run() { + try { + //connectBlocking多出一个等待操作,会先连接再发送,否则未连接发送会报错 + client.connectBlocking(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + }.start(); + + } + + @SuppressLint("HandlerLeak") + final Handler hand2 = new Handler(){ + @Override + public void handleMessage(Message msg){ + alert.show(); + } + }; + + + + + @SuppressLint("HandlerLeak") final Handler hand1 = new Handler() { @Override @@ -279,9 +298,9 @@ public class PickUpUI extends Fragment implements View.OnClickListener{ Toast.makeText(mContext, "加入队列成功", Toast.LENGTH_SHORT).show(); joinQueue(); }else if(msg.what == 2){ - Toast.makeText(mContext, "出库失败", Toast.LENGTH_SHORT).show(); + Toast.makeText(mContext, "手机号错误", Toast.LENGTH_SHORT).show(); }else if(msg.what == 3){ - Toast.makeText(mContext, "保存记录失败", Toast.LENGTH_SHORT).show(); + Toast.makeText(mContext, "取件码不存在", Toast.LENGTH_SHORT).show(); } } }; @@ -296,6 +315,7 @@ public class PickUpUI extends Fragment implements View.OnClickListener{ Log.d(TAG, pickupcode); Log.d(TAG, phonenum); + //将整型数据Integer转换为基本数据类型int con.put("code", Integer.parseInt(pickupcode)); con.put("shelf", shelfnum); con.put("floor", floornum); @@ -304,8 +324,6 @@ public class PickUpUI extends Fragment implements View.OnClickListener{ js.put("op", "connect"); } catch (JSONException jsonException) { jsonException.printStackTrace(); - } finally { - } if (null != client) { diff --git a/src/Logistics/app/src/main/java/com/example/logistics/ui/SearchUI.java b/src/Logistics/app/src/main/java/com/example/logistics/ui/SearchUI.java index 4b99191..dbda1b8 100644 --- a/src/Logistics/app/src/main/java/com/example/logistics/ui/SearchUI.java +++ b/src/Logistics/app/src/main/java/com/example/logistics/ui/SearchUI.java @@ -25,10 +25,10 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -public class SearchUI extends Activity implements OnItemClickListener, OnScrollListener, View.OnClickListener { +public class SearchUI extends Activity implements OnItemClickListener, OnScrollListener, View.OnClickListener {//查询未取快件 private String TAG = "SearchUI"; - + //绑定界面元素 private ListView lv_nopick; private ArrayAdapter arr_adapter; private SimpleAdapter simp_adapter; @@ -38,8 +38,11 @@ public class SearchUI extends Activity implements OnItemClickListener, OnScrollL @Override protected void onCreate(Bundle savedInstanceState) { + + Log.d(TAG, "onCreate"); + super.onCreate(savedInstanceState); - setContentView(R.layout.activity_no_pick); + setContentView(R.layout.activity_search); dataList=new ArrayList>(); lv_nopick = (ListView) findViewById(R.id.lv_nopick); @@ -54,7 +57,7 @@ public class SearchUI extends Activity implements OnItemClickListener, OnScrollL Intent intent = getIntent(); phonenum = intent.getStringExtra("user"); - sync(); + sync();//同步未取快件信息 } @Override @@ -97,11 +100,14 @@ public class SearchUI extends Activity implements OnItemClickListener, OnScrollL } public void sync(){ + + Log.d(TAG, "sync"); + new Thread(){ @Override public void run(){ goodManager goodManager = new goodManager(); - dataList = goodManager.nopick(phonenum); + dataList = goodManager.nopick(phonenum);//掉用goodManager的查询未取件函数 int msg = 1; hand1.sendEmptyMessage(msg); diff --git a/src/Logistics/app/src/main/java/com/example/logistics/ui/SetUI.java b/src/Logistics/app/src/main/java/com/example/logistics/ui/SetUI.java index 7d1ba3a..d4f04d4 100644 --- a/src/Logistics/app/src/main/java/com/example/logistics/ui/SetUI.java +++ b/src/Logistics/app/src/main/java/com/example/logistics/ui/SetUI.java @@ -5,6 +5,7 @@ import androidx.fragment.app.Fragment; import android.content.Context; import android.content.Intent; import android.os.Bundle; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -18,7 +19,7 @@ import com.example.logistics.R; public class SetUI extends Fragment implements View.OnClickListener{ private String TAG = "SetUI"; - + //绑定界面元素 private LinearLayout ll_waiting; private LinearLayout ll_history; private LinearLayout ll_exit; @@ -32,7 +33,10 @@ public class SetUI extends Fragment implements View.OnClickListener{ @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View view = inflater.inflate(R.layout.my_fragment3,container,false); + + Log.d(TAG, "onCreateView"); + + View view = inflater.inflate(R.layout.frag_set,container,false); ll_waiting = (LinearLayout) view.findViewById(R.id.waiting); ll_history = (LinearLayout) view.findViewById(R.id.history); @@ -54,20 +58,22 @@ public class SetUI extends Fragment implements View.OnClickListener{ public void onClick(View view) { Intent intent; switch(view.getId()){ - case R.id.waiting: + case R.id.waiting://跳转到未取件界面 + Log.d(TAG, "waiting"); intent = new Intent(mContext, SearchUI.class); - intent.putExtra("user", user); + intent.putExtra("user", user);//将用户信息一并发过去 startActivity(intent); break; - case R.id.history: - + case R.id.history://跳转到历史记录界面 + Log.d(TAG, "history"); intent = new Intent(mContext, HistoryUI.class); - intent.putExtra("user", user); + intent.putExtra("user", user);//将用户信息一并发过去 startActivity(intent); break; - case R.id.exit: + case R.id.exit://跳转到退出登录界面 + Log.d(TAG, "exit"); Toast.makeText(mContext, "exit", Toast.LENGTH_SHORT).show(); - intent = new Intent(mContext, LoginUI.class); + intent = new Intent(mContext, LoginUI.class);//跳转到loginUI类 startActivity(intent); getActivity().finish(); break; diff --git a/src/Logistics/app/src/main/java/com/example/logistics/ui/SignUpUI.java b/src/Logistics/app/src/main/java/com/example/logistics/ui/SignUpUI.java index b1a9528..cf3619a 100644 --- a/src/Logistics/app/src/main/java/com/example/logistics/ui/SignUpUI.java +++ b/src/Logistics/app/src/main/java/com/example/logistics/ui/SignUpUI.java @@ -6,7 +6,6 @@ import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; -import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; @@ -16,38 +15,35 @@ import com.example.logistics.R; import com.example.logistics.manager.userManager; import com.example.logistics.entity.User; +//signup UI +//UI from android public class SignUpUI extends Activity { - - private String TAG = "SignUpUI"; - @Override protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); setContentView(R.layout.activity_sign_up); Button signUpButton = (Button) this.findViewById(R.id.SignUpButton); Button backLoginButton = (Button) this.findViewById(R.id.BackLoginButton); + //注册按钮 signUpButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { - Log.d(TAG, "SignUp:onClick"); register(v); } } ); - + //返回按钮 // 返回登录按钮监听器 backLoginButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { - // 跳转到登录界面 - Log.d(TAG, "BackLogin:onClick"); - + // 建立;跳转 Intent intent = new Intent(SignUpUI.this, LoginUI.class); + //执行 startActivity(intent); } } @@ -55,48 +51,32 @@ public class SignUpUI extends Activity { } - public void register(View view){ - - Log.d(TAG, "register"); + public void register(View view){ + //获取 EditText userName = (EditText) this.findViewById(R.id.UserNameEdit); EditText passWord = (EditText) this.findViewById(R.id.PassWordEdit); EditText passWordAgain = (EditText) this.findViewById(R.id.PassWordAgainEdit); EditText phone = (EditText) this.findViewById(R.id.PhoneEdit); + //编辑 String strUserName = userName.getText().toString().trim(); String strPassWord = passWord.getText().toString().trim(); String strPassWordAgain = passWordAgain.getText().toString().trim(); String strPhoneNumber = phone.getText().toString().trim(); + //输入判断 if (strUserName.length() > 10) { - - Log.d(TAG, "username out of length"); Toast.makeText(SignUpUI.this, "用户名长度必须小于10!", Toast.LENGTH_SHORT).show(); - } else if (strUserName.length() == 0) { - - Log.d(TAG, "username is none"); Toast.makeText(SignUpUI.this, "用户名不能为空!", Toast.LENGTH_SHORT).show(); - } else if (strPassWord.length() > 16) { - - Log.d(TAG, "password out of length"); Toast.makeText(SignUpUI.this, "密码长度必须小于16!", Toast.LENGTH_SHORT).show(); - } else if (strPassWord.length() == 0) { - - Log.d(TAG, "password is none"); Toast.makeText(SignUpUI.this, "密码不能为空!", Toast.LENGTH_SHORT).show(); - } else if (!strPassWord.equals(strPassWordAgain)) { - - Log.d(TAG, "password is not same"); Toast.makeText(SignUpUI.this, "两次密码输入不一致!", Toast.LENGTH_SHORT).show(); - } else { - - Log.d(TAG, "register success"); Toast.makeText(SignUpUI.this, "注册成功!", Toast.LENGTH_SHORT).show(); User user = new User(); @@ -104,30 +84,21 @@ public class SignUpUI extends Activity { user.setPassWord(strPassWord); user.setPhoneNum(strPhoneNumber); + //数据库查询,得出msg new Thread(){ @Override public void run(){ - - Log.d(TAG, "register thread"); int msg = 0; userManager userManager = new userManager(); User uu = userManager.findUser(user.getUserName()); if(uu != null){ - - Log.d(TAG, "have this account"); msg = 1; //have this account - }else{ - - Log.d(TAG, "have no this account"); boolean flag = userManager.register(user); if(flag){ - - Log.d(TAG, "register success"); msg = 2; - } } hand.sendEmptyMessage(msg); @@ -136,27 +107,19 @@ public class SignUpUI extends Activity { } } + //根据msg显示 @SuppressLint("HandlerLeak") final Handler hand = new Handler(){ public void handleMessage(Message msg){ - - Log.d(TAG, "msg is:" + msg.toString()); - if(msg.what == 0){ - Toast.makeText(getApplicationContext(), "注册失败", Toast.LENGTH_SHORT).show(); - }else if(msg.what == 1){ - Toast.makeText(getApplicationContext(), "该账号已存在,请换一个注册", Toast.LENGTH_SHORT).show(); - }else if(msg.what == 2){ - Toast.makeText(getApplicationContext(), "注册成功", Toast.LENGTH_SHORT).show(); - + //于是自动跳转登录界面 Intent intent = new Intent(SignUpUI.this, LoginUI.class); startActivity(intent); - } } }; diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/Example.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/Example.java new file mode 100644 index 0000000..c4f8fd2 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/Example.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros; + +import com.jilk.ros.message.ros.message.Clock; +import com.jilk.ros.message.ros.message.Log; +import com.jilk.ros.message.ros.rosapi.message.Empty; +import com.jilk.ros.message.ros.rosapi.message.GetTime; +import com.jilk.ros.message.ros.rosapi.message.MessageDetails; +import com.jilk.ros.message.ros.rosapi.message.Type; +import com.jilk.ros.message.ros.rosbridge.ROSBridgeClient; + +public class Example { + + public Example() {} + + public static void main(String[] args) { + ROSBridgeClient client = new ROSBridgeClient("ws://162.243.238.80:9090"); + client.connect(); + //testTopic(client); + try { + testService(client); + } + catch (RuntimeException ex) { + ex.printStackTrace(); + } + finally { + client.disconnect(); + } + } + + public static void testService(ROSBridgeClient client) { + try { + Service timeService = + new Service("/rosapi/get_time", Empty.class, GetTime.class, client); + timeService.verify(); + //System.out.println("Time (secs): " + timeService.callBlocking(new Empty()).time.sec); + + Service serviceTypeService = + new Service("/rosapi/service_type", + com.jilk.ros.message.ros.rosapi.message.Service.class, Type.class, client); + serviceTypeService.verify(); + String type = serviceTypeService.callBlocking(new com.jilk.ros.message.ros.rosapi.message.Service("/rosapi/service_response_details")).type; + + Service serviceDetails = + new Service("/rosapi/service_response_details", + Type.class, MessageDetails.class, client); + serviceDetails.verify(); + //serviceDetails.callBlocking(new Type(type)).print(); + + Topic logTopic = + new Topic("/rosout", Log.class, client); + logTopic.verify(); + + /* + System.out.println("Nodes"); + for (String s : client.getNodes()) + System.out.println(" " + s); + System.out.println("Topics"); + for (String s : client.getTopics()) { + System.out.println(s + ":"); + client.getTopicMessageDetails(s).print(); + } + System.out.println("Services"); + for (String s : client.getServices()) { + System.out.println(s + ":"); + client.getServiceRequestDetails(s).print(); + System.out.println("-----------------"); + client.getServiceResponseDetails(s).print(); + } + */ + } + catch (InterruptedException ex) { + System.out.println("Process was interrupted."); + } finally { + + } + /* + Service topicService = + new Service("/rosapi/topics", Empty.class, Topics.class, client); + Service typeService = + new Service("/rosapi/topic_type", Topic.class, Type.class, client); + Service messageService = + new Service("/rosapi/message_details", Type.class, MessageDetails.class, client); + try { + Topics topics = topicService.callBlocking(new Empty()); + for (String topicString : topics.topics) { + Topic topic = new Topic(); + topic.topic = topicString; + Type type = typeService.callBlocking(topic); + MessageDetails details = messageService.callBlocking(type); + System.out.println("Topic: " + topic.topic + " Type: " + type.type); + details.print(); + System.out.println(); + } + Type type = new Type(); + type.type = "time"; + System.out.print("Single type check on \'time\': "); + messageService.callBlocking(type).print(); + } + catch (InterruptedException ex) { + System.out.println("testService: process was interrupted."); + } + */ + } + + public static void testTopic(ROSBridgeClient client) { + Topic clockTopic = new Topic("/clock", Clock.class, client); + clockTopic.subscribe(); + try { + Thread.sleep(20000);} catch(InterruptedException ex) {}finally { + + } + Clock cl = null; + try { + cl = clockTopic.take(); // just gets one + } + catch (InterruptedException ex) {}finally { + + } + cl.print(); + cl.clock.nsecs++; + clockTopic.unsubscribe(); + clockTopic.advertise(); + clockTopic.publish(cl); + clockTopic.unadvertise(); + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/MessageHandler.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/MessageHandler.java new file mode 100644 index 0000000..650f05a --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/MessageHandler.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros; + +import com.jilk.ros.message.ros.message.Message; + +public interface MessageHandler { + public void onMessage(T message); +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/ROSClient.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/ROSClient.java new file mode 100644 index 0000000..3f7216c --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/ROSClient.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.rosapi.message.TypeDef; +import com.jilk.ros.message.ros.rosbridge.FullMessageHandler; +import com.jilk.ros.message.ros.rosbridge.ROSBridgeClient; +import com.jilk.ros.message.ros.rosbridge.operation.Operation; + +public abstract class ROSClient { + + public ROSClient() {} + + public static ROSClient create(String uriString) { + // if we ever implement other ROSClient types, we'll key off the URI protocol (e.g., ws://) + // we'd also have to abstract out Topic and Service since they depend on the ROSBridge operations + return new ROSBridgeClient(uriString); + } + + public abstract boolean connect(); + public abstract boolean connect(ConnectionStatusListener listener); + public abstract void disconnect(); + public abstract void send(Operation operation); + public abstract void send(String json); + public abstract void register(Class c, + String s, + Class m, + FullMessageHandler h); + public abstract void unregister(Class c, String s); + public abstract void setDebug(boolean debug); + public abstract String[] getNodes() throws InterruptedException; + public abstract String[] getTopics() throws InterruptedException; + public abstract String[] getServices() throws InterruptedException; + public abstract TypeDef getTopicMessageDetails(String topic) throws InterruptedException; + public abstract TypeDef[] getTopicMessageList(String topic) throws InterruptedException; + public abstract TypeDef getServiceRequestDetails(String service) throws InterruptedException; + public abstract TypeDef[] getServiceRequestList(String service) throws InterruptedException; + public abstract TypeDef getServiceResponseDetails(String service) throws InterruptedException; + public abstract TypeDef[] getServiceResponseList(String service) throws InterruptedException; + public abstract TypeDef getTypeDetails(String type) throws InterruptedException; + public abstract TypeDef[] getTypeList(String type) throws InterruptedException; + public abstract void typeMatch(TypeDef t, Class c) throws InterruptedException; + public abstract Object getUnderlyingClient(); // for debugging + + public interface ConnectionStatusListener { + public void onConnect(); + public void onDisconnect(boolean normal, String reason, int code); + public void onError(Exception ex); + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/Service.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/Service.java new file mode 100644 index 0000000..8c1e3b7 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/Service.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.rosbridge.FullMessageHandler; +import com.jilk.ros.message.ros.rosbridge.operation.CallService; +import com.jilk.ros.message.ros.rosbridge.operation.ServiceResponse; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CountDownLatch; + +public class Service extends Message implements FullMessageHandler { + private String service; + private Class responseType; + private Class callType; + private ROSClient client; + private Map calls; + + public Service(String service, Class callType, + Class responseType, ROSClient client) { + this.service = service; + this.client = client; + this.responseType = responseType; + this.callType = callType; + calls = new HashMap(); + } + + // A result can only be returned once; it is cleared from the hash before + // being sent/returned. This is to ensure that results do not accumulate + // indefinitely. If callers need to keep these around they can set up their + // own hash. + + @Override + public void onMessage(String id, Message response) { + //System.out.print("Service.onMessage: "); + //response.print(); + CallRecord call = calls.get(id); + if(call == null) { + System.out.print("No caller service response"); + return; + } + if (call.handler != null) { + calls.remove(id); + call.handler.onMessage((ResponseType) response); + } + else { + call.result = (ResponseType) response; + call.latch.countDown(); + } + } + + public String call(CallType args) { + return callImpl(args, null); + } + + public void callWithHandler(CallType args, MessageHandler responseHandler) { + callImpl(args, responseHandler); + } + + public ResponseType callBlocking(CallType args) throws InterruptedException { + return take(call(args)); + } + + private String callImpl(CallType args, MessageHandler responseHandler) { + client.register(ServiceResponse.class, service, responseType, this); // do this once on creation? + CallService messageCallService = new CallService(service, args); + String id = messageCallService.id; + CallRecord callRecord = new CallRecord(responseHandler); + calls.put(id, callRecord); + client.send(messageCallService); + return id; + } + + public ResponseType poll(String id) { + CallRecord call = calls.get(id); + if (call.result != null) + calls.remove(id); + return call.result; + } + + public ResponseType take(String id) throws InterruptedException { + CallRecord call = calls.get(id); + call.latch.await(); + calls.remove(id); + return call.result; + } + + public void verify() throws InterruptedException { + + boolean hasService = false; + for (String s : client.getServices()) { + if (s.equals(service)) { + hasService = true; + break; + } + } + if (!hasService) + throw new RuntimeException("Service \'" + service + "\' not available."); + + client.typeMatch(client.getServiceRequestDetails(service), callType); + client.typeMatch(client.getServiceResponseDetails(service), responseType); + } + + private class CallRecord { + public ResponseType result; + public CountDownLatch latch; + public MessageHandler handler; + + public CallRecord(MessageHandler handler) { + this.result = null; + this.latch = new CountDownLatch(1); + this.handler = handler; + } + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/Topic.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/Topic.java new file mode 100644 index 0000000..7b1a811 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/Topic.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.rosbridge.FullMessageHandler; +import com.jilk.ros.message.ros.rosbridge.operation.Advertise; +import com.jilk.ros.message.ros.rosbridge.operation.Operation; +import com.jilk.ros.message.ros.rosbridge.operation.Publish; +import com.jilk.ros.message.ros.rosbridge.operation.Subscribe; +import com.jilk.ros.message.ros.rosbridge.operation.Unadvertise; +import com.jilk.ros.message.ros.rosbridge.operation.Unsubscribe; + +import java.util.concurrent.LinkedBlockingQueue; + + +public class Topic extends LinkedBlockingQueue implements FullMessageHandler { + protected String topic; + private Class type; + private String messageType; + private ROSClient client; + private Thread handlerThread; + + public Topic(String topic, Class type, ROSClient client) { + this.topic = topic; + this.client = client; + this.type = type; + messageType = Message.getMessageType(type); + handlerThread = null; + } + + @Override + public void onMessage(String id, Message message) { + add((T) message); + } + + + // warning: there is a delay between the completion of this method and + // the completion of the subscription; it takes longer than + // publishing multiple other messages, for example. + public void subscribe(MessageHandler handler) { + startRunner(handler); + subscribe(); + } + + public void subscribe() { + client.register(Publish.class, topic, type, this); + send(new Subscribe(topic, messageType)); + } + + public void unsubscribe() { + // need to handle race conditions in incoming message handler + // so that once unsubscribe has happened the handler gets no more + // messages + send(new Unsubscribe(topic)); + client.unregister(Publish.class, topic); + stopRunner(); + } + + private void startRunner(MessageHandler handler) { + stopRunner(); + handlerThread = new Thread(new MessageRunner(handler)); + handlerThread.setName("Message handler for " + topic); + handlerThread.start(); + } + + private void stopRunner() { + if (handlerThread != null) { + handlerThread.interrupt(); + clear(); + handlerThread = null; + } + } + + + public void advertise() { + send(new Advertise(topic, messageType)); + } + + public void publish(T message) { + send(new Publish(topic, message)); + } + + public void unadvertise() { + send(new Unadvertise(topic)); + } + + private void send(Operation operation) { + client.send(operation); + } + + public void verify() throws InterruptedException { + + boolean hasTopic = false; + for (String s : client.getTopics()) { + if (s.equals(topic)) { + hasTopic = true; + break; + } + } + if (!hasTopic) + throw new RuntimeException("Topic \'" + topic + "\' not available."); + + client.typeMatch(client.getTopicMessageDetails(topic), type); + } + + private class MessageRunner implements Runnable { + private MessageHandler handler; + + public MessageRunner(MessageHandler handler) { + this.handler = handler; + } + + @Override + public void run() { + while (!Thread.interrupted()) { + try { + handler.onMessage(take()); + } + catch (InterruptedException ex) { + break; + } finally { + + } + } + } + } + +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/map/WayPointUtil.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/map/WayPointUtil.java new file mode 100644 index 0000000..fcb3717 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/map/WayPointUtil.java @@ -0,0 +1,1046 @@ +package com.jilk.ros.message.ros.map; + +import java.util.List; + +/** + * Created by super_yu on 27/10/2017. + */ + +public class WayPointUtil { + + /** + * goal_timeout : 0 + * name : pose_charge + * header : {"seq":0,"frame_id":"initial_pose","stamp":{"secs":0,"nsecs":0}} + * close_enough : 0 + * failure_mode : LOOP + * pose : {"orientation":{"z":6.72817E-5,"x":0.00212954,"w":0.999965,"y":0.00806749},"position":{"z":-1.11391E-5,"x":0.0140563,"y":-0.00219822}} + */ + + private List waypoints; + + public List getWaypoints() { + return waypoints; + } + + public void setWaypoints(List waypoints) { + this.waypoints = waypoints; + } + + public static class WaypointsBean { + private int goal_timeout; + private String name; + /** + * seq : 0 + * frame_id : initial_pose + * stamp : {"secs":0,"nsecs":0} + */ + + private HeaderBean header; + private double close_enough; + private String failure_mode; + /** + * orientation : {"z":6.72817E-5,"x":0.00212954,"w":0.999965,"y":0.00806749} + * position : {"z":-1.11391E-5,"x":0.0140563,"y":-0.00219822} + */ + + private PoseBean pose; + + public int getGoal_timeout() { + return goal_timeout; + } + + public void setGoal_timeout(int goal_timeout) { + this.goal_timeout = goal_timeout; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public HeaderBean getHeader() { + return header; + } + + public void setHeader(HeaderBean header) { + this.header = header; + } + + public double getClose_enough() { + return close_enough; + } + + public void setClose_enough(double close_enough) { + this.close_enough = close_enough; + } + + public String getFailure_mode() { + return failure_mode; + } + + public void setFailure_mode(String failure_mode) { + this.failure_mode = failure_mode; + } + + public PoseBean getPose() { + return pose; + } + + public void setPose(PoseBean pose) { + this.pose = pose; + } + + public static class HeaderBean { + private int seq; + private String frame_id; + /** + * secs : 0 + * nsecs : 0 + */ + + private StampBean stamp; + + public int getSeq() { + return seq; + } + + public void setSeq(int seq) { + this.seq = seq; + } + + public String getFrame_id() { + return frame_id; + } + + public void setFrame_id(String frame_id) { + this.frame_id = frame_id; + } + + public StampBean getStamp() { + return stamp; + } + + public void setStamp(StampBean stamp) { + this.stamp = stamp; + } + + public static class StampBean { + private int secs; + private int nsecs; + + public int getSecs() { + return secs; + } + + public void setSecs(int secs) { + this.secs = secs; + } + + public int getNsecs() { + return nsecs; + } + + public void setNsecs(int nsecs) { + this.nsecs = nsecs; + } + } + } + + public static class PoseBean { + /** + * z : 6.72817E-5 + * x : 0.00212954 + * w : 0.999965 + * y : 0.00806749 + */ + + private OrientationBean orientation; + /** + * z : -1.11391E-5 + * x : 0.0140563 + * y : -0.00219822 + */ + + private PositionBean position; + + public OrientationBean getOrientation() { + return orientation; + } + + public void setOrientation(OrientationBean orientation) { + this.orientation = orientation; + } + + public PositionBean getPosition() { + return position; + } + + public void setPosition(PositionBean position) { + this.position = position; + } + + public static class OrientationBean { + private double z; + private double x; + private double w; + private double y; + + public double getZ() { + return z; + } + + public void setZ(double z) { + this.z = z; + } + + public double getX() { + return x; + } + + public void setX(double x) { + this.x = x; + } + + public double getW() { + return w; + } + + public void setW(double w) { + this.w = w; + } + + public double getY() { + return y; + } + + public void setY(double y) { + this.y = y; + } + } + + public static class PositionBean { + private double z; + private double x; + private double y; + + public double getZ() { + return z; + } + + public void setZ(double z) { + this.z = z; + } + + public double getX() { + return x; + } + + public void setX(double x) { + this.x = x; + } + + public double getY() { + return y; + } + + public void setY(double y) { + this.y = y; + } + } + } + } + + /** + * { + "waypoints": [ + { + "goal_timeout": 0, + "name": "pose_charge", + "header": { + "seq": 0, + "frame_id": "initial_pose", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "LOOP", + "pose": { + "orientation": { + "z": 0.0000672817, + "x": 0.00212954, + "w": 0.999965, + "y": 0.00806749 + }, + "position": { + "z": -0.0000111391, + "x": 0.0140563, + "y": -0.00219822 + } + } + }, + { + "goal_timeout": 0, + "name": "map_dockBegin", + "header": { + "seq": 0, + "frame_id": "map", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "LOOP", + "pose": { + "orientation": { + "z": 0.0000672817, + "x": 0.00212954, + "w": 0.999965, + "y": 0.00806749 + }, + "position": { + "z": -0.0000111391, + "x": -0.335944, + "y": -0.00224531 + } + } + }, + { + "goal_timeout": 0, + "name": "pubsuber_charge_adjust", + "header": { + "seq": 0, + "frame_id": "pubsuber", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "charge_adjust_done", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "pubsuber_auto_charge", + "header": { + "seq": 0, + "frame_id": "pubsuber", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "3", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "vel_forward", + "header": { + "seq": 0, + "frame_id": "cmd_vel", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0.05000000074505806, + "failure_mode": "NONE", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "vel_stop", + "header": { + "seq": 0, + "frame_id": "cmd_vel", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "NONE", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "vel_backward", + "header": { + "seq": 0, + "frame_id": "cmd_vel", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": -0.05000000074505806, + "failure_mode": "NONE", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "pub_bumper_on", + "header": { + "seq": 0, + "frame_id": "publisher", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "NONE", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "pub_bumper_off", + "header": { + "seq": 0, + "frame_id": "publisher", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "NONE", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "pub_estop_on", + "header": { + "seq": 0, + "frame_id": "publisher", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "NONE", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "pub_estop_off", + "header": { + "seq": 0, + "frame_id": "publisher", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "NONE", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "pub_estop_auto", + "header": { + "seq": 0, + "frame_id": "publisher", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "NONE", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "pub_light_r", + "header": { + "seq": 0, + "frame_id": "publisher", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "NONE", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "pub_light_g", + "header": { + "seq": 0, + "frame_id": "publisher", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "NONE", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "pub_light_b", + "header": { + "seq": 0, + "frame_id": "publisher", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "NONE", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "pub_light_y", + "header": { + "seq": 0, + "frame_id": "publisher", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "NONE", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "sound_sound_on", + "header": { + "seq": 0, + "frame_id": "sound_play", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "START", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "sound_sound_off", + "header": { + "seq": 0, + "frame_id": "sound_play", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "STOP", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "sound_sound_play_once", + "header": { + "seq": 0, + "frame_id": "sound_play", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "ONCE", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "scanMarker_scan_9", + "header": { + "seq": 0, + "frame_id": "scan_marker", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0.8999999761581421, + "failure_mode": "LOOP", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "scanMarker_scan_8", + "header": { + "seq": 0, + "frame_id": "scan_marker", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0.800000011920929, + "failure_mode": "LOOP", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "scanMarker_scan_7", + "header": { + "seq": 0, + "frame_id": "scan_marker", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0.699999988079071, + "failure_mode": "LOOP", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "scanMarker_scan_6", + "header": { + "seq": 0, + "frame_id": "scan_marker", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0.6000000238418579, + "failure_mode": "LOOP", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "scanMarker_scan_5", + "header": { + "seq": 0, + "frame_id": "scan_marker", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0.5, + "failure_mode": "LOOP", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "scanMarker_scan_4", + "header": { + "seq": 0, + "frame_id": "scan_marker", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0.4000000059604645, + "failure_mode": "LOOP", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 6, + "name": "timer_sail", + "header": { + "seq": 0, + "frame_id": "timer", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "NONE", + "pose": { + "orientation": { + "z": 0, + "x": 0, + "w": 1, + "y": 0 + }, + "position": { + "z": 0, + "x": 0, + "y": 0 + } + } + }, + { + "goal_timeout": 0, + "name": "map_6_A_601", + "header": { + "seq": 0, + "frame_id": "map", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "LOOP", + "pose": { + "orientation": { + "z": -0.710356, + "x": 0.00568841, + "w": 0.70382, + "y": 0.000206077 + }, + "position": { + "z": 0.0000268415, + "x": -5.43955, + "y": 0.441982 + } + } + }, + { + "goal_timeout": 0, + "name": "scanMarker_6_A_O", + "header": { + "seq": 0, + "frame_id": "scan_marker", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "LOOP", + "pose": { + "orientation": { + "z": -0.00584617, + "x": 0.00134079, + "w": 0.999976, + "y": -0.00348327 + }, + "position": { + "z": 0.0095544, + "x": -0.00660459, + "y": -0.0187305 + } + } + }, + { + "goal_timeout": 0, + "name": "map_6_A_602", + "header": { + "seq": 0, + "frame_id": "map", + "stamp": { + "secs": 0, + "nsecs": 0 + } + }, + "close_enough": 0, + "failure_mode": "LOOP", + "pose": { + "orientation": { + "z": 0.673475, + "x": 0.00818346, + "w": 0.739164, + "y": 0.00151504 + }, + "position": { + "z": 0.000584151, + "x": -2.65592, + "y": 0.365388 + } + } + } + ] + } + */ +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/AudioMsg.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/AudioMsg.java new file mode 100644 index 0000000..1a0f5d0 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/AudioMsg.java @@ -0,0 +1,9 @@ +package com.jilk.ros.message.ros.message; + +/** + * Created by xxhong on 16-11-17. + */ +@MessageType(string = "std_msgs/Int16MultiArray") +public class AudioMsg extends Message { + public short[] data; +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Clock.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Clock.java new file mode 100644 index 0000000..48b02a6 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Clock.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.message; + +@MessageType(string = "rosgraph_msgs/Clock") +public class Clock extends Message { + public TimePrimitive clock; +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Duration.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Duration.java new file mode 100644 index 0000000..2e89b37 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Duration.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.message; + +@MessageType(string = "std_msgs/Duration") +public class Duration extends DurationPrimitive { +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/DurationPrimitive.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/DurationPrimitive.java new file mode 100644 index 0000000..7e69340 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/DurationPrimitive.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.message; + +@MessageType(string = "duration") +public class DurationPrimitive extends TimePrimitive { + +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Empty.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Empty.java new file mode 100644 index 0000000..04b486e --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Empty.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.message; + +@MessageType(string = "std_srvs/Empty") +public class Empty extends Message { +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Header.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Header.java new file mode 100644 index 0000000..437e400 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Header.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.message; + +@MessageType(string = "std_msgs/Header") +public class Header extends Message { + public long seq; + public TimePrimitive stamp; + public String frame_id; +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Log.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Log.java new file mode 100644 index 0000000..65713f9 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Log.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.message; + +@MessageType(string = "rosgraph_msgs/Log") +public class Log extends Message { + public Header header; + public byte level; + public String name; + public String msg; + public String file; + public String function; + public long line; + public String[] topics; +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Message.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Message.java new file mode 100644 index 0000000..543e1dd --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Message.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.message; + +import java.lang.reflect.Array; +import java.lang.reflect.Field; +import java.util.Map; + + +@MessageType(string = "message") +public abstract class Message { + + // Some requirements about message types: + // - It must have a MessageType declaration to be recognized on inbound messages + // - Every field must be explicitly designated as public + // - Every field that is not a primitive or near-primitive must be another Message class + // - If there is a non-empty constructor, you must also have an empty constructor + // - If it is set up as an inner class, it needs an explicit nullary constructor + // (note: I have seen an inner class otherwise fail, I have not tested it with the explicit constructor) + + public static void register(Class c, Map messageClasses) { + try { + typecheck(c); + + // Must register the class and not have duplicate + // This is not recursive because only the top level message class + // needs to be determined from the string - others are top-down. + String messageString = getMessageType(c); + Class existingClass = messageClasses.get(messageString); + if (existingClass != null && !existingClass.equals(c)) + throw new MessageException("Message String \'" + messageString + + "\' is assigned to two different classes (" + + c.getName() + " and " + existingClass.getName() + ")"); + messageClasses.put(messageString, c); + } + catch (MessageException ex) { + // should be changed to be a hooked method to give library user control + System.out.println(ex.getMessage()); + }finally { + + } + } + + public static String getMessageType(Class c) { + return ((MessageType) c.getAnnotation(MessageType.class)).string(); + } + + // this has never been used or tested but kind of belongs here + // commented out because it uses ReflectiveOperationException which is not available on Android + /* + public static Message newInstance(String className) { + try { + Class messageClass = Class.forName(className); + if (Message.class.isAssignableFrom(messageClass)) + return (Message) messageClass.newInstance(); + else throw new ClassCastException(); + } + catch (ReflectiveOperationException ex) { + throw new RuntimeException("Unable to create message of class \'" + className + "\'.", ex); + } + } + */ + + // Could probably do more checking here, but not sure what right now + private static void typecheck(Class c) throws MessageException { + + // Must inherit from Message + if (!Message.class.isAssignableFrom(c)) + throw new MessageException("Class \'" + c.getName() + + "\' does not extend Message"); + + // Must have the MessageType annotation + if (getMessageType(c) == null) + throw new MessageException("Class \'" + c.getName() + + "\' is missing the MessageType annotation"); + + // All fields must also be valid Message classes + // Note that this also serves to force-load all the message classes + // so that they get registered + for (Field f : c.getFields()) { + Class fc = f.getType(); + if (fc.isArray()) { + Class ac = fc.getComponentType(); + if (!isPrimitive(ac)) + typecheck(ac); + } + else if (!isPrimitive(fc)) + typecheck(fc); + } + } + + public void print() { + printMessage(this, ""); + } + + private static void printMessage(Object o, String indent) { + for (Field f : o.getClass().getFields()) { + Class c = f.getType(); + Object fieldObject = getFieldObject(f, o); + if (fieldObject != null) { + if (isPrimitive(c)) + System.out.println(indent + f.getName() + ": " + fieldObject); + else if (c.isArray()) { + System.out.println(indent + f.getName() + ": ["); + printArray(fieldObject, indent + " "); + System.out.println(indent + "]"); + } + else { + System.out.println(indent + f.getName() + ":"); + printMessage(fieldObject, indent + " "); + } + } + } + } + + private static void printArray(Object array, String indent) { + Class arrayClass = array.getClass().getComponentType(); + for (int i = 0; i < Array.getLength(array); i++) { + Object elementObject = Array.get(array, i); + if (elementObject != null) { + if (isPrimitive(arrayClass)) + System.out.println(indent + i + ": " + elementObject); + else if (arrayClass.isArray()) { // this is not actually allowed in ROS + System.out.println(indent + i + ": ["); + printArray(elementObject, indent + " "); + System.out.println(indent + "]"); + } + else { + System.out.println(indent + i + ":"); + printMessage(elementObject, indent + " "); + } + } + } + // remember to print array indices + } + + public static boolean isPrimitive(Class c) { + return (c.isPrimitive() || + c.equals(String.class) || + Number.class.isAssignableFrom(c) || + c.equals(Boolean.class)); + } + + + // Copied from com.jilk.ros.rosbridge.JSON + private static Object getFieldObject(Field f, Object o) { + Object fo = null; + try { + fo = f.get(o); + } + catch (IllegalAccessException ex) { + ex.printStackTrace(); + } + finally { + + } + return fo; + } + + public void copyFrom(Message source) { + try { + if (source.getClass() != getClass()) + throw new RuntimeException("Attempt to copy non-matching classes"); + for (Field f : getClass().getFields()) { + Class fc = f.getType(); + if (fc.isArray()) + throw new RuntimeException("copyFrom - array types not implemented"); + else if (!isPrimitive(fc)) + ((Message) f.get(this)).copyFrom((Message) f.get(source)); + else { + Object value = f.get(source); + f.set(this, value); + } + } + } + catch (IllegalAccessException ex) { + throw new RuntimeException("copyFrom error", ex); + } + catch (ClassCastException ex) { + throw new RuntimeException("copyFrom error", ex); + } + finally { + + } + // ReflectiveOperationException is not available on Android (Java 1.6) + /* + catch (ReflectiveOperationException ex) { + throw new RuntimeException ("copyFrom error", ex); + } + */ + } + +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/MessageException.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/MessageException.java new file mode 100644 index 0000000..f5e8348 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/MessageException.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.message; + +public class MessageException extends Exception { + + public MessageException(String message) { + super(message); + } + + public MessageException(String message, Throwable cause) { + super(message, cause); + } +} + diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/MessageType.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/MessageType.java new file mode 100644 index 0000000..e858a1b --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/MessageType.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.message; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface MessageType { + String string() default ""; +} + diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/SemanticRequest.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/SemanticRequest.java new file mode 100644 index 0000000..b3d1f55 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/SemanticRequest.java @@ -0,0 +1,13 @@ +package com.jilk.ros.message.ros.message; + +/** + * Created by xxhong on 16-11-17. + */ +@MessageType(string = "std_msgs/String") +public class SemanticRequest extends Message { + public SemanticRequest(String args) { + jsonStr = args; + } + + public String jsonStr; +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/SemanticResponse.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/SemanticResponse.java new file mode 100644 index 0000000..42de0e4 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/SemanticResponse.java @@ -0,0 +1,9 @@ +package com.jilk.ros.message.ros.message; + +/** + * Created by xxhong on 16-11-17. + */ +@MessageType(string = "std_msgs/String") +public class SemanticResponse extends Message { + public String result; +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/StdMsg.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/StdMsg.java new file mode 100644 index 0000000..3d2e677 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/StdMsg.java @@ -0,0 +1,9 @@ +package com.jilk.ros.message.ros.message; + +/** + * Created by xxhong on 16-11-17. + */ +@MessageType(string = "std_msgs/String") +public class StdMsg extends Message { + public String data; +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Time.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Time.java new file mode 100644 index 0000000..93d90a3 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/Time.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.message; + +@MessageType(string = "std_msgs/Time") +public class Time extends TimePrimitive { +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/TimePrimitive.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/TimePrimitive.java new file mode 100644 index 0000000..c4bafbc --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/message/TimePrimitive.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.message; + +@MessageType(string = "time") +public class TimePrimitive extends Message { + public int secs; // when requesting this format from ROSbridge, it uses 'sec' (no 's') + public int nsecs; // when requesting this format from ROSbridge, it uses 'nsec' +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/model/FootPrintResult.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/model/FootPrintResult.java new file mode 100644 index 0000000..4d4540d --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/model/FootPrintResult.java @@ -0,0 +1,178 @@ +package com.jilk.ros.message.ros.model; + +import java.util.List; + +/** + * Created by super_yu on 2018/1/8. + */ + +public class FootPrintResult { + /** + * header : {"seq":4297,"frame_id":"odom","stamp":{"secs":1515378187,"nsecs":125325857}} + * polygon : {"points":[{"z":0,"x":0.31369608640670776,"y":-0.5355392694473267},{"z":0,"x":0.35115259885787964,"y":-0.016890067607164383},{"z":0,"x":-0.30713292956352234,"y":0.03065088950097561},{"z":0,"x":-0.3445894420146942,"y":-0.4879983365535736}]} + */ + + private HeaderBean header; + private PolygonBean polygon; + + public HeaderBean getHeader() { + return header; + } + + public void setHeader(HeaderBean header) { + this.header = header; + } + + public PolygonBean getPolygon() { + return polygon; + } + + public void setPolygon(PolygonBean polygon) { + this.polygon = polygon; + } + + public static class HeaderBean { + /** + * seq : 4297 + * frame_id : odom + * stamp : {"secs":1515378187,"nsecs":125325857} + */ + + private int seq; + private String frame_id; + private StampBean stamp; + + public int getSeq() { + return seq; + } + + public void setSeq(int seq) { + this.seq = seq; + } + + public String getFrame_id() { + return frame_id; + } + + public void setFrame_id(String frame_id) { + this.frame_id = frame_id; + } + + public StampBean getStamp() { + return stamp; + } + + public void setStamp(StampBean stamp) { + this.stamp = stamp; + } + + public static class StampBean { + /** + * secs : 1515378187 + * nsecs : 125325857 + */ + + private int secs; + private int nsecs; + + public int getSecs() { + return secs; + } + + public void setSecs(int secs) { + this.secs = secs; + } + + public int getNsecs() { + return nsecs; + } + + public void setNsecs(int nsecs) { + this.nsecs = nsecs; + } + } + } + + public static class PolygonBean { + private List points; + + public List getPoints() { + return points; + } + + public void setPoints(List points) { + this.points = points; + } + + public static class PointsBean { + /** + * z : 0 + * x : 0.31369608640670776 + * y : -0.5355392694473267 + */ + + private int z; + private double x; + private double y; + + public int getZ() { + return z; + } + + public void setZ(int z) { + this.z = z; + } + + public double getX() { + return x; + } + + public void setX(double x) { + this.x = x; + } + + public double getY() { + return y; + } + + public void setY(double y) { + this.y = y; + } + } + } + +// { +// "header": { +// "seq": 4297, +// "frame_id": "odom", +// "stamp": { +// "secs": 1515378187, +// "nsecs": 125325857 +// } +// }, +// "polygon": { +// "points": [ +// { +// "z": 0, +// "x": 0.31369608640670776, +// "y": -0.5355392694473267 +// }, +// { +// "z": 0, +// "x": 0.35115259885787964, +// "y": -0.016890067607164383 +// }, +// { +// "z": 0, +// "x": -0.30713292956352234, +// "y": 0.03065088950097561 +// }, +// { +// "z": 0, +// "x": -0.3445894420146942, +// "y": -0.4879983365535736 +// } +// ] +// } +// } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/model/InitPoseResult.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/model/InitPoseResult.java new file mode 100644 index 0000000..5a39217 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/model/InitPoseResult.java @@ -0,0 +1,274 @@ +package com.jilk.ros.message.ros.model; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by super_yu on 2018/2/5. + */ + +public class InitPoseResult { + + /** + * op : publish + * topic : /initialpose + * msg : {"header":{"frame_id":"map"},"pose":{"pose":{"position":{"x":0,"y":0,"z":0},"orientation":{"x":0,"y":0,"z":0,"w":1}},"covariance":[0.25,0,0,0,0,0,0,0.25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.06853891945200942]}} + */ + + private String op = "publish"; + private String topic = "/initialpose"; + private MsgBean msg; + + + public MsgBean getMsg() { + return msg; + } + + public void setMsg(MsgBean msg) { + this.msg = msg; + } + + public static class MsgBean { + /** + * header : {"frame_id":"map"} + * pose : {"pose":{"position":{"x":0,"y":0,"z":0},"orientation":{"x":0,"y":0,"z":0,"w":1}},"covariance":[0.25,0,0,0,0,0,0,0.25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.06853891945200942]} + */ + + private HeaderBean header; + private PoseBeanX pose; + + public HeaderBean getHeader() { + return header; + } + + public void setHeader(HeaderBean header) { + this.header = header; + } + + public PoseBeanX getPose() { + return pose; + } + + public void setPose(PoseBeanX pose) { + this.pose = pose; + } + + public static class HeaderBean { + /** + * frame_id : map + */ + + private String frame_id = "map"; + } + + public static class PoseBeanX { + /** + * pose : {"position":{"x":0,"y":0,"z":0},"orientation":{"x":0,"y":0,"z":0,"w":1}} + * covariance : + * 0.25,0,0,0,0,0,0,0.25, + * 0,0,0,0,0,0,0,0,0,0,0, + * 0,0,0,0,0,0,0,0,0,0,0, + * 0,0,0,0,0,0.06853891945200942 + */ + + private PoseBean pose; + private List covariance; + + public PoseBean getPose() { + return pose; + } + + public void setPose(PoseBean pose) { + this.pose = pose; + } + + public void setCovariance() { + covariance = new ArrayList(); + for (int i = 0; i < 36; i++) { + if (i == 0) { + covariance.add(0.25); + } else if (i == 7) { + covariance.add(0.25); + } else if (i == 35) { + covariance.add(0.06853891945200942); + + } else { + covariance.add((double) 0); + } + } + } + + public static class PoseBean { + /** + * position : {"x":0,"y":0,"z":0} + * orientation : {"x":0,"y":0,"z":0,"w":1} + */ + + private PositionBean position; + private OrientationBean orientation; + + public PositionBean getPosition() { + return position; + } + + public void setPosition(PositionBean position) { + this.position = position; + } + + public OrientationBean getOrientation() { + return orientation; + } + + public void setOrientation(OrientationBean orientation) { + this.orientation = orientation; + } + + public static class PositionBean { + /** + * x : 0 + * y : 0 + * z : 0 + */ + + private double x; + private double y; + private double z; + + public double getX() { + return x; + } + + public void setX(double x) { + this.x = x; + } + + public double getY() { + return y; + } + + public void setY(double y) { + this.y = y; + } + + public double getZ() { + return z; + } + + public void setZ(double z) { + this.z = z; + } + } + + public static class OrientationBean { + /** + * x : 0 + * y : 0 + * z : 0 + * w : 1 + */ + + private double x; + private double y; + private double z; + private double w; + + public double getX() { + return x; + } + + public void setX(double x) { + this.x = x; + } + + public double getY() { + return y; + } + + public void setY(double y) { + this.y = y; + } + + public double getZ() { + return z; + } + + public void setZ(double z) { + this.z = z; + } + + public double getW() { + return w; + } + + public void setW(double w) { + this.w = w; + } + } + } + } + } + + +// { +// "op": "publish", +// "topic": "/initialpose", +// "msg": { +// "header": { +// "frame_id": "map" +// }, +// "pose": { +// "pose": { +// "position": { +// "x": 0, +// "y": 0, +// "z": 0 +// }, +// "orientation": { +// "x": 0, +// "y": 0, +// "z": 0, +// "w": 1 +// } +// }, +// "covariance": [ +// 0.25, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0.25, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0.06853891945200942 +// ] +// } +// } +// } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/model/PoiResult.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/model/PoiResult.java new file mode 100644 index 0000000..582903f --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/model/PoiResult.java @@ -0,0 +1,501 @@ +package com.jilk.ros.message.ros.model; + +/** + * Created by super_yu on 2018/1/5. + */ + +import java.util.List; + +/** + *对位置移动有数据变化的是 + * orientation z、w + * position x、y + * twist x + * angular z + * Created by super_yu on 2017/9/29. + */ + +public class PoiResult { + + /** + * twist : {"twist":{"angular":{"z":0,"y":0,"x":0},"linear":{"z":0,"y":0,"x":0}},"covariance":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]} + * child_frame_id : base_footprint + * pose : {"covariance":[0.1,0,0,0,0,0,0,0.1,0,0,0,0,0,0,1.7976931348623157E308,0,0,0,0,0,0,1.7976931348623157E308,0,0,0,0,0,0,1.7976931348623157E308,0,0,0,0,0,0,0.2],"pose":{"position":{"z":0,"y":-0.16137039724419636,"x":0.001470031525333453},"orientation":{"w":-0.08271030624895466,"z":-0.9965736326234024,"y":"-0","x":0}}} + * header : {"seq":69712,"stamp":{"secs":1506650141,"nsecs":455670567},"frame_id":"odom"} + */ + + private TwistBeanX twist; + private String child_frame_id; + private PoseBeanX pose; + private HeaderBean header; + + public TwistBeanX getTwist() { + return twist; + } + + public void setTwist(TwistBeanX twist) { + this.twist = twist; + } + + public String getChild_frame_id() { + return child_frame_id; + } + + public void setChild_frame_id(String child_frame_id) { + this.child_frame_id = child_frame_id; + } + + public PoseBeanX getPose() { + return pose; + } + + public void setPose(PoseBeanX pose) { + this.pose = pose; + } + + public HeaderBean getHeader() { + return header; + } + + public void setHeader(HeaderBean header) { + this.header = header; + } + + public static class TwistBeanX { + /** + * twist : {"angular":{"z":0,"y":0,"x":0},"linear":{"z":0,"y":0,"x":0}} + * covariance : [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] + */ + + private TwistBean twist; + private List covariance; + + public TwistBean getTwist() { + return twist; + } + + public void setTwist(TwistBean twist) { + this.twist = twist; + } + + public List getCovariance() { + return covariance; + } + + public void setCovariance(List covariance) { + this.covariance = covariance; + } + + public static class TwistBean { + /** + * angular : {"z":0,"y":0,"x":0} + * linear : {"z":0,"y":0,"x":0} + */ + + private AngularBean angular; + private LinearBean linear; + + public AngularBean getAngular() { + return angular; + } + + public void setAngular(AngularBean angular) { + this.angular = angular; + } + + public LinearBean getLinear() { + return linear; + } + + public void setLinear(LinearBean linear) { + this.linear = linear; + } + + public static class AngularBean { + /** + * z : 0 + * y : 0 + * x : 0 + */ + + private int z; + private int y; + private int x; + + public int getZ() { + return z; + } + + public void setZ(int z) { + this.z = z; + } + + public int getY() { + return y; + } + + public void setY(int y) { + this.y = y; + } + + public int getX() { + return x; + } + + public void setX(int x) { + this.x = x; + } + } + + public static class LinearBean { + /** + * z : 0 + * y : 0 + * x : 0 + */ + + private int z; + private int y; + private int x; + + public int getZ() { + return z; + } + + public void setZ(int z) { + this.z = z; + } + + public int getY() { + return y; + } + + public void setY(int y) { + this.y = y; + } + + public int getX() { + return x; + } + + public void setX(int x) { + this.x = x; + } + } + } + } + + public static class PoseBeanX { + /** + * covariance : [0.1,0,0,0,0,0,0,0.1,0,0,0,0,0,0,1.7976931348623157E308,0,0,0,0,0,0,1.7976931348623157E308,0,0,0,0,0,0,1.7976931348623157E308,0,0,0,0,0,0,0.2] + * pose : {"position":{"z":0,"y":-0.16137039724419636,"x":0.001470031525333453},"orientation":{"w":-0.08271030624895466,"z":-0.9965736326234024,"y":"-0","x":0}} + */ + + private PoseBean pose; + private List covariance; + + public PoseBean getPose() { + return pose; + } + + public void setPose(PoseBean pose) { + this.pose = pose; + } + + public List getCovariance() { + return covariance; + } + + public void setCovariance(List covariance) { + this.covariance = covariance; + } + + public static class PoseBean { + /** + * position : {"z":0,"y":-0.16137039724419636,"x":0.001470031525333453} + * orientation : {"w":-0.08271030624895466,"z":-0.9965736326234024,"y":"-0","x":0} + */ + + private PositionBean position; + private OrientationBean orientation; + + public PositionBean getPosition() { + return position; + } + + public void setPosition(PositionBean position) { + this.position = position; + } + + public OrientationBean getOrientation() { + return orientation; + } + + public void setOrientation(OrientationBean orientation) { + this.orientation = orientation; + } + + public static class PositionBean { + /** + * z : 0 + * y : -0.16137039724419636 + * x : 0.001470031525333453 + */ + + private int z; + private double y; + private double x; + + public int getZ() { + return z; + } + + public void setZ(int z) { + this.z = z; + } + + public double getY() { + return y; + } + + public void setY(double y) { + this.y = y; + } + + public double getX() { + return x; + } + + public void setX(double x) { + this.x = x; + } + } + + public static class OrientationBean { + /** + * w : -0.08271030624895466 + * z : -0.9965736326234024 + * y : -0 + * x : 0 + */ + + private double w; + private double z; + private String y; + private int x; + + public double getW() { + return w; + } + + public void setW(double w) { + this.w = w; + } + + public double getZ() { + return z; + } + + public void setZ(double z) { + this.z = z; + } + + public String getY() { + return y; + } + + public void setY(String y) { + this.y = y; + } + + public int getX() { + return x; + } + + public void setX(int x) { + this.x = x; + } + } + } + } + + public static class HeaderBean { + /** + * seq : 69712 + * stamp : {"secs":1506650141,"nsecs":455670567} + * frame_id : odom + */ + + private int seq; + private StampBean stamp; + private String frame_id; + + public int getSeq() { + return seq; + } + + public void setSeq(int seq) { + this.seq = seq; + } + + public StampBean getStamp() { + return stamp; + } + + public void setStamp(StampBean stamp) { + this.stamp = stamp; + } + + public String getFrame_id() { + return frame_id; + } + + public void setFrame_id(String frame_id) { + this.frame_id = frame_id; + } + + public static class StampBean { + /** + * secs : 1506650141 + * nsecs : 455670567 + */ + + private int secs; + private int nsecs; + + public int getSecs() { + return secs; + } + + public void setSecs(int secs) { + this.secs = secs; + } + + public int getNsecs() { + return nsecs; + } + + public void setNsecs(int nsecs) { + this.nsecs = nsecs; + } + } + } + +// +// { +// "twist": { +// "twist": { +// "angular": { +// "z": 0, +// "y": 0, +// "x": 0 +// }, +// "linear": { +// "z": 0, +// "y": 0, +// "x": 0 +// } +// }, +// "covariance": [ +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0 +// ] +// }, +// "child_frame_id": "base_footprint", +// "pose": { +// "covariance": [ +// 0.1, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0.1, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 1.7976931348623157E308, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 1.7976931348623157E308, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 1.7976931348623157E308, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0, +// 0.2 +// ], +// "pose": { +// "position": { +// "z": 0, +// "y": -0.16137039724419636, +// "x": 0.001470031525333453 +// }, +// "orientation": { +// "w": -0.08271030624895466, +// "z": -0.9965736326234024, +// "y": -0, +// "x": 0 +// } +// } +// }, +// "header": { +// "seq": 69712, +// "stamp": { +// "secs": 1506650141, +// "nsecs": 455670567 +// }, +// "frame_id": "odom" +// } +// } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/nav/Move_Base_Goal.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/nav/Move_Base_Goal.java new file mode 100644 index 0000000..855e18f --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/nav/Move_Base_Goal.java @@ -0,0 +1,246 @@ +package com.jilk.ros.message.ros.nav; + +/** + * Created by super_yu on 27/10/2017. + */ + +public class Move_Base_Goal { + /** + * msg : {"target_pose":{"header":{"frame_id":"/map"},"pose":{"w":0.72508,"x":0.00455891,"y":0.0110448,"z":-0.688561}},"base_position":{"header":{"frame_id":"/map"},"pose":{"x":-5.56034,"y":0.543951,"z":2.96803E-4}}} + * op : publish + * topic : /move_base/goal + */ + + private MsgBean msg; + private String op = "publish"; + private String topic = "/move_base/goal"; + + public MsgBean getMsg() { + return msg; + } + + public void setMsg(MsgBean msg) { + this.msg = msg; + } + + public String getOp() { + return op; + } + + public String getTopic() { + return topic; + } + + public static class MsgBean { + /** + * target_pose : {"header":{"frame_id":"/map"},"pose":{"w":0.72508,"x":0.00455891,"y":0.0110448,"z":-0.688561}} + * base_position : {"header":{"frame_id":"/map"},"pose":{"x":-5.56034,"y":0.543951,"z":2.96803E-4}} + */ + + private TargetPoseBean target_pose; + private BasePositionBean base_position; + + public TargetPoseBean getTarget_pose() { + return target_pose; + } + + public void setTarget_pose(TargetPoseBean target_pose) { + this.target_pose = target_pose; + } + + public BasePositionBean getBase_position() { + return base_position; + } + + public void setBase_position(BasePositionBean base_position) { + this.base_position = base_position; + } + + public static class TargetPoseBean { + /** + * header : {"frame_id":"/map"} + * pose : {"w":0.72508,"x":0.00455891,"y":0.0110448,"z":-0.688561} + */ + + private HeaderBean header; + private PoseBean pose; + + public HeaderBean getHeader() { + return header; + } + + public void setHeader(HeaderBean header) { + this.header = header; + } + + public PoseBean getPose() { + return pose; + } + + public void setPose(PoseBean pose) { + this.pose = pose; + } + + public static class HeaderBean { + /** + * frame_id : /map + */ + + private String frame_id = "/map"; + + public String getFrame_id() { + return frame_id; + } + } + + public static class PoseBean { + /** + * w : 0.72508 + * x : 0.00455891 + * y : 0.0110448 + * z : -0.688561 + */ + + private double w; + private double x; + private double y; + private double z; + + public double getW() { + return w; + } + + public void setW(double w) { + this.w = w; + } + + public double getX() { + return x; + } + + public void setX(double x) { + this.x = x; + } + + public double getY() { + return y; + } + + public void setY(double y) { + this.y = y; + } + + public double getZ() { + return z; + } + + public void setZ(double z) { + this.z = z; + } + } + } + + public static class BasePositionBean { + /** + * header : {"frame_id":"/map"} + * pose : {"x":-5.56034,"y":0.543951,"z":2.96803E-4} + */ + + private HeaderBeanX header; + private PoseBeanX pose; + + public HeaderBeanX getHeader() { + return header; + } + + public void setHeader(HeaderBeanX header) { + this.header = header; + } + + public PoseBeanX getPose() { + return pose; + } + + public void setPose(PoseBeanX pose) { + this.pose = pose; + } + + public static class HeaderBeanX { + /** + * frame_id : /map + */ + + private String frame_id = "/map"; + + public String getFrame_id() { + return frame_id; + } + } + + public static class PoseBeanX { + /** + * x : -5.56034 + * y : 0.543951 + * z : 2.96803E-4 + */ + + private double x; + private double y; + private double z; + + public double getX() { + return x; + } + + public void setX(double x) { + this.x = x; + } + + public double getY() { + return y; + } + + public void setY(double y) { + this.y = y; + } + + public double getZ() { + return z; + } + + public void setZ(double z) { + this.z = z; + } + } + } + } + + +// { +// "op": "publish", +// "topic": "/move_base/goal", +// "msg": { +// "target_pose": { +// "header": { +// "frame_id": "/map" +// }, +// "pose": { +// "z": -0.695688, +// "x": 0.000728705, +// "w": 0.71834, +// "y": 0.00213251 +// } +// }, +// "base_position": { +// "header": { +// "frame_id": "/map" +// }, +// "pose": { +// "z": 0.00984454, +// "x": -0.0483838, +// "y": -0.00480753 +// } +// } +// } +// } +} \ No newline at end of file diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/nav/Move_Base_Status.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/nav/Move_Base_Status.java new file mode 100644 index 0000000..260e7cf --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/nav/Move_Base_Status.java @@ -0,0 +1,219 @@ +package com.jilk.ros.message.ros.nav; + +import java.util.List; + +/** + * Created by super_yu on 30/10/2017. + */ + +public class Move_Base_Status { + /** + * status_list : [{"goal_id":{"id":"map_6_A_603","stamp":{"secs":1509348841,"nsecs":490135242}},"text":"Goal reached.","status":3},{"goal_id":{"id":"map_6_A_601","stamp":{"secs":1509348875,"nsecs":650002258}},"text":"This goal has been accepted by the simple action server","status":1}] + * header : {"seq":13516,"frame_id":"","stamp":{"secs":1509348876,"nsecs":156902566}} + */ + + private HeaderBean header; + private List status_list; + + public HeaderBean getHeader() { + return header; + } + + public void setHeader(HeaderBean header) { + this.header = header; + } + + public List getStatus_list() { + return status_list; + } + + public void setStatus_list(List status_list) { + this.status_list = status_list; + } + + public static class HeaderBean { + /** + * seq : 13516 + * frame_id : + * stamp : {"secs":1509348876,"nsecs":156902566} + */ + + private int seq; + private String frame_id; + private StampBean stamp; + + public int getSeq() { + return seq; + } + + public void setSeq(int seq) { + this.seq = seq; + } + + public String getFrame_id() { + return frame_id; + } + + public void setFrame_id(String frame_id) { + this.frame_id = frame_id; + } + + public StampBean getStamp() { + return stamp; + } + + public void setStamp(StampBean stamp) { + this.stamp = stamp; + } + + public static class StampBean { + /** + * secs : 1509348876 + * nsecs : 156902566 + */ + + private int secs; + private int nsecs; + + public int getSecs() { + return secs; + } + + public void setSecs(int secs) { + this.secs = secs; + } + + public int getNsecs() { + return nsecs; + } + + public void setNsecs(int nsecs) { + this.nsecs = nsecs; + } + } + } + + public static class StatusListBean { + /** + * goal_id : {"id":"map_6_A_603","stamp":{"secs":1509348841,"nsecs":490135242}} + * text : Goal reached. + * status : 3 + */ + + private GoalIdBean goal_id; + private String text; + private int status; + + public GoalIdBean getGoal_id() { + return goal_id; + } + + public void setGoal_id(GoalIdBean goal_id) { + this.goal_id = goal_id; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public static class GoalIdBean { + /** + * id : map_6_A_603 + * stamp : {"secs":1509348841,"nsecs":490135242} + */ + + private String id; + private StampBeanX stamp; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public StampBeanX getStamp() { + return stamp; + } + + public void setStamp(StampBeanX stamp) { + this.stamp = stamp; + } + + public static class StampBeanX { + /** + * secs : 1509348841 + * nsecs : 490135242 + */ + + private int secs; + private int nsecs; + + public int getSecs() { + return secs; + } + + public void setSecs(int secs) { + this.secs = secs; + } + + public int getNsecs() { + return nsecs; + } + + public void setNsecs(int nsecs) { + this.nsecs = nsecs; + } + } + } + } + + +// { +// "status_list": [ +// { +// "goal_id": { +// "id": "map_6_A_603", +// "stamp": { +// "secs": 1509348841, +// "nsecs": 490135242 +// } +// }, +// "text": "Goal reached.", +// "status": 3 +// }, +// { +// "goal_id": { +// "id": "map_6_A_601", +// "stamp": { +// "secs": 1509348875, +// "nsecs": 650002258 +// } +// }, +// "text": "This goal has been accepted by the simple action server", +// "status": 1 +// } +// ], +// "header": { +// "seq": 13516, +// "frame_id": "", +// "stamp": { +// "secs": 1509348876, +// "nsecs": 156902566 +// } +// } +// } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/nav/NavPublich.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/nav/NavPublich.java new file mode 100644 index 0000000..53c950d --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/nav/NavPublich.java @@ -0,0 +1,37 @@ +package com.jilk.ros.message.ros.nav; + +import java.util.HashMap; +import java.util.List; + +/** + * 存储导航对象 + * Created by super_yu on 27/10/2017. + */ + +public class NavPublich { + + private List wayPointsNames; + + private HashMap navPublishHashMap; + + public List getWayPointsNames() { + return wayPointsNames; + } + + public void setWayPointsNames(List wayPointsNames) { + this.wayPointsNames = wayPointsNames; + } + + public HashMap getNavPublishHashMap() { + return navPublishHashMap; + } + + public void setNavPublishHashMap(HashMap navPublishHashMap) { + this.navPublishHashMap = navPublishHashMap; + } + + public void clear() { + if (wayPointsNames != null) wayPointsNames.clear(); + if (navPublishHashMap != null) navPublishHashMap.clear(); + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/nav/TMove_Base_Goal.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/nav/TMove_Base_Goal.java new file mode 100644 index 0000000..04f9cb6 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/nav/TMove_Base_Goal.java @@ -0,0 +1,402 @@ +package com.jilk.ros.message.ros.nav; + +/** + * Created by super_yu on 30/10/2017. + */ + +public class TMove_Base_Goal { + /** + * op : publish + * topic : /move_base/goal + * msg : {"header":{"seq":0,"stamp":{"secs":0,"nsecs":0},"frame_id":"map"},"goal_id":{"stamp":{"secs":0,"nsecs":0},"id":"map_6_A_601"},"goal":{"target_pose":{"header":{"seq":0,"stamp":{"secs":0,"nsecs":0},"frame_id":"map"},"pose":{"position":{"z":2.96803E-4,"x":-5.56034,"y":0.543951},"orientation":{"z":-0.688561,"x":0.00455891,"w":0.72508,"y":0.0110448}}}}} + */ + private String op = "publish"; + private String topic = "/move_base/goal"; + private MsgBean msg; + + public String getOp() { + return op; + } + + public String getTopic() { + return topic; + } + + public MsgBean getMsg() { + return msg; + } + + public void setMsg(MsgBean msg) { + this.msg = msg; + } + + public static class MsgBean { + /** + * header : {"seq":0,"stamp":{"secs":0,"nsecs":0},"frame_id":"map"} + * goal_id : {"stamp":{"secs":0,"nsecs":0},"id":"map_6_A_601"} + * goal : {"target_pose":{"header":{"seq":0,"stamp":{"secs":0,"nsecs":0},"frame_id":"map"},"pose":{"position":{"z":2.96803E-4,"x":-5.56034,"y":0.543951},"orientation":{"z":-0.688561,"x":0.00455891,"w":0.72508,"y":0.0110448}}}} + */ + + private HeaderBean header; + private GoalIdBean goal_id; + private GoalBean goal; + + public HeaderBean getHeader() { + return header; + } + + public void setHeader(HeaderBean header) { + this.header = header; + } + + public GoalIdBean getGoal_id() { + return goal_id; + } + + public void setGoal_id(GoalIdBean goal_id) { + this.goal_id = goal_id; + } + + public GoalBean getGoal() { + return goal; + } + + public void setGoal(GoalBean goal) { + this.goal = goal; + } + + public static class HeaderBean { + /** + * seq : 0 + * stamp : {"secs":0,"nsecs":0} + * frame_id : map + */ + + private int seq = 0; + private StampBean stamp; + private String frame_id = "map"; + + public int getSeq() { + return seq; + } + + public StampBean getStamp() { + return stamp; + } + + public void setStamp(StampBean stamp) { + this.stamp = stamp; + } + + public String getFrame_id() { + return frame_id; + } + + public static class StampBean { + /** + * secs : 0 + * nsecs : 0 + */ + + private int secs = 0; + private int nsecs = 0; + + public int getSecs() { + return secs; + } + + public int getNsecs() { + return nsecs; + } + } + } + + public static class GoalIdBean { + /** + * stamp : {"secs":0,"nsecs":0} + * id : map_6_A_601 + */ + + private StampBeanX stamp; + + private String id; + + public StampBeanX getStamp() { + return stamp; + } + + public void setStamp(StampBeanX stamp) { + this.stamp = stamp; + } + + public void setId(String id) { + this.id = id; + } + + public String getId() { + return id; + } + + public static class StampBeanX { + /** + * secs : 0 + * nsecs : 0 + */ + + private int secs = 0; + private int nsecs = 0; + + public int getSecs() { + return secs; + } + + public int getNsecs() { + return nsecs; + } + } + } + + public static class GoalBean { + /** + * target_pose : {"header":{"seq":0,"stamp":{"secs":0,"nsecs":0},"frame_id":"map"},"pose":{"position":{"z":2.96803E-4,"x":-5.56034,"y":0.543951},"orientation":{"z":-0.688561,"x":0.00455891,"w":0.72508,"y":0.0110448}}} + */ + + private TargetPoseBean target_pose; + + public TargetPoseBean getTarget_pose() { + return target_pose; + } + + public void setTarget_pose(TargetPoseBean target_pose) { + this.target_pose = target_pose; + } + + public static class TargetPoseBean { + /** + * header : {"seq":0,"stamp":{"secs":0,"nsecs":0},"frame_id":"map"} + * pose : {"position":{"z":2.96803E-4,"x":-5.56034,"y":0.543951},"orientation":{"z":-0.688561,"x":0.00455891,"w":0.72508,"y":0.0110448}} + */ + + private HeaderBeanX header; + private PoseBean pose; + + public HeaderBeanX getHeader() { + return header; + } + + public void setHeader(HeaderBeanX header) { + this.header = header; + } + + public PoseBean getPose() { + return pose; + } + + public void setPose(PoseBean pose) { + this.pose = pose; + } + + public static class HeaderBeanX { + /** + * seq : 0 + * stamp : {"secs":0,"nsecs":0} + * frame_id : map + */ + + private int seq = 0; + private StampBeanXX stamp; + private String frame_id = "map"; + + public int getSeq() { + return seq; + } + + public StampBeanXX getStamp() { + return stamp; + } + + public void setStamp(StampBeanXX stamp) { + this.stamp = stamp; + } + + public String getFrame_id() { + return frame_id; + } + + public static class StampBeanXX { + /** + * secs : 0 + * nsecs : 0 + */ + + private int secs = 0; + private int nsecs = 0; + + public int getSecs() { + return secs; + } + + public int getNsecs() { + return nsecs; + } + } + } + + public static class PoseBean { + /** + * position : {"z":2.96803E-4,"x":-5.56034,"y":0.543951} + * orientation : {"z":-0.688561,"x":0.00455891,"w":0.72508,"y":0.0110448} + */ + + private PositionBean position; + private OrientationBean orientation; + + public PositionBean getPosition() { + return position; + } + + public void setPosition(PositionBean position) { + this.position = position; + } + + public OrientationBean getOrientation() { + return orientation; + } + + public void setOrientation(OrientationBean orientation) { + this.orientation = orientation; + } + + public static class PositionBean { + /** + * z : 2.96803E-4 + * x : -5.56034 + * y : 0.543951 + */ + + private double z; + private double x; + private double y; + + public double getZ() { + return z; + } + + public void setZ(double z) { + this.z = z; + } + + public double getX() { + return x; + } + + public void setX(double x) { + this.x = x; + } + + public double getY() { + return y; + } + + public void setY(double y) { + this.y = y; + } + } + + public static class OrientationBean { + /** + * z : -0.688561 + * x : 0.00455891 + * w : 0.72508 + * y : 0.0110448 + */ + + private double z; + private double x; + private double w; + private double y; + + public double getZ() { + return z; + } + + public void setZ(double z) { + this.z = z; + } + + public double getX() { + return x; + } + + public void setX(double x) { + this.x = x; + } + + public double getW() { + return w; + } + + public void setW(double w) { + this.w = w; + } + + public double getY() { + return y; + } + + public void setY(double y) { + this.y = y; + } + } + } + } + } + } + +// { +// "op": "publish", +// "topic": "/move_base/goal", +// "msg": { +// "header": { +// "seq": 0, +// "stamp": { +// "secs": 0, +// "nsecs": 0 +// }, +// "frame_id": "map" +// }, +// "goal_id": { +// "stamp": { +// "secs": 0, +// "nsecs": 0 +// }, +// "id": "map_6_A_601" +// }, +// "goal": { +// "target_pose": { +// "header": { +// "seq": 0, +// "stamp": { +// "secs": 0, +// "nsecs": 0 +// }, +// "frame_id": "map" +// }, +// "pose": { +// "position": { +// "z": 0.000296803, +// "x": -5.56034, +// "y": 0.543951 +// }, +// "orientation": { +// "z": -0.688561, +// "x": 0.00455891, +// "w": 0.72508, +// "y": 0.0110448 +// } +// } +// } +// } +// } +// } +} \ No newline at end of file diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/net/NetBroadcastReceiver.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/net/NetBroadcastReceiver.java new file mode 100644 index 0000000..c91a0f7 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/net/NetBroadcastReceiver.java @@ -0,0 +1,22 @@ +package com.jilk.ros.message.ros.net; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.net.ConnectivityManager; + + +/** + * Created by Administrator on 2017/5/22 0022. + */ + +public class NetBroadcastReceiver extends BroadcastReceiver { + @Override + public void onReceive(Context context, Intent intent) { + // TODO Auto-generated method stub + // 如果相等的话就说明网络状态发生了变化 + if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) { + int netWorkState = NetUtil.getNetWorkState(context); + } + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/net/NetUtil.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/net/NetUtil.java new file mode 100644 index 0000000..45b85fa --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/net/NetUtil.java @@ -0,0 +1,49 @@ +package com.jilk.ros.message.ros.net; + +import android.content.Context; +import android.net.ConnectivityManager; +import android.net.NetworkInfo; + +/** + * Created by Administrator on 2017/5/22 0022. + */ + +public class NetUtil { + + /** + * 没有连接网络 + */ + private static final int NETWORK_NONE = -1; + /** + * 移动网络 + */ + private static final int NETWORK_MOBILE = 0; + /** + * 无线网络 + */ + private static final int NETWORK_WIFI = 1; + + public static int getNetWorkState(Context context) { + // 得到连接管理器对象 + ConnectivityManager connectivityManager = (ConnectivityManager) context + .getSystemService(Context.CONNECTIVITY_SERVICE); + + NetworkInfo activeNetworkInfo = connectivityManager + .getActiveNetworkInfo(); + if (activeNetworkInfo != null && activeNetworkInfo.isConnected()) { + + if (activeNetworkInfo.getType() == (ConnectivityManager.TYPE_WIFI)) { + return NETWORK_WIFI; + } else if (activeNetworkInfo.getType() == (ConnectivityManager.TYPE_MOBILE)) { + return NETWORK_MOBILE; + } + } else { + return NETWORK_NONE; + } + return NETWORK_NONE; + } +} + + + + diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/net/POI.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/net/POI.java new file mode 100644 index 0000000..bcba86d --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/net/POI.java @@ -0,0 +1,1846 @@ +package com.jilk.ros.message.ros.net; + +import java.util.List; + +/** + * Created by super_yu on 2017/7/13. + */ + +public class POI { + + + /** + * status : 1 + * searchOpt : {"city":"430100","pageSize":"20","pageIndex":"1","ac":"false","keyword":"宠物店","type":"4"} + * data : {"codepoint":0,"code":"1","suggestion":{},"timestamp":"1499941100.95","lqii":{"cache_directive":{"cache_filter":{"flag":"1","expires":"24"},"cache_all":{"flag":"0"}},"query_intent":{"cate_list":"","type":"1000","cate":"06","cate_ext":""},"classify_range":{"district_adcode":"430100","subway_adcode":"430100","nearby_enable":"1","subway_enable":"1","district_enable":"1"},"general_flag":"","specialclassify":"","view_region":"113.029599800,28.194115900,113.123658200,28.181505100","suggestcontent":"","pdheatmap":"","render_name_flag":"1","is_current_city":"2","expand_range_tip":"","suggest_query":{"data":[],"col":"","row":""},"change_query_tip":"","is_tupu_sug":"0","has_recommend":"0","brand_intent":{"t_tag":"","flag":"0","cate":"","name":""},"suggestionview":"1","change_query_type":"","business":"","car_icon_flag":"0","slayer_type":"none","show_pic":"","is_view_city":"1","querytype":"5","self_navigation":"","showaoi":"","utd_sceneid":"1000","distance_info":"","slayer":"1","target_view_city":"","call_taxi":"0","preload_next_page":"1","magic_box":{},"activity":{"new_year":{"flag":"0","tip":""}}},"general_flag":"1","result":"true","keywords":"","message":"Successful.","total":"172","bus_list":[],"is_general_search":"1","bounds":"113.037438;28.182556;113.115820;28.193065","version":"2.0-3.0.7191.1745","busline_count":"0","magicbox_data":{},"interior_count":"0","poi_list":[{"rating":"","tel":"15873110896","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.085508","address":"湖南农业大学农大路东湖小区9栋1号门面","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFF00687","name":"宠物森林宠物店","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/2e1f07ad78ffb766518e2ab25bfe3373","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"宠物森林宠物店","cpdata":"","latitude":"28.186454","discount_flag":"0"},{"rating":"","tel":"","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.109596","address":"榔梨镇新建路22号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFGHFNA0","name":"欧瑞名门","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430121","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"欧瑞名门","cpdata":"","latitude":"28.183838","discount_flag":"0"},{"rating":"","tel":"0731-86805055;15974202555","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.115820","address":"新建路与梨江路交叉口东南50米","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFGHT7GH","name":"千禧花艺","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430121","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/471be64496d71b9e10aed5ce69103c9b","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"千禧花艺","cpdata":"","latitude":"28.182556","discount_flag":"0"},{"rating":"5","tel":"15675234442","typecode":"061211|060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.045410","address":"长房白沙湾小区a3栋06门店(婚庆公园旁)","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFGBIR3N","name":"灵宠之家","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/563c1dfea3109280d0010c5f","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"061211|060502","disp_name":"灵宠之家","cpdata":"","latitude":"28.193065","discount_flag":"0"},{"rating":"","tel":"0731-82329304;13875869939","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.038326","address":"古曲中路扬帆小区E5栋内","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFFQ7CG9","name":"迦南水族超市","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/37764947dd81c37cd017b6422b632967","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"迦南水族超市","cpdata":"","latitude":"28.189954","discount_flag":"0"},{"rating":"","tel":"0731-88278798;15074947900","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.038223","address":"扬帆市场E10栋1-2号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFG2UX3F","name":"温鑫水族馆","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/8232b213b2ff6b7b52e8e3fa36a97666","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"温鑫水族馆","cpdata":"","latitude":"28.189884","discount_flag":"0"},{"rating":"3.0","tel":"","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037902","address":"古曲中路与荷花路交叉口西南150米","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFG2UX4P","name":"可丽爱水族(湖南总店)","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/d1f2baab493a8ec2f01f2c329487e6a2","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"可丽爱水族(湖南总店)","cpdata":"","latitude":"28.190558","discount_flag":"0"},{"rating":"","tel":"15802669660","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037923","address":"杨帆小区e4栋11号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFFQ7E8W","name":"创艺水族(湖南总店)","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/788c5ee41bd2cfcc53d3ff7fa07d564b","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"创艺水族(湖南总店)","cpdata":"","latitude":"28.189849","discount_flag":"0"},{"rating":"","tel":"15084955766;18390868815","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037885","address":"荷花路扬帆小区","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFG2UWYY","name":"湘阳水族","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/bec96cc64c4b0fde273c9a6e395c518a","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"湘阳水族","cpdata":"","latitude":"28.189848","discount_flag":"0"},{"rating":"","tel":"","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037919","address":"金苹果扬帆市场E9栋10号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFGA45UF","name":"水森林鱼艺创意生活馆","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/97189fa8fb836455e7ded28de1539433","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"水森林鱼艺创意生活馆","cpdata":"","latitude":"28.189610","discount_flag":"0"},{"rating":"","tel":"","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037857","address":"荷花路610号附近","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFH6KQS1","name":"可丽爱水族生活馆(扬帆店)","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/b856f2fddb6e2deb804e4a1cd6fca8d1","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"可丽爱水族生活馆(扬帆店)","cpdata":"","latitude":"28.189846","discount_flag":"0"},{"rating":"3.5","tel":"0731-85148699","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037834","address":"金苹果扬帆大市场E4栋-8号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFFQ7BSC","name":"闽江水族(扬帆小区西)","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/2709f078b19d94f477265468fb068360","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"闽江水族(扬帆小区西)","cpdata":"","latitude":"28.189847","discount_flag":"0"},{"rating":"5","tel":"13974840573","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037804","address":"古曲中路扬帆小区E-4栋7号门面","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFH6KR5O","name":"方哥金鱼锦鲤批发中心","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/47a9f7f0e6caa0838a69dc77ef793afb","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"方哥金鱼锦鲤批发中心","cpdata":"","latitude":"28.189846","discount_flag":"0"},{"rating":"","tel":"0731-85576062","typecode":"061211","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037806","address":"扬帆小区E9栋8号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFH86O0U","name":"威顺宠物水族用品批发店","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/b74946382ffc6ecf313f81e2e8522a6a","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"061211","disp_name":"威顺宠物水族用品批发店","cpdata":"","latitude":"28.189609","discount_flag":"0"},{"rating":"","tel":"0731-82562071;13787262098","typecode":"060502|060501","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037641","address":"扬帆小区E4栋6号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFFQ7E92","name":"利钧花鸟批发专店","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/7dbed3b70bc0332d6f19d3ef37e80d07","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502|060501","disp_name":"利钧花鸟批发专店","cpdata":"","latitude":"28.189937","discount_flag":"0"},{"rating":"","tel":"0731-84420870;13973114985","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037655","address":"金苹果扬帆大市场E4栋-4号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFGAAZEQ","name":"名仕水族批发(总店)","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/6bcf6364f0086cc694d13d5d5d7017fc","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"名仕水族批发(总店)","cpdata":"","latitude":"28.189842","discount_flag":"0"},{"rating":"","tel":"13973009116","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037578","address":"荷花路610号附近","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFH6KQRH","name":"旺家美花卉水族馆","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/01a7ef414b06cbdac43dbef16d59f7cc","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"旺家美花卉水族馆","cpdata":"","latitude":"28.189843","discount_flag":"0"},{"rating":"","tel":"","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037592","address":"扬帆小区E9栋-5号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFH6KR4P","name":"阿梅水族批发","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/9bb0da87b7aa80957eadd4c8310d0d56","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"阿梅水族批发","cpdata":"","latitude":"28.189712","discount_flag":"0"},{"rating":"","tel":"13170481820;13170488159","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037574","address":"东屯渡街道扬帆小区E9栋","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFG9YMUY","name":"宋氏水族馆","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/42a6659559e338f553f3d9d822aac298","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"宋氏水族馆","cpdata":"","latitude":"28.189604","discount_flag":"0"},{"rating":"","tel":"18302079703","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037438","address":"扬帆小区e4栋2号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFG9WXV5","name":"聚友轩水族馆","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/a90f112b20c9dbf3e8627d434232e326","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"聚友轩水族馆","cpdata":"","latitude":"28.189846","discount_flag":"0"}],"classify":[{"checkedvalue":"filter_keywords=宠物市场","category":[{"alias":"","multiselect":"","name":"全部分类","value":"category=0601|061000|061001|0603|0606|0607|0605|060800|0613","display":""},{"alias":"","multiselect":"","name":"超市","value":"filter_keywords=超市","display":""},{"category":[{"alias":"","name":"全部","value":"category=060101|060103"},{"alias":"","name":"购物中心","value":"filter_keywords=购物中心"},{"alias":"","name":"免税品店","value":"category=060103"}],"alias":"","multiselect":"","name":"综合商场","display":""},{"category":[{"alias":"","name":"全部","value":"category=061000|061001"},{"alias":"","name":"特色商业街","value":"category=061000"},{"alias":"","name":"步行街","value":"filter_keywords=步行街"}],"alias":"","multiselect":"","name":"商业街","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=家电卖场"},{"alias":"","name":"家电电子卖场","value":"category=060300"},{"alias":"","name":"综合家电商场","value":"filter_keywords=综合家电"},{"alias":"","name":"国美","value":"category=060302"},{"alias":"","name":"大中","value":"filter_keywords=大中电器"},{"alias":"","name":"苏宁","value":"category=060304"},{"alias":"","name":"手机销售","value":"filter_keywords=手机销售"},{"alias":"","name":"数码电子","value":"filter_keywords=数码电子"}],"alias":"","multiselect":"","name":"家电","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=家具建材"},{"alias":"","name":"家具建材市场","value":"category=060601"},{"alias":"","name":"家具城","value":"filter_keywords=家具城"},{"alias":"","name":"建材五金市场","value":"filter_keywords=建材五金市场"},{"alias":"","name":"厨卫市场","value":"category=060604"},{"alias":"","name":"布艺市场","value":"category=060605"},{"alias":"","name":"灯具瓷器市场","value":"category=060606"}],"alias":"","multiselect":"","name":"家具建材","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=综合市场"},{"alias":"","name":"小商品市场","value":"filter_keywords=小商品批发市场"},{"alias":"","name":"旧货市场","value":"category=060702"},{"alias":"","name":"农副产品市场","value":"filter_keywords=农产品批发市场"},{"alias":"","name":"果品市场","value":"filter_keywords=果品批发市场"},{"alias":"","name":"蔬菜市场","value":"filter_keywords=蔬菜市场"},{"alias":"","name":"水产海鲜市场","value":"filter_keywords=水产海鲜市场"}],"alias":"","multiselect":"","name":"综合市场","display":""},{"alias":"","multiselect":"","name":"文化用品店","value":"filter_keywords=文化办公用品","display":""},{"category":[{"alias":"","name":"全部","value":"category=060500|060501|060502"},{"alias":"","name":"花鸟鱼虫市场","value":"filter_keywords=花鸟市场"},{"alias":"","name":"花卉市场","value":"filter_keywords=花卉市场"},{"alias":"","name":"宠物市场","value":"filter_keywords=宠物市场"}],"alias":"","multiselect":"","name":"花鸟市场","display":""},{"category":[{"alias":"","name":"全部","value":"category=061301|061302"},{"alias":"","name":"拍卖行","value":"category=061301"},{"alias":"","name":"典当行","value":"category=061302"}],"alias":"","multiselect":"","name":"买卖场所","display":""}],"name":"全部分类","ctype":"category","flag":2},{"checkedvalue":"sort_rule=0;reserved_keywords=true","category":[{"name":"推荐排序","value":"sort_rule=0;reserved_keywords=true"},{"name":"距离优先","value":"sort_rule=1;reserved_keywords=true"},{"name":"好评优先","value":"sort_rule=5;sort_fields=rating:d;reserved_keywords=true"},{"name":"低价优先","value":"sort_rule=5;sort_fields=averagecost:a0;reserved_keywords=true"},{"name":"高价优先","value":"sort_rule=5;sort_fields=averagecost:d;reserved_keywords=true"}],"name":"排序","ctype":"filter"}],"busline_list":[]} + * SPQ : true + * isSPQ : false + * classify : {"classify_type":{"checkedvalue":"filter_keywords=宠物市场","category":[{"alias":"","multiselect":"","name":"全部分类","value":"category=0601|061000|061001|0603|0606|0607|0605|060800|0613","display":""},{"alias":"","multiselect":"","name":"超市","value":"filter_keywords=超市","display":""},{"category":[{"alias":"","name":"全部","value":"category=060101|060103"},{"alias":"","name":"购物中心","value":"filter_keywords=购物中心"},{"alias":"","name":"免税品店","value":"category=060103"}],"alias":"","multiselect":"","name":"综合商场","display":""},{"category":[{"alias":"","name":"全部","value":"category=061000|061001"},{"alias":"","name":"特色商业街","value":"category=061000"},{"alias":"","name":"步行街","value":"filter_keywords=步行街"}],"alias":"","multiselect":"","name":"商业街","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=家电卖场"},{"alias":"","name":"家电电子卖场","value":"category=060300"},{"alias":"","name":"综合家电商场","value":"filter_keywords=综合家电"},{"alias":"","name":"国美","value":"category=060302"},{"alias":"","name":"大中","value":"filter_keywords=大中电器"},{"alias":"","name":"苏宁","value":"category=060304"},{"alias":"","name":"手机销售","value":"filter_keywords=手机销售"},{"alias":"","name":"数码电子","value":"filter_keywords=数码电子"}],"alias":"","multiselect":"","name":"家电","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=家具建材"},{"alias":"","name":"家具建材市场","value":"category=060601"},{"alias":"","name":"家具城","value":"filter_keywords=家具城"},{"alias":"","name":"建材五金市场","value":"filter_keywords=建材五金市场"},{"alias":"","name":"厨卫市场","value":"category=060604"},{"alias":"","name":"布艺市场","value":"category=060605"},{"alias":"","name":"灯具瓷器市场","value":"category=060606"}],"alias":"","multiselect":"","name":"家具建材","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=综合市场"},{"alias":"","name":"小商品市场","value":"filter_keywords=小商品批发市场"},{"alias":"","name":"旧货市场","value":"category=060702"},{"alias":"","name":"农副产品市场","value":"filter_keywords=农产品批发市场"},{"alias":"","name":"果品市场","value":"filter_keywords=果品批发市场"},{"alias":"","name":"蔬菜市场","value":"filter_keywords=蔬菜市场"},{"alias":"","name":"水产海鲜市场","value":"filter_keywords=水产海鲜市场"}],"alias":"","multiselect":"","name":"综合市场","display":""},{"alias":"","multiselect":"","name":"文化用品店","value":"filter_keywords=文化办公用品","display":""},{"category":[{"alias":"","name":"全部","value":"category=060500|060501|060502"},{"alias":"","name":"花鸟鱼虫市场","value":"filter_keywords=花鸟市场"},{"alias":"","name":"花卉市场","value":"filter_keywords=花卉市场"},{"alias":"","name":"宠物市场","value":"filter_keywords=宠物市场"}],"alias":"","multiselect":"","name":"花鸟市场","display":""},{"category":[{"alias":"","name":"全部","value":"category=061301|061302"},{"alias":"","name":"拍卖行","value":"category=061301"},{"alias":"","name":"典当行","value":"category=061302"}],"alias":"","multiselect":"","name":"买卖场所","display":""}],"name":"全部分类","ctype":"category","flag":2},"classify_sort":{"checkedvalue":"sort_rule=0;reserved_keywords=true","category":[{"name":"推荐排序","value":"sort_rule=0;reserved_keywords=true"},{"name":"距离优先","value":"sort_rule=1;reserved_keywords=true"},{"name":"好评优先","value":"sort_rule=5;sort_fields=rating:d;reserved_keywords=true"},{"name":"低价优先","value":"sort_rule=5;sort_fields=averagecost:a0;reserved_keywords=true"},{"name":"高价优先","value":"sort_rule=5;sort_fields=averagecost:d;reserved_keywords=true"}],"name":"排序","ctype":"filter"},"count":2} + * bizAreaData : {"citycode":"0731","adcode":"430100","name":"长沙市","center":"112.982279,28.19409","level":"city","districts":[{"citycode":"0731","adcode":"430102","name":"芙蓉区","center":"112.988094,28.193106","level":"district","districts":[{"citycode":"0731","adcode":"430102","name":"德政园","center":"113.022609,28.186145","level":"biz_area","areacode":"19749","districts":[]},{"citycode":"0731","adcode":"430102","name":"定王台","center":"112.985227,28.190025","level":"biz_area","areacode":"19750","districts":[]},{"citycode":"0731","adcode":"430102","name":"黄兴路","center":"112.976687,28.190437","level":"biz_area","areacode":"19751","districts":[]},{"citycode":"0731","adcode":"430102","name":"韭菜园","center":"112.988766,28.194756","level":"biz_area","areacode":"19752","districts":[]},{"citycode":"0731","adcode":"430102","name":"马王堆","center":"113.028870,28.195465","level":"biz_area","areacode":"19753","districts":[]},{"citycode":"0731","adcode":"430102","name":"五里牌","center":"113.011699,28.198328","level":"biz_area","areacode":"19754","districts":[]},{"citycode":"0731","adcode":"430102","name":"湘湖","center":"113.012682,28.205252","level":"biz_area","areacode":"19755","districts":[]},{"citycode":"0731","adcode":"430102","name":"袁家岭","center":"112.997033,28.194455","level":"biz_area","areacode":"19756","districts":[]},{"citycode":"0731","adcode":"430102","name":"八一路","center":"113.000355,28.197485","level":"biz_area","areacode":"19757","districts":[]},{"citycode":"0731","adcode":"430102","name":"朝阳路","center":"113.007038,28.189212","level":"biz_area","areacode":"19758","districts":[]},{"citycode":"0731","adcode":"430102","name":"东屯渡","center":"113.038626,28.194082","level":"biz_area","areacode":"19759","districts":[]},{"citycode":"0731","adcode":"430102","name":"芙蓉广场","center":"112.995054,28.197940","level":"biz_area","areacode":"19760","districts":[]},{"citycode":"0731","adcode":"430102","name":"芙蓉中路","center":"112.986125,28.187681","level":"biz_area","areacode":"19761","districts":[]},{"citycode":"0731","adcode":"430102","name":"荷花路","center":"113.032740,28.191378","level":"biz_area","areacode":"19762","districts":[]},{"citycode":"0731","adcode":"430102","name":"荷花园","center":"113.021219,28.191605","level":"biz_area","areacode":"19763","districts":[]},{"citycode":"0731","adcode":"430102","name":"火星","center":"113.023431,28.202349","level":"biz_area","areacode":"19764","districts":[]},{"citycode":"0731","adcode":"430102","name":"凌霄路","center":"113.029080,28.202090","level":"biz_area","areacode":"19765","districts":[]},{"citycode":"0731","adcode":"430102","name":"浏正街","center":"112.984803,28.191896","level":"biz_area","areacode":"19766","districts":[]},{"citycode":"0731","adcode":"430102","name":"三湘大市场","center":"113.016648,28.202302","level":"biz_area","areacode":"19768","districts":[]},{"citycode":"0731","adcode":"430102","name":"万家丽","center":"113.030236,28.185394","level":"biz_area","areacode":"19770","districts":[]},{"citycode":"0731","adcode":"430102","name":"文艺路","center":"112.994009,28.191407","level":"biz_area","areacode":"19771","districts":[]},{"citycode":"0731","adcode":"430102","name":"五一大道","center":"112.988446,28.194898","level":"biz_area","areacode":"19772","districts":[]},{"citycode":"0731","adcode":"430102","name":"燕山街","center":"113.000486,28.196539","level":"biz_area","areacode":"19773","districts":[]},{"citycode":"0731","adcode":"430102","name":"远大路","center":"113.027617,28.198384","level":"biz_area","areacode":"19774","districts":[]},{"citycode":"0731","adcode":"430102","name":"中山路","center":"112.979051,28.199921","level":"biz_area","areacode":"19775","districts":[]},{"citycode":"0731","adcode":"430102","name":"车站中路","center":"113.010938,28.193068","level":"biz_area","areacode":"19776","districts":[]},{"citycode":"0731","adcode":"430102","name":"芙蓉区政府","center":"113.003653,28.194434","level":"biz_area","areacode":"19785","districts":[]},{"citycode":"0731","adcode":"430102","name":"解放东路","center":"113.005201,28.190678","level":"biz_area","areacode":"19792","districts":[]},{"citycode":"0731","adcode":"430102","name":"解放西路","center":"112.979381,28.191326","level":"biz_area","areacode":"19813","districts":[]},{"citycode":"0731","adcode":"430102","name":"都正街","center":"112.981833,28.187702","level":"biz_area","areacode":"19814","districts":[]},{"citycode":"0731","adcode":"430102","name":"火车站","center":"113.011203,28.193686","level":"biz_area","areacode":"19830","districts":[]},{"citycode":"0731","adcode":"430102","name":"车站北路","center":"113.009321,28.207354","level":"biz_area","areacode":"19845","districts":[]}]},{"citycode":"0731","adcode":"430103","name":"天心区","center":"112.97307,28.192375","level":"district","districts":[{"citycode":"0731","adcode":"430103","name":"韶山南路","center":"113.000079,28.135185","level":"biz_area","areacode":"19782","districts":[]},{"citycode":"0731","adcode":"430103","name":"城南路","center":"112.983886,28.182259","level":"biz_area","areacode":"19787","districts":[]},{"citycode":"0731","adcode":"430103","name":"劳动西路","center":"112.983972,28.173499","level":"biz_area","areacode":"19797","districts":[]},{"citycode":"0731","adcode":"430103","name":"黄土岭","center":"112.985897,28.161960","level":"biz_area","areacode":"19808","districts":[]},{"citycode":"0731","adcode":"430103","name":"友谊路","center":"112.997239,28.125006","level":"biz_area","areacode":"19809","districts":[]},{"citycode":"0731","adcode":"430103","name":"裕南街","center":"112.972993,28.172404","level":"biz_area","areacode":"19810","districts":[]},{"citycode":"0731","adcode":"430103","name":"芙蓉南路","center":"112.986581,28.132236","level":"biz_area","areacode":"19811","districts":[]},{"citycode":"0731","adcode":"430103","name":"赤岭路","center":"112.979397,28.153046","level":"biz_area","areacode":"19812","districts":[]},{"citycode":"0731","adcode":"430103","name":"芙蓉南路","center":"112.987141,28.124923","level":"biz_area","areacode":"19816","districts":[]},{"citycode":"0731","adcode":"430103","name":"白沙路","center":"112.982195,28.182379","level":"biz_area","areacode":"19818","districts":[]},{"citycode":"0731","adcode":"430103","name":"碧湘街","center":"112.972105,28.182679","level":"biz_area","areacode":"19819","districts":[]},{"citycode":"0731","adcode":"430103","name":"金盆岭","center":"112.977234,28.151578","level":"biz_area","areacode":"19822","districts":[]},{"citycode":"0731","adcode":"430103","name":"南湖路","center":"112.977905,28.165537","level":"biz_area","areacode":"19825","districts":[]},{"citycode":"0731","adcode":"430103","name":"南门口","center":"112.975929,28.183259","level":"biz_area","areacode":"19827","districts":[]},{"citycode":"0731","adcode":"430103","name":"坡子街","center":"112.973189,28.190238","level":"biz_area","areacode":"19828","districts":[]},{"citycode":"0731","adcode":"430103","name":"青园","center":"112.994944,28.128891","level":"biz_area","areacode":"19829","districts":[]},{"citycode":"0731","adcode":"430103","name":"书院路","center":"112.971563,28.175927","level":"biz_area","areacode":"19832","districts":[]},{"citycode":"0731","adcode":"430103","name":"书院南路","center":"112.972190,28.150083","level":"biz_area","areacode":"19833","districts":[]},{"citycode":"0731","adcode":"430103","name":"天心阁","center":"112.981184,28.184664","level":"biz_area","areacode":"19835","districts":[]},{"citycode":"0731","adcode":"430103","name":"西牌楼","center":"112.972712,28.193602","level":"biz_area","areacode":"19837","districts":[]},{"citycode":"0731","adcode":"430103","name":"新开铺","center":"112.970512,28.133102","level":"biz_area","areacode":"19838","districts":[]},{"citycode":"0731","adcode":"430103","name":"铁道学院","center":"112.992682,28.140356","level":"biz_area","areacode":"19839","districts":[]},{"citycode":"0731","adcode":"430103","name":"西湖","center":"112.967188,28.187826","level":"biz_area","areacode":"19879","districts":[]}]},{"citycode":"0731","adcode":"430104","name":"岳麓区","center":"112.911591,28.213044","level":"district","districts":[{"citycode":"0731","adcode":"430104","name":"观沙岭","center":"112.950525,28.235600","level":"biz_area","areacode":"19861","districts":[]},{"citycode":"0731","adcode":"430104","name":"湖南商学院","center":"112.918042,28.219331","level":"biz_area","areacode":"19862","districts":[]},{"citycode":"0731","adcode":"430104","name":"麓谷","center":"112.889410,28.214029","level":"biz_area","areacode":"19863","districts":[]},{"citycode":"0731","adcode":"430104","name":"汽车西站","center":"112.910711,28.209866","level":"biz_area","areacode":"19864","districts":[]},{"citycode":"0731","adcode":"430104","name":"桐梓坡","center":"112.930153,28.218539","level":"biz_area","areacode":"19865","districts":[]},{"citycode":"0731","adcode":"430104","name":"望月湖","center":"112.955265,28.204105","level":"biz_area","areacode":"19866","districts":[]},{"citycode":"0731","adcode":"430104","name":"咸嘉湖","center":"112.930929,28.212604","level":"biz_area","areacode":"19867","districts":[]},{"citycode":"0731","adcode":"430104","name":"岳麓山","center":"112.943829,28.178123","level":"biz_area","areacode":"19868","districts":[]},{"citycode":"0731","adcode":"430104","name":"玉兰路","center":"112.910965,28.214257","level":"biz_area","areacode":"19869","districts":[]},{"citycode":"0731","adcode":"430104","name":"白沙液街","center":"112.952884,28.201147","level":"biz_area","areacode":"19870","districts":[]},{"citycode":"0731","adcode":"430104","name":"枫林一路","center":"112.946030,28.198881","level":"biz_area","areacode":"19871","districts":[]},{"citycode":"0731","adcode":"430104","name":"湖南大学","center":"112.945213,28.177733","level":"biz_area","areacode":"19872","districts":[]},{"citycode":"0731","adcode":"430104","name":"湖南师范大学","center":"112.948495,28.187094","level":"biz_area","areacode":"19873","districts":[]},{"citycode":"0731","adcode":"430104","name":"雷锋大道","center":"112.899515,28.237511","level":"biz_area","areacode":"19874","districts":[]},{"citycode":"0731","adcode":"430104","name":"麓山路","center":"112.949074,28.189117","level":"biz_area","areacode":"19875","districts":[]},{"citycode":"0731","adcode":"430104","name":"桐梓坡路","center":"112.934137,28.218532","level":"biz_area","areacode":"19876","districts":[]},{"citycode":"0731","adcode":"430104","name":"望城坡","center":"112.912119,28.213111","level":"biz_area","areacode":"19877","districts":[]},{"citycode":"0731","adcode":"430104","name":"望岳","center":"112.922311,28.221183","level":"biz_area","areacode":"19878","districts":[]},{"citycode":"0731","adcode":"430104","name":"咸嘉新村","center":"112.927504,28.220168","level":"biz_area","areacode":"19880","districts":[]},{"citycode":"0731","adcode":"430104","name":"新民路","center":"112.953168,28.192306","level":"biz_area","areacode":"19881","districts":[]},{"citycode":"0731","adcode":"430104","name":"银盆岭","center":"112.953686,28.222394","level":"biz_area","areacode":"19882","districts":[]},{"citycode":"0731","adcode":"430104","name":"中南大学","center":"112.933330,28.163911","level":"biz_area","areacode":"19883","districts":[]}]},{"citycode":"0731","adcode":"430105","name":"开福区","center":"112.985525,28.201336","level":"district","districts":[{"citycode":"0731","adcode":"430105","name":"五一广场","center":"112.976276,28.195472","level":"biz_area","areacode":"19840","districts":[]},{"citycode":"0731","adcode":"430105","name":"四方坪","center":"113.010379,28.235254","level":"biz_area","areacode":"19841","districts":[]},{"citycode":"0731","adcode":"430105","name":"伍家岭","center":"112.989085,28.229513","level":"biz_area","areacode":"19842","districts":[]},{"citycode":"0731","adcode":"430105","name":"湘雅医院","center":"112.970288,28.208441","level":"biz_area","areacode":"19843","districts":[]},{"citycode":"0731","adcode":"430105","name":"营盘路","center":"112.980982,28.204196","level":"biz_area","areacode":"19844","districts":[]},{"citycode":"0731","adcode":"430105","name":"芙蓉北路","center":"112.984343,28.253526","level":"biz_area","areacode":"19846","districts":[]},{"citycode":"0731","adcode":"430105","name":"北正街","center":"112.976591,28.206011","level":"biz_area","areacode":"19847","districts":[]},{"citycode":"0731","adcode":"430105","name":"蔡锷北路","center":"112.981659,28.206246","level":"biz_area","areacode":"19848","districts":[]},{"citycode":"0731","adcode":"430105","name":"德雅路","center":"113.004718,28.222866","level":"biz_area","areacode":"19849","districts":[]},{"citycode":"0731","adcode":"430105","name":"东风路","center":"112.992763,28.217975","level":"biz_area","areacode":"19850","districts":[]},{"citycode":"0731","adcode":"430105","name":"华夏路","center":"112.982770,28.224978","level":"biz_area","areacode":"19851","districts":[]},{"citycode":"0731","adcode":"430105","name":"开福寺","center":"112.980862,28.223230","level":"biz_area","areacode":"19852","districts":[]},{"citycode":"0731","adcode":"430105","name":"科大佳园","center":"113.003668,28.236008","level":"biz_area","areacode":"19853","districts":[]},{"citycode":"0731","adcode":"430105","name":"麻园岭","center":"112.984825,28.215030","level":"biz_area","areacode":"19854","districts":[]},{"citycode":"0731","adcode":"430105","name":"清水塘","center":"112.988751,28.200502","level":"biz_area","areacode":"19855","districts":[]},{"citycode":"0731","adcode":"430105","name":"三一大道","center":"113.005297,28.231043","level":"biz_area","areacode":"19856","districts":[]},{"citycode":"0731","adcode":"430105","name":"通泰街","center":"112.974645,28.206132","level":"biz_area","areacode":"19857","districts":[]},{"citycode":"0731","adcode":"430105","name":"湘江中路","center":"112.972143,28.203561","level":"biz_area","areacode":"19858","districts":[]},{"citycode":"0731","adcode":"430105","name":"湘雅路","center":"112.979935,28.213924","level":"biz_area","areacode":"19859","districts":[]},{"citycode":"0731","adcode":"430105","name":"新河","center":"112.982264,28.227548","level":"biz_area","areacode":"19860","districts":[]}]},{"citycode":"0731","adcode":"430111","name":"雨花区","center":"113.016337,28.109937","level":"district","districts":[{"citycode":"0731","adcode":"430111","name":"人民中路","center":"113.001047,28.185355","level":"biz_area","areacode":"19767","districts":[]},{"citycode":"0731","adcode":"430111","name":"曙光路","center":"113.001969,28.179694","level":"biz_area","areacode":"19769","districts":[]},{"citycode":"0731","adcode":"430111","name":"窑岭","center":"112.998484,28.185167","level":"biz_area","areacode":"19777","districts":[]},{"citycode":"0731","adcode":"430111","name":"茶园坡","center":"113.008657,28.159707","level":"biz_area","areacode":"19778","districts":[]},{"citycode":"0731","adcode":"430111","name":"东塘","center":"112.994720,28.168757","level":"biz_area","areacode":"19779","districts":[]},{"citycode":"0731","adcode":"430111","name":"高桥","center":"113.022508,28.172998","level":"biz_area","areacode":"19780","districts":[]},{"citycode":"0731","adcode":"430111","name":"砂子塘","center":"112.997399,28.161249","level":"biz_area","areacode":"19781","districts":[]},{"citycode":"0731","adcode":"430111","name":"雨花亭","center":"112.997573,28.150595","level":"biz_area","areacode":"19783","districts":[]},{"citycode":"0731","adcode":"430111","name":"左家塘","center":"113.003294,28.176401","level":"biz_area","areacode":"19784","districts":[]},{"citycode":"0731","adcode":"430111","name":"小林子冲","center":"112.988135,28.177010","level":"biz_area","areacode":"19786","districts":[]},{"citycode":"0731","adcode":"430111","name":"阿弥岭","center":"113.006469,28.172421","level":"biz_area","areacode":"19788","districts":[]},{"citycode":"0731","adcode":"430111","name":"圭塘","center":"113.033391,28.139720","level":"biz_area","areacode":"19794","districts":[]},{"citycode":"0731","adcode":"430111","name":"红花坡","center":"113.005448,28.165878","level":"biz_area","areacode":"19795","districts":[]},{"citycode":"0731","adcode":"430111","name":"井湾子","center":"113.009767,28.124386","level":"biz_area","areacode":"19796","districts":[]},{"citycode":"0731","adcode":"430111","name":"劳动中路","center":"113.002097,28.163422","level":"biz_area","areacode":"19798","districts":[]},{"citycode":"0731","adcode":"430111","name":"曲塘","center":"113.032987,28.148308","level":"biz_area","areacode":"19799","districts":[]},{"citycode":"0731","adcode":"430111","name":"韶山中路","center":"112.994247,28.158138","level":"biz_area","areacode":"19800","districts":[]},{"citycode":"0731","adcode":"430111","name":"树木岭","center":"113.022365,28.150991","level":"biz_area","areacode":"19801","districts":[]},{"citycode":"0731","adcode":"430111","name":"王家冲","center":"113.001659,28.152828","level":"biz_area","areacode":"19802","districts":[]},{"citycode":"0731","adcode":"430111","name":"香樟路","center":"113.012409,28.136391","level":"biz_area","areacode":"19803","districts":[]},{"citycode":"0731","adcode":"430111","name":"雨花区政府","center":"113.018871,28.146627","level":"biz_area","areacode":"19804","districts":[]},{"citycode":"0731","adcode":"430111","name":"植物园","center":"113.019004,28.103487","level":"biz_area","areacode":"19805","districts":[]},{"citycode":"0731","adcode":"430111","name":"梓园路","center":"112.991337,28.178514","level":"biz_area","areacode":"19806","districts":[]},{"citycode":"0731","adcode":"430111","name":"侯家塘","center":"112.985710,28.173230","level":"biz_area","areacode":"19807","districts":[]}]},{"citycode":"0731","adcode":"430112","name":"望城区","center":"112.819549,28.347458","level":"district","districts":[]},{"citycode":"0731","adcode":"430121","name":"长沙县","center":"113.080098,28.237888","level":"district","districts":[]},{"citycode":"0731","adcode":"430124","name":"宁乡县","center":"112.553182,28.253928","level":"district","districts":[]},{"citycode":"0731","adcode":"430181","name":"浏阳市","center":"113.633301,28.141112","level":"district","districts":[]}],"checkedvalue":"query_type=TQUERY"} + * classifyFlag : true + */ + + private String status; + /** + * city : 430100 + * pageSize : 20 + * pageIndex : 1 + * ac : false + * keyword : 宠物店 + * type : 4 + */ + + private SearchOptBean searchOpt; + /** + * codepoint : 0 + * code : 1 + * suggestion : {} + * timestamp : 1499941100.95 + * lqii : {"cache_directive":{"cache_filter":{"flag":"1","expires":"24"},"cache_all":{"flag":"0"}},"query_intent":{"cate_list":"","type":"1000","cate":"06","cate_ext":""},"classify_range":{"district_adcode":"430100","subway_adcode":"430100","nearby_enable":"1","subway_enable":"1","district_enable":"1"},"general_flag":"","specialclassify":"","view_region":"113.029599800,28.194115900,113.123658200,28.181505100","suggestcontent":"","pdheatmap":"","render_name_flag":"1","is_current_city":"2","expand_range_tip":"","suggest_query":{"data":[],"col":"","row":""},"change_query_tip":"","is_tupu_sug":"0","has_recommend":"0","brand_intent":{"t_tag":"","flag":"0","cate":"","name":""},"suggestionview":"1","change_query_type":"","business":"","car_icon_flag":"0","slayer_type":"none","show_pic":"","is_view_city":"1","querytype":"5","self_navigation":"","showaoi":"","utd_sceneid":"1000","distance_info":"","slayer":"1","target_view_city":"","call_taxi":"0","preload_next_page":"1","magic_box":{},"activity":{"new_year":{"flag":"0","tip":""}}} + * general_flag : 1 + * result : true + * keywords : + * message : Successful. + * total : 172 + * bus_list : [] + * is_general_search : 1 + * bounds : 113.037438;28.182556;113.115820;28.193065 + * version : 2.0-3.0.7191.1745 + * busline_count : 0 + * magicbox_data : {} + * interior_count : 0 + * poi_list : [{"rating":"","tel":"15873110896","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.085508","address":"湖南农业大学农大路东湖小区9栋1号门面","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFF00687","name":"宠物森林宠物店","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/2e1f07ad78ffb766518e2ab25bfe3373","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"宠物森林宠物店","cpdata":"","latitude":"28.186454","discount_flag":"0"},{"rating":"","tel":"","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.109596","address":"榔梨镇新建路22号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFGHFNA0","name":"欧瑞名门","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430121","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"欧瑞名门","cpdata":"","latitude":"28.183838","discount_flag":"0"},{"rating":"","tel":"0731-86805055;15974202555","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.115820","address":"新建路与梨江路交叉口东南50米","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFGHT7GH","name":"千禧花艺","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430121","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/471be64496d71b9e10aed5ce69103c9b","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"千禧花艺","cpdata":"","latitude":"28.182556","discount_flag":"0"},{"rating":"5","tel":"15675234442","typecode":"061211|060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.045410","address":"长房白沙湾小区a3栋06门店(婚庆公园旁)","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFGBIR3N","name":"灵宠之家","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/563c1dfea3109280d0010c5f","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"061211|060502","disp_name":"灵宠之家","cpdata":"","latitude":"28.193065","discount_flag":"0"},{"rating":"","tel":"0731-82329304;13875869939","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.038326","address":"古曲中路扬帆小区E5栋内","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFFQ7CG9","name":"迦南水族超市","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/37764947dd81c37cd017b6422b632967","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"迦南水族超市","cpdata":"","latitude":"28.189954","discount_flag":"0"},{"rating":"","tel":"0731-88278798;15074947900","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.038223","address":"扬帆市场E10栋1-2号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFG2UX3F","name":"温鑫水族馆","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/8232b213b2ff6b7b52e8e3fa36a97666","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"温鑫水族馆","cpdata":"","latitude":"28.189884","discount_flag":"0"},{"rating":"3.0","tel":"","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037902","address":"古曲中路与荷花路交叉口西南150米","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFG2UX4P","name":"可丽爱水族(湖南总店)","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/d1f2baab493a8ec2f01f2c329487e6a2","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"可丽爱水族(湖南总店)","cpdata":"","latitude":"28.190558","discount_flag":"0"},{"rating":"","tel":"15802669660","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037923","address":"杨帆小区e4栋11号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFFQ7E8W","name":"创艺水族(湖南总店)","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/788c5ee41bd2cfcc53d3ff7fa07d564b","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"创艺水族(湖南总店)","cpdata":"","latitude":"28.189849","discount_flag":"0"},{"rating":"","tel":"15084955766;18390868815","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037885","address":"荷花路扬帆小区","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFG2UWYY","name":"湘阳水族","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/bec96cc64c4b0fde273c9a6e395c518a","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"湘阳水族","cpdata":"","latitude":"28.189848","discount_flag":"0"},{"rating":"","tel":"","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037919","address":"金苹果扬帆市场E9栋10号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFGA45UF","name":"水森林鱼艺创意生活馆","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/97189fa8fb836455e7ded28de1539433","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"水森林鱼艺创意生活馆","cpdata":"","latitude":"28.189610","discount_flag":"0"},{"rating":"","tel":"","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037857","address":"荷花路610号附近","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFH6KQS1","name":"可丽爱水族生活馆(扬帆店)","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/b856f2fddb6e2deb804e4a1cd6fca8d1","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"可丽爱水族生活馆(扬帆店)","cpdata":"","latitude":"28.189846","discount_flag":"0"},{"rating":"3.5","tel":"0731-85148699","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037834","address":"金苹果扬帆大市场E4栋-8号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFFQ7BSC","name":"闽江水族(扬帆小区西)","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/2709f078b19d94f477265468fb068360","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"闽江水族(扬帆小区西)","cpdata":"","latitude":"28.189847","discount_flag":"0"},{"rating":"5","tel":"13974840573","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037804","address":"古曲中路扬帆小区E-4栋7号门面","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFH6KR5O","name":"方哥金鱼锦鲤批发中心","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/47a9f7f0e6caa0838a69dc77ef793afb","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"方哥金鱼锦鲤批发中心","cpdata":"","latitude":"28.189846","discount_flag":"0"},{"rating":"","tel":"0731-85576062","typecode":"061211","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037806","address":"扬帆小区E9栋8号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFH86O0U","name":"威顺宠物水族用品批发店","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/b74946382ffc6ecf313f81e2e8522a6a","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"061211","disp_name":"威顺宠物水族用品批发店","cpdata":"","latitude":"28.189609","discount_flag":"0"},{"rating":"","tel":"0731-82562071;13787262098","typecode":"060502|060501","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037641","address":"扬帆小区E4栋6号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFFQ7E92","name":"利钧花鸟批发专店","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/7dbed3b70bc0332d6f19d3ef37e80d07","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502|060501","disp_name":"利钧花鸟批发专店","cpdata":"","latitude":"28.189937","discount_flag":"0"},{"rating":"","tel":"0731-84420870;13973114985","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037655","address":"金苹果扬帆大市场E4栋-4号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFGAAZEQ","name":"名仕水族批发(总店)","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/6bcf6364f0086cc694d13d5d5d7017fc","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"名仕水族批发(总店)","cpdata":"","latitude":"28.189842","discount_flag":"0"},{"rating":"","tel":"13973009116","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037578","address":"荷花路610号附近","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFH6KQRH","name":"旺家美花卉水族馆","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/01a7ef414b06cbdac43dbef16d59f7cc","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"旺家美花卉水族馆","cpdata":"","latitude":"28.189843","discount_flag":"0"},{"rating":"","tel":"","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037592","address":"扬帆小区E9栋-5号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFH6KR4P","name":"阿梅水族批发","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/9bb0da87b7aa80957eadd4c8310d0d56","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"阿梅水族批发","cpdata":"","latitude":"28.189712","discount_flag":"0"},{"rating":"","tel":"13170481820;13170488159","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037574","address":"东屯渡街道扬帆小区E9栋","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFG9YMUY","name":"宋氏水族馆","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/42a6659559e338f553f3d9d822aac298","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"宋氏水族馆","cpdata":"","latitude":"28.189604","discount_flag":"0"},{"rating":"","tel":"18302079703","typecode":"060502","areacode":"0731","cityname":"长沙市","display_brand":"","shape_region":"","longitude":"113.037438","address":"扬帆小区e4栋2号","cinemazuo_flag":"0","diner_flag":"0","id":"B0FFG9WXV5","name":"聚友轩水族馆","group_flag":"0","distance":"0","entrances":[],"recommend_flag":"0","exits":[],"adcode":"430102","domain_list":[{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/a90f112b20c9dbf3e8627d434232e326","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}],"newtype":"060502","disp_name":"聚友轩水族馆","cpdata":"","latitude":"28.189846","discount_flag":"0"}] + * classify : [{"checkedvalue":"filter_keywords=宠物市场","category":[{"alias":"","multiselect":"","name":"全部分类","value":"category=0601|061000|061001|0603|0606|0607|0605|060800|0613","display":""},{"alias":"","multiselect":"","name":"超市","value":"filter_keywords=超市","display":""},{"category":[{"alias":"","name":"全部","value":"category=060101|060103"},{"alias":"","name":"购物中心","value":"filter_keywords=购物中心"},{"alias":"","name":"免税品店","value":"category=060103"}],"alias":"","multiselect":"","name":"综合商场","display":""},{"category":[{"alias":"","name":"全部","value":"category=061000|061001"},{"alias":"","name":"特色商业街","value":"category=061000"},{"alias":"","name":"步行街","value":"filter_keywords=步行街"}],"alias":"","multiselect":"","name":"商业街","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=家电卖场"},{"alias":"","name":"家电电子卖场","value":"category=060300"},{"alias":"","name":"综合家电商场","value":"filter_keywords=综合家电"},{"alias":"","name":"国美","value":"category=060302"},{"alias":"","name":"大中","value":"filter_keywords=大中电器"},{"alias":"","name":"苏宁","value":"category=060304"},{"alias":"","name":"手机销售","value":"filter_keywords=手机销售"},{"alias":"","name":"数码电子","value":"filter_keywords=数码电子"}],"alias":"","multiselect":"","name":"家电","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=家具建材"},{"alias":"","name":"家具建材市场","value":"category=060601"},{"alias":"","name":"家具城","value":"filter_keywords=家具城"},{"alias":"","name":"建材五金市场","value":"filter_keywords=建材五金市场"},{"alias":"","name":"厨卫市场","value":"category=060604"},{"alias":"","name":"布艺市场","value":"category=060605"},{"alias":"","name":"灯具瓷器市场","value":"category=060606"}],"alias":"","multiselect":"","name":"家具建材","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=综合市场"},{"alias":"","name":"小商品市场","value":"filter_keywords=小商品批发市场"},{"alias":"","name":"旧货市场","value":"category=060702"},{"alias":"","name":"农副产品市场","value":"filter_keywords=农产品批发市场"},{"alias":"","name":"果品市场","value":"filter_keywords=果品批发市场"},{"alias":"","name":"蔬菜市场","value":"filter_keywords=蔬菜市场"},{"alias":"","name":"水产海鲜市场","value":"filter_keywords=水产海鲜市场"}],"alias":"","multiselect":"","name":"综合市场","display":""},{"alias":"","multiselect":"","name":"文化用品店","value":"filter_keywords=文化办公用品","display":""},{"category":[{"alias":"","name":"全部","value":"category=060500|060501|060502"},{"alias":"","name":"花鸟鱼虫市场","value":"filter_keywords=花鸟市场"},{"alias":"","name":"花卉市场","value":"filter_keywords=花卉市场"},{"alias":"","name":"宠物市场","value":"filter_keywords=宠物市场"}],"alias":"","multiselect":"","name":"花鸟市场","display":""},{"category":[{"alias":"","name":"全部","value":"category=061301|061302"},{"alias":"","name":"拍卖行","value":"category=061301"},{"alias":"","name":"典当行","value":"category=061302"}],"alias":"","multiselect":"","name":"买卖场所","display":""}],"name":"全部分类","ctype":"category","flag":2},{"checkedvalue":"sort_rule=0;reserved_keywords=true","category":[{"name":"推荐排序","value":"sort_rule=0;reserved_keywords=true"},{"name":"距离优先","value":"sort_rule=1;reserved_keywords=true"},{"name":"好评优先","value":"sort_rule=5;sort_fields=rating:d;reserved_keywords=true"},{"name":"低价优先","value":"sort_rule=5;sort_fields=averagecost:a0;reserved_keywords=true"},{"name":"高价优先","value":"sort_rule=5;sort_fields=averagecost:d;reserved_keywords=true"}],"name":"排序","ctype":"filter"}] + * busline_list : [] + */ + + private DataBean data; + private boolean SPQ; + private boolean isSPQ; + /** + * classify_type : {"checkedvalue":"filter_keywords=宠物市场","category":[{"alias":"","multiselect":"","name":"全部分类","value":"category=0601|061000|061001|0603|0606|0607|0605|060800|0613","display":""},{"alias":"","multiselect":"","name":"超市","value":"filter_keywords=超市","display":""},{"category":[{"alias":"","name":"全部","value":"category=060101|060103"},{"alias":"","name":"购物中心","value":"filter_keywords=购物中心"},{"alias":"","name":"免税品店","value":"category=060103"}],"alias":"","multiselect":"","name":"综合商场","display":""},{"category":[{"alias":"","name":"全部","value":"category=061000|061001"},{"alias":"","name":"特色商业街","value":"category=061000"},{"alias":"","name":"步行街","value":"filter_keywords=步行街"}],"alias":"","multiselect":"","name":"商业街","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=家电卖场"},{"alias":"","name":"家电电子卖场","value":"category=060300"},{"alias":"","name":"综合家电商场","value":"filter_keywords=综合家电"},{"alias":"","name":"国美","value":"category=060302"},{"alias":"","name":"大中","value":"filter_keywords=大中电器"},{"alias":"","name":"苏宁","value":"category=060304"},{"alias":"","name":"手机销售","value":"filter_keywords=手机销售"},{"alias":"","name":"数码电子","value":"filter_keywords=数码电子"}],"alias":"","multiselect":"","name":"家电","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=家具建材"},{"alias":"","name":"家具建材市场","value":"category=060601"},{"alias":"","name":"家具城","value":"filter_keywords=家具城"},{"alias":"","name":"建材五金市场","value":"filter_keywords=建材五金市场"},{"alias":"","name":"厨卫市场","value":"category=060604"},{"alias":"","name":"布艺市场","value":"category=060605"},{"alias":"","name":"灯具瓷器市场","value":"category=060606"}],"alias":"","multiselect":"","name":"家具建材","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=综合市场"},{"alias":"","name":"小商品市场","value":"filter_keywords=小商品批发市场"},{"alias":"","name":"旧货市场","value":"category=060702"},{"alias":"","name":"农副产品市场","value":"filter_keywords=农产品批发市场"},{"alias":"","name":"果品市场","value":"filter_keywords=果品批发市场"},{"alias":"","name":"蔬菜市场","value":"filter_keywords=蔬菜市场"},{"alias":"","name":"水产海鲜市场","value":"filter_keywords=水产海鲜市场"}],"alias":"","multiselect":"","name":"综合市场","display":""},{"alias":"","multiselect":"","name":"文化用品店","value":"filter_keywords=文化办公用品","display":""},{"category":[{"alias":"","name":"全部","value":"category=060500|060501|060502"},{"alias":"","name":"花鸟鱼虫市场","value":"filter_keywords=花鸟市场"},{"alias":"","name":"花卉市场","value":"filter_keywords=花卉市场"},{"alias":"","name":"宠物市场","value":"filter_keywords=宠物市场"}],"alias":"","multiselect":"","name":"花鸟市场","display":""},{"category":[{"alias":"","name":"全部","value":"category=061301|061302"},{"alias":"","name":"拍卖行","value":"category=061301"},{"alias":"","name":"典当行","value":"category=061302"}],"alias":"","multiselect":"","name":"买卖场所","display":""}],"name":"全部分类","ctype":"category","flag":2} + * classify_sort : {"checkedvalue":"sort_rule=0;reserved_keywords=true","category":[{"name":"推荐排序","value":"sort_rule=0;reserved_keywords=true"},{"name":"距离优先","value":"sort_rule=1;reserved_keywords=true"},{"name":"好评优先","value":"sort_rule=5;sort_fields=rating:d;reserved_keywords=true"},{"name":"低价优先","value":"sort_rule=5;sort_fields=averagecost:a0;reserved_keywords=true"},{"name":"高价优先","value":"sort_rule=5;sort_fields=averagecost:d;reserved_keywords=true"}],"name":"排序","ctype":"filter"} + * count : 2 + */ + + private ClassifyBean classify; + /** + * citycode : 0731 + * adcode : 430100 + * name : 长沙市 + * center : 112.982279,28.19409 + * level : city + * districts : [{"citycode":"0731","adcode":"430102","name":"芙蓉区","center":"112.988094,28.193106","level":"district","districts":[{"citycode":"0731","adcode":"430102","name":"德政园","center":"113.022609,28.186145","level":"biz_area","areacode":"19749","districts":[]},{"citycode":"0731","adcode":"430102","name":"定王台","center":"112.985227,28.190025","level":"biz_area","areacode":"19750","districts":[]},{"citycode":"0731","adcode":"430102","name":"黄兴路","center":"112.976687,28.190437","level":"biz_area","areacode":"19751","districts":[]},{"citycode":"0731","adcode":"430102","name":"韭菜园","center":"112.988766,28.194756","level":"biz_area","areacode":"19752","districts":[]},{"citycode":"0731","adcode":"430102","name":"马王堆","center":"113.028870,28.195465","level":"biz_area","areacode":"19753","districts":[]},{"citycode":"0731","adcode":"430102","name":"五里牌","center":"113.011699,28.198328","level":"biz_area","areacode":"19754","districts":[]},{"citycode":"0731","adcode":"430102","name":"湘湖","center":"113.012682,28.205252","level":"biz_area","areacode":"19755","districts":[]},{"citycode":"0731","adcode":"430102","name":"袁家岭","center":"112.997033,28.194455","level":"biz_area","areacode":"19756","districts":[]},{"citycode":"0731","adcode":"430102","name":"八一路","center":"113.000355,28.197485","level":"biz_area","areacode":"19757","districts":[]},{"citycode":"0731","adcode":"430102","name":"朝阳路","center":"113.007038,28.189212","level":"biz_area","areacode":"19758","districts":[]},{"citycode":"0731","adcode":"430102","name":"东屯渡","center":"113.038626,28.194082","level":"biz_area","areacode":"19759","districts":[]},{"citycode":"0731","adcode":"430102","name":"芙蓉广场","center":"112.995054,28.197940","level":"biz_area","areacode":"19760","districts":[]},{"citycode":"0731","adcode":"430102","name":"芙蓉中路","center":"112.986125,28.187681","level":"biz_area","areacode":"19761","districts":[]},{"citycode":"0731","adcode":"430102","name":"荷花路","center":"113.032740,28.191378","level":"biz_area","areacode":"19762","districts":[]},{"citycode":"0731","adcode":"430102","name":"荷花园","center":"113.021219,28.191605","level":"biz_area","areacode":"19763","districts":[]},{"citycode":"0731","adcode":"430102","name":"火星","center":"113.023431,28.202349","level":"biz_area","areacode":"19764","districts":[]},{"citycode":"0731","adcode":"430102","name":"凌霄路","center":"113.029080,28.202090","level":"biz_area","areacode":"19765","districts":[]},{"citycode":"0731","adcode":"430102","name":"浏正街","center":"112.984803,28.191896","level":"biz_area","areacode":"19766","districts":[]},{"citycode":"0731","adcode":"430102","name":"三湘大市场","center":"113.016648,28.202302","level":"biz_area","areacode":"19768","districts":[]},{"citycode":"0731","adcode":"430102","name":"万家丽","center":"113.030236,28.185394","level":"biz_area","areacode":"19770","districts":[]},{"citycode":"0731","adcode":"430102","name":"文艺路","center":"112.994009,28.191407","level":"biz_area","areacode":"19771","districts":[]},{"citycode":"0731","adcode":"430102","name":"五一大道","center":"112.988446,28.194898","level":"biz_area","areacode":"19772","districts":[]},{"citycode":"0731","adcode":"430102","name":"燕山街","center":"113.000486,28.196539","level":"biz_area","areacode":"19773","districts":[]},{"citycode":"0731","adcode":"430102","name":"远大路","center":"113.027617,28.198384","level":"biz_area","areacode":"19774","districts":[]},{"citycode":"0731","adcode":"430102","name":"中山路","center":"112.979051,28.199921","level":"biz_area","areacode":"19775","districts":[]},{"citycode":"0731","adcode":"430102","name":"车站中路","center":"113.010938,28.193068","level":"biz_area","areacode":"19776","districts":[]},{"citycode":"0731","adcode":"430102","name":"芙蓉区政府","center":"113.003653,28.194434","level":"biz_area","areacode":"19785","districts":[]},{"citycode":"0731","adcode":"430102","name":"解放东路","center":"113.005201,28.190678","level":"biz_area","areacode":"19792","districts":[]},{"citycode":"0731","adcode":"430102","name":"解放西路","center":"112.979381,28.191326","level":"biz_area","areacode":"19813","districts":[]},{"citycode":"0731","adcode":"430102","name":"都正街","center":"112.981833,28.187702","level":"biz_area","areacode":"19814","districts":[]},{"citycode":"0731","adcode":"430102","name":"火车站","center":"113.011203,28.193686","level":"biz_area","areacode":"19830","districts":[]},{"citycode":"0731","adcode":"430102","name":"车站北路","center":"113.009321,28.207354","level":"biz_area","areacode":"19845","districts":[]}]},{"citycode":"0731","adcode":"430103","name":"天心区","center":"112.97307,28.192375","level":"district","districts":[{"citycode":"0731","adcode":"430103","name":"韶山南路","center":"113.000079,28.135185","level":"biz_area","areacode":"19782","districts":[]},{"citycode":"0731","adcode":"430103","name":"城南路","center":"112.983886,28.182259","level":"biz_area","areacode":"19787","districts":[]},{"citycode":"0731","adcode":"430103","name":"劳动西路","center":"112.983972,28.173499","level":"biz_area","areacode":"19797","districts":[]},{"citycode":"0731","adcode":"430103","name":"黄土岭","center":"112.985897,28.161960","level":"biz_area","areacode":"19808","districts":[]},{"citycode":"0731","adcode":"430103","name":"友谊路","center":"112.997239,28.125006","level":"biz_area","areacode":"19809","districts":[]},{"citycode":"0731","adcode":"430103","name":"裕南街","center":"112.972993,28.172404","level":"biz_area","areacode":"19810","districts":[]},{"citycode":"0731","adcode":"430103","name":"芙蓉南路","center":"112.986581,28.132236","level":"biz_area","areacode":"19811","districts":[]},{"citycode":"0731","adcode":"430103","name":"赤岭路","center":"112.979397,28.153046","level":"biz_area","areacode":"19812","districts":[]},{"citycode":"0731","adcode":"430103","name":"芙蓉南路","center":"112.987141,28.124923","level":"biz_area","areacode":"19816","districts":[]},{"citycode":"0731","adcode":"430103","name":"白沙路","center":"112.982195,28.182379","level":"biz_area","areacode":"19818","districts":[]},{"citycode":"0731","adcode":"430103","name":"碧湘街","center":"112.972105,28.182679","level":"biz_area","areacode":"19819","districts":[]},{"citycode":"0731","adcode":"430103","name":"金盆岭","center":"112.977234,28.151578","level":"biz_area","areacode":"19822","districts":[]},{"citycode":"0731","adcode":"430103","name":"南湖路","center":"112.977905,28.165537","level":"biz_area","areacode":"19825","districts":[]},{"citycode":"0731","adcode":"430103","name":"南门口","center":"112.975929,28.183259","level":"biz_area","areacode":"19827","districts":[]},{"citycode":"0731","adcode":"430103","name":"坡子街","center":"112.973189,28.190238","level":"biz_area","areacode":"19828","districts":[]},{"citycode":"0731","adcode":"430103","name":"青园","center":"112.994944,28.128891","level":"biz_area","areacode":"19829","districts":[]},{"citycode":"0731","adcode":"430103","name":"书院路","center":"112.971563,28.175927","level":"biz_area","areacode":"19832","districts":[]},{"citycode":"0731","adcode":"430103","name":"书院南路","center":"112.972190,28.150083","level":"biz_area","areacode":"19833","districts":[]},{"citycode":"0731","adcode":"430103","name":"天心阁","center":"112.981184,28.184664","level":"biz_area","areacode":"19835","districts":[]},{"citycode":"0731","adcode":"430103","name":"西牌楼","center":"112.972712,28.193602","level":"biz_area","areacode":"19837","districts":[]},{"citycode":"0731","adcode":"430103","name":"新开铺","center":"112.970512,28.133102","level":"biz_area","areacode":"19838","districts":[]},{"citycode":"0731","adcode":"430103","name":"铁道学院","center":"112.992682,28.140356","level":"biz_area","areacode":"19839","districts":[]},{"citycode":"0731","adcode":"430103","name":"西湖","center":"112.967188,28.187826","level":"biz_area","areacode":"19879","districts":[]}]},{"citycode":"0731","adcode":"430104","name":"岳麓区","center":"112.911591,28.213044","level":"district","districts":[{"citycode":"0731","adcode":"430104","name":"观沙岭","center":"112.950525,28.235600","level":"biz_area","areacode":"19861","districts":[]},{"citycode":"0731","adcode":"430104","name":"湖南商学院","center":"112.918042,28.219331","level":"biz_area","areacode":"19862","districts":[]},{"citycode":"0731","adcode":"430104","name":"麓谷","center":"112.889410,28.214029","level":"biz_area","areacode":"19863","districts":[]},{"citycode":"0731","adcode":"430104","name":"汽车西站","center":"112.910711,28.209866","level":"biz_area","areacode":"19864","districts":[]},{"citycode":"0731","adcode":"430104","name":"桐梓坡","center":"112.930153,28.218539","level":"biz_area","areacode":"19865","districts":[]},{"citycode":"0731","adcode":"430104","name":"望月湖","center":"112.955265,28.204105","level":"biz_area","areacode":"19866","districts":[]},{"citycode":"0731","adcode":"430104","name":"咸嘉湖","center":"112.930929,28.212604","level":"biz_area","areacode":"19867","districts":[]},{"citycode":"0731","adcode":"430104","name":"岳麓山","center":"112.943829,28.178123","level":"biz_area","areacode":"19868","districts":[]},{"citycode":"0731","adcode":"430104","name":"玉兰路","center":"112.910965,28.214257","level":"biz_area","areacode":"19869","districts":[]},{"citycode":"0731","adcode":"430104","name":"白沙液街","center":"112.952884,28.201147","level":"biz_area","areacode":"19870","districts":[]},{"citycode":"0731","adcode":"430104","name":"枫林一路","center":"112.946030,28.198881","level":"biz_area","areacode":"19871","districts":[]},{"citycode":"0731","adcode":"430104","name":"湖南大学","center":"112.945213,28.177733","level":"biz_area","areacode":"19872","districts":[]},{"citycode":"0731","adcode":"430104","name":"湖南师范大学","center":"112.948495,28.187094","level":"biz_area","areacode":"19873","districts":[]},{"citycode":"0731","adcode":"430104","name":"雷锋大道","center":"112.899515,28.237511","level":"biz_area","areacode":"19874","districts":[]},{"citycode":"0731","adcode":"430104","name":"麓山路","center":"112.949074,28.189117","level":"biz_area","areacode":"19875","districts":[]},{"citycode":"0731","adcode":"430104","name":"桐梓坡路","center":"112.934137,28.218532","level":"biz_area","areacode":"19876","districts":[]},{"citycode":"0731","adcode":"430104","name":"望城坡","center":"112.912119,28.213111","level":"biz_area","areacode":"19877","districts":[]},{"citycode":"0731","adcode":"430104","name":"望岳","center":"112.922311,28.221183","level":"biz_area","areacode":"19878","districts":[]},{"citycode":"0731","adcode":"430104","name":"咸嘉新村","center":"112.927504,28.220168","level":"biz_area","areacode":"19880","districts":[]},{"citycode":"0731","adcode":"430104","name":"新民路","center":"112.953168,28.192306","level":"biz_area","areacode":"19881","districts":[]},{"citycode":"0731","adcode":"430104","name":"银盆岭","center":"112.953686,28.222394","level":"biz_area","areacode":"19882","districts":[]},{"citycode":"0731","adcode":"430104","name":"中南大学","center":"112.933330,28.163911","level":"biz_area","areacode":"19883","districts":[]}]},{"citycode":"0731","adcode":"430105","name":"开福区","center":"112.985525,28.201336","level":"district","districts":[{"citycode":"0731","adcode":"430105","name":"五一广场","center":"112.976276,28.195472","level":"biz_area","areacode":"19840","districts":[]},{"citycode":"0731","adcode":"430105","name":"四方坪","center":"113.010379,28.235254","level":"biz_area","areacode":"19841","districts":[]},{"citycode":"0731","adcode":"430105","name":"伍家岭","center":"112.989085,28.229513","level":"biz_area","areacode":"19842","districts":[]},{"citycode":"0731","adcode":"430105","name":"湘雅医院","center":"112.970288,28.208441","level":"biz_area","areacode":"19843","districts":[]},{"citycode":"0731","adcode":"430105","name":"营盘路","center":"112.980982,28.204196","level":"biz_area","areacode":"19844","districts":[]},{"citycode":"0731","adcode":"430105","name":"芙蓉北路","center":"112.984343,28.253526","level":"biz_area","areacode":"19846","districts":[]},{"citycode":"0731","adcode":"430105","name":"北正街","center":"112.976591,28.206011","level":"biz_area","areacode":"19847","districts":[]},{"citycode":"0731","adcode":"430105","name":"蔡锷北路","center":"112.981659,28.206246","level":"biz_area","areacode":"19848","districts":[]},{"citycode":"0731","adcode":"430105","name":"德雅路","center":"113.004718,28.222866","level":"biz_area","areacode":"19849","districts":[]},{"citycode":"0731","adcode":"430105","name":"东风路","center":"112.992763,28.217975","level":"biz_area","areacode":"19850","districts":[]},{"citycode":"0731","adcode":"430105","name":"华夏路","center":"112.982770,28.224978","level":"biz_area","areacode":"19851","districts":[]},{"citycode":"0731","adcode":"430105","name":"开福寺","center":"112.980862,28.223230","level":"biz_area","areacode":"19852","districts":[]},{"citycode":"0731","adcode":"430105","name":"科大佳园","center":"113.003668,28.236008","level":"biz_area","areacode":"19853","districts":[]},{"citycode":"0731","adcode":"430105","name":"麻园岭","center":"112.984825,28.215030","level":"biz_area","areacode":"19854","districts":[]},{"citycode":"0731","adcode":"430105","name":"清水塘","center":"112.988751,28.200502","level":"biz_area","areacode":"19855","districts":[]},{"citycode":"0731","adcode":"430105","name":"三一大道","center":"113.005297,28.231043","level":"biz_area","areacode":"19856","districts":[]},{"citycode":"0731","adcode":"430105","name":"通泰街","center":"112.974645,28.206132","level":"biz_area","areacode":"19857","districts":[]},{"citycode":"0731","adcode":"430105","name":"湘江中路","center":"112.972143,28.203561","level":"biz_area","areacode":"19858","districts":[]},{"citycode":"0731","adcode":"430105","name":"湘雅路","center":"112.979935,28.213924","level":"biz_area","areacode":"19859","districts":[]},{"citycode":"0731","adcode":"430105","name":"新河","center":"112.982264,28.227548","level":"biz_area","areacode":"19860","districts":[]}]},{"citycode":"0731","adcode":"430111","name":"雨花区","center":"113.016337,28.109937","level":"district","districts":[{"citycode":"0731","adcode":"430111","name":"人民中路","center":"113.001047,28.185355","level":"biz_area","areacode":"19767","districts":[]},{"citycode":"0731","adcode":"430111","name":"曙光路","center":"113.001969,28.179694","level":"biz_area","areacode":"19769","districts":[]},{"citycode":"0731","adcode":"430111","name":"窑岭","center":"112.998484,28.185167","level":"biz_area","areacode":"19777","districts":[]},{"citycode":"0731","adcode":"430111","name":"茶园坡","center":"113.008657,28.159707","level":"biz_area","areacode":"19778","districts":[]},{"citycode":"0731","adcode":"430111","name":"东塘","center":"112.994720,28.168757","level":"biz_area","areacode":"19779","districts":[]},{"citycode":"0731","adcode":"430111","name":"高桥","center":"113.022508,28.172998","level":"biz_area","areacode":"19780","districts":[]},{"citycode":"0731","adcode":"430111","name":"砂子塘","center":"112.997399,28.161249","level":"biz_area","areacode":"19781","districts":[]},{"citycode":"0731","adcode":"430111","name":"雨花亭","center":"112.997573,28.150595","level":"biz_area","areacode":"19783","districts":[]},{"citycode":"0731","adcode":"430111","name":"左家塘","center":"113.003294,28.176401","level":"biz_area","areacode":"19784","districts":[]},{"citycode":"0731","adcode":"430111","name":"小林子冲","center":"112.988135,28.177010","level":"biz_area","areacode":"19786","districts":[]},{"citycode":"0731","adcode":"430111","name":"阿弥岭","center":"113.006469,28.172421","level":"biz_area","areacode":"19788","districts":[]},{"citycode":"0731","adcode":"430111","name":"圭塘","center":"113.033391,28.139720","level":"biz_area","areacode":"19794","districts":[]},{"citycode":"0731","adcode":"430111","name":"红花坡","center":"113.005448,28.165878","level":"biz_area","areacode":"19795","districts":[]},{"citycode":"0731","adcode":"430111","name":"井湾子","center":"113.009767,28.124386","level":"biz_area","areacode":"19796","districts":[]},{"citycode":"0731","adcode":"430111","name":"劳动中路","center":"113.002097,28.163422","level":"biz_area","areacode":"19798","districts":[]},{"citycode":"0731","adcode":"430111","name":"曲塘","center":"113.032987,28.148308","level":"biz_area","areacode":"19799","districts":[]},{"citycode":"0731","adcode":"430111","name":"韶山中路","center":"112.994247,28.158138","level":"biz_area","areacode":"19800","districts":[]},{"citycode":"0731","adcode":"430111","name":"树木岭","center":"113.022365,28.150991","level":"biz_area","areacode":"19801","districts":[]},{"citycode":"0731","adcode":"430111","name":"王家冲","center":"113.001659,28.152828","level":"biz_area","areacode":"19802","districts":[]},{"citycode":"0731","adcode":"430111","name":"香樟路","center":"113.012409,28.136391","level":"biz_area","areacode":"19803","districts":[]},{"citycode":"0731","adcode":"430111","name":"雨花区政府","center":"113.018871,28.146627","level":"biz_area","areacode":"19804","districts":[]},{"citycode":"0731","adcode":"430111","name":"植物园","center":"113.019004,28.103487","level":"biz_area","areacode":"19805","districts":[]},{"citycode":"0731","adcode":"430111","name":"梓园路","center":"112.991337,28.178514","level":"biz_area","areacode":"19806","districts":[]},{"citycode":"0731","adcode":"430111","name":"侯家塘","center":"112.985710,28.173230","level":"biz_area","areacode":"19807","districts":[]}]},{"citycode":"0731","adcode":"430112","name":"望城区","center":"112.819549,28.347458","level":"district","districts":[]},{"citycode":"0731","adcode":"430121","name":"长沙县","center":"113.080098,28.237888","level":"district","districts":[]},{"citycode":"0731","adcode":"430124","name":"宁乡县","center":"112.553182,28.253928","level":"district","districts":[]},{"citycode":"0731","adcode":"430181","name":"浏阳市","center":"113.633301,28.141112","level":"district","districts":[]}] + * checkedvalue : query_type=TQUERY + */ + + private BizAreaDataBean bizAreaData; + private boolean classifyFlag; + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public SearchOptBean getSearchOpt() { + return searchOpt; + } + + public void setSearchOpt(SearchOptBean searchOpt) { + this.searchOpt = searchOpt; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public boolean isSPQ() { + return SPQ; + } + + public void setSPQ(boolean SPQ) { + this.SPQ = SPQ; + } + + public boolean isIsSPQ() { + return isSPQ; + } + + public void setIsSPQ(boolean isSPQ) { + this.isSPQ = isSPQ; + } + + public ClassifyBean getClassify() { + return classify; + } + + public void setClassify(ClassifyBean classify) { + this.classify = classify; + } + + public BizAreaDataBean getBizAreaData() { + return bizAreaData; + } + + public void setBizAreaData(BizAreaDataBean bizAreaData) { + this.bizAreaData = bizAreaData; + } + + public boolean isClassifyFlag() { + return classifyFlag; + } + + public void setClassifyFlag(boolean classifyFlag) { + this.classifyFlag = classifyFlag; + } + + public static class SearchOptBean { + private String city; + private String pageSize; + private String pageIndex; + private String ac; + private String keyword; + private String type; + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getPageSize() { + return pageSize; + } + + public void setPageSize(String pageSize) { + this.pageSize = pageSize; + } + + public String getPageIndex() { + return pageIndex; + } + + public void setPageIndex(String pageIndex) { + this.pageIndex = pageIndex; + } + + public String getAc() { + return ac; + } + + public void setAc(String ac) { + this.ac = ac; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + } + + public static class DataBean { + private int codepoint; + private String code; + private String timestamp; + /** + * cache_directive : {"cache_filter":{"flag":"1","expires":"24"},"cache_all":{"flag":"0"}} + * query_intent : {"cate_list":"","type":"1000","cate":"06","cate_ext":""} + * classify_range : {"district_adcode":"430100","subway_adcode":"430100","nearby_enable":"1","subway_enable":"1","district_enable":"1"} + * general_flag : + * specialclassify : + * view_region : 113.029599800,28.194115900,113.123658200,28.181505100 + * suggestcontent : + * pdheatmap : + * render_name_flag : 1 + * is_current_city : 2 + * expand_range_tip : + * suggest_query : {"data":[],"col":"","row":""} + * change_query_tip : + * is_tupu_sug : 0 + * has_recommend : 0 + * brand_intent : {"t_tag":"","flag":"0","cate":"","name":""} + * suggestionview : 1 + * change_query_type : + * business : + * car_icon_flag : 0 + * slayer_type : none + * show_pic : + * is_view_city : 1 + * querytype : 5 + * self_navigation : + * showaoi : + * utd_sceneid : 1000 + * distance_info : + * slayer : 1 + * target_view_city : + * call_taxi : 0 + * preload_next_page : 1 + * magic_box : {} + * activity : {"new_year":{"flag":"0","tip":""}} + */ + + private LqiiBean lqii; + private String general_flag; + private String result; + private String keywords; + private String message; + private String total; + private String is_general_search; + private String bounds; + private String version; + private String busline_count; + private MagicboxDataBean magicbox_data; + private String interior_count; + private List bus_list; + /** + * rating : + * tel : 15873110896 + * typecode : 060502 + * areacode : 0731 + * cityname : 长沙市 + * display_brand : + * shape_region : + * longitude : 113.085508 + * address : 湖南农业大学农大路东湖小区9栋1号门面 + * cinemazuo_flag : 0 + * diner_flag : 0 + * id : B0FFF00687 + * name : 宠物森林宠物店 + * group_flag : 0 + * distance : 0 + * entrances : [] + * recommend_flag : 0 + * exits : [] + * adcode : 430102 + * domain_list : [{"type":"html","id":"1015","name":"poiclosed"},{"type":"img","id":"1003","name":"icon"},{"type":"html","id":"1011","name":"traffic"},{"type":"text","id":"1014","name":"roadaoi"},{"type":"button","id":"1012","name":"ext_btn"},{"type":"webimg","id":"1009","value":"http://store.is.autonavi.com/showpic/2e1f07ad78ffb766518e2ab25bfe3373","name":"pic_info"},{"type":"img","id":"1008","name":"overbooked"},{"type":"img","id":"1007","name":"moreservice"},{"type":"html","id":"1006","name":"tag"},{"type":"text","id":"1005","name":"parent_info"},{"type":"array","name":"parent_other_rel","id":"1004"},{"type":"text","id":"1010","name":"business_area"},{"type":"html","id":"1002","name":"deepinfo"},{"type":"html","id":"1001","name":"price"},{"type":"text","id":"1013","name":"aoi"}] + * newtype : 060502 + * disp_name : 宠物森林宠物店 + * cpdata : + * latitude : 28.186454 + * discount_flag : 0 + */ + + private List poi_list; + /** + * checkedvalue : filter_keywords=宠物市场 + * category : [{"alias":"","multiselect":"","name":"全部分类","value":"category=0601|061000|061001|0603|0606|0607|0605|060800|0613","display":""},{"alias":"","multiselect":"","name":"超市","value":"filter_keywords=超市","display":""},{"category":[{"alias":"","name":"全部","value":"category=060101|060103"},{"alias":"","name":"购物中心","value":"filter_keywords=购物中心"},{"alias":"","name":"免税品店","value":"category=060103"}],"alias":"","multiselect":"","name":"综合商场","display":""},{"category":[{"alias":"","name":"全部","value":"category=061000|061001"},{"alias":"","name":"特色商业街","value":"category=061000"},{"alias":"","name":"步行街","value":"filter_keywords=步行街"}],"alias":"","multiselect":"","name":"商业街","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=家电卖场"},{"alias":"","name":"家电电子卖场","value":"category=060300"},{"alias":"","name":"综合家电商场","value":"filter_keywords=综合家电"},{"alias":"","name":"国美","value":"category=060302"},{"alias":"","name":"大中","value":"filter_keywords=大中电器"},{"alias":"","name":"苏宁","value":"category=060304"},{"alias":"","name":"手机销售","value":"filter_keywords=手机销售"},{"alias":"","name":"数码电子","value":"filter_keywords=数码电子"}],"alias":"","multiselect":"","name":"家电","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=家具建材"},{"alias":"","name":"家具建材市场","value":"category=060601"},{"alias":"","name":"家具城","value":"filter_keywords=家具城"},{"alias":"","name":"建材五金市场","value":"filter_keywords=建材五金市场"},{"alias":"","name":"厨卫市场","value":"category=060604"},{"alias":"","name":"布艺市场","value":"category=060605"},{"alias":"","name":"灯具瓷器市场","value":"category=060606"}],"alias":"","multiselect":"","name":"家具建材","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=综合市场"},{"alias":"","name":"小商品市场","value":"filter_keywords=小商品批发市场"},{"alias":"","name":"旧货市场","value":"category=060702"},{"alias":"","name":"农副产品市场","value":"filter_keywords=农产品批发市场"},{"alias":"","name":"果品市场","value":"filter_keywords=果品批发市场"},{"alias":"","name":"蔬菜市场","value":"filter_keywords=蔬菜市场"},{"alias":"","name":"水产海鲜市场","value":"filter_keywords=水产海鲜市场"}],"alias":"","multiselect":"","name":"综合市场","display":""},{"alias":"","multiselect":"","name":"文化用品店","value":"filter_keywords=文化办公用品","display":""},{"category":[{"alias":"","name":"全部","value":"category=060500|060501|060502"},{"alias":"","name":"花鸟鱼虫市场","value":"filter_keywords=花鸟市场"},{"alias":"","name":"花卉市场","value":"filter_keywords=花卉市场"},{"alias":"","name":"宠物市场","value":"filter_keywords=宠物市场"}],"alias":"","multiselect":"","name":"花鸟市场","display":""},{"category":[{"alias":"","name":"全部","value":"category=061301|061302"},{"alias":"","name":"拍卖行","value":"category=061301"},{"alias":"","name":"典当行","value":"category=061302"}],"alias":"","multiselect":"","name":"买卖场所","display":""}] + * name : 全部分类 + * ctype : category + * flag : 2 + */ + + private List classify; + private List busline_list; + + public int getCodepoint() { + return codepoint; + } + + public void setCodepoint(int codepoint) { + this.codepoint = codepoint; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getTimestamp() { + return timestamp; + } + + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + public LqiiBean getLqii() { + return lqii; + } + + public void setLqii(LqiiBean lqii) { + this.lqii = lqii; + } + + public String getGeneral_flag() { + return general_flag; + } + + public void setGeneral_flag(String general_flag) { + this.general_flag = general_flag; + } + + public String getResult() { + return result; + } + + public void setResult(String result) { + this.result = result; + } + + public String getKeywords() { + return keywords; + } + + public void setKeywords(String keywords) { + this.keywords = keywords; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getTotal() { + return total; + } + + public void setTotal(String total) { + this.total = total; + } + + public String getIs_general_search() { + return is_general_search; + } + + public void setIs_general_search(String is_general_search) { + this.is_general_search = is_general_search; + } + + public String getBounds() { + return bounds; + } + + public void setBounds(String bounds) { + this.bounds = bounds; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getBusline_count() { + return busline_count; + } + + public void setBusline_count(String busline_count) { + this.busline_count = busline_count; + } + + public MagicboxDataBean getMagicbox_data() { + return magicbox_data; + } + + public void setMagicbox_data(MagicboxDataBean magicbox_data) { + this.magicbox_data = magicbox_data; + } + + public String getInterior_count() { + return interior_count; + } + + public void setInterior_count(String interior_count) { + this.interior_count = interior_count; + } + + public List getBus_list() { + return bus_list; + } + + public void setBus_list(List bus_list) { + this.bus_list = bus_list; + } + + public List getPoi_list() { + return poi_list; + } + + public void setPoi_list(List poi_list) { + this.poi_list = poi_list; + } + + public List getClassify() { + return classify; + } + + public void setClassify(List classify) { + this.classify = classify; + } + + public List getBusline_list() { + return busline_list; + } + + public void setBusline_list(List busline_list) { + this.busline_list = busline_list; + } + + public static class LqiiBean { + /** + * cache_filter : {"flag":"1","expires":"24"} + * cache_all : {"flag":"0"} + */ + + private CacheDirectiveBean cache_directive; + /** + * cate_list : + * type : 1000 + * cate : 06 + * cate_ext : + */ + + private QueryIntentBean query_intent; + /** + * district_adcode : 430100 + * subway_adcode : 430100 + * nearby_enable : 1 + * subway_enable : 1 + * district_enable : 1 + */ + + private ClassifyRangeBean classify_range; + private String general_flag; + private String specialclassify; + private String view_region; + private String suggestcontent; + private String pdheatmap; + private String render_name_flag; + private String is_current_city; + private String expand_range_tip; + /** + * data : [] + * col : + * row : + */ + + private SuggestQueryBean suggest_query; + private String change_query_tip; + private String is_tupu_sug; + private String has_recommend; + /** + * t_tag : + * flag : 0 + * cate : + * name : + */ + + private BrandIntentBean brand_intent; + private String suggestionview; + private String change_query_type; + private String business; + private String car_icon_flag; + private String slayer_type; + private String show_pic; + private String is_view_city; + private String querytype; + private String self_navigation; + private String showaoi; + private String utd_sceneid; + private String distance_info; + private String slayer; + private String target_view_city; + private String call_taxi; + private String preload_next_page; + private MagicBoxBean magic_box; + /** + * new_year : {"flag":"0","tip":""} + */ + + private ActivityBean activity; + + public CacheDirectiveBean getCache_directive() { + return cache_directive; + } + + public void setCache_directive(CacheDirectiveBean cache_directive) { + this.cache_directive = cache_directive; + } + + public QueryIntentBean getQuery_intent() { + return query_intent; + } + + public void setQuery_intent(QueryIntentBean query_intent) { + this.query_intent = query_intent; + } + + public ClassifyRangeBean getClassify_range() { + return classify_range; + } + + public void setClassify_range(ClassifyRangeBean classify_range) { + this.classify_range = classify_range; + } + + public String getGeneral_flag() { + return general_flag; + } + + public void setGeneral_flag(String general_flag) { + this.general_flag = general_flag; + } + + public String getSpecialclassify() { + return specialclassify; + } + + public void setSpecialclassify(String specialclassify) { + this.specialclassify = specialclassify; + } + + public String getView_region() { + return view_region; + } + + public void setView_region(String view_region) { + this.view_region = view_region; + } + + public String getSuggestcontent() { + return suggestcontent; + } + + public void setSuggestcontent(String suggestcontent) { + this.suggestcontent = suggestcontent; + } + + public String getPdheatmap() { + return pdheatmap; + } + + public void setPdheatmap(String pdheatmap) { + this.pdheatmap = pdheatmap; + } + + public String getRender_name_flag() { + return render_name_flag; + } + + public void setRender_name_flag(String render_name_flag) { + this.render_name_flag = render_name_flag; + } + + public String getIs_current_city() { + return is_current_city; + } + + public void setIs_current_city(String is_current_city) { + this.is_current_city = is_current_city; + } + + public String getExpand_range_tip() { + return expand_range_tip; + } + + public void setExpand_range_tip(String expand_range_tip) { + this.expand_range_tip = expand_range_tip; + } + + public SuggestQueryBean getSuggest_query() { + return suggest_query; + } + + public void setSuggest_query(SuggestQueryBean suggest_query) { + this.suggest_query = suggest_query; + } + + public String getChange_query_tip() { + return change_query_tip; + } + + public void setChange_query_tip(String change_query_tip) { + this.change_query_tip = change_query_tip; + } + + public String getIs_tupu_sug() { + return is_tupu_sug; + } + + public void setIs_tupu_sug(String is_tupu_sug) { + this.is_tupu_sug = is_tupu_sug; + } + + public String getHas_recommend() { + return has_recommend; + } + + public void setHas_recommend(String has_recommend) { + this.has_recommend = has_recommend; + } + + public BrandIntentBean getBrand_intent() { + return brand_intent; + } + + public void setBrand_intent(BrandIntentBean brand_intent) { + this.brand_intent = brand_intent; + } + + public String getSuggestionview() { + return suggestionview; + } + + public void setSuggestionview(String suggestionview) { + this.suggestionview = suggestionview; + } + + public String getChange_query_type() { + return change_query_type; + } + + public void setChange_query_type(String change_query_type) { + this.change_query_type = change_query_type; + } + + public String getBusiness() { + return business; + } + + public void setBusiness(String business) { + this.business = business; + } + + public String getCar_icon_flag() { + return car_icon_flag; + } + + public void setCar_icon_flag(String car_icon_flag) { + this.car_icon_flag = car_icon_flag; + } + + public String getSlayer_type() { + return slayer_type; + } + + public void setSlayer_type(String slayer_type) { + this.slayer_type = slayer_type; + } + + public String getShow_pic() { + return show_pic; + } + + public void setShow_pic(String show_pic) { + this.show_pic = show_pic; + } + + public String getIs_view_city() { + return is_view_city; + } + + public void setIs_view_city(String is_view_city) { + this.is_view_city = is_view_city; + } + + public String getQuerytype() { + return querytype; + } + + public void setQuerytype(String querytype) { + this.querytype = querytype; + } + + public String getSelf_navigation() { + return self_navigation; + } + + public void setSelf_navigation(String self_navigation) { + this.self_navigation = self_navigation; + } + + public String getShowaoi() { + return showaoi; + } + + public void setShowaoi(String showaoi) { + this.showaoi = showaoi; + } + + public String getUtd_sceneid() { + return utd_sceneid; + } + + public void setUtd_sceneid(String utd_sceneid) { + this.utd_sceneid = utd_sceneid; + } + + public String getDistance_info() { + return distance_info; + } + + public void setDistance_info(String distance_info) { + this.distance_info = distance_info; + } + + public String getSlayer() { + return slayer; + } + + public void setSlayer(String slayer) { + this.slayer = slayer; + } + + public String getTarget_view_city() { + return target_view_city; + } + + public void setTarget_view_city(String target_view_city) { + this.target_view_city = target_view_city; + } + + public String getCall_taxi() { + return call_taxi; + } + + public void setCall_taxi(String call_taxi) { + this.call_taxi = call_taxi; + } + + public String getPreload_next_page() { + return preload_next_page; + } + + public void setPreload_next_page(String preload_next_page) { + this.preload_next_page = preload_next_page; + } + + public MagicBoxBean getMagic_box() { + return magic_box; + } + + public void setMagic_box(MagicBoxBean magic_box) { + this.magic_box = magic_box; + } + + public ActivityBean getActivity() { + return activity; + } + + public void setActivity(ActivityBean activity) { + this.activity = activity; + } + + public static class CacheDirectiveBean { + /** + * flag : 1 + * expires : 24 + */ + + private CacheFilterBean cache_filter; + /** + * flag : 0 + */ + + private CacheAllBean cache_all; + + public CacheFilterBean getCache_filter() { + return cache_filter; + } + + public void setCache_filter(CacheFilterBean cache_filter) { + this.cache_filter = cache_filter; + } + + public CacheAllBean getCache_all() { + return cache_all; + } + + public void setCache_all(CacheAllBean cache_all) { + this.cache_all = cache_all; + } + + public static class CacheFilterBean { + private String flag; + private String expires; + + public String getFlag() { + return flag; + } + + public void setFlag(String flag) { + this.flag = flag; + } + + public String getExpires() { + return expires; + } + + public void setExpires(String expires) { + this.expires = expires; + } + } + + public static class CacheAllBean { + private String flag; + + public String getFlag() { + return flag; + } + + public void setFlag(String flag) { + this.flag = flag; + } + } + } + + public static class QueryIntentBean { + private String cate_list; + private String type; + private String cate; + private String cate_ext; + + public String getCate_list() { + return cate_list; + } + + public void setCate_list(String cate_list) { + this.cate_list = cate_list; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getCate() { + return cate; + } + + public void setCate(String cate) { + this.cate = cate; + } + + public String getCate_ext() { + return cate_ext; + } + + public void setCate_ext(String cate_ext) { + this.cate_ext = cate_ext; + } + } + + public static class ClassifyRangeBean { + private String district_adcode; + private String subway_adcode; + private String nearby_enable; + private String subway_enable; + private String district_enable; + + public String getDistrict_adcode() { + return district_adcode; + } + + public void setDistrict_adcode(String district_adcode) { + this.district_adcode = district_adcode; + } + + public String getSubway_adcode() { + return subway_adcode; + } + + public void setSubway_adcode(String subway_adcode) { + this.subway_adcode = subway_adcode; + } + + public String getNearby_enable() { + return nearby_enable; + } + + public void setNearby_enable(String nearby_enable) { + this.nearby_enable = nearby_enable; + } + + public String getSubway_enable() { + return subway_enable; + } + + public void setSubway_enable(String subway_enable) { + this.subway_enable = subway_enable; + } + + public String getDistrict_enable() { + return district_enable; + } + + public void setDistrict_enable(String district_enable) { + this.district_enable = district_enable; + } + } + + public static class SuggestQueryBean { + private String col; + private String row; + private List data; + + public String getCol() { + return col; + } + + public void setCol(String col) { + this.col = col; + } + + public String getRow() { + return row; + } + + public void setRow(String row) { + this.row = row; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + } + + public static class BrandIntentBean { + private String t_tag; + private String flag; + private String cate; + private String name; + + public String getT_tag() { + return t_tag; + } + + public void setT_tag(String t_tag) { + this.t_tag = t_tag; + } + + public String getFlag() { + return flag; + } + + public void setFlag(String flag) { + this.flag = flag; + } + + public String getCate() { + return cate; + } + + public void setCate(String cate) { + this.cate = cate; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + + public static class MagicBoxBean { + } + + public static class ActivityBean { + /** + * flag : 0 + * tip : + */ + + private NewYearBean new_year; + + public NewYearBean getNew_year() { + return new_year; + } + + public void setNew_year(NewYearBean new_year) { + this.new_year = new_year; + } + + public static class NewYearBean { + private String flag; + private String tip; + + public String getFlag() { + return flag; + } + + public void setFlag(String flag) { + this.flag = flag; + } + + public String getTip() { + return tip; + } + + public void setTip(String tip) { + this.tip = tip; + } + } + } + } + + public static class MagicboxDataBean { + } + + public static class PoiListBean { + private String rating; + private String tel; + private String typecode; + private String areacode; + private String cityname; + private String display_brand; + private String shape_region; + private String longitude; + private String address; + private String cinemazuo_flag; + private String diner_flag; + private String id; + private String name; + private String group_flag; + private String distance; + private String recommend_flag; + private String adcode; + private String newtype; + private String disp_name; + private String cpdata; + private String latitude; + private String discount_flag; + private List entrances; + private List exits; + /** + * type : html + * id : 1015 + * name : poiclosed + */ + + private List domain_list; + + public String getRating() { + return rating; + } + + public void setRating(String rating) { + this.rating = rating; + } + + public String getTel() { + return tel; + } + + public void setTel(String tel) { + this.tel = tel; + } + + public String getTypecode() { + return typecode; + } + + public void setTypecode(String typecode) { + this.typecode = typecode; + } + + public String getAreacode() { + return areacode; + } + + public void setAreacode(String areacode) { + this.areacode = areacode; + } + + public String getCityname() { + return cityname; + } + + public void setCityname(String cityname) { + this.cityname = cityname; + } + + public String getDisplay_brand() { + return display_brand; + } + + public void setDisplay_brand(String display_brand) { + this.display_brand = display_brand; + } + + public String getShape_region() { + return shape_region; + } + + public void setShape_region(String shape_region) { + this.shape_region = shape_region; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getCinemazuo_flag() { + return cinemazuo_flag; + } + + public void setCinemazuo_flag(String cinemazuo_flag) { + this.cinemazuo_flag = cinemazuo_flag; + } + + public String getDiner_flag() { + return diner_flag; + } + + public void setDiner_flag(String diner_flag) { + this.diner_flag = diner_flag; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getGroup_flag() { + return group_flag; + } + + public void setGroup_flag(String group_flag) { + this.group_flag = group_flag; + } + + public String getDistance() { + return distance; + } + + public void setDistance(String distance) { + this.distance = distance; + } + + public String getRecommend_flag() { + return recommend_flag; + } + + public void setRecommend_flag(String recommend_flag) { + this.recommend_flag = recommend_flag; + } + + public String getAdcode() { + return adcode; + } + + public void setAdcode(String adcode) { + this.adcode = adcode; + } + + public String getNewtype() { + return newtype; + } + + public void setNewtype(String newtype) { + this.newtype = newtype; + } + + public String getDisp_name() { + return disp_name; + } + + public void setDisp_name(String disp_name) { + this.disp_name = disp_name; + } + + public String getCpdata() { + return cpdata; + } + + public void setCpdata(String cpdata) { + this.cpdata = cpdata; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public String getDiscount_flag() { + return discount_flag; + } + + public void setDiscount_flag(String discount_flag) { + this.discount_flag = discount_flag; + } + + public List getEntrances() { + return entrances; + } + + public void setEntrances(List entrances) { + this.entrances = entrances; + } + + public List getExits() { + return exits; + } + + public void setExits(List exits) { + this.exits = exits; + } + + public List getDomain_list() { + return domain_list; + } + + public void setDomain_list(List domain_list) { + this.domain_list = domain_list; + } + + public static class DomainListBean { + private String type; + private String id; + private String name; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + } + + public static class ClassifyBean { + private String checkedvalue; + private String name; + private String ctype; + private int flag; + /** + * alias : + * multiselect : + * name : 全部分类 + * value : category=0601|061000|061001|0603|0606|0607|0605|060800|0613 + * display : + */ + + private List category; + + public String getCheckedvalue() { + return checkedvalue; + } + + public void setCheckedvalue(String checkedvalue) { + this.checkedvalue = checkedvalue; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCtype() { + return ctype; + } + + public void setCtype(String ctype) { + this.ctype = ctype; + } + + public int getFlag() { + return flag; + } + + public void setFlag(int flag) { + this.flag = flag; + } + + public List getCategory() { + return category; + } + + public void setCategory(List category) { + this.category = category; + } + + public static class CategoryBean { + private String alias; + private String multiselect; + private String name; + private String value; + private String display; + + public String getAlias() { + return alias; + } + + public void setAlias(String alias) { + this.alias = alias; + } + + public String getMultiselect() { + return multiselect; + } + + public void setMultiselect(String multiselect) { + this.multiselect = multiselect; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getDisplay() { + return display; + } + + public void setDisplay(String display) { + this.display = display; + } + } + } + } + + public static class ClassifyBean { + /** + * checkedvalue : filter_keywords=宠物市场 + * category : [{"alias":"","multiselect":"","name":"全部分类","value":"category=0601|061000|061001|0603|0606|0607|0605|060800|0613","display":""},{"alias":"","multiselect":"","name":"超市","value":"filter_keywords=超市","display":""},{"category":[{"alias":"","name":"全部","value":"category=060101|060103"},{"alias":"","name":"购物中心","value":"filter_keywords=购物中心"},{"alias":"","name":"免税品店","value":"category=060103"}],"alias":"","multiselect":"","name":"综合商场","display":""},{"category":[{"alias":"","name":"全部","value":"category=061000|061001"},{"alias":"","name":"特色商业街","value":"category=061000"},{"alias":"","name":"步行街","value":"filter_keywords=步行街"}],"alias":"","multiselect":"","name":"商业街","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=家电卖场"},{"alias":"","name":"家电电子卖场","value":"category=060300"},{"alias":"","name":"综合家电商场","value":"filter_keywords=综合家电"},{"alias":"","name":"国美","value":"category=060302"},{"alias":"","name":"大中","value":"filter_keywords=大中电器"},{"alias":"","name":"苏宁","value":"category=060304"},{"alias":"","name":"手机销售","value":"filter_keywords=手机销售"},{"alias":"","name":"数码电子","value":"filter_keywords=数码电子"}],"alias":"","multiselect":"","name":"家电","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=家具建材"},{"alias":"","name":"家具建材市场","value":"category=060601"},{"alias":"","name":"家具城","value":"filter_keywords=家具城"},{"alias":"","name":"建材五金市场","value":"filter_keywords=建材五金市场"},{"alias":"","name":"厨卫市场","value":"category=060604"},{"alias":"","name":"布艺市场","value":"category=060605"},{"alias":"","name":"灯具瓷器市场","value":"category=060606"}],"alias":"","multiselect":"","name":"家具建材","display":""},{"category":[{"alias":"","name":"全部","value":"filter_keywords=综合市场"},{"alias":"","name":"小商品市场","value":"filter_keywords=小商品批发市场"},{"alias":"","name":"旧货市场","value":"category=060702"},{"alias":"","name":"农副产品市场","value":"filter_keywords=农产品批发市场"},{"alias":"","name":"果品市场","value":"filter_keywords=果品批发市场"},{"alias":"","name":"蔬菜市场","value":"filter_keywords=蔬菜市场"},{"alias":"","name":"水产海鲜市场","value":"filter_keywords=水产海鲜市场"}],"alias":"","multiselect":"","name":"综合市场","display":""},{"alias":"","multiselect":"","name":"文化用品店","value":"filter_keywords=文化办公用品","display":""},{"category":[{"alias":"","name":"全部","value":"category=060500|060501|060502"},{"alias":"","name":"花鸟鱼虫市场","value":"filter_keywords=花鸟市场"},{"alias":"","name":"花卉市场","value":"filter_keywords=花卉市场"},{"alias":"","name":"宠物市场","value":"filter_keywords=宠物市场"}],"alias":"","multiselect":"","name":"花鸟市场","display":""},{"category":[{"alias":"","name":"全部","value":"category=061301|061302"},{"alias":"","name":"拍卖行","value":"category=061301"},{"alias":"","name":"典当行","value":"category=061302"}],"alias":"","multiselect":"","name":"买卖场所","display":""}] + * name : 全部分类 + * ctype : category + * flag : 2 + */ + + private ClassifyTypeBean classify_type; + /** + * checkedvalue : sort_rule=0;reserved_keywords=true + * category : [{"name":"推荐排序","value":"sort_rule=0;reserved_keywords=true"},{"name":"距离优先","value":"sort_rule=1;reserved_keywords=true"},{"name":"好评优先","value":"sort_rule=5;sort_fields=rating:d;reserved_keywords=true"},{"name":"低价优先","value":"sort_rule=5;sort_fields=averagecost:a0;reserved_keywords=true"},{"name":"高价优先","value":"sort_rule=5;sort_fields=averagecost:d;reserved_keywords=true"}] + * name : 排序 + * ctype : filter + */ + + private ClassifySortBean classify_sort; + private int count; + + public ClassifyTypeBean getClassify_type() { + return classify_type; + } + + public void setClassify_type(ClassifyTypeBean classify_type) { + this.classify_type = classify_type; + } + + public ClassifySortBean getClassify_sort() { + return classify_sort; + } + + public void setClassify_sort(ClassifySortBean classify_sort) { + this.classify_sort = classify_sort; + } + + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } + + public static class ClassifyTypeBean { + private String checkedvalue; + private String name; + private String ctype; + private int flag; + /** + * alias : + * multiselect : + * name : 全部分类 + * value : category=0601|061000|061001|0603|0606|0607|0605|060800|0613 + * display : + */ + + private List category; + + public String getCheckedvalue() { + return checkedvalue; + } + + public void setCheckedvalue(String checkedvalue) { + this.checkedvalue = checkedvalue; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCtype() { + return ctype; + } + + public void setCtype(String ctype) { + this.ctype = ctype; + } + + public int getFlag() { + return flag; + } + + public void setFlag(int flag) { + this.flag = flag; + } + + public List getCategory() { + return category; + } + + public void setCategory(List category) { + this.category = category; + } + + public static class CategoryBean { + private String alias; + private String multiselect; + private String name; + private String value; + private String display; + + public String getAlias() { + return alias; + } + + public void setAlias(String alias) { + this.alias = alias; + } + + public String getMultiselect() { + return multiselect; + } + + public void setMultiselect(String multiselect) { + this.multiselect = multiselect; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getDisplay() { + return display; + } + + public void setDisplay(String display) { + this.display = display; + } + } + } + + public static class ClassifySortBean { + private String checkedvalue; + private String name; + private String ctype; + /** + * name : 推荐排序 + * value : sort_rule=0;reserved_keywords=true + */ + + private List category; + + public String getCheckedvalue() { + return checkedvalue; + } + + public void setCheckedvalue(String checkedvalue) { + this.checkedvalue = checkedvalue; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCtype() { + return ctype; + } + + public void setCtype(String ctype) { + this.ctype = ctype; + } + + public List getCategory() { + return category; + } + + public void setCategory(List category) { + this.category = category; + } + + public static class CategoryBean { + private String name; + private String value; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + } + } + } + + public static class BizAreaDataBean { + private String citycode; + private String adcode; + private String name; + private String center; + private String level; + private String checkedvalue; + /** + * citycode : 0731 + * adcode : 430102 + * name : 芙蓉区 + * center : 112.988094,28.193106 + * level : district + * districts : [{"citycode":"0731","adcode":"430102","name":"德政园","center":"113.022609,28.186145","level":"biz_area","areacode":"19749","districts":[]},{"citycode":"0731","adcode":"430102","name":"定王台","center":"112.985227,28.190025","level":"biz_area","areacode":"19750","districts":[]},{"citycode":"0731","adcode":"430102","name":"黄兴路","center":"112.976687,28.190437","level":"biz_area","areacode":"19751","districts":[]},{"citycode":"0731","adcode":"430102","name":"韭菜园","center":"112.988766,28.194756","level":"biz_area","areacode":"19752","districts":[]},{"citycode":"0731","adcode":"430102","name":"马王堆","center":"113.028870,28.195465","level":"biz_area","areacode":"19753","districts":[]},{"citycode":"0731","adcode":"430102","name":"五里牌","center":"113.011699,28.198328","level":"biz_area","areacode":"19754","districts":[]},{"citycode":"0731","adcode":"430102","name":"湘湖","center":"113.012682,28.205252","level":"biz_area","areacode":"19755","districts":[]},{"citycode":"0731","adcode":"430102","name":"袁家岭","center":"112.997033,28.194455","level":"biz_area","areacode":"19756","districts":[]},{"citycode":"0731","adcode":"430102","name":"八一路","center":"113.000355,28.197485","level":"biz_area","areacode":"19757","districts":[]},{"citycode":"0731","adcode":"430102","name":"朝阳路","center":"113.007038,28.189212","level":"biz_area","areacode":"19758","districts":[]},{"citycode":"0731","adcode":"430102","name":"东屯渡","center":"113.038626,28.194082","level":"biz_area","areacode":"19759","districts":[]},{"citycode":"0731","adcode":"430102","name":"芙蓉广场","center":"112.995054,28.197940","level":"biz_area","areacode":"19760","districts":[]},{"citycode":"0731","adcode":"430102","name":"芙蓉中路","center":"112.986125,28.187681","level":"biz_area","areacode":"19761","districts":[]},{"citycode":"0731","adcode":"430102","name":"荷花路","center":"113.032740,28.191378","level":"biz_area","areacode":"19762","districts":[]},{"citycode":"0731","adcode":"430102","name":"荷花园","center":"113.021219,28.191605","level":"biz_area","areacode":"19763","districts":[]},{"citycode":"0731","adcode":"430102","name":"火星","center":"113.023431,28.202349","level":"biz_area","areacode":"19764","districts":[]},{"citycode":"0731","adcode":"430102","name":"凌霄路","center":"113.029080,28.202090","level":"biz_area","areacode":"19765","districts":[]},{"citycode":"0731","adcode":"430102","name":"浏正街","center":"112.984803,28.191896","level":"biz_area","areacode":"19766","districts":[]},{"citycode":"0731","adcode":"430102","name":"三湘大市场","center":"113.016648,28.202302","level":"biz_area","areacode":"19768","districts":[]},{"citycode":"0731","adcode":"430102","name":"万家丽","center":"113.030236,28.185394","level":"biz_area","areacode":"19770","districts":[]},{"citycode":"0731","adcode":"430102","name":"文艺路","center":"112.994009,28.191407","level":"biz_area","areacode":"19771","districts":[]},{"citycode":"0731","adcode":"430102","name":"五一大道","center":"112.988446,28.194898","level":"biz_area","areacode":"19772","districts":[]},{"citycode":"0731","adcode":"430102","name":"燕山街","center":"113.000486,28.196539","level":"biz_area","areacode":"19773","districts":[]},{"citycode":"0731","adcode":"430102","name":"远大路","center":"113.027617,28.198384","level":"biz_area","areacode":"19774","districts":[]},{"citycode":"0731","adcode":"430102","name":"中山路","center":"112.979051,28.199921","level":"biz_area","areacode":"19775","districts":[]},{"citycode":"0731","adcode":"430102","name":"车站中路","center":"113.010938,28.193068","level":"biz_area","areacode":"19776","districts":[]},{"citycode":"0731","adcode":"430102","name":"芙蓉区政府","center":"113.003653,28.194434","level":"biz_area","areacode":"19785","districts":[]},{"citycode":"0731","adcode":"430102","name":"解放东路","center":"113.005201,28.190678","level":"biz_area","areacode":"19792","districts":[]},{"citycode":"0731","adcode":"430102","name":"解放西路","center":"112.979381,28.191326","level":"biz_area","areacode":"19813","districts":[]},{"citycode":"0731","adcode":"430102","name":"都正街","center":"112.981833,28.187702","level":"biz_area","areacode":"19814","districts":[]},{"citycode":"0731","adcode":"430102","name":"火车站","center":"113.011203,28.193686","level":"biz_area","areacode":"19830","districts":[]},{"citycode":"0731","adcode":"430102","name":"车站北路","center":"113.009321,28.207354","level":"biz_area","areacode":"19845","districts":[]}] + */ + + private List districts; + + public String getCitycode() { + return citycode; + } + + public void setCitycode(String citycode) { + this.citycode = citycode; + } + + public String getAdcode() { + return adcode; + } + + public void setAdcode(String adcode) { + this.adcode = adcode; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCenter() { + return center; + } + + public void setCenter(String center) { + this.center = center; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public String getCheckedvalue() { + return checkedvalue; + } + + public void setCheckedvalue(String checkedvalue) { + this.checkedvalue = checkedvalue; + } + + public List getDistricts() { + return districts; + } + + public void setDistricts(List districts) { + this.districts = districts; + } + + public static class DistrictsBean { + private String citycode; + private String adcode; + private String name; + private String center; + private String level; + /** + * citycode : 0731 + * adcode : 430102 + * name : 德政园 + * center : 113.022609,28.186145 + * level : biz_area + * areacode : 19749 + * districts : [] + */ + + private List districts; + + public String getCitycode() { + return citycode; + } + + public void setCitycode(String citycode) { + this.citycode = citycode; + } + + public String getAdcode() { + return adcode; + } + + public void setAdcode(String adcode) { + this.adcode = adcode; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCenter() { + return center; + } + + public void setCenter(String center) { + this.center = center; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public List getDistricts() { + return districts; + } + + public void setDistricts(List districts) { + this.districts = districts; + } + + public static class DistrictsBea { + private String citycode; + private String adcode; + private String name; + private String center; + private String level; + private String areacode; + private List districts; + + public String getCitycode() { + return citycode; + } + + public void setCitycode(String citycode) { + this.citycode = citycode; + } + + public String getAdcode() { + return adcode; + } + + public void setAdcode(String adcode) { + this.adcode = adcode; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCenter() { + return center; + } + + public void setCenter(String center) { + this.center = center; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public String getAreacode() { + return areacode; + } + + public void setAreacode(String areacode) { + this.areacode = areacode; + } + + public List getDistricts() { + return districts; + } + + public void setDistricts(List districts) { + this.districts = districts; + } + } + } + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Empty.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Empty.java new file mode 100644 index 0000000..918551b --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Empty.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosapi.message; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "std_msgs/Empty") +public class Empty extends Message { +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/GetTime.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/GetTime.java new file mode 100644 index 0000000..f226683 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/GetTime.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosapi.message; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.message.MessageType; +import com.jilk.ros.message.ros.message.TimePrimitive; + + +@MessageType(string = "rosapi/GetTimeResponse") +public class GetTime extends Message { + public TimePrimitive time; +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/MessageDetails.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/MessageDetails.java new file mode 100644 index 0000000..eab4b52 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/MessageDetails.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosapi.message; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "rosapi/MessageDetails") +public class MessageDetails extends Message { + public TypeDef[] typedefs; +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Nodes.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Nodes.java new file mode 100644 index 0000000..1d0c1eb --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Nodes.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosapi.message; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "rosapi/Nodes") +public class Nodes extends Message { + public String[] nodes; +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Service.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Service.java new file mode 100644 index 0000000..222dbfb --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Service.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosapi.message; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "rosapi/Service") +public class Service extends Message { + public String service; + + public Service() {} + + public Service(String service) { + this.service = service; + } +} \ No newline at end of file diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Services.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Services.java new file mode 100644 index 0000000..c60e0dd --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Services.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosapi.message; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "rosapi/Services") +public class Services extends Message { + public String[] services; +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Topic.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Topic.java new file mode 100644 index 0000000..facc8fe --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Topic.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosapi.message; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "rosapi/Topic") +public class Topic extends Message { + public String topic; + + public Topic() {} + + public Topic(String topic) { + this.topic = topic; + } +} \ No newline at end of file diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Topics.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Topics.java new file mode 100644 index 0000000..6666fa1 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Topics.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosapi.message; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "rosapi/Topics") +public class Topics extends Message { + public String[] topics; +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Type.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Type.java new file mode 100644 index 0000000..f1942d5 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/Type.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosapi.message; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "rosapi/Type") +public class Type extends Message { + public String type; + + public Type() {} + + public Type(String type) { + this.type = type; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/TypeDef.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/TypeDef.java new file mode 100644 index 0000000..31fb299 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosapi/message/TypeDef.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosapi.message; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "rosapi/TypeDef") +public class TypeDef extends Message { + public String type; + public String[] fieldnames; + public String[] fieldtypes; + public int[] fieldarraylen; + public String[] examples; + + public static boolean match(String type, Class c) { + boolean result = false; + if ( + (type.equals("bool") && ((boolean.class.equals(c)) || (Boolean.class.equals(c)))) || + (type.equals("int8") && ((byte.class.equals(c)) || (Byte.class.equals(c)))) || + (type.equals("byte") && ((byte.class.equals(c)) || (Byte.class.equals(c)))) || // deprecated + (type.equals("uint8") && ((short.class.equals(c)) || (Short.class.equals(c)))) || + (type.equals("char") && ((short.class.equals(c)) || (Short.class.equals(c)))) || // deprecated + (type.equals("int16") && ((short.class.equals(c)) || (Short.class.equals(c)))) || + (type.equals("uint16") && ((int.class.equals(c)) || (Integer.class.equals(c)))) || + (type.equals("int32") && ((int.class.equals(c)) || (Integer.class.equals(c)))) || + (type.equals("uint32") && ((long.class.equals(c)) || (Long.class.equals(c)))) || + (type.equals("int64") && ((long.class.equals(c)) || (Long.class.equals(c)))) || + (type.equals("float32") && ((float.class.equals(c)) || (Float.class.equals(c)))) || + (type.equals("float64") && ((double.class.equals(c)) || (Double.class.equals(c)))) || + (type.equals("uint64") && (java.math.BigInteger.class.equals(c))) || + (type.equals("string") && (String.class.equals(c))) + ) + result = true; + + return result; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/FullMessageHandler.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/FullMessageHandler.java new file mode 100644 index 0000000..69837b5 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/FullMessageHandler.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge; + +import com.jilk.ros.message.ros.message.Message; + +public interface FullMessageHandler { + public void onMessage(String id, T message); +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/ROSBridgeClient.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/ROSBridgeClient.java new file mode 100644 index 0000000..805d5c3 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/ROSBridgeClient.java @@ -0,0 +1,270 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge; + +import com.jilk.ros.message.ros.ROSClient; +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.message.MessageType; +import com.jilk.ros.message.ros.rosapi.message.Empty; +import com.jilk.ros.message.ros.rosapi.message.MessageDetails; +import com.jilk.ros.message.ros.rosapi.message.Nodes; +import com.jilk.ros.message.ros.rosapi.message.Service; +import com.jilk.ros.message.ros.rosapi.message.Services; +import com.jilk.ros.message.ros.rosapi.message.Topic; +import com.jilk.ros.message.ros.rosapi.message.Topics; +import com.jilk.ros.message.ros.rosapi.message.Type; +import com.jilk.ros.message.ros.rosapi.message.TypeDef; +import com.jilk.ros.message.ros.rosbridge.implementation.ROSBridgeWebSocketClient; +import com.jilk.ros.message.ros.rosbridge.operation.Operation; + +import java.lang.reflect.Field; + +public class ROSBridgeClient extends ROSClient { + String uriString; + ROSBridgeWebSocketClient client; + + public ROSBridgeClient(String uriString) { + this.uriString = uriString; + } + + @Override + public boolean connect() { + return connect(null); + } + + @Override + public boolean connect(ConnectionStatusListener listener) { + boolean result = false; + client = ROSBridgeWebSocketClient.create(uriString); + if (client != null) { + client.setListener(listener); + try { + result = client.connectBlocking(); + } + catch (InterruptedException ex) { + + } + finally { + + } + } + return result; + } + + @Override + public void disconnect() { + try { + client.closeBlocking(); + } + catch (InterruptedException ex) { + + } + finally { + + } + } + + @Override + public void send(Operation operation) { + client.send(operation); + } + + @Override + public void send(String json) { + client.send(json); + } + + @Override + public void register(Class c, + String s, + Class m, + FullMessageHandler h) { + client.register(c, s, m, h); + } + + @Override + public void unregister(Class c, String s) { + client.unregister(c, s); + } + + @Override + public void setDebug(boolean debug) { + client.setDebug(debug); + } + + @Override + public String[] getNodes() throws InterruptedException { + com.jilk.ros.message.ros.Service nodeService = + new com.jilk.ros.message.ros.Service("/rosapi/nodes", Empty.class, Nodes.class, this); + return nodeService.callBlocking(new Empty()).nodes; + } + + @Override + public String[] getTopics() throws InterruptedException { + com.jilk.ros.message.ros.Service topicsService = + new com.jilk.ros.message.ros.Service("/rosapi/topics", Empty.class, Topics.class, this); + return topicsService.callBlocking(new Empty()).topics; + } + + @Override + public String[] getServices() throws InterruptedException { + com.jilk.ros.message.ros.Service servicesService = + new com.jilk.ros.message.ros.Service("/rosapi/services", Empty.class, Services.class, this); + return servicesService.callBlocking(new Empty()).services; + } + + @Override + public TypeDef getTopicMessageDetails(String topic) throws InterruptedException { + return getTypeDetails(getTopicType(topic)); + } + + @Override + public TypeDef[] getTopicMessageList(String topic) throws InterruptedException { + return getTypeList(getTopicType(topic)); + } + + @Override + public TypeDef getServiceRequestDetails(String service) throws InterruptedException { + return getTypeDetails(getServiceType(service), "Request", "/rosapi/service_request_details"); + } + + @Override + public TypeDef[] getServiceRequestList(String service) throws InterruptedException { + return getTypeList(getServiceType(service), "Request", "/rosapi/service_request_details"); + } + + @Override + public TypeDef getServiceResponseDetails(String service) throws InterruptedException { + return getTypeDetails(getServiceType(service), "Response", "/rosapi/service_response_details"); + } + + @Override + public TypeDef[] getServiceResponseList(String service) throws InterruptedException { + return getTypeList(getServiceType(service), "Response", "/rosapi/service_response_details"); + } + + @Override + public TypeDef[] getTypeList(String type) throws InterruptedException { + return getTypeList(type, "", "/rosapi/message_details"); + } + + @Override + public TypeDef getTypeDetails(String type) throws InterruptedException { + return getTypeDetails(type, "", "/rosapi/message_details"); + } + + private TypeDef[] getTypeList(String type, String suffix, String serviceName) throws InterruptedException { + com.jilk.ros.message.ros.Service messageDetailsService = + new com.jilk.ros.message.ros.Service(serviceName, + Type.class, MessageDetails.class, this); + return messageDetailsService.callBlocking(new Type(type)).typedefs; + } + + private TypeDef getTypeDetails(String type, String suffix, String serviceName) throws InterruptedException { + com.jilk.ros.message.ros.Service messageDetailsService = + new com.jilk.ros.message.ros.Service(serviceName, + Type.class, MessageDetails.class, this); + return findType(type + suffix, messageDetailsService.callBlocking(new Type(type)).typedefs); + } + + private String getTopicType(String topic) throws InterruptedException { + com.jilk.ros.message.ros.Service topicTypeService = + new com.jilk.ros.message.ros.Service("/rosapi/topic_type", + Topic.class, Type.class, this); + return topicTypeService.callBlocking(new Topic(topic)).type; + } + + private String getServiceType(String service) throws InterruptedException { + com.jilk.ros.message.ros.Service serviceTypeService = + new com.jilk.ros.message.ros.Service("/rosapi/service_type", + Service.class, Type.class, this); + return serviceTypeService.callBlocking(new Service(service)).type; + } + + private TypeDef findType(String type, TypeDef[] types) { + TypeDef result = null; + for (TypeDef t : types) { + if (t.type.equals(type)) { + result = t; + break; + } + } + //System.out.println("ROSBridgeClient.findType: "); + //result.print(); + return result; + } + + @Override + public void typeMatch(TypeDef t, Class c) throws InterruptedException { + if (c == null) + throw new RuntimeException("No registered message type found for: " + t.type); + Field[] fields = c.getFields(); + for (int i = 0; i < t.fieldnames.length; i++) { + + // Field names + String classFieldName = fields[i].getName(); + String typeFieldName = t.fieldnames[i]; + if (!classFieldName.equals(typeFieldName)) + typeMatchError(t, c, "field name", typeFieldName, classFieldName); + + // Array type of field + boolean typeIsArray = (t.fieldarraylen[i] >= 0); + boolean fieldIsArray = fields[i].getType().isArray(); + if (typeIsArray != fieldIsArray) + typeMatchError(t, c, "array mismatch", typeFieldName, classFieldName); + + // Get base type of field + Class fieldClass = fields[i].getType(); + if (fieldIsArray) + fieldClass = fields[i].getType().getComponentType(); + String type = t.fieldtypes[i]; + + // Field type for primitivesclient + if (Message.isPrimitive(fieldClass)) { + if (!TypeDef.match(type, fieldClass)) + typeMatchError(t, c, "type mismatch", type, fieldClass.getName()); + } + + // Field type for non-primitive classes, and recurse + else { + if (!Message.class.isAssignableFrom(fieldClass)) + throw new RuntimeException("Member " + classFieldName + + " of class " + fieldClass.getName() + " does not extend Message."); + String fieldClassString = ((MessageType) fieldClass.getAnnotation(MessageType.class)).string(); + if (!type.equals(fieldClassString)) + typeMatchError(t, c, "message type mismatch", type, fieldClassString); + typeMatch(getTypeDetails(type), fieldClass); + } + } + } + + private void typeMatchError(TypeDef t, Class c, + String error, String tString, String cString) { + throw new RuntimeException("Type match error between " + + t.type + " and " + c.getName() + ": " + + error + ": \'" + tString + "\' does not match \'" + cString + "\'."); + } + + @Override + public Object getUnderlyingClient() { + return client; + } + +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/implementation/Base64.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/implementation/Base64.java new file mode 100644 index 0000000..75860e2 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/implementation/Base64.java @@ -0,0 +1,575 @@ +package com.jilk.ros.message.ros.rosbridge.implementation; + +import java.util.Arrays; + +/** A very fast and memory efficient class to encode and decode to and from BASE64 in full accordance + * with RFC 2045.

+ * On Windows XP sp1 with 1.4.2_04 and later ;), this encoder and decoder is about 10 times faster + * on small arrays (10 - 1000 bytes) and 2-3 times as fast on larger arrays (10000 - 1000000 bytes) + * compared to sun.misc.Encoder()/Decoder().

+ * + * On byte arrays the encoder is about 20% faster than Jakarta Commons Base64 Codec for encode and + * about 50% faster for decoding large arrays. This implementation is about twice as fast on very small + * arrays (< 30 bytes). If source/destination is a String this + * version is about three times as fast due to the fact that the Commons Codec result has to be recoded + * to a String from byte[], which is very expensive.

+ * + * This encode/decode algorithm doesn't create any temporary arrays as many other codecs do, it only + * allocates the resulting array. This produces less garbage and it is possible to handle arrays twice + * as large as algorithms that create a temporary array. (E.g. Jakarta Commons Codec). It is unknown + * whether Sun's sun.misc.Encoder()/Decoder() produce temporary arrays but since performance + * is quite low it probably does.

+ * + * The encoder produces the same output as the Sun one except that the Sun's encoder appends + * a trailing line separator if the last character isn't a pad. Unclear why but it only adds to the + * length and is probably a side effect. Both are in conformance with RFC 2045 though.
+ * Commons codec seem to always att a trailing line separator.

+ * + * Note! + * The encode/decode method pairs (types) come in three versions with the exact same algorithm and + * thus a lot of code redundancy. This is to not create any temporary arrays for transcoding to/from different + * format types. The methods not used can simply be commented out.

+ * + * There is also a "fast" version of all decode methods that works the same way as the normal ones, but + * har a few demands on the decoded input. Normally though, these fast verions should be used if the source if + * the input is known and it hasn't bee tampered with.

+ * + * If you find the code useful or you find a bug, please send me a note at base64 @ miginfocom . com. + * + * Licence (BSD): + * ============== + * + * Copyright (c) 2004, Mikael Grev, MiG InfoCom AB. (base64 @ miginfocom . com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, this list + * of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * Neither the name of the MiG InfoCom AB nor the names of its contributors may be + * used to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * @version 2.2 + * @author Mikael Grev + * Date: 2004-aug-02 + * Time: 11:31:11 + */ + +public class Base64 +{ + private static final char[] CA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray(); + private static final int[] IA = new int[256]; + static { + Arrays.fill(IA, -1); + for (int i = 0, iS = CA.length; i < iS; i++) + IA[CA[i]] = i; + IA['='] = 0; + } + + // **************************************************************************************** + // * char[] version + // **************************************************************************************** + + /** Encodes a raw byte array into a BASE64 char[] representation i accordance with RFC 2045. + * @param sArr The bytes to convert. If null or length 0 an empty array will be returned. + * @param lineSep Optional "\r\n" after 76 characters, unless end of file.
+ * No line separator will be in breach of RFC 2045 which specifies max 76 per line but will be a + * little faster. + * @return A BASE64 encoded array. Never null. + */ + public final static char[] encodeToChar(byte[] sArr, boolean lineSep) + { + // Check special case + int sLen = sArr != null ? sArr.length : 0; + if (sLen == 0) + return new char[0]; + + int eLen = (sLen / 3) * 3; // Length of even 24-bits. + int cCnt = ((sLen - 1) / 3 + 1) << 2; // Returned character count + int dLen = cCnt + (lineSep ? (cCnt - 1) / 76 << 1 : 0); // Length of returned array + char[] dArr = new char[dLen]; + + // Encode even 24-bits + for (int s = 0, d = 0, cc = 0; s < eLen;) { + // Copy next three bytes into lower 24 bits of int, paying attension to sign. + int i = (sArr[s++] & 0xff) << 16 | (sArr[s++] & 0xff) << 8 | (sArr[s++] & 0xff); + + // Encode the int into four chars + dArr[d++] = CA[(i >>> 18) & 0x3f]; + dArr[d++] = CA[(i >>> 12) & 0x3f]; + dArr[d++] = CA[(i >>> 6) & 0x3f]; + dArr[d++] = CA[i & 0x3f]; + + // Add optional line separator + if (lineSep && ++cc == 19 && d < dLen - 2) { + dArr[d++] = '\r'; + dArr[d++] = '\n'; + cc = 0; + } + } + + // Pad and encode last bits if source isn't even 24 bits. + int left = sLen - eLen; // 0 - 2. + if (left > 0) { + // Prepare the int + int i = ((sArr[eLen] & 0xff) << 10) | (left == 2 ? ((sArr[sLen - 1] & 0xff) << 2) : 0); + + // Set last four chars + dArr[dLen - 4] = CA[i >> 12]; + dArr[dLen - 3] = CA[(i >>> 6) & 0x3f]; + dArr[dLen - 2] = left == 2 ? CA[i & 0x3f] : '='; + dArr[dLen - 1] = '='; + } + return dArr; + } + + /** Decodes a BASE64 encoded char array. All illegal characters will be ignored and can handle both arrays with + * and without line separators. + * @param sArr The source array. null or length 0 will return an empty array. + * @return The decoded array of bytes. May be of length 0. Will be null if the legal characters + * (including '=') isn't divideable by 4. (I.e. definitely corrupted). + */ + public final static byte[] decode(char[] sArr) + { + // Check special case + int sLen = sArr != null ? sArr.length : 0; + if (sLen == 0) + return new byte[0]; + + // Count illegal characters (including '\r', '\n') to know what size the returned array will be, + // so we don't have to reallocate & copy it later. + int sepCnt = 0; // Number of separator characters. (Actually illegal characters, but that's a bonus...) + for (int i = 0; i < sLen; i++) // If input is "pure" (I.e. no line separators or illegal chars) base64 this loop can be commented out. + if (IA[sArr[i]] < 0) + sepCnt++; + + // Check so that legal chars (including '=') are evenly divideable by 4 as specified in RFC 2045. + if ((sLen - sepCnt) % 4 != 0) + return null; + + int pad = 0; + for (int i = sLen; i > 1 && IA[sArr[--i]] <= 0;) + if (sArr[i] == '=') + pad++; + + int len = ((sLen - sepCnt) * 6 >> 3) - pad; + + byte[] dArr = new byte[len]; // Preallocate byte[] of exact length + + for (int s = 0, d = 0; d < len;) { + // Assemble three bytes into an int from four "valid" characters. + int i = 0; + for (int j = 0; j < 4; j++) { // j only increased if a valid char was found. + int c = IA[sArr[s++]]; + if (c >= 0) + i |= c << (18 - j * 6); + else + j--; + } + // Add the bytes + dArr[d++] = (byte) (i >> 16); + if (d < len) { + dArr[d++]= (byte) (i >> 8); + if (d < len) + dArr[d++] = (byte) i; + } + } + return dArr; + } + + /** Decodes a BASE64 encoded char array that is known to be resonably well formatted. The method is about twice as + * fast as {@link #decode(char[])}. The preconditions are:
+ * + The array must have a line length of 76 chars OR no line separators at all (one line).
+ * + Line separator must be "\r\n", as specified in RFC 2045 + * + The array must not contain illegal characters within the encoded string
+ * + The array CAN have illegal characters at the beginning and end, those will be dealt with appropriately.
+ * @param sArr The source array. Length 0 will return an empty array. null will throw an exception. + * @return The decoded array of bytes. May be of length 0. + */ + public final static byte[] decodeFast(char[] sArr) + { + // Check special case + int sLen = sArr.length; + if (sLen == 0) + return new byte[0]; + + int sIx = 0, eIx = sLen - 1; // Start and end index after trimming. + + // Trim illegal chars from start + while (sIx < eIx && IA[sArr[sIx]] < 0) + sIx++; + + // Trim illegal chars from end + while (eIx > 0 && IA[sArr[eIx]] < 0) + eIx--; + + // get the padding count (=) (0, 1 or 2) + int pad = sArr[eIx] == '=' ? (sArr[eIx - 1] == '=' ? 2 : 1) : 0; // Count '=' at end. + int cCnt = eIx - sIx + 1; // Content count including possible separators + int sepCnt = sLen > 76 ? (sArr[76] == '\r' ? cCnt / 78 : 0) << 1 : 0; + + int len = ((cCnt - sepCnt) * 6 >> 3) - pad; // The number of decoded bytes + byte[] dArr = new byte[len]; // Preallocate byte[] of exact length + + // Decode all but the last 0 - 2 bytes. + int d = 0; + for (int cc = 0, eLen = (len / 3) * 3; d < eLen;) { + // Assemble three bytes into an int from four "valid" characters. + int i = IA[sArr[sIx++]] << 18 | IA[sArr[sIx++]] << 12 | IA[sArr[sIx++]] << 6 | IA[sArr[sIx++]]; + + // Add the bytes + dArr[d++] = (byte) (i >> 16); + dArr[d++] = (byte) (i >> 8); + dArr[d++] = (byte) i; + + // If line separator, jump over it. + if (sepCnt > 0 && ++cc == 19) { + sIx += 2; + cc = 0; + } + } + + if (d < len) { + // Decode last 1-3 bytes (incl '=') into 1-3 bytes + int i = 0; + for (int j = 0; sIx <= eIx - pad; j++) + i |= IA[sArr[sIx++]] << (18 - j * 6); + + for (int r = 16; d < len; r -= 8) + dArr[d++] = (byte) (i >> r); + } + + return dArr; + } + + // **************************************************************************************** + // * byte[] version + // **************************************************************************************** + + /** Encodes a raw byte array into a BASE64 byte[] representation i accordance with RFC 2045. + * @param sArr The bytes to convert. If null or length 0 an empty array will be returned. + * @param lineSep Optional "\r\n" after 76 characters, unless end of file.
+ * No line separator will be in breach of RFC 2045 which specifies max 76 per line but will be a + * little faster. + * @return A BASE64 encoded array. Never null. + */ + public final static byte[] encodeToByte(byte[] sArr, boolean lineSep) + { + // Check special case + int sLen = sArr != null ? sArr.length : 0; + if (sLen == 0) + return new byte[0]; + + int eLen = (sLen / 3) * 3; // Length of even 24-bits. + int cCnt = ((sLen - 1) / 3 + 1) << 2; // Returned character count + int dLen = cCnt + (lineSep ? (cCnt - 1) / 76 << 1 : 0); // Length of returned array + byte[] dArr = new byte[dLen]; + + // Encode even 24-bits + for (int s = 0, d = 0, cc = 0; s < eLen;) { + // Copy next three bytes into lower 24 bits of int, paying attension to sign. + int i = (sArr[s++] & 0xff) << 16 | (sArr[s++] & 0xff) << 8 | (sArr[s++] & 0xff); + + // Encode the int into four chars + dArr[d++] = (byte) CA[(i >>> 18) & 0x3f]; + dArr[d++] = (byte) CA[(i >>> 12) & 0x3f]; + dArr[d++] = (byte) CA[(i >>> 6) & 0x3f]; + dArr[d++] = (byte) CA[i & 0x3f]; + + // Add optional line separator + if (lineSep && ++cc == 19 && d < dLen - 2) { + dArr[d++] = '\r'; + dArr[d++] = '\n'; + cc = 0; + } + } + + // Pad and encode last bits if source isn't an even 24 bits. + int left = sLen - eLen; // 0 - 2. + if (left > 0) { + // Prepare the int + int i = ((sArr[eLen] & 0xff) << 10) | (left == 2 ? ((sArr[sLen - 1] & 0xff) << 2) : 0); + + // Set last four chars + dArr[dLen - 4] = (byte) CA[i >> 12]; + dArr[dLen - 3] = (byte) CA[(i >>> 6) & 0x3f]; + dArr[dLen - 2] = left == 2 ? (byte) CA[i & 0x3f] : (byte) '='; + dArr[dLen - 1] = '='; + } + return dArr; + } + + /** Decodes a BASE64 encoded byte array. All illegal characters will be ignored and can handle both arrays with + * and without line separators. + * @param sArr The source array. Length 0 will return an empty array. null will throw an exception. + * @return The decoded array of bytes. May be of length 0. Will be null if the legal characters + * (including '=') isn't divideable by 4. (I.e. definitely corrupted). + */ + public final static byte[] decode(byte[] sArr) + { + // Check special case + int sLen = sArr.length; + + // Count illegal characters (including '\r', '\n') to know what size the returned array will be, + // so we don't have to reallocate & copy it later. + int sepCnt = 0; // Number of separator characters. (Actually illegal characters, but that's a bonus...) + for (int i = 0; i < sLen; i++) // If input is "pure" (I.e. no line separators or illegal chars) base64 this loop can be commented out. + if (IA[sArr[i] & 0xff] < 0) + sepCnt++; + + // Check so that legal chars (including '=') are evenly divideable by 4 as specified in RFC 2045. + if ((sLen - sepCnt) % 4 != 0) + return null; + + int pad = 0; + for (int i = sLen; i > 1 && IA[sArr[--i] & 0xff] <= 0;) + if (sArr[i] == '=') + pad++; + + int len = ((sLen - sepCnt) * 6 >> 3) - pad; + + byte[] dArr = new byte[len]; // Preallocate byte[] of exact length + + for (int s = 0, d = 0; d < len;) { + // Assemble three bytes into an int from four "valid" characters. + int i = 0; + for (int j = 0; j < 4; j++) { // j only increased if a valid char was found. + int c = IA[sArr[s++] & 0xff]; + if (c >= 0) + i |= c << (18 - j * 6); + else + j--; + } + + // Add the bytes + dArr[d++] = (byte) (i >> 16); + if (d < len) { + dArr[d++]= (byte) (i >> 8); + if (d < len) + dArr[d++] = (byte) i; + } + } + + return dArr; + } + + + /** Decodes a BASE64 encoded byte array that is known to be resonably well formatted. The method is about twice as + * fast as {@link #decode(byte[])}. The preconditions are:
+ * + The array must have a line length of 76 chars OR no line separators at all (one line).
+ * + Line separator must be "\r\n", as specified in RFC 2045 + * + The array must not contain illegal characters within the encoded string
+ * + The array CAN have illegal characters at the beginning and end, those will be dealt with appropriately.
+ * @param sArr The source array. Length 0 will return an empty array. null will throw an exception. + * @return The decoded array of bytes. May be of length 0. + */ + public final static byte[] decodeFast(byte[] sArr) + { + // Check special case + int sLen = sArr.length; + if (sLen == 0) + return new byte[0]; + + int sIx = 0, eIx = sLen - 1; // Start and end index after trimming. + + // Trim illegal chars from start + while (sIx < eIx && IA[sArr[sIx] & 0xff] < 0) + sIx++; + + // Trim illegal chars from end + while (eIx > 0 && IA[sArr[eIx] & 0xff] < 0) + eIx--; + + // get the padding count (=) (0, 1 or 2) + int pad = sArr[eIx] == '=' ? (sArr[eIx - 1] == '=' ? 2 : 1) : 0; // Count '=' at end. + int cCnt = eIx - sIx + 1; // Content count including possible separators + int sepCnt = sLen > 76 ? (sArr[76] == '\r' ? cCnt / 78 : 0) << 1 : 0; + + int len = ((cCnt - sepCnt) * 6 >> 3) - pad; // The number of decoded bytes + byte[] dArr = new byte[len]; // Preallocate byte[] of exact length + + // Decode all but the last 0 - 2 bytes. + int d = 0; + for (int cc = 0, eLen = (len / 3) * 3; d < eLen;) { + // Assemble three bytes into an int from four "valid" characters. + int i = IA[sArr[sIx++]] << 18 | IA[sArr[sIx++]] << 12 | IA[sArr[sIx++]] << 6 | IA[sArr[sIx++]]; + + // Add the bytes + dArr[d++] = (byte) (i >> 16); + dArr[d++] = (byte) (i >> 8); + dArr[d++] = (byte) i; + + // If line separator, jump over it. + if (sepCnt > 0 && ++cc == 19) { + sIx += 2; + cc = 0; + } + } + + if (d < len) { + // Decode last 1-3 bytes (incl '=') into 1-3 bytes + int i = 0; + for (int j = 0; sIx <= eIx - pad; j++) + i |= IA[sArr[sIx++]] << (18 - j * 6); + + for (int r = 16; d < len; r -= 8) + dArr[d++] = (byte) (i >> r); + } + + return dArr; + } + + // **************************************************************************************** + // * String version + // **************************************************************************************** + + /** Encodes a raw byte array into a BASE64 String representation i accordance with RFC 2045. + * @param sArr The bytes to convert. If null or length 0 an empty array will be returned. + * @param lineSep Optional "\r\n" after 76 characters, unless end of file.
+ * No line separator will be in breach of RFC 2045 which specifies max 76 per line but will be a + * little faster. + * @return A BASE64 encoded array. Never null. + */ + public final static String encodeToString(byte[] sArr, boolean lineSep) + { + // Reuse char[] since we can't create a String incrementally anyway and StringBuffer/Builder would be slower. + return new String(encodeToChar(sArr, lineSep)); + } + + /** Decodes a BASE64 encoded String. All illegal characters will be ignored and can handle both strings with + * and without line separators.
+ * Note! It can be up to about 2x the speed to call decode(str.toCharArray()) instead. That + * will create a temporary array though. This version will use str.charAt(i) to iterate the string. + * @param str The source string. null or length 0 will return an empty array. + * @return The decoded array of bytes. May be of length 0. Will be null if the legal characters + * (including '=') isn't divideable by 4. (I.e. definitely corrupted). + */ + public final static byte[] decode(String str) + { + // Check special case + int sLen = str != null ? str.length() : 0; + if (sLen == 0) + return new byte[0]; + + // Count illegal characters (including '\r', '\n') to know what size the returned array will be, + // so we don't have to reallocate & copy it later. + int sepCnt = 0; // Number of separator characters. (Actually illegal characters, but that's a bonus...) + for (int i = 0; i < sLen; i++) // If input is "pure" (I.e. no line separators or illegal chars) base64 this loop can be commented out. + if (IA[str.charAt(i)] < 0) + sepCnt++; + + // Check so that legal chars (including '=') are evenly divideable by 4 as specified in RFC 2045. + if ((sLen - sepCnt) % 4 != 0) + return null; + + // Count '=' at end + int pad = 0; + for (int i = sLen; i > 1 && IA[str.charAt(--i)] <= 0;) + if (str.charAt(i) == '=') + pad++; + + int len = ((sLen - sepCnt) * 6 >> 3) - pad; + + byte[] dArr = new byte[len]; // Preallocate byte[] of exact length + + for (int s = 0, d = 0; d < len;) { + // Assemble three bytes into an int from four "valid" characters. + int i = 0; + for (int j = 0; j < 4; j++) { // j only increased if a valid char was found. + int c = IA[str.charAt(s++)]; + if (c >= 0) + i |= c << (18 - j * 6); + else + j--; + } + // Add the bytes + dArr[d++] = (byte) (i >> 16); + if (d < len) { + dArr[d++]= (byte) (i >> 8); + if (d < len) + dArr[d++] = (byte) i; + } + } + return dArr; + } + + /** Decodes a BASE64 encoded string that is known to be resonably well formatted. The method is about twice as + * fast as {@link #decode(String)}. The preconditions are:
+ * + The array must have a line length of 76 chars OR no line separators at all (one line).
+ * + Line separator must be "\r\n", as specified in RFC 2045 + * + The array must not contain illegal characters within the encoded string
+ * + The array CAN have illegal characters at the beginning and end, those will be dealt with appropriately.
+ * @param s The source string. Length 0 will return an empty array. null will throw an exception. + * @return The decoded array of bytes. May be of length 0. + */ + public final static byte[] decodeFast(String s) + { + // Check special case + int sLen = s.length(); + if (sLen == 0) + return new byte[0]; + + int sIx = 0, eIx = sLen - 1; // Start and end index after trimming. + + // Trim illegal chars from start + while (sIx < eIx && IA[s.charAt(sIx) & 0xff] < 0) + sIx++; + + // Trim illegal chars from end + while (eIx > 0 && IA[s.charAt(eIx) & 0xff] < 0) + eIx--; + + // get the padding count (=) (0, 1 or 2) + int pad = s.charAt(eIx) == '=' ? (s.charAt(eIx - 1) == '=' ? 2 : 1) : 0; // Count '=' at end. + int cCnt = eIx - sIx + 1; // Content count including possible separators + int sepCnt = sLen > 76 ? (s.charAt(76) == '\r' ? cCnt / 78 : 0) << 1 : 0; + + int len = ((cCnt - sepCnt) * 6 >> 3) - pad; // The number of decoded bytes + byte[] dArr = new byte[len]; // Preallocate byte[] of exact length + + // Decode all but the last 0 - 2 bytes. + int d = 0; + for (int cc = 0, eLen = (len / 3) * 3; d < eLen;) { + // Assemble three bytes into an int from four "valid" characters. + int i = IA[s.charAt(sIx++)] << 18 | IA[s.charAt(sIx++)] << 12 | IA[s.charAt(sIx++)] << 6 | IA[s.charAt(sIx++)]; + + // Add the bytes + dArr[d++] = (byte) (i >> 16); + dArr[d++] = (byte) (i >> 8); + dArr[d++] = (byte) i; + + // If line separator, jump over it. + if (sepCnt > 0 && ++cc == 19) { + sIx += 2; + cc = 0; + } + } + + if (d < len) { + // Decode last 1-3 bytes (incl '=') into 1-3 bytes + int i = 0; + for (int j = 0; sIx <= eIx - pad; j++) + i |= IA[s.charAt(sIx++)] << (18 - j * 6); + + for (int r = 16; d < len; r -= 8) + dArr[d++] = (byte) (i >> r); + } + + return dArr; + } +} \ No newline at end of file diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/implementation/JSON.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/implementation/JSON.java new file mode 100644 index 0000000..b2115a0 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/implementation/JSON.java @@ -0,0 +1,347 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.implementation; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.rosbridge.indication.Indication; +import com.jilk.ros.message.ros.rosbridge.operation.Wrapper; + +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; +import org.json.simple.parser.JSONParser; + +import java.io.StringReader; +import java.lang.reflect.Array; +import java.lang.reflect.Field; + + +// The slightly crazy abstractions here are designed to isolate knowledge of +// the JSON library and data types from the Operation details of rosbridge. +// Why is this important? A few reasons I can see. First, we might want +// to change JSON libraries and this encapsulates all use of JSON-simple. +// Second, as much as possible I would like the semantics of the rosbridge +// protocol to be encapsulated in the Operation and its subclasses rather +// than in a module that is essentially about serialization. +// +// Unfortunately the hierarchical Message abstraction is a bit broken +// at the top level. Beginning at the actual operation (e.g., Publish), the +// types of the fields are determined either by the fields themselves or by +// an indicator. However, the type of the operation itself is not determined +// this way, because the indicator is in the object itself, which means it +// would have to be created before its type is known. Rather than build in +// exceptions, I elected to create a "Wrapper" operation type that simply +// wraps the concrete operation and copies its "op" field. +// + +public class JSON { + + /** + * Translates a Message recursively into JSON. Normally the Message is also an + * Operation, but it does not have to be. The caller constructs a complete + * message using @Operation and @Message types. This includes situations + * where one or more fields are marked to be turned into arrays, using @AsArray. + * @param m the @Message object to be recursively translated. + * @return the complete JSON string. + */ + public static String toJSON(Message m) { + JSONObject jo = convertObjectToJSONObject(m); // Object to JSON-Simple + return jo.toJSONString(); // JSON-Simple to string + } + + /** + * Translates JSON into a hierarchical Operation/Message structure. + * This includes handling fields that are @Indicated and @AsArray. If the + * @Class parameter is a @Wrapper, this is a special case whereby the + * object is wrapped to create a consistent hierarchy. + * @param json the source JSON string + * @param c the top level class of the JSON. Normally @Wrapper + * @param r the @Registry containing topic registrations + * @return the fully instantiated message hierarchy represented + * by the JSON string. + */ + public static Message toMessage(String json, Class c, Registry r) { + JSONObject joUnwrapped = convertStringToJSONObject(json); // String to JSON-Simple + JSONObject jo = joUnwrapped; + if (Wrapper.class.isAssignableFrom(c)) + jo = wrap(joUnwrapped, c); // wrap: a hack to make the hierarchy homogeneous + return convertJSONObjectToMessage(jo, c, r); // JSON-Simple to Message + } + + // *** Create JSON from Messages *** // + + // Translate the object into a JSON-Simple object, field-by-field, + // recursively via convertElementToJSON. + // except for the case where AsArray is indicated + private static JSONObject convertObjectToJSONObject(Object o) { + JSONObject result = new JSONObject(); + for (Field f : o.getClass().getFields()) { + Object fieldObject = getFieldObject(f, o); + if (fieldObject != null) { + Object resultObject; + if (Indication.isBase64Encoded(f)) + resultObject = convertByteArrayToBase64JSONString(fieldObject); + else if (Indication.asArray(f)) + resultObject = convertObjectToJSONArray(fieldObject); + else resultObject = convertElementToJSON(fieldObject); + result.put(f.getName(), resultObject); + } + } + return result; + } + + // Convert an array type to a JSON-Simple array, element-by-element, + // recursively via convertElementToJSON. + private static JSONArray convertArrayToJSONArray(Object array) { + JSONArray result = new JSONArray(); + for (int i = 0; i < Array.getLength(array); i++) { + Object elementObject = Array.get(array, i); + if (elementObject != null) { + Object resultObject = convertElementToJSON(elementObject); + result.add(resultObject); + } + } + return result; + } + + // For AsArray objects, convert the object to a JSON-Simple array + // NOTE: This relies on later versions of the JDK providing + // the fields in order. + private static JSONArray convertObjectToJSONArray(Object o) { + JSONArray result = new JSONArray(); + for (Field f : o.getClass().getFields()) { + Object fieldObject = getFieldObject(f, o); + if (fieldObject != null) { + Object resultObject = convertElementToJSON(fieldObject); + result.add(resultObject); + } + } + return result; + } + + // Convert the individual field or array element items recursively + private static Object convertElementToJSON(Object elementObject) { + Class elementClass = elementObject.getClass(); + Object resultObject; + if (Message.isPrimitive(elementClass)) + resultObject = elementObject; + else if (elementClass.isArray()) + resultObject = convertArrayToJSONArray(elementObject); + else + resultObject = convertObjectToJSONObject(elementObject); + return resultObject; + } + + // Special case for Base 64-encoded fields + private static Object convertByteArrayToBase64JSONString(Object fieldObject) { + return Base64.encodeToString((byte[]) fieldObject, false); + } + + // This is just to buffer the code from the exception. Better error + // handling needed here. + private static Object getFieldObject(Field f, Object o) { + Object fo = null; + try { + fo = f.get(o); + } + catch (IllegalAccessException ex) { + ex.printStackTrace(); + } + finally { + + } + return fo; + } + + // *** Create Messages from JSON *** // + + // Use the JSON-simple parser to create the JSON-Simple object + private static JSONObject convertStringToJSONObject(String json) { + JSONObject result = null; + StringReader r = new StringReader(json); + JSONParser jp = new JSONParser(); + try { + result = (JSONObject) jp.parse(r); + } + catch (Throwable t) { + System.out.println(t.getMessage()); + } + finally { + + } + r.close(); + return result; + } + + // A bit of a hack to create a consistent hierarchy with jsonbridge operations + // At least it does not depend on any specific field names, it just copies the + // Indicator and Indicated fields. + private static JSONObject wrap(JSONObject jo, Class c) { + JSONObject result = new JSONObject(); + String indicatorName = Indication.getIndicatorName(c); + String indicatedName = Indication.getIndicatedName(c); + result.put(indicatorName, jo.get(indicatorName)); + result.put(indicatedName, jo); + return result; + } + + // Convert the JSON-Simple object to the indicated message, field-by-field + // recursively via convertElementToField. + private static Message convertJSONObjectToMessage(JSONObject jo, Class c, Registry r) { + //System.out.println("JSON.convertJSONObjectToMessage: " + jo.toJSONString()); + try { + Message result = (Message) c.newInstance(); + for (Field f : c.getFields()) { + Class fc = getFieldClass(result, jo, f, r); + Object lookup = jo.get(f.getName()); + if (lookup != null) { + Object value = convertElementToField(lookup, fc, f, r); + f.set(result, value); + } + } + return result; + } + catch (Exception ex) { + //ex.printStackTrace(); + return null; + } + finally { + + } + } + + // Convert the JSON-Simple array to the indicated message, element-by-element + // recursively via convertElementToField. + private static Object convertJSONArrayToArray(JSONArray ja, Class c, Registry r) { + Object result = Array.newInstance(c, ja.size()); + for (int i = 0; i < ja.size(); i++) { + Object lookup = ja.get(i); + Object value = null; + if (lookup != null) { + if (lookup.getClass().equals(JSONObject.class)) + value = convertJSONObjectToMessage((JSONObject) lookup, c, r); + else if (lookup.getClass().equals(JSONArray.class)) // this is not actually allowed in ROS + value = convertJSONArrayToArray((JSONArray) lookup, c.getComponentType(), r); + else + value = convertJSONPrimitiveToPrimitive(lookup, c); + Array.set(result, i, value); + } + } + + return result; + } + + // Convert a JSON-Simple array to a Message, field-by-field of the Message, + // element-by-element of the array, recursively via convertElementToField. + // NOTE: This relies on later versions of the JDK providing + // the fields in order. + private static Message convertJSONArrayToMessage(JSONArray ja, Class c, Registry r) { + try { + Message result = (Message) c.newInstance(); + int arrayIndex = 0; + for (Field f : c.getFields()) { + Class fc = getFieldClass(result, null, f, r); + Object lookup = ja.get(arrayIndex++); // yes we are assuming that the fields are delivered in order + if (lookup != null) { + Object value = convertElementToField(lookup, fc, f, r); + f.set(result, value); + } + } + + return result; + } + catch (Exception ex) { + ex.printStackTrace(); + return null; + } + finally { + + } + } + + // Convert an individual array or object element to a field in the Message, + // recursively, and applying AsArray if needed. + private static Object convertElementToField(Object element, Class fc, Field f, Registry r) { + //System.out.println("JSON.convertElementToField: " + f.getName() + " " + fc.getName()); + Object value; + if (element.getClass().equals(JSONObject.class)) { + //System.out.println("JSON.convertElementToField: JSON Object " + ((JSONObject) element).toJSONString()); + value = convertJSONObjectToMessage((JSONObject) element, fc, r); + } + else if (element.getClass().equals(JSONArray.class)) { + //System.out.println("JSON.convertElementToField: JSON Array " + ((JSONArray) element).toJSONString()); + if (Indication.asArray(f)) + value = convertJSONArrayToMessage((JSONArray) element, fc, r); + else value = convertJSONArrayToArray((JSONArray) element, fc, r); + } + else { + //System.out.println("JSON.convertElementToField: Primitive " + element); + if (Indication.isBase64Encoded(f)) + value = convertBase64JSONStringToByteArray(element); + else value = convertJSONPrimitiveToPrimitive(element, fc); + } + + return value; + } + + // Note that this is not checking ranges + public static Object convertJSONPrimitiveToPrimitive(Object o, Class c) { + Object result = o; + if (c.isPrimitive() || Number.class.isAssignableFrom(c)) { + if (c.equals(double.class) || c.equals(Double.class)) + result = new Double(((Number) o).doubleValue()); + else if (c.equals(float.class) || c.equals(Float.class)) + result = new Float(((Number) o).floatValue()); + else if (c.equals(long.class) || c.equals(Long.class)) + result = new Long(((Number) o).longValue()); + else if (int.class.equals(c) || c.equals(Integer.class)) + result = new Integer(((Number) o).intValue()); + else if (c.equals(short.class) || c.equals(Short.class)) + result = new Short(((Number) o).shortValue()); + else if (c.equals(byte.class) || c.equals(Byte.class)) + result = new Byte(((Number) o).byteValue()); + } + return result; + } + + public static byte[] convertBase64JSONStringToByteArray(Object element) { + return Base64.decode((String) element); + } + + // Determine the target class of a field in the object or array, based + // directly on the field's type, or using the Indicator if applicable, + // The Indicator field only provides the topic/service, so we have to look + // up the Class in the registry. + public static Class getFieldClass(Message parent, JSONObject jo, Field f, Registry r) { + Class fc; + fc = f.getType(); + if (fc.isArray()) + fc = f.getType().getComponentType(); + if (Indication.isIndicated(f) && (jo != null)) { + //fc = Indication.getIndication(parent, + // (String) jo.get(Indication.getIndicatorName(parent.getClass()))); + fc = r.lookup(parent.getClass(), + (String) jo.get(Indication.getIndicatorName(parent.getClass()))); + //System.out.println("JSON.getFieldClass: parent class " + parent.getClass().getName() + + // " Indicator: " + Indication.getIndicatorName(parent.getClass()) + + // " result: " + fc.getName()); + } + return fc; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/implementation/PublishEvent.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/implementation/PublishEvent.java new file mode 100644 index 0000000..6f53dde --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/implementation/PublishEvent.java @@ -0,0 +1,24 @@ +package com.jilk.ros.message.ros.rosbridge.implementation; + +import com.jilk.ros.message.ros.rosbridge.operation.Operation; + +/**EventBus event entity,describe ros server response info + * Created by xxhong on 16-11-22. + */ + +public class PublishEvent { + public String msg; + public String id; + public String name; + public String op; + + + public PublishEvent(Operation operation, String name, String content) { + if(operation != null) { + id = operation.id; + op = operation.op; + } + this.name = name; + msg = content; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/implementation/ROSBridgeWebSocketClient.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/implementation/ROSBridgeWebSocketClient.java new file mode 100644 index 0000000..9f64f75 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/implementation/ROSBridgeWebSocketClient.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + *

+ * This file is part of the Java ROSBridge Client. + *

+ * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + */ +package com.jilk.ros.message.ros.rosbridge.implementation; + +import com.jilk.ros.message.ros.ROSClient; +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.rosbridge.FullMessageHandler; +import com.jilk.ros.message.ros.rosbridge.operation.Operation; +import com.jilk.ros.message.ros.rosbridge.operation.Publish; +import com.jilk.ros.message.ros.rosbridge.operation.ServiceResponse; + +import org.java_websocket.client.WebSocketClient; +import org.java_websocket.framing.CloseFrame; +import org.java_websocket.handshake.ServerHandshake; +import org.json.simple.JSONObject; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; + +import java.lang.reflect.Field; +import java.net.Socket; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.channels.SocketChannel; + +import de.greenrobot.event.EventBus; + +public class ROSBridgeWebSocketClient extends WebSocketClient { + private Registry classes; + private Registry handlers; + private boolean debug; + private ROSClient.ConnectionStatusListener listener; + + ROSBridgeWebSocketClient(URI serverURI) { + super(serverURI); + classes = new Registry(); + handlers = new Registry(); + Operation.initialize(classes); // note, this ensures that the Message Map is initialized too + listener = null; + } + + public static ROSBridgeWebSocketClient create(String URIString) { + ROSBridgeWebSocketClient client = null; + try { + URI uri = new URI(URIString); + client = new ROSBridgeWebSocketClient(uri); + } catch (URISyntaxException ex) { + ex.printStackTrace(); + } finally { + + } + return client; + } + + public void setListener(ROSClient.ConnectionStatusListener listener) { + this.listener = listener; + } + + @Override + public void onOpen(ServerHandshake handshakedata) { + if (listener != null) + listener.onConnect(); + } + + @Override + public void onMessage(String message) { + if (debug) System.out.println(" " + json); + send(json); + } + + public void register(Class c, + String s, + Class m, + FullMessageHandler h) { + Message.register(m, classes.get(Message.class)); + classes.register(c, s, m); + if (h != null) + handlers.register(c, s, h); + } + + public void unregister(Class c, String s) { + handlers.unregister(c, s); + // Note that there is no concept of unregistering a class - it can get replaced is all + } + + public Class getRegisteredMessage(String messageString) { + return classes.lookup(Message.class, messageString); + } + + public void setDebug(boolean debug) { + this.debug = debug; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/implementation/Registry.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/implementation/Registry.java new file mode 100644 index 0000000..ede00ee --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/implementation/Registry.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.implementation; + +import java.util.HashMap; +import java.util.Map; + +public class Registry extends HashMap> { + + public void register(Class c, String s, T t) { + Map table = get(c); + if (table == null) { + table = new HashMap(); + put(c, table); + } + table.put(s, t); + } + + public void unregister(Class c, String s) { + Map table = get(c); + if (table != null) + table.remove(s); + } + + public T lookup(Class c, String s) { + T result = null; + Map table = get(c); + if (table != null) + result = table.get(s); + return result; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/AsArray.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/AsArray.java new file mode 100644 index 0000000..52fb9d0 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/AsArray.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.indication; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface AsArray { +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/Base64Encoded.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/Base64Encoded.java new file mode 100644 index 0000000..4cb70dd --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/Base64Encoded.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.indication; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface Base64Encoded { +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/Indicate.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/Indicate.java new file mode 100644 index 0000000..52b6a50 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/Indicate.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.indication; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface Indicate { + // if later we want multiple indicated fields, use an int here +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/Indicated.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/Indicated.java new file mode 100644 index 0000000..d8c4b18 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/Indicated.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.indication; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface Indicated { + // if later we want multiple indicated fields, use an int here +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/Indication.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/Indication.java new file mode 100644 index 0000000..c132f36 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/Indication.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.indication; + +import java.lang.reflect.Field; + +public class Indication { + public static boolean isIndicated(Field f) { + return (f.getAnnotation(Indicated.class) != null); + } + + public static boolean asArray(Field f) { + return (f.getAnnotation(AsArray.class) != null); + } + + public static boolean isBase64Encoded(Field f) { + return ((f.getAnnotation(Base64Encoded.class) != null) && + f.getType().isArray() && + f.getType().getComponentType().equals(byte.class)); + } + + public static String getIndicatorName(Class c) { + return getName(c, Indicator.class); + } + + public static String getIndicatedName(Class c) { + return getName(c, Indicated.class); + } + + private static String getName(Class c, Class annotation) { + String result = null; + for (Field f : c.getFields()) { + if (f.getAnnotation(annotation) != null) { + result = f.getName(); + break; + } + } + return result; + } + + /* + public static Class getIndication(Object o, String s) { + Class c = o.getClass(); + Class result = null; + try { + Method m = getIndicateMethod(c); + result = (Class) (m.invoke(o, s)); + } + catch (ReflectiveOperationException ex) { + ex.printStackTrace(); + } + return result; + } + + private static Method getIndicateMethod(Class c) { + Method result = null; + for (Method m : c.getMethods()) { + if (m.getAnnotation(Indicate.class) != null) { + result = m; + break; + } + } + return result; + } + */ +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/Indicator.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/Indicator.java new file mode 100644 index 0000000..50b7a0e --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/indication/Indicator.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.indication; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface Indicator { + // if later we want multiple indicated fields, use an int here +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Advertise.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Advertise.java new file mode 100644 index 0000000..4c87088 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Advertise.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.operation; + +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "advertise") +public class Advertise extends Operation { + public String topic; + public String type; + + public Advertise() {} + + public Advertise(String topic, String type) { + this.topic = topic; + this.type = type; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Authenticate.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Authenticate.java new file mode 100644 index 0000000..6b88ce7 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Authenticate.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.operation; + +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "auth") +public class Authenticate extends Operation { + public String mac; + public String client; + public String dest; + public String rand; + public int t; + public String level; + public int end; + + public Authenticate() {} + + public Authenticate( + String mac, + String client, + String dest, + String rand, + int t, + String level, + int end) + { + this.mac = mac; + this.client = client; + this.dest = dest; + this.rand = rand; + this.t = t; + this.level = level; + this.end = end; + + this.id = null; // even though id is on EVERY OTHER operation type + } + +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/CallService.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/CallService.java new file mode 100644 index 0000000..ac4a7a9 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/CallService.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.operation; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.message.MessageType; +import com.jilk.ros.message.ros.rosbridge.indication.AsArray; +import com.jilk.ros.message.ros.rosbridge.indication.Indicated; +import com.jilk.ros.message.ros.rosbridge.indication.Indicator; + +@MessageType(string = "call_service") +public class CallService extends Operation { + @Indicator + public String service; + @Indicated + @AsArray + public Message args; + public Integer fragment_size; // use Integer for optional items + public String compression; + + public CallService() {} + + public CallService(String service, Message args) { + this.service = service; + this.args = args; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Fragment.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Fragment.java new file mode 100644 index 0000000..7e95333 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Fragment.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.operation; + +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "fragment") +public class Fragment extends Operation { + public String data; + public int num; + public int total; + + public Fragment() {} + + public Fragment(String data, int num, int total) { + this.data = data; + this.num = num; + this.total = total; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Operation.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Operation.java new file mode 100644 index 0000000..0477e39 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Operation.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.operation; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.message.MessageType; +import com.jilk.ros.message.ros.rosbridge.implementation.JSON; +import com.jilk.ros.message.ros.rosbridge.implementation.Registry; + +@MessageType(string = "operation") +public class Operation extends Message { + private static Long uid = 0L; + + public String op; + public String id; + + public Operation() { + this.op = getMessageType(getClass()); + this.id = nextId(); + } + + private static synchronized String nextId() { + String result = uid.toString(); + uid++; + return result; + } + + public String toJSON() { + return JSON.toJSON(this); + } + + public static Operation toOperation(String json, Registry registry) { + return ((Wrapper) JSON.toMessage(json, Wrapper.class, registry)).msg; + } + + public static void initialize(Registry registry) { + initClass(registry, Advertise.class); + initClass(registry, Authenticate.class); + initClass(registry, CallService.class); + initClass(registry, Fragment.class); + initClass(registry, Operation.class); + initClass(registry, PNG.class); + initClass(registry, Publish.class); + initClass(registry, ServiceResponse.class); + initClass(registry, SetStatusLevel.class); + initClass(registry, Status.class); + initClass(registry, Subscribe.class); + initClass(registry, Unadvertise.class); + initClass(registry, Unsubscribe.class); + initClass(registry, Wrapper.class); + + registry.register(Wrapper.class, Message.getMessageType(Publish.class), Publish.class); + registry.register(Wrapper.class, Message.getMessageType(CallService.class), CallService.class); + registry.register(Wrapper.class, Message.getMessageType(ServiceResponse.class), ServiceResponse.class); + } + + private static void initClass(Registry registry, Class c) { + registry.register(Message.class, Message.getMessageType(c), c); + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/PNG.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/PNG.java new file mode 100644 index 0000000..1544a01 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/PNG.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.operation; + +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "png") +public class PNG extends Operation { + public String data; + public Integer num; // use Integer for optional items + public Integer total; // use Integer for optional items + + public PNG() {} + + public PNG(String data) { + this.data = data; + } + + public PNG(String data, int num, int total) { + this.data = data; + this.num = num; + this.total = total; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Publish.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Publish.java new file mode 100644 index 0000000..c1a85ab --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Publish.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.operation; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.message.MessageType; +import com.jilk.ros.message.ros.rosbridge.indication.Indicated; +import com.jilk.ros.message.ros.rosbridge.indication.Indicator; + +@MessageType(string = "publish") +public class Publish extends Operation { + + @Indicator + public String topic; + @Indicated + public Message msg; + + public Publish() {} + + public Publish(String topic, Message msg) { + this.topic = topic; + this.msg = msg; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/ServiceResponse.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/ServiceResponse.java new file mode 100644 index 0000000..79f447f --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/ServiceResponse.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.operation; + +import com.jilk.ros.message.ros.message.Message; +import com.jilk.ros.message.ros.message.MessageType; +import com.jilk.ros.message.ros.rosbridge.indication.Indicated; +import com.jilk.ros.message.ros.rosbridge.indication.Indicator; + +@MessageType(string = "service_response") +public class ServiceResponse extends Operation { + @Indicator + public String service; + public boolean result; + @Indicated + public Message values; + + public ServiceResponse() {} + + public ServiceResponse(String service) { + this.service = service; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/SetStatusLevel.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/SetStatusLevel.java new file mode 100644 index 0000000..6ce1737 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/SetStatusLevel.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.operation; + +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "set_level") +public class SetStatusLevel extends Operation { + public String level; + + public SetStatusLevel() {} + + public SetStatusLevel(String level) { + this.level = null; + if ("none".equals(level) || + "warning".equals(level) || + "error".equals(level) || + "info".equals(level)) + this.level = level; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Status.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Status.java new file mode 100644 index 0000000..cc21bc3 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Status.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.operation; + +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "status") +public class Status extends Operation { + String level; + String msg; + + public Status() {} + + public Status(String level, String msg) { + this.level = level; + this.msg = msg; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Subscribe.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Subscribe.java new file mode 100644 index 0000000..af18a6c --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Subscribe.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.operation; + +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "subscribe") +public class Subscribe extends Operation { + public String topic; + public String type; + public Integer throttle_rate; // use Integer for optional items + public Integer queue_length; // use Integer for optional items + public Integer fragment_size; // use Integer for optional items + public String compression; + + public Subscribe() {} + + public Subscribe(String topic, String type) { + this.topic = topic; + this.type = type; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Unadvertise.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Unadvertise.java new file mode 100644 index 0000000..b3fd482 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Unadvertise.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.operation; + +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "unadvertise") +public class Unadvertise extends Operation { + public String topic; + + public Unadvertise() {} + + public Unadvertise(String topic) { + this.topic = topic; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Unsubscribe.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Unsubscribe.java new file mode 100644 index 0000000..108e3ac --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Unsubscribe.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.operation; + +import com.jilk.ros.message.ros.message.MessageType; + +@MessageType(string = "unsubscribe") +public class Unsubscribe extends Operation { + public String topic; + + public Unsubscribe() {} + + public Unsubscribe(String topic) { + this.topic = topic; + } +} diff --git a/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Wrapper.java b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Wrapper.java new file mode 100644 index 0000000..2a8cdc1 --- /dev/null +++ b/src/Logistics/app/src/main/java/com/jilk/ros/message/ros/rosbridge/operation/Wrapper.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2014 Jilk Systems, Inc. + * + * This file is part of the Java ROSBridge Client. + * + * The Java ROSBridge Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Java ROSBridge Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/. + * + */ +package com.jilk.ros.message.ros.rosbridge.operation; + +import com.jilk.ros.message.ros.message.MessageType; +import com.jilk.ros.message.ros.rosbridge.indication.Indicated; +import com.jilk.ros.message.ros.rosbridge.indication.Indicator; + +@MessageType(string = "wrapper") +public class Wrapper extends Operation { + @Indicator + public String op; + @Indicated + public Operation msg; + + public Wrapper() {} +} diff --git a/src/Logistics/app/src/main/res/layout/activity_no_pick.xml b/src/Logistics/app/src/main/res/layout/activity_search.xml similarity index 100% rename from src/Logistics/app/src/main/res/layout/activity_no_pick.xml rename to src/Logistics/app/src/main/res/layout/activity_search.xml diff --git a/src/Logistics/app/src/main/res/layout/my_fragment1.xml b/src/Logistics/app/src/main/res/layout/frag_find.xml similarity index 100% rename from src/Logistics/app/src/main/res/layout/my_fragment1.xml rename to src/Logistics/app/src/main/res/layout/frag_find.xml diff --git a/src/Logistics/app/src/main/res/layout/my_fragment2.xml b/src/Logistics/app/src/main/res/layout/frag_pickup.xml similarity index 100% rename from src/Logistics/app/src/main/res/layout/my_fragment2.xml rename to src/Logistics/app/src/main/res/layout/frag_pickup.xml diff --git a/src/Logistics/app/src/main/res/layout/my_fragment3.xml b/src/Logistics/app/src/main/res/layout/frag_set.xml similarity index 100% rename from src/Logistics/app/src/main/res/layout/my_fragment3.xml rename to src/Logistics/app/src/main/res/layout/frag_set.xml diff --git a/src/Logistics/app/src/test/java/com/example/logistics/ExampleUnitTest.java b/src/Logistics/app/src/test/java/com/example/logistics/ExampleUnitTest.java index 47cc96f..e7ae3eb 100644 --- a/src/Logistics/app/src/test/java/com/example/logistics/ExampleUnitTest.java +++ b/src/Logistics/app/src/test/java/com/example/logistics/ExampleUnitTest.java @@ -11,7 +11,8 @@ import static org.junit.Assert.*; */ public class ExampleUnitTest { @Test + public void addition_isCorrect() { - assertEquals(4, 2 + 2); + assertEquals(, 2 + 2); } } \ No newline at end of file diff --git a/src/server/src/main/java/com/example/testdemo/manager/QueueManager.java b/src/server/src/main/java/com/example/testdemo/manager/ServerManager.java similarity index 97% rename from src/server/src/main/java/com/example/testdemo/manager/QueueManager.java rename to src/server/src/main/java/com/example/testdemo/manager/ServerManager.java index b3f3898..829c657 100644 --- a/src/server/src/main/java/com/example/testdemo/manager/QueueManager.java +++ b/src/server/src/main/java/com/example/testdemo/manager/ServerManager.java @@ -24,17 +24,17 @@ import java.util.concurrent.atomic.AtomicInteger; @Slf4j @ServerEndpoint("/result") @Component -public class QueueManager { +public class ServerManager { @Autowired private GoodManager gmanager; private static String TAG = "SendObjectMessage"; private static AtomicInteger onlineCount = new AtomicInteger(0); - private static ConcurrentLinkedQueue socket = new ConcurrentLinkedQueue(); + private static ConcurrentLinkedQueue socket = new ConcurrentLinkedQueue(); private Session session; - private QueueManager mObject = null; + private ServerManager mObject = null; @OnOpen public void onOpen(Session session) {