MCPcopy Create free account
hub / github.com/CoolProp/CoolProp / PsychPlotFrame

Class PsychPlotFrame

wrappers/Python/CoolProp/GUI/CoolPropGUI.py:88–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86
87
88class PsychPlotFrame(wx.Frame):
89 def __init__(self, Tmin=263.15, Tmax=333.15, p=101.325, **kwargs):
90
91 wx.Frame.__init__(self, None, title='Psychrometric plot', **kwargs)
92
93 sizer = wx.BoxSizer(wx.HORIZONTAL)
94 self.PP = PlotPanel(self)
95
96 self.PP.figure.delaxes(self.PP.ax)
97 self.PP.ax = self.PP.figure.add_axes((0.1, 0.1, 0.85, 0.85))
98
99 sizer.Add(self.PP, 1, wx.EXPAND)
100 self.SetSizer(sizer)
101
102 PsychChart.p = p
103 PsychChart.Tdb = np.linspace(Tmin, Tmax)
104
105 SL = PsychChart.SaturationLine()
106 SL.plot(self.PP.ax)
107
108 RHL = PsychChart.HumidityLines([0.05, 0.1, 0.15, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9])
109 RHL.plot(self.PP.ax)
110
111 HL = PsychChart.EnthalpyLines(range(-20, 100, 10))
112 HL.plot(self.PP.ax)
113
114 PF = PsychChart.PlotFormatting()
115 PF.plot(self.PP.ax)
116
117 sizer.Layout()
118
119 self.add_menu()
120
121 self.PP.toolbar = WXToolbar(self.PP.canvas)
122 self.PP.toolbar.Realize()
123 self.PP.GetSizer().Add(self.PP.toolbar)
124
125 self.PP.Layout()
126
127 def add_menu(self):
128 # Menu Bar
129 self.MenuBar = wx.MenuBar()
130 self.File = wx.Menu()
131
132 mnuItem = wx.MenuItem(self.File, -1, "Edit...", "", wx.ITEM_NORMAL)
133
134 self.File.AppendItem(mnuItem)
135 self.MenuBar.Append(self.File, "File")
136
137 self.SetMenuBar(self.MenuBar)
138
139
140class PHPlotFrame(wx.Frame):

Callers 1

OnPsychPlotMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected