| | |
| | | private static String hexStr = "0123456789ABCDEF"; |
| | | |
| | | public static void dell_AACC(String message,String ip,int port) { |
| | | if(message.startsWith("AACC")) { |
| | | String[] gnggns=message.split("AACC"); |
| | | int size=gnggns.length; |
| | | if(size>2) { |
| | | for(int i=0;i<size;i++) { |
| | | if(gnggns[i].length()>5) { |
| | | jiexi_AACC("AACC"+gnggns[i],ip,port); |
| | | } |
| | | String[] gnggns=message.split("AACC"); |
| | | int size=gnggns.length; |
| | | if(size>2) { |
| | | for(int i=0;i<size;i++) { |
| | | if(gnggns[i].length()>80) { |
| | | jiexi_AACC("AACC"+gnggns[i],ip,port); |
| | | } |
| | | }else { |
| | | jiexi_AACC(message,ip,port); |
| | | } |
| | | }else { |
| | | if(message.length()>80 && size==2) { |
| | | jiexi_AACC("AACC"+gnggns[1],ip,port); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | String yaw0=hex[79]+hex[78]+hex[77]+hex[76]; |
| | | String stat0=hex[153]+hex[152]; |
| | | String age0=hex[157]+hex[156]+hex[155]+hex[154]; |
| | | String ns0=hex[161]+hex[160]; |
| | | String ns0=hex[159]+hex[158]; |
| | | // String ns20=hex[161]+hex[160]; |
| | | lenth=decodeHEX(lenth0); |
| | | lat=doubelttohex(lat0); |
| | | lon=doubelttohex(lon0); |
| | |
| | | if(Index1.getXieyi_type().equals("2")) { |
| | | mess="经度:"+lat+",纬度:"+lon+",高程:"+alt+",俯仰角:"+pitch |
| | | +",横滚角:"+roll+",航向角:"+yaw+",状态:"+stats+",差分龄期:"+age+",卫星颗数:"+ns; |
| | | }else if(Index1.getXieyi_type().equals("1")) { |
| | | mess=infom; |
| | | Index1.ara_show(mess); |
| | | }else if(Index1.getXieyi_type().equals("3")) { |
| | | mess="经度:"+lat0+",纬度:"+lon0+",高程:"+alt0+",俯仰角:"+pitch0 |
| | | +",横滚角:"+roll0+",航向角:"+yaw0+",状态:"+stat0+",差分龄期:"+age0+",卫星颗数:"+ns0; |
| | | Index1.ara_show(mess); |
| | | }else if(Index1.getXieyi_type().equals("5")) { |
| | | mess="$GNGGAD,"+lat+","+lon; |
| | | Index1.ara_show_no_time(mess); |
| | | } |
| | | Index1.ara_show(mess); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | byt=subBytes(packet.getData(),0, lenth); |
| | | //获取发送端的IP地址对象 |
| | | String ip=packet.getAddress().getHostAddress(); |
| | | int port=packet.getPort(); |
| | | String datas=Tools.Bytes2HexString(byt); |
| | | String upinfo=datas.toUpperCase(); |
| | | if(Index1.isShoware() && Index1.getTagid().equals("HEX")) { |
| | | Index1.ara_show(upinfo); |
| | | } |
| | | int port=packet.getPort(); |
| | | i=i+1; |
| | | Index1.getUdpnum().setText(i+"条"); |
| | | if(i==100000) { |
| | | i=0; |
| | | } |
| | | |
| | | if(Index1.getInput_data_type()==2) { |
| | | String message=new String(packet.getData(), 0, lenth); |
| | | message=message.replaceAll(" ", ""); |
| | | message=message.replaceAll("\r\n", ""); |
| | | String infor2=message.toUpperCase(); |
| | | Dell_AACC.dell_AACC(infor2, ip, port); |
| | | Dell_baotou.dell_baotou_start(infor2,ip,port); |
| | | if(Index1.isShoware() && Index1.getXieyi_type().equals("1")) { |
| | | Index1.ara_show_no_time(infor2); |
| | | } |
| | | }else { |
| | | String datas=Tools.Bytes2HexString(byt); |
| | | String upinfo=datas.toUpperCase(); |
| | | Dell_55AA02.dell_55aa02_start(upinfo, ip, port); |
| | | Dell_AACC.dell_AACC(upinfo, ip, port); |
| | | if(Index1.isShoware() && Index1.getXieyi_type().equals("1")) { |
| | | Index1.ara_show_no_time(upinfo); |
| | | } |
| | | } |
| | | String message=new String(packet.getData(), 0, lenth); |
| | | message=message.replaceAll(" ", ""); |
| | | message=message.replaceAll("\r\n", ""); |
| | | String infor2=message.toUpperCase(); |
| | | Dell_baotou.dell_baotou_start(infor2,ip,port); |
| | | Dell_55AA02.dell_55aa02_start(upinfo, ip, port); |
| | | Dell_AACC.dell_AACC(upinfo, ip, port); |
| | | if(Index1.isShoware() && Index1.getTagid().equals("ASCLL")) { |
| | | Index1.ara_show(infor2); |
| | | } |
| | | |
| | | byt=null; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); // 输出异常信息 |
| | |
| | | JButtonModel2 jbt_chushi_enhd=null;//初始化偏移量初始值 |
| | | JButtonModel2 jbt_send=null;//发送设置基准站左边 |
| | | JButtonModel2 jbt_getbase_jwd=null;//获取基准值经纬度 |
| | | JButtonModel2 jbt_datatype=null;//获取基准值经纬度 |
| | | JTextField searchFileld=null;//搜索文本框 |
| | | JTextField send_Fileld=null;//搜索文本框 |
| | | JlableModel jl_UDP=new JlableModel("UDP监听端口:"+Dell_system.getPort()); |
| | |
| | | static String tagid="0"; |
| | | JComboBox<String> box=null; |
| | | static String xieyi_type="2";//协议类型选择 |
| | | static int input_data_type=1; |
| | | |
| | | public Index1() {//构造方法 |
| | | Toolkit toolkit = getToolkit();// 获得窗体工具包 |
| | |
| | | int w=(int) (screenSize.width* 0.15); |
| | | int h=(int) (screenSize.height * 0.15); |
| | | this.setBounds(w,h, width, height);//设置窗体尺寸 |
| | | this.setTitle("离线记录软件V1.01"); |
| | | this.setTitle("离线记录软件V1.02"); |
| | | Container rq=getContentPane();//获取容器 |
| | | rq.setLayout(new BorderLayout()); |
| | | rq.setBackground(Color.white); |
| | |
| | | mb.add(getUdpnum()); |
| | | mb.add(getBut_shuaxin1()); |
| | | mb.add(getBox()); |
| | | mb.add(getJbt_datatype()); |
| | | jl_UDP.setBounds(x+3, y,140,30); |
| | | //jl_tcp.setBounds(x+140, y,120,30); |
| | | //getTcpnum().setBounds(x+140+120+10, y,100,30); |
| | |
| | | getBut_start().setBounds(x, y2+h1+20,100,40); |
| | | getBut_clear().setBounds(x+120, y2+h1+20,100,40); |
| | | getBox().setBounds(x+240, y2+h1+20,120,40); |
| | | getJbt_datatype().setBounds(x+380, y2+h1+20,120,40); |
| | | |
| | | |
| | | |
| | |
| | | are.append(GetNowTime.sss()+","+message+"\n"); |
| | | are.setCaretPosition(are.getText().length()); |
| | | } |
| | | |
| | | public static void ara_show_no_time(String message) { |
| | | are.append(message+"\n"); |
| | | are.setCaretPosition(are.getText().length()); |
| | | } |
| | | |
| | | public JButtonModel getBut_start() { |
| | | if(but_start==null) { |
| | |
| | | return xieyi_type; |
| | | } |
| | | |
| | | public JButtonModel2 getJbt_datatype() { |
| | | if(jbt_datatype==null) { |
| | | jbt_datatype=new JButtonModel2("HEX输入"); |
| | | jbt_datatype.addActionListener(new ActionListener() { |
| | | public void actionPerformed(ActionEvent e) { |
| | | if(input_data_type==2) { |
| | | jbt_datatype.setText("HEX输入"); |
| | | input_data_type=1; |
| | | }else { |
| | | jbt_datatype.setText("ASCLL输入"); |
| | | input_data_type=2; |
| | | } |
| | | |
| | | } |
| | | }); |
| | | } |
| | | return jbt_datatype; |
| | | } |
| | | |
| | | |
| | | |
| | | public static int getInput_data_type() { |
| | | return input_data_type; |
| | | } |
| | | |
| | | public static void setInput_data_type(int input_data_type) { |
| | | Index1.input_data_type = input_data_type; |
| | | } |
| | | |
| | | |
| | | |
| | | } |