15 "OS": "24", |
15 "OS": "24", |
16 } |
16 } |
17 def __init__(self, device="/dev/ttyUSB0", baudrate=115200, timeout=0.1, |
17 def __init__(self, device="/dev/ttyUSB0", baudrate=115200, timeout=0.1, |
18 address=5): |
18 address=5): |
19 super(GPIBplotter, self).__init__(device, baudrate, timeout, address, mode=0) |
19 super(GPIBplotter, self).__init__(device, baudrate, timeout, address, mode=0) |
|
20 |
|
21 def plotStarted(self): |
|
22 pass |
20 |
23 |
21 def load_plot(self, wait_timeout=0): |
24 def load_plot(self, wait_timeout=0): |
22 """ |
25 """ |
23 Make a full plot process. |
26 Make a full plot process. |
24 |
27 |
41 while i<self._retries: |
44 while i<self._retries: |
42 l = self._cnx.readline().strip() |
45 l = self._cnx.readline().strip() |
43 if firstloop: |
46 if firstloop: |
44 self._cnx.timeout = self._timeout |
47 self._cnx.timeout = self._timeout |
45 firstloop = False |
48 firstloop = False |
|
49 self.plotStarted() |
46 if l == "": |
50 if l == "": |
47 if i == 0:# > (self._retries/2): |
51 if i == 0:# > (self._retries/2): |
48 # ie. we just received new stuffs (i is reset in the else block) |
52 # ie. we just received new stuffs (i is reset in the else block) |
49 for k, v in replies.items(): |
53 for k, v in replies.items(): |
50 # check wether we should reply smthg |
54 # check wether we should reply smthg |