@@ -6,6 +6,7 import mpldriver | |||||
6 | from schainpy.model.proc.jroproc_base import Operation |
|
6 | from schainpy.model.proc.jroproc_base import Operation | |
7 |
|
7 | |||
8 | def isRealtime(utcdatatime): |
|
8 | def isRealtime(utcdatatime): | |
|
9 | ||||
9 | utcnow = time.mktime(time.localtime()) |
|
10 | utcnow = time.mktime(time.localtime()) | |
10 | delta = abs(utcnow - utcdatatime) # abs |
|
11 | delta = abs(utcnow - utcdatatime) # abs | |
11 | if delta >= 30.: |
|
12 | if delta >= 30.: | |
@@ -15,7 +16,6 def isRealtime(utcdatatime): | |||||
15 | class Figure(Operation): |
|
16 | class Figure(Operation): | |
16 |
|
17 | |||
17 | __driver = mpldriver |
|
18 | __driver = mpldriver | |
18 | __isConfigThread = False |
|
|||
19 | fig = None |
|
19 | fig = None | |
20 |
|
20 | |||
21 | id = None |
|
21 | id = None | |
@@ -27,8 +27,8 class Figure(Operation): | |||||
27 |
|
27 | |||
28 | axesObjList = [] |
|
28 | axesObjList = [] | |
29 |
|
29 | |||
30 |
WIDTH = |
|
30 | WIDTH = 300 | |
31 |
HEIGHT = |
|
31 | HEIGHT = 200 | |
32 | PREFIX = 'fig' |
|
32 | PREFIX = 'fig' | |
33 |
|
33 | |||
34 | xmin = None |
|
34 | xmin = None | |
@@ -40,7 +40,7 class Figure(Operation): | |||||
40 |
|
40 | |||
41 | def __init__(self): |
|
41 | def __init__(self): | |
42 |
|
42 | |||
43 | raise ValueError, "This method is not implemented" |
|
43 | raise NotImplementedError | |
44 |
|
44 | |||
45 | def __del__(self): |
|
45 | def __del__(self): | |
46 |
|
46 | |||
@@ -58,7 +58,7 class Figure(Operation): | |||||
58 |
|
58 | |||
59 | def getSubplots(self): |
|
59 | def getSubplots(self): | |
60 |
|
60 | |||
61 | raise ValueError, "Abstract method: This method should be defined" |
|
61 | raise NotImplementedError | |
62 |
|
62 | |||
63 | def getScreenDim(self, widthplot, heightplot): |
|
63 | def getScreenDim(self, widthplot, heightplot): | |
64 |
|
64 | |||
@@ -81,7 +81,6 class Figure(Operation): | |||||
81 |
|
81 | |||
82 | if timerange == None and (xmin==None or xmax==None): |
|
82 | if timerange == None and (xmin==None or xmax==None): | |
83 | timerange = 14400 #seconds |
|
83 | timerange = 14400 #seconds | |
84 | #raise ValueError, "(timerange) or (xmin & xmax) should be defined" |
|
|||
85 |
|
84 | |||
86 | if timerange != None: |
|
85 | if timerange != None: | |
87 | txmin = x[0] #- x[0] % min(timerange/10, 10*60) |
|
86 | txmin = x[0] #- x[0] % min(timerange/10, 10*60) | |
@@ -105,7 +104,7 class Figure(Operation): | |||||
105 |
|
104 | |||
106 | def init(self, id, nplots, wintitle): |
|
105 | def init(self, id, nplots, wintitle): | |
107 |
|
106 | |||
108 |
raise |
|
107 | raise NotImplementedError, "This method has been replaced with createFigure" | |
109 |
|
108 | |||
110 | def createFigure(self, id, wintitle, widthplot=None, heightplot=None, show=True): |
|
109 | def createFigure(self, id, wintitle, widthplot=None, heightplot=None, show=True): | |
111 |
|
110 | |||
@@ -156,11 +155,11 class Figure(Operation): | |||||
156 |
|
155 | |||
157 | def setTextFromAxes(self, text): |
|
156 | def setTextFromAxes(self, text): | |
158 |
|
157 | |||
159 | raise ValueError, "Este metodo ha sido reemplazaado con el metodo setText de la clase Axes" |
|
158 | raise NotImplementedError, "This method has been replaced with Axes.setText" | |
160 |
|
159 | |||
161 | def makeAxes(self, nrow, ncol, xpos, ypos, colspan, rowspan): |
|
160 | def makeAxes(self, nrow, ncol, xpos, ypos, colspan, rowspan): | |
162 |
|
161 | |||
163 |
raise |
|
162 | raise NotImplementedError, "This method has been replaced with Axes.addAxes" | |
164 |
|
163 | |||
165 | def addAxes(self, *args): |
|
164 | def addAxes(self, *args): | |
166 | """ |
|
165 | """ | |
@@ -246,7 +245,7 class Figure(Operation): | |||||
246 |
|
245 | |||
247 | def run(self): |
|
246 | def run(self): | |
248 |
|
247 | |||
249 | raise ValueError, "This method is not implemented" |
|
248 | raise NotImplementedError | |
250 |
|
249 | |||
251 | def close(self, show=False): |
|
250 | def close(self, show=False): | |
252 |
|
251 |
@@ -12,7 +12,7 if 'darwin' in sys.platform: | |||||
12 | import matplotlib.pyplot |
|
12 | import matplotlib.pyplot | |
13 |
|
13 | |||
14 | from mpl_toolkits.axes_grid1 import make_axes_locatable |
|
14 | from mpl_toolkits.axes_grid1 import make_axes_locatable | |
15 |
from matplotlib.ticker import |
|
15 | from matplotlib.ticker import FuncFormatter, LinearLocator | |
16 |
|
16 | |||
17 | ########################################### |
|
17 | ########################################### | |
18 | #Actualizacion de las funciones del driver |
|
18 | #Actualizacion de las funciones del driver | |
@@ -40,12 +40,12 def closeFigure(show=False, fig=None): | |||||
40 |
|
40 | |||
41 | if fig != None: |
|
41 | if fig != None: | |
42 | matplotlib.pyplot.close(fig.number) |
|
42 | matplotlib.pyplot.close(fig.number) | |
43 |
|
|
43 | matplotlib.pyplot.pause(0.1) | |
44 | # matplotlib.pyplot.ion() |
|
44 | # matplotlib.pyplot.ion() | |
45 | return |
|
45 | return | |
46 |
|
46 | |||
47 | matplotlib.pyplot.close("all") |
|
47 | matplotlib.pyplot.close("all") | |
48 |
|
|
48 | matplotlib.pyplot.pause(0.1) | |
49 | # matplotlib.pyplot.ion() |
|
49 | # matplotlib.pyplot.ion() | |
50 | return |
|
50 | return | |
51 |
|
51 |
General Comments 0
You need to be logged in to leave comments.
Login now