Source code for src.gui.instruments.vecmag_frame
"""A frame for monitoring and manually controlling the vector magnet."""
import wx
from src.gui.instruments import cryomag_panels as cm
ID_FIELDX = wx.NewId()
ID_FIELDY = wx.NewId()
ID_FIELDZ = wx.NewId()
ID_TEMP = wx.NewId()
[docs]class VecMagController (wx.Frame):
"""A frame for monitoring and manually controlling the vector magnet."""
def __init__(self, parent):
super(VecMagController, self).__init__(parent, wx.ID_ANY,
title='Vector Magnet Controller')
fieldLabels = ['X', 'Y', 'Z']
tempLabels = ['Cold Stage', 'Magnet', 'Sorb', 'PT2 Plate',
'PT1 Plate', 'He3 Pot']
datapanel = wx.Panel(self)
datasizer = wx.BoxSizer(wx.VERTICAL)
datapanel.SetSizer(datasizer)
fieldpanel = cm.GridPanel(datapanel, 'Fields (T)', fieldLabels,
[ID_FIELDX, ID_FIELDY, ID_FIELDZ])
temppanel = cm.GridPanel(datapanel, 'Temperatures (K)', tempLabels,
[ID_TEMP])
companel = wx.Panel(datapanel)
comsizer = wx.BoxSizer(wx.HORIZONTAL)
companel.SetSizer(comsizer)
self.btncool = wx.Button(companel, -1, 'Cooldown')
self.btncon = wx.Button(companel, -1, 'Condense')
self.btnrecon = wx.Button(companel, -1, 'Recondense')
comsizer.Add(self.btncool)
comsizer.Add(self.btncon)
comsizer.Add(self.btnrecon)
datasizer.Add(fieldpanel, 0, wx.EXPAND|wx.ALL, 5)
datasizer.Add(temppanel, 0, wx.EXPAND|wx.ALL, 5)
datasizer.Add(companel, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5)
mainsizer = wx.BoxSizer(wx.HORIZONTAL)
mainsizer.Add(datapanel, 1, wx.EXPAND)
self.SetSizerAndFit(mainsizer)
if __name__ == '__main__':
app = wx.App(0)
frame = VecMagController(None)
frame.Show()
app.MainLoop()