@@ -1103,7 +1103,7 class PlotterData(object): | |||
|
1103 | 1103 | MAXNUMX = 100 |
|
1104 | 1104 | MAXNUMY = 100 |
|
1105 | 1105 | |
|
1106 | def __init__(self, code, throttle_value, exp_code, buffering=True): | |
|
1106 | def __init__(self, code, throttle_value, exp_code, buffering=True, snr=False): | |
|
1107 | 1107 | |
|
1108 | 1108 | self.throttle = throttle_value |
|
1109 | 1109 | self.exp_code = exp_code |
@@ -1124,6 +1124,9 class PlotterData(object): | |||
|
1124 | 1124 | else: |
|
1125 | 1125 | self.plottypes = [code] |
|
1126 | 1126 | |
|
1127 | if 'snr' not in self.plottypes and snr: | |
|
1128 | self.plottypes.append('snr') | |
|
1129 | ||
|
1127 | 1130 | for plot in self.plottypes: |
|
1128 | 1131 | self.data[plot] = {} |
|
1129 | 1132 |
@@ -227,7 +227,7 class Plot(Operation): | |||
|
227 | 227 | self.sender_period = kwargs.get('sender_period', 2) |
|
228 | 228 | self.__throttle_plot = apply_throttle(self.throttle) |
|
229 | 229 | self.data = PlotterData( |
|
230 | self.CODE, self.throttle, self.exp_code, self.buffering) | |
|
230 | self.CODE, self.throttle, self.exp_code, self.buffering, snr=self.showSNR) | |
|
231 | 231 | |
|
232 | 232 | if self.plot_server: |
|
233 | 233 | if not self.plot_server.startswith('tcp://'): |
@@ -310,8 +310,6 class Plot(Operation): | |||
|
310 | 310 | fig.canvas.mpl_connect('button_press_event', self.onBtnPress) |
|
311 | 311 | fig.canvas.mpl_connect('motion_notify_event', self.onMotion) |
|
312 | 312 | fig.canvas.mpl_connect('button_release_event', self.onBtnRelease) |
|
313 | if self.show: | |
|
314 | fig.show() | |
|
315 | 313 | |
|
316 | 314 | def OnKeyPress(self, event): |
|
317 | 315 | ''' |
@@ -604,6 +602,9 class Plot(Operation): | |||
|
604 | 602 | fig.canvas.manager.set_window_title('{} - {}'.format(self.title, |
|
605 | 603 | self.getDateTime(self.data.max_time).strftime('%Y/%m/%d'))) |
|
606 | 604 | fig.canvas.draw() |
|
605 | if self.show: | |
|
606 | fig.show() | |
|
607 | figpause(0.1) | |
|
607 | 608 | |
|
608 | 609 | if self.save: |
|
609 | 610 | self.save_figure(n) |
@@ -739,13 +740,21 class Plot(Operation): | |||
|
739 | 740 | |
|
740 | 741 | if dataOut.useLocalTime: |
|
741 | 742 | self.getDateTime = datetime.datetime.fromtimestamp |
|
743 | if not self.localtime: | |
|
744 | t += time.timezone | |
|
742 | 745 | else: |
|
743 | 746 | self.getDateTime = datetime.datetime.utcfromtimestamp |
|
747 | if self.localtime: | |
|
748 | t -= time.timezone | |
|
744 | 749 | |
|
745 | 750 | if self.xmin is None: |
|
746 | 751 | self.tmin = t |
|
747 | 752 | else: |
|
748 | self.tmin = (self.getDateTime(t).replace(hour=self.xmin, minute=0, second=0) - datetime.datetime(1970, 1, 1)).total_seconds() | |
|
753 | self.tmin = ( | |
|
754 | self.getDateTime(t).replace( | |
|
755 | hour=self.xmin, | |
|
756 | minute=0, | |
|
757 | second=0) - self.getDateTime(0)).total_seconds() | |
|
749 | 758 | |
|
750 | 759 | self.data.setup() |
|
751 | 760 | self.isConfig = True |
@@ -787,8 +796,6 class Plot(Operation): | |||
|
787 | 796 | else: |
|
788 | 797 | self.__throttle_plot(self.__plot)#, coerce=coerce) |
|
789 | 798 | |
|
790 | figpause(0.01) | |
|
791 | ||
|
792 | 799 | def close(self): |
|
793 | 800 | |
|
794 | 801 | if self.data: |
@@ -144,7 +144,8 class BLTRParamReader(JRODataReader, ProcessingUnit): | |||
|
144 | 144 | Get last file and add it to the list |
|
145 | 145 | ''' |
|
146 | 146 | |
|
147 |
for n in range(self.nTries): |
|
|
147 | for n in range(self.nTries+1): | |
|
148 | if n>0: | |
|
148 | 149 | log.warning( |
|
149 | 150 | "Waiting %0.2f seconds for the next file, try %03d ..." % (self.delay, n+1), |
|
150 | 151 | self.name |
@@ -230,6 +231,7 class BLTRParamReader(JRODataReader, ProcessingUnit): | |||
|
230 | 231 | self.counter_records = 0 |
|
231 | 232 | self.flagIsNewFile = 0 |
|
232 | 233 | self.fileIndex += 1 |
|
234 | time.sleep(2) | |
|
233 | 235 | |
|
234 | 236 | return 1 |
|
235 | 237 | |
@@ -245,7 +247,7 class BLTRParamReader(JRODataReader, ProcessingUnit): | |||
|
245 | 247 | pointer = self.fp.tell() |
|
246 | 248 | self.readBlock() |
|
247 | 249 | except: |
|
248 | if self.waitDataBlock(pointer, 38512) == 1: | |
|
250 | if self.online and self.waitDataBlock(pointer, 38512) == 1: | |
|
249 | 251 | continue |
|
250 | 252 | else: |
|
251 | 253 | if not self.setNextFile(): |
General Comments 0
You need to be logged in to leave comments.
Login now