diff --git a/schainpy/model/graphics/jroplot_data.py b/schainpy/model/graphics/jroplot_data.py index 6d3d898..9d592e4 100644 --- a/schainpy/model/graphics/jroplot_data.py +++ b/schainpy/model/graphics/jroplot_data.py @@ -86,6 +86,9 @@ class PlotData(Operation, Process): print 'plotting...{}'.format(self.CODE) + if self.show: + self.figure.show() + self.plot() self.figure.suptitle('{} {} - Date:{}'.format(self.title, self.CODE.upper(), datetime.datetime.utcfromtimestamp(self.max_time).strftime('%y/%m/%d %H:%M:%S'))) @@ -184,7 +187,6 @@ class PlotSpectraData(PlotData): n += 1 self.figure.subplots_adjust(left=0.1, right=0.95, bottom=0.15, top=0.85, wspace=0.9, hspace=0.5) - self.figure.show() def plot(self): @@ -277,7 +279,6 @@ class PlotRTIData(PlotData): ax.firsttime = True self.axes.append(ax) self.figure.subplots_adjust(hspace=0.5) - self.figure.show() def plot(self): @@ -367,7 +368,6 @@ class PlotCOHData(PlotRTIData): self.axes.append(ax) self.figure.subplots_adjust(hspace=0.5) - self.figure.show() class PlotNoiseData(PlotData): CODE = 'noise' @@ -392,8 +392,6 @@ class PlotNoiseData(PlotData): self.ax = self.figure.add_subplot(self.nrows, self.ncols, 1) self.ax.firsttime = True - self.figure.show() - def plot(self): x = self.times diff --git a/schainpy/model/utils/jroutils_publish.py b/schainpy/model/utils/jroutils_publish.py index a2b8287..8759589 100644 --- a/schainpy/model/utils/jroutils_publish.py +++ b/schainpy/model/utils/jroutils_publish.py @@ -31,7 +31,9 @@ def roundFloats(obj): def decimate(z): # dx = int(len(self.x)/self.__MAXNUMX) + 1 + dy = int(len(z[0])/MAXNUMY) + 1 + return z[::, ::dy] class throttle(object): @@ -148,8 +150,6 @@ class PublishData(Operation): self.zmq_socket.connect(address) time.sleep(1) - - def publish_data(self): self.dataOut.finished = False if self.mqtt is 1: @@ -354,10 +354,19 @@ class ReceiverData(ProcessingUnit, Process): if plottype == 'phase': self.data[plottype][t] = self.dataOut.getCoherence(phase=True) if self.realtime: +<<<<<<< HEAD self.data_web[plottype] = roundFloats(decimate(self.data[plottype][t]).tolist()) self.data_web['timestamp'] = t +======= + if plottype == 'spc': + self.data_web[plottype] = roundFloats(decimate(self.data[plottype]).tolist()) + else: + self.data_web[plottype] = roundFloats(decimate(self.data[plottype][t]).tolist()) + self.data_web['time'] = t +>>>>>>> f65929d2cf32d4dddb2d5fa2a72f3970d4d51812 self.data_web['interval'] = self.dataOut.getTimeInterval() self.data_web['type'] = plottype + def run(self): print '[Starting] {} from {}'.format(self.name, self.address) @@ -406,15 +415,18 @@ class ReceiverData(ProcessingUnit, Process): context = zmq.Context() sender_web_config = context.socket(zmq.PUB) if 'tcp://' in self.plot_address: - print self.plot_address dum, address, port = self.plot_address.split(':') conf_address = '{}:{}:{}'.format(dum, address, int(port)+1) else: conf_address = self.plot_address + '.config' sender_web_config.bind(conf_address) +<<<<<<< HEAD +======= + time.sleep(1) +>>>>>>> f65929d2cf32d4dddb2d5fa2a72f3970d4d51812 for kwargs in self.operationKwargs.values(): if 'plot' in kwargs: + print '[Sending] Config data to web for {}'.format(kwargs['code'].upper()) sender_web_config.send_string(json.dumps(kwargs)) - print kwargs self.isWebConfig = True diff --git a/schainpy/scripts/0, b/schainpy/scripts/0, new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/schainpy/scripts/0, diff --git a/schainpy/scripts/[], b/schainpy/scripts/[], new file mode 100644 index 0000000..8b2b5f2 --- /dev/null +++ b/schainpy/scripts/[], @@ -0,0 +1 @@ +=: ERROR: cannot open `=' (No such file or directory) diff --git a/schainpy/scripts/host, b/schainpy/scripts/host, new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/schainpy/scripts/host, diff --git a/schainpy/scripts/password, b/schainpy/scripts/password, new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/schainpy/scripts/password, diff --git a/schainpy/scripts/path, b/schainpy/scripts/path, new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/schainpy/scripts/path, diff --git a/schainpy/scripts/protocol, b/schainpy/scripts/protocol, new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/schainpy/scripts/protocol, diff --git a/schainpy/scripts/username, b/schainpy/scripts/username, new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/schainpy/scripts/username, diff --git a/schainpy/scripts/{ b/schainpy/scripts/{ new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/schainpy/scripts/{ diff --git a/schainpy/scripts/{-s} b/schainpy/scripts/{-s} new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/schainpy/scripts/{-s} diff --git a/schainpy/scripts/{}}}, b/schainpy/scripts/{}}}, new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/schainpy/scripts/{}}},