zsh_root
2024-01-02 7b595546af704983dbafcd0d385c8768ddacefc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
package jiekou;
 
import BaoWen.Udp_Out;
import Method.GetNowTime;
import PbuliClass.Systems;
import VectroData.ForwardDatas;
import http.HTTP_Post;
 
import java.util.LinkedHashMap;
 
/**
 * UWB±êÇ©ÉÏ´«µÄλÖñ¨ÎÄ
 * display,[lenth],[tagid],[baoxu],[timestamp],[layer],[x],[y],[z], [vbat],[state],[sos],[mark]
 * Ê¾Àý£º
 * display,64,2012,70,2020-12-14 13:08:33.479,0,648,367,150,32,0,0,1
 * ËµÃ÷£º
 * 1    display:°üÍ·
 * 2    [length]£º±¨Îij¤¶È
 * 3    [tagid] £º±êÇ©µÄIDºÅ£¬Î¨Ò»±àºÅ
 * 4    [baoxu] £º°üÐò£¨0~255Ñ­»·£©
 * 5    [timestamp] £ºÊ±¼ä´Á£¨ÕâÌõ±¨ÎÄ·¢³öµÄʱ¼ä£©
 * 6    [layer] £º±êÇ©ËùÔڵIJã
 * 7    [x] £º±êÇ©µÄX×ø±ê£¬µ¥Î»ÀåÃ×
 * 8    [y] £º±êÇ©µÄY×ø±ê£¬µ¥Î»ÀåÃ×
 * 9    [z] £º±êÇ©µÄZ×ø±ê£¬µ¥Î»ÀåÃ×
 * 10    [vbat] £º±êÇ©µÄµçÁ¿ÐÅÏ¢£¬£¨0~100£©
 * 11    [state] £º±êÇ©µÄ״̬£¬¾²Ö¹Îª1£¬Ô˶¯Îª0
 * 12    [sos] £º±êÇ©µÄSOS°´¼ü״̬£¬°´ÏÂΪ1£¬Ã»Óа´ÏÂΪ0
 * 13    [mark] £º±ê־λ£¬Çø±ð´ÓÄĸöÒýÇæÉÏ´«Êý¾Ý£¬ÊÊÓÃÓÚ¶à¸öÏîÄ¿´«ÈëÒ»¸öƽ̨£¬Ä¬ÈÏΪ0**/    
 
 
public class display {
    static String mark=Systems.sys().getBiaozhi();
    static String a=null;
    static String b=null;
 
    /**
     *@param String tagid,±êÇ©ID
     *@param String baoxu,°üÐò
     *@param String timestamp,ʱ¼ä´Á
     *@param String floor,²ã
     *@param String x,
     *@param String y,
     *@param String z,
     *@param String vbat,µçÁ¿
     *@param String state,״̬
     *@param String sos,Ò»¼üºô¾È*/
    public static void out(
            String tagid,
            String baoxu,
            String timestamp,
            String floor,
            String x,
            String y,
            String z,
            String vbat,
            String state,
            String sos        
            ) {                
 
        int len=0;        
        String addtime=GetNowTime.timestamp2();
        String baotou=Systems.sys().getBaowentou()+"display,";
        a=baotou+len+","+tagid+","+baoxu+","+addtime+","+floor+","+x+","+y+","+z+","+vbat+","+state+","+sos+","+mark;
        len=a.length()+1;
        b=baotou+len+","+tagid+","+baoxu+","+addtime+","+floor+","+x+","+y+","+z+","+vbat+","+state+","+sos+","+mark;        
        Udp_Out.udp_tcp_out_display(b, tagid);/**Èç¹û´æÔÚÐèÒªUDPת·¢Î»ÖÃÐÅÏ¢**/    
        if(ForwardDatas.isHTTPClient()) {//HTTTPת·¢    
            if(!ForwardDatas.have_http("λÖÃÊý¾Ý")) {
                return;
            }
            LinkedHashMap<String, Object> displayh=new LinkedHashMap<String, Object>();
            displayh.put("type", "display");
            displayh.put("tagid", tagid);
            displayh.put("baoxu", baoxu);
            displayh.put("timestamp",addtime);
            displayh.put("floor",floor);
            displayh.put("x",x);
            displayh.put("y",y);
            displayh.put("z",z);
            displayh.put("vbat",vbat);
            displayh.put("state",state);
            displayh.put("sos",sos);
            displayh.put("mark",mark);    
//            HTTP_Post.getDisplayvc().add(displayh);
            HTTP_Post.display("", "", displayh);
        }
 
        if(ForwardDatas.isCutom1()) {//Èç¹û´æÔÚcustom1
            Custom1.costom1out(tagid);
        }
        addtime=null;
        a=null;
        b=null;
    }
 
    /**Êý¾Ý¸ñʽ
     * ±¨Îĸñʽ£ºdisplay,tagid,jingdu,weidu,gaocheng,power,addtime,mark,end
     * ±¨ÎÄ˵Ã÷£º
     * display£º°üÍ·
     * tagid£º±êÇ©ID£¬HEX¸ñʽ
     * jingdu£º¾­¶È
     * weidu£ºÎ¬¶È
     * gaocheng£º¸ß¶È
     * power£ºµçÁ¿
     * addtime£ºÌí¼Óʱ¼ä
     * mark:±êÖ¾
     * end:½áÊø±ê־λ
     * Êý¾ÝʾÀý£º*/
    public static void out2(
            String tagid,
            String jingdu,
            String weidu,
            String gaocheng,
            String power    
            ) {    
        String addtime=GetNowTime.timestamp2();
        //int shineiwai =person_Dell.get_Person(tagid).getIndoor_or_outdoor();
        //String display="display,"+tagid+","+jingdu+","+weidu+","+gaocheng+","+power+","+addtime+","+mark+","+shineiwai+",end";//ÊÒÄÚÍâÅжÏ
        String display="display,"+tagid+","+jingdu+","+weidu+","+gaocheng+","+power+","+addtime+","+mark+","+"end";
        Udp_Out.udp_tcp_out_display(display, tagid);/**Èç¹û´æÔÚÐèÒªUDPת·¢Î»ÖÃÐÅÏ¢**/
        display=null;
        if(ForwardDatas.isHTTPClient()) {//HTTTPת·¢    
            if(!ForwardDatas.have_http("λÖÃÊý¾Ý")) {
                return;
            }
            LinkedHashMap<String, Object> displayh=new LinkedHashMap<String, Object>();
            displayh.put("type", "display");
            displayh.put("tagid", tagid);
            displayh.put("jingdu",jingdu);
            displayh.put("weidu", weidu);            
            displayh.put("gaocheng",gaocheng);
            displayh.put("power",power);
            displayh.put("timestamp",addtime);
            displayh.put("mark",mark);
            HTTP_Post.display("", "", displayh);
            displayh=null;
        }
    }
 
 
    /**
     * UWB±êÇ©ÉÏ´«µÄλÖñ¨ÎÄ
     * display,[lenth],[tagid],[baoxu],[timestamp],[layer],[x],[y],[z]
     * Ê¾Àý£º
     * display,64,2012,70,2020-12-14 13:08:33.479,0,648,367,150
     * ËµÃ÷£º
     * 1    display:°üÍ·
     * 2    [length]£º±¨Îij¤¶È
     * 3    [tagid] £º±êÇ©µÄIDºÅ£¬Î¨Ò»±àºÅ
     * 4    [baoxu] £º°üÐò£¨0~255Ñ­»·£©
     * 5    [timestamp] £ºÊ±¼ä´Á£¨ÕâÌõ±¨ÎÄ·¢³öµÄʱ¼ä£©
     * 6    [layer] £º±êÇ©ËùÔڵIJã
     * 7    [x] £º±êÇ©µÄX×ø±ê£¬µ¥Î»ÀåÃ×
     * 8    [y] £º±êÇ©µÄY×ø±ê£¬µ¥Î»ÀåÃ×
     * 9    [z] £º±êÇ©µÄZ×ø±ê£¬µ¥Î»ÀåÃ×
     * **/    
    /**¾É°æµÄdisplayÊý¾Ý*/
    public static void outold(
            String tagid,
            String baoxu,
            String timestamp,
            String floor,
            String x,
            String y,
            String z    
            ) {
 
 
        int len=0;        
        StringBuffer addtime=new StringBuffer(GetNowTime.timestamp2());
        String baotou=Systems.sys().getBaowentou()+"display,";
        StringBuffer display0=new StringBuffer(baotou
                +len+","
                +tagid+","
                +baoxu+","
                +addtime+","
                +floor+","
                +x+","
                +y+","
                +z
                );
 
        len=display0.length()+1;
 
 
 
        StringBuffer display=new StringBuffer(baotou
                +len+","
                +tagid+","
                +baoxu+","
                +addtime+","
                +floor+","
                +x+","
                +y+","
                +z
                );
 
 
        /**Èç¹û´æÔÚÐèÒªUDPת·¢Î»ÖÃÐÅÏ¢**/
        Udp_Out.udp_tcp_out_display(display.toString(), tagid);
        addtime.setLength(0);
        display0.setLength(0);
        display.setLength(0);
    }
 
 
    public static String getMark() {
        return mark;
    }
 
}