@@ -1,37 +1,42 | |||
|
1 | 1 | VERSIONS: |
|
2 | 2 | |
|
3 | 3 | 2.1.2: |
|
4 | 4 | -jroutils_ftp.py: Bug fixed, Any error sending file stopped the Server Thread |
|
5 | 5 | Server thread opens and closes remote server each time file list is sent |
|
6 | 6 | -jroplot_spectra.py: Noise path was not being created when noise data is saved. |
|
7 | 7 | -jroIO_base.py: startTime can be greater than endTime. Example: SpreadF [18:00 - 07:00] |
|
8 | 8 | |
|
9 | 9 | 2.1.3: |
|
10 | 10 | -jroplot_heispectra.py: SpectraHeisScope was not showing the right channels |
|
11 | 11 | -jroproc_voltage.py: Bug fixed selecting profiles (self.nProfiles took a wrong value), |
|
12 | 12 | Bug fixed selecting heights by block (selecting profiles instead heights) |
|
13 | 13 | -jroproc_voltage.py: New feature added: decoding data by block using FFT. |
|
14 | 14 | -jroIO_heispectra.py: Bug fixed in FitsReader. Using local Fits instance instead schainpy.mode.data.jrodata.Fits. |
|
15 | 15 | -jroIO_heispectra.py: Channel index list does not exist. |
|
16 | 16 | |
|
17 | 17 | 2.1.3.1: |
|
18 | 18 | -GUI: every icon were resized |
|
19 | 19 | -jroproc_voltage.py: Print a message when "Read from code" option is selected and the code is not defined inside data file |
|
20 | 20 | |
|
21 | 21 | 2.1.3.2: |
|
22 | 22 | -GUI: user interaction enhanced |
|
23 | 23 | -controller_api.py: Safe access to ControllerThead |
|
24 | 24 | |
|
25 | 25 | 2.1.3.3: |
|
26 | 26 | -Colored Button Icons were added to GUI |
|
27 | 27 | |
|
28 | 28 | 2.1.4: |
|
29 | 29 | -Sending error notifications to signal chain administrator |
|
30 | 30 | -Login to email server added |
|
31 | 31 | |
|
32 | 32 | 2.1.4.1: |
|
33 | 33 | -Send notifications when an error different to ValueError is detected |
|
34 | 34 | |
|
35 | 35 | 2.1.4.2: |
|
36 | 36 | -A new Plotter Class was added |
|
37 | -Project.start() does not accept filename as a parameter anymore | |
|
38 | ||
|
39 | 2.1.5: | |
|
40 | -serializer module added to Signal Chain | |
|
41 | -jroplotter.py added to Signal Chain | |
|
37 | 42 |
@@ -1,7 +1,7 | |||
|
1 | 1 | ''' |
|
2 | 2 | Created on Feb 7, 2012 |
|
3 | 3 | |
|
4 | 4 | @author $Author$ |
|
5 | 5 | @version $Id$ |
|
6 | 6 | ''' |
|
7 |
__version__ = "2.1. |
|
|
7 | __version__ = "2.1.5" No newline at end of file |
@@ -1,68 +1,104 | |||
|
1 | 1 | ''' |
|
2 | 2 | Created on Jul 9, 2014 |
|
3 | 3 | |
|
4 | 4 | @author: roj-idl71 |
|
5 | 5 | ''' |
|
6 | 6 | import os |
|
7 | 7 | import datetime |
|
8 | 8 | import numpy |
|
9 | 9 | |
|
10 |
from |
|
|
10 | from time import sleep | |
|
11 | from Queue import Queue | |
|
12 | from threading import Thread | |
|
11 | 13 | |
|
12 | class Plotter(Figure): | |
|
14 | from schainpy.model.proc.jroproc_base import Operation | |
|
15 | from schainpy.model.serializer.data import obj2Dict, dict2Obj | |
|
16 | from schainpy.model.graphics import * | |
|
17 | ||
|
18 | class Plotter(Operation): | |
|
13 | 19 | |
|
14 | 20 | isConfig = None |
|
15 | 21 | name = None |
|
16 |
|
|
|
22 | __queue = None | |
|
17 | 23 | |
|
18 | 24 | def __init__(self, plotter_name, plotter_queue=None): |
|
19 | 25 | |
|
26 | Operation.__init__(self) | |
|
27 | ||
|
20 | 28 | self.isConfig = False |
|
21 | 29 | self.name = plotter_name |
|
22 |
self. |
|
|
30 | self.__queue = plotter_queue | |
|
23 | 31 | |
|
24 | 32 | def getSubplots(self): |
|
25 | 33 | |
|
26 | 34 | nrow = self.nplots |
|
27 | 35 | ncol = 1 |
|
28 | 36 | return nrow, ncol |
|
29 | 37 | |
|
30 | 38 | def setup(self, **kwargs): |
|
31 | 39 | |
|
32 | # self.nplots = nplots | |
|
33 | # | |
|
34 | # self.createFigure(id=id, | |
|
35 | # wintitle=wintitle, | |
|
36 | # show=show) | |
|
37 | # | |
|
38 | # nrow,ncol = self.getSubplots() | |
|
39 | # colspan = 3 | |
|
40 | # rowspan = 1 | |
|
41 | # | |
|
42 | # for i in range(nplots): | |
|
43 | # self.addAxes(nrow, ncol, i, 0, colspan, rowspan) | |
|
44 | ||
|
45 | ||
|
46 | ||
|
47 | 40 | print "Initializing ..." |
|
48 | 41 | |
|
49 | 42 | |
|
50 | def run(self, dataOut, **kwargs): | |
|
43 | def run(self, dataOut, id=None, **kwargs): | |
|
51 | 44 | |
|
52 | 45 | """ |
|
53 | 46 | |
|
54 | 47 | Input: |
|
55 | 48 | dataOut : |
|
56 | 49 | id : |
|
57 | wintitle : | |
|
58 | channelList : | |
|
59 | show : | |
|
60 | 50 | """ |
|
61 | 51 | |
|
62 | if not self.isConfig: | |
|
63 | self.setup(**kwargs) | |
|
64 | self.isConfig=True | |
|
52 | packDict = {} | |
|
53 | ||
|
54 | packDict['id'] = id | |
|
55 | packDict['name'] = self.name | |
|
56 | packDict['kwargs'] = kwargs | |
|
57 | ||
|
58 | packDict['data'] = obj2Dict(dataOut) | |
|
59 | ||
|
60 | self.__queue.put(packDict) | |
|
61 | ||
|
62 | class PlotterManager(Thread): | |
|
63 | ||
|
64 | __stop = False | |
|
65 | ||
|
66 | def __init__(self, plotter_queue): | |
|
67 | ||
|
68 | Thread.__init__(self) | |
|
69 | ||
|
70 | self.__queue = plotter_queue | |
|
71 | ||
|
72 | self.plotInstanceDict = {} | |
|
73 | self.__stop = False | |
|
74 | ||
|
75 | def run(self): | |
|
76 | ||
|
77 | while True: | |
|
78 | ||
|
79 | if self.__stop: | |
|
80 | break | |
|
81 | ||
|
82 | if self.__queue.empty(): | |
|
83 | sleep(0.5) | |
|
84 | continue | |
|
85 | ||
|
86 | serial_data = self.__queue.get(True) | |
|
87 | ||
|
88 | plot_id = serial_data['id'] | |
|
89 | plot_name = serial_data['name'] | |
|
90 | kwargs = serial_data['kwargs'] | |
|
91 | dataDict = serial_data['data'] | |
|
92 | ||
|
93 | dataPlot = dict2Obj(dataDict) | |
|
94 | ||
|
95 | if plot_id not in self.plotInstanceDict.keys(): | |
|
96 | className = eval(plot_name) | |
|
97 | self.plotInstanceDict[plot_id] = className() | |
|
98 | ||
|
99 | plotter = self.plotInstanceDict[plot_id] | |
|
100 | plotter.run(dataPlot, plot_id, **kwargs) | |
|
65 | 101 | |
|
66 | print "Putting data on %s queue:" %self.name | |
|
67 | print kwargs | |
|
102 | def stop(self): | |
|
68 | 103 | |
|
104 | self.__stop = True No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now