##// END OF EJS Templates
SChain v2.1.5: jroplotter.py and testPlotter.py were added to Signal Chain
Miguel Valdez -
r698:060cd0e7af33
parent child
Show More
@@ -1,37 +1,42
1 VERSIONS:
1 VERSIONS:
2
2
3 2.1.2:
3 2.1.2:
4 -jroutils_ftp.py: Bug fixed, Any error sending file stopped the Server Thread
4 -jroutils_ftp.py: Bug fixed, Any error sending file stopped the Server Thread
5 Server thread opens and closes remote server each time file list is sent
5 Server thread opens and closes remote server each time file list is sent
6 -jroplot_spectra.py: Noise path was not being created when noise data is saved.
6 -jroplot_spectra.py: Noise path was not being created when noise data is saved.
7 -jroIO_base.py: startTime can be greater than endTime. Example: SpreadF [18:00 - 07:00]
7 -jroIO_base.py: startTime can be greater than endTime. Example: SpreadF [18:00 - 07:00]
8
8
9 2.1.3:
9 2.1.3:
10 -jroplot_heispectra.py: SpectraHeisScope was not showing the right channels
10 -jroplot_heispectra.py: SpectraHeisScope was not showing the right channels
11 -jroproc_voltage.py: Bug fixed selecting profiles (self.nProfiles took a wrong value),
11 -jroproc_voltage.py: Bug fixed selecting profiles (self.nProfiles took a wrong value),
12 Bug fixed selecting heights by block (selecting profiles instead heights)
12 Bug fixed selecting heights by block (selecting profiles instead heights)
13 -jroproc_voltage.py: New feature added: decoding data by block using FFT.
13 -jroproc_voltage.py: New feature added: decoding data by block using FFT.
14 -jroIO_heispectra.py: Bug fixed in FitsReader. Using local Fits instance instead schainpy.mode.data.jrodata.Fits.
14 -jroIO_heispectra.py: Bug fixed in FitsReader. Using local Fits instance instead schainpy.mode.data.jrodata.Fits.
15 -jroIO_heispectra.py: Channel index list does not exist.
15 -jroIO_heispectra.py: Channel index list does not exist.
16
16
17 2.1.3.1:
17 2.1.3.1:
18 -GUI: every icon were resized
18 -GUI: every icon were resized
19 -jroproc_voltage.py: Print a message when "Read from code" option is selected and the code is not defined inside data file
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 2.1.3.2:
21 2.1.3.2:
22 -GUI: user interaction enhanced
22 -GUI: user interaction enhanced
23 -controller_api.py: Safe access to ControllerThead
23 -controller_api.py: Safe access to ControllerThead
24
24
25 2.1.3.3:
25 2.1.3.3:
26 -Colored Button Icons were added to GUI
26 -Colored Button Icons were added to GUI
27
27
28 2.1.4:
28 2.1.4:
29 -Sending error notifications to signal chain administrator
29 -Sending error notifications to signal chain administrator
30 -Login to email server added
30 -Login to email server added
31
31
32 2.1.4.1:
32 2.1.4.1:
33 -Send notifications when an error different to ValueError is detected
33 -Send notifications when an error different to ValueError is detected
34
34
35 2.1.4.2:
35 2.1.4.2:
36 -A new Plotter Class was added
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 Created on Feb 7, 2012
2 Created on Feb 7, 2012
3
3
4 @author $Author$
4 @author $Author$
5 @version $Id$
5 @version $Id$
6 '''
6 '''
7 __version__ = "2.1.4.2" No newline at end of file
7 __version__ = "2.1.5" No newline at end of file
@@ -1,68 +1,104
1 '''
1 '''
2 Created on Jul 9, 2014
2 Created on Jul 9, 2014
3
3
4 @author: roj-idl71
4 @author: roj-idl71
5 '''
5 '''
6 import os
6 import os
7 import datetime
7 import datetime
8 import numpy
8 import numpy
9
9
10 from figure import Figure
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 isConfig = None
20 isConfig = None
15 name = None
21 name = None
16 plotterQueue = None
22 __queue = None
17
23
18 def __init__(self, plotter_name, plotter_queue=None):
24 def __init__(self, plotter_name, plotter_queue=None):
19
25
26 Operation.__init__(self)
27
20 self.isConfig = False
28 self.isConfig = False
21 self.name = plotter_name
29 self.name = plotter_name
22 self.plotterQueue = plotter_queue
30 self.__queue = plotter_queue
23
31
24 def getSubplots(self):
32 def getSubplots(self):
25
33
26 nrow = self.nplots
34 nrow = self.nplots
27 ncol = 1
35 ncol = 1
28 return nrow, ncol
36 return nrow, ncol
29
37
30 def setup(self, **kwargs):
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 print "Initializing ..."
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 Input:
47 Input:
55 dataOut :
48 dataOut :
56 id :
49 id :
57 wintitle :
58 channelList :
59 show :
60 """
50 """
61
51
62 if not self.isConfig:
52 packDict = {}
63 self.setup(**kwargs)
53
64 self.isConfig=True
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
102 def stop(self):
67 print kwargs
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