Cat
StorageFifo.py
Go to the documentation of this file.
1 import wx
2 from proc import *
3 from plotter import *
4 from libCatKernel import *
5 from matplotlib.path import Path
6 import matplotlib.patches as patches
7 
9  def __init__(self, cat, obj, panel, path):
10  proc.__init__(self,cat,obj,panel,path)
11  self.loadxrc()
12 
13  self.s1=self.getControl("s1")
14  self.s2=self.getControl("s2")
15  self.s3=self.getControl("s3")
16  self.s4=self.getControl("s4")
17  self.update()
18 
19  self.panel.Bind(wx.EVT_BUTTON, self.onApply, id=xrc.XRCID("Apply"))
20 
21  def onApply(self, event):
22  v1 = float(self.s1.GetValue())
23  v2 = float(self.s2.GetValue())
24  v3 = float(self.s3.GetValue())
25  v4 = float(self.s4.GetValue())
26  self.obj.setSigma(v1,v2,v3,v4)
27 
28  def update(self):
29  v1=self.obj.sigma(0)
30  v2=self.obj.sigma(1)
31  v3=self.obj.sigma(2)
32  v4=self.obj.sigma(3)
33 
34  self.s1.SetValue(str(v1))
35  self.s2.SetValue(str(v2))
36  self.s3.SetValue(str(v3))
37  self.s4.SetValue(str(v4))
38 
39 #----------------------------------------------------------------------
40 
41 def Edit (cat, obj, panel, path):
42  return StorageFifo(cat, obj, panel, path)
43 
44 #----------------------------------------------------------------------
45 
46 def Plot(cat, obj, parent, id):
47  from mpl_toolkits.mplot3d import Axes3D
48  from matplotlib import cm
49  import matplotlib as mpl
50  import matplotlib.pyplot as plt
51  import numpy as np
52 
53  plot=plotter(parent,id)
54  fig=plot.current()
55  fig.suptitle('Dump of the Prototype Spy Fifo', fontsize=14, fontweight='bold')
56 
57 
58  # plot of data channel 1
59  p1=fig.add_subplot(4,2,1)
60  p1.set_title(r'Channel 1')
61  h1=h1d(p1, obj.hist1d(0), facecolor='red',linestyle='dashed')
62  p1.grid(False)
63 
64 
65  # plot of data channel 2
66  p2=fig.add_subplot(4,2,2)
67  p2.set_title(r'Channel 2')
68  h2=h1d(p2, obj.hist1d(1), facecolor='red',linestyle='dashed')
69  p2.grid(False)
70 
71 
72  # plot of data channel 3
73  p3=fig.add_subplot(4,2,3)
74  p3.set_title(r'Channel 3')
75  h3=h1d(p3, obj.hist1d(2), facecolor='red',linestyle='dashed')
76  p3.grid(False)
77 
78 
79  # plot of data channel 4
80  p4=fig.add_subplot(4,2,4)
81  p4.set_title(r'Channel 4')
82  h4=h1d(p4, obj.hist1d(3), facecolor='red',linestyle='dashed')
83  p4.grid(False)
84 
85 
86  # plot of data channel 5
87  p5=fig.add_subplot(4,2,5)
88  p5.set_title(r'Channel 5')
89  h5=h1d(p5, obj.hist1d(4), facecolor='red',linestyle='dashed')
90  p5.grid(False)
91 
92 
93 
94  # plot of data channel 6
95  p6=fig.add_subplot(4,2,6)
96  p6.set_title(r'Channel 6')
97  h6=h1d(p6, obj.hist1d(5), facecolor='red',linestyle='dashed')
98  p6.grid(False)
99 
100 
101  # plot of data channel 7
102  p7=fig.add_subplot(4,2,7)
103  p7.set_title(r'Channel 7')
104  h7=h1d(p7, obj.hist1d(6), facecolor='red',linestyle='dashed')
105  p7.grid(False)
106 
107  # plot of data channel 8
108  p8=fig.add_subplot(4,2,8)
109  p8.set_title(r'Channel 8')
110  h8=h1d(p8, obj.hist1d(7), facecolor='blue',linestyle='dashed')
111  p8.grid(False)
112 
113  return plot
def Plot(cat, obj, parent, id)
Definition: StorageFifo.py:46
def onApply(self, event)
Definition: StorageFifo.py:21
def h1d(fig, histo, alpha=0.5, facecolor='green', edgecolor='yellow', linestyle='dashed')
Definition: plotter.py:51
def __init__(self, cat, obj, panel, path)
Definition: StorageFifo.py:9
Definition: proc.py:1
def Edit(cat, obj, panel, path)
Definition: StorageFifo.py:41