package com.hxzkoa.udp; /** 自动添加标签的方法 */ public class AddTagZidong { static int i = 1; public static void addtag(String ss) { // 1.如果是55aa01开头 // 插入合法的以55AA01开头的读模式数据测距数据 if (ss.startsWith("55AA01") && ss.length() == 42) { String[] hex = StringToHex.hex(ss); // 模块ID receive_tagid String receive_tagid = (hex[6] + hex[5]).toUpperCase(); // 如果标签不存在则添加标签 // if (Tag_Dell.get_tag(receive_tagid) ==null) { // 电量 // String power=String.valueOf(DellMessage.decodeHEX(hex[13])); // 向书库添加标签 // Tag_Into_Database.insert_all_Tag_info_dabase(receive_tagid,"未绑定", // power, "在线", "150", "无", "1"); // 向集合添加标签 // Tag_Dell.add_tag(receive_tagid, "未绑定", "150","无","1"); // ShowMessage.zidingyi("添加第"+i+"个标签"+receive_tagid+"成功!"); // i++; // } } } }