@@ -0,0 +1,66 | |||
|
1 | Status of modules | |
|
2 | ---------------- | |
|
3 | 192.168.1.1 [1 1] | |
|
4 | 192.168.1.2 [1 1] | |
|
5 | 192.168.1.3 [0 0] | |
|
6 | 192.168.1.4 [0 0] | |
|
7 | 192.168.1.5 [0 0] | |
|
8 | 192.168.1.6 [0 0] | |
|
9 | 192.168.1.7 [0 0] | |
|
10 | 192.168.1.8 [0 0] | |
|
11 | 192.168.1.9 [0 0] | |
|
12 | 192.168.1.10 [0 0] | |
|
13 | 192.168.1.11 [0 0] | |
|
14 | 192.168.1.12 [1 1] | |
|
15 | 192.168.1.13 [0 0] | |
|
16 | 192.168.1.14 [0 0] | |
|
17 | 192.168.1.15 [0 0] | |
|
18 | 192.168.1.16 [0 0] | |
|
19 | 192.168.1.17 [0 0] | |
|
20 | 192.168.1.18 [0 0] | |
|
21 | 192.168.1.19 [0 0] | |
|
22 | 192.168.1.20 [0 0] | |
|
23 | 192.168.1.21 [0 0] | |
|
24 | 192.168.1.22 [0 0] | |
|
25 | 192.168.1.23 [1 1] | |
|
26 | 192.168.1.24 [0 0] | |
|
27 | 192.168.1.25 [0 0] | |
|
28 | 192.168.1.26 [0 0] | |
|
29 | 192.168.1.27 [0 0] | |
|
30 | 192.168.1.28 [0 0] | |
|
31 | 192.168.1.29 [0 0] | |
|
32 | 192.168.1.30 [0 0] | |
|
33 | 192.168.1.31 [0 0] | |
|
34 | 192.168.1.32 [0 0] | |
|
35 | 192.168.1.33 [0 0] | |
|
36 | 192.168.1.34 [0 0] | |
|
37 | 192.168.1.35 [0 0] | |
|
38 | 192.168.1.36 [0 0] | |
|
39 | 192.168.1.37 [0 0] | |
|
40 | 192.168.1.38 [0 0] | |
|
41 | 192.168.1.39 [0 0] | |
|
42 | 192.168.1.40 [0 0] | |
|
43 | 192.168.1.41 [0 0] | |
|
44 | 192.168.1.42 [0 0] | |
|
45 | 192.168.1.43 [0 0] | |
|
46 | 192.168.1.44 [0 0] | |
|
47 | 192.168.1.45 [0 0] | |
|
48 | 192.168.1.46 [0 0] | |
|
49 | 192.168.1.47 [0 0] | |
|
50 | 192.168.1.48 [0 0] | |
|
51 | 192.168.1.49 [0 0] | |
|
52 | 192.168.1.50 [0 0] | |
|
53 | 192.168.1.51 [0 0] | |
|
54 | 192.168.1.52 [0 0] | |
|
55 | 192.168.1.53 [0 0] | |
|
56 | 192.168.1.54 [0 0] | |
|
57 | 192.168.1.55 [0 0] | |
|
58 | 192.168.1.56 [0 0] | |
|
59 | 192.168.1.57 [0 0] | |
|
60 | 192.168.1.58 [0 0] | |
|
61 | 192.168.1.59 [0 0] | |
|
62 | 192.168.1.60 [0 0] | |
|
63 | 192.168.1.61 [0 0] | |
|
64 | 192.168.1.62 [0 0] | |
|
65 | 192.168.1.63 [0 0] | |
|
66 | 192.168.1.64 [0 0] |
@@ -4,7 +4,7 | |||
|
4 | 4 | |
|
5 | 5 | class ABSServer: |
|
6 | 6 | |
|
7 | def __init__(self,ipSource="localhost", ipDestino="192.168.1.117", portDestino=7000, ipDestino2="192.168.1.11", portDestino2=5500): | |
|
7 | def __init__(self,ipSource="localhost", ipDestino="192.168.1.117", portDestino=7000, ipDestino2="192.168.1.11", portDestino2=5500, rx_buffer = "default"): | |
|
8 | 8 | |
|
9 | 9 | self.ipSource = ipSource |
|
10 | 10 | self.ipDestino = ipDestino |
@@ -14,7 +14,8 | |||
|
14 | 14 | self.portDestino2 = portDestino2 |
|
15 | 15 | |
|
16 | 16 | self.tx_buffer = "default" |
|
17 | self.rx_buffer = "default" | |
|
17 | # self.rx_buffer = "default" | |
|
18 | self.rx_buffer = rx_buffer | |
|
18 | 19 | self.enaModules = [] |
|
19 | 20 | |
|
20 | 21 | self.createObjects() |
@@ -191,6 +192,45 | |||
|
191 | 192 | |
|
192 | 193 | return self.tx_buffer |
|
193 | 194 | |
|
195 | def getConnectionStatus(self, cmd): | |
|
196 | ||
|
197 | ena = self.checkAntenna() | |
|
198 | self.enaModules = ena | |
|
199 | ||
|
200 | blockLst = [] | |
|
201 | ||
|
202 | for id in range(1,65): | |
|
203 | if id not in self.enaModules: | |
|
204 | continue | |
|
205 | ||
|
206 | blockStr = self.__ConnectionWithControlModules(self.rx_buffer,cmd,id) | |
|
207 | blockLst.append(blockStr + ", 192.168.1." + str(id) + "\n") | |
|
208 | #Using tx buffer | |
|
209 | self.tx_buffer = "".join(blockLst) | |
|
210 | print self.tx_buffer | |
|
211 | ||
|
212 | return self.tx_buffer | |
|
213 | ||
|
214 | def getControlModuleStatus(self, cmd): | |
|
215 | ||
|
216 | all_blocks = "" | |
|
217 | # enaModules = self.checkAntenna() | |
|
218 | # enaModules = [11,12,13,14] | |
|
219 | ||
|
220 | for id in range(1,65): | |
|
221 | if id not in self.enaModules: | |
|
222 | continue | |
|
223 | ||
|
224 | one_block = self.__ConnectionWithControlModules(self.rx_buffer,cmd,id) | |
|
225 | ||
|
226 | all_blocks = all_blocks + one_block | |
|
227 | #Using tx buffer | |
|
228 | print all_blocks | |
|
229 | self.tx_buffer = all_blocks | |
|
230 | ||
|
231 | return all_blocks | |
|
232 | ||
|
233 | ||
|
194 | 234 | if __name__ == '__main__': |
|
195 | 235 | |
|
196 | 236 | absObj = ABSServer() |
General Comments 0
You need to be logged in to leave comments.
Login now