Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 717 → Rev 718

/VibrationTest/branches/ParameterTest/VibrationTest/VibrationTestGui.py
64,6 → 64,136
(MeasStatusUpdateEvent, EVT_MEAS_STATUS_UPDATE) = wx.lib.newevent.NewEvent()
(MeasDataEvent, EVT_MEAS_DATA) = wx.lib.newevent.NewEvent()
 
class MkSettingsDialog(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: MkSettingsDialog.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.label_2 = wx.StaticText(self, -1, "Gyro-P", style=wx.ALIGN_RIGHT)
self.slider_GyroP = wx.Slider(self, -1, 0, 0, 255, style=wx.SL_HORIZONTAL|wx.SL_LABELS)
self.label_2_copy = wx.StaticText(self, -1, "Gyro-I", style=wx.ALIGN_RIGHT)
self.slider_GyroI = wx.Slider(self, -1, 0, 0, 255, style=wx.SL_HORIZONTAL|wx.SL_LABELS)
self.label_2_copy_1 = wx.StaticText(self, -1, "Gyro-D", style=wx.ALIGN_RIGHT)
self.slider_GyroD = wx.Slider(self, -1, 0, 0, 255, style=wx.SL_HORIZONTAL|wx.SL_LABELS)
self.label_2_copy_2 = wx.StaticText(self, -1, "Factor-I", style=wx.ALIGN_RIGHT)
self.slider_FactorI = wx.Slider(self, -1, 0, 0, 255, style=wx.SL_HORIZONTAL|wx.SL_LABELS)
self.label_2_copy_3 = wx.StaticText(self, -1, "", style=wx.ALIGN_RIGHT)
self.slider_1_copy_3 = wx.Slider(self, -1, 0, 0, 255, style=wx.SL_HORIZONTAL|wx.SL_LABELS)
self.loadButton = wx.Button(self, -1, "Load")
self.storeButton = wx.Button(self, -1, "Store")
 
self.__set_properties()
self.__do_layout()
 
self.Bind(wx.EVT_BUTTON, self.onLoad, self.loadButton)
# end wxGlade
 
def __set_properties(self):
# begin wxGlade: MkSettingsDialog.__set_properties
self.SetTitle("MK Settings")
self.SetSize((600, 450))
self.label_2.SetMinSize((80, 16))
self.label_2.SetFont(wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, ""))
self.slider_GyroP.SetMinSize((400, -1))
self.slider_GyroP.SetBackgroundColour(wx.Colour(128, 128, 128))
self.label_2_copy.SetMinSize((80, 16))
self.label_2_copy.SetFont(wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, ""))
self.slider_GyroI.SetMinSize((400, -1))
self.slider_GyroI.SetBackgroundColour(wx.Colour(128, 128, 128))
self.label_2_copy_1.SetMinSize((80, 16))
self.label_2_copy_1.SetFont(wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, ""))
self.slider_GyroD.SetMinSize((400, -1))
self.slider_GyroD.SetBackgroundColour(wx.Colour(128, 128, 128))
self.label_2_copy_2.SetMinSize((80, 16))
self.label_2_copy_2.SetFont(wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, ""))
self.slider_FactorI.SetMinSize((400, -1))
self.slider_FactorI.SetBackgroundColour(wx.Colour(128, 128, 128))
self.label_2_copy_3.SetMinSize((80, 16))
self.label_2_copy_3.SetFont(wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, ""))
self.slider_1_copy_3.SetMinSize((400, -1))
self.slider_1_copy_3.SetBackgroundColour(wx.Colour(128, 128, 128))
# end wxGlade
 
def __do_layout(self):
# begin wxGlade: MkSettingsDialog.__do_layout
sizer_15 = wx.BoxSizer(wx.VERTICAL)
sizer_21 = wx.BoxSizer(wx.HORIZONTAL)
sizer_22 = wx.BoxSizer(wx.VERTICAL)
sizer_25 = wx.BoxSizer(wx.HORIZONTAL)
sizer_23 = wx.BoxSizer(wx.VERTICAL)
sizer_24_copy_3 = wx.BoxSizer(wx.HORIZONTAL)
sizer_24_copy_2 = wx.BoxSizer(wx.HORIZONTAL)
sizer_24_copy_1 = wx.BoxSizer(wx.HORIZONTAL)
sizer_24_copy = wx.BoxSizer(wx.HORIZONTAL)
sizer_24 = wx.BoxSizer(wx.HORIZONTAL)
sizer_21.Add((20, 20), 0, 0, 0)
sizer_22.Add((20, 20), 0, 0, 0)
sizer_24.Add(self.label_2, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0)
sizer_24.Add((20, 20), 0, 0, 0)
sizer_24.Add(self.slider_GyroP, 0, 0, 0)
sizer_23.Add(sizer_24, 1, wx.EXPAND, 0)
sizer_23.Add((20, 20), 0, 0, 0)
sizer_24_copy.Add(self.label_2_copy, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0)
sizer_24_copy.Add((20, 20), 0, 0, 0)
sizer_24_copy.Add(self.slider_GyroI, 0, 0, 0)
sizer_23.Add(sizer_24_copy, 1, wx.EXPAND, 0)
sizer_23.Add((20, 20), 0, 0, 0)
sizer_24_copy_1.Add(self.label_2_copy_1, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0)
sizer_24_copy_1.Add((20, 20), 0, 0, 0)
sizer_24_copy_1.Add(self.slider_GyroD, 0, 0, 0)
sizer_23.Add(sizer_24_copy_1, 1, wx.EXPAND, 0)
sizer_23.Add((20, 20), 0, 0, 0)
sizer_24_copy_2.Add(self.label_2_copy_2, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0)
sizer_24_copy_2.Add((20, 20), 0, 0, 0)
sizer_24_copy_2.Add(self.slider_FactorI, 0, 0, 0)
sizer_23.Add(sizer_24_copy_2, 1, wx.EXPAND, 0)
sizer_23.Add((20, 20), 0, 0, 0)
sizer_24_copy_3.Add(self.label_2_copy_3, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0)
sizer_24_copy_3.Add((20, 20), 0, 0, 0)
sizer_24_copy_3.Add(self.slider_1_copy_3, 0, 0, 0)
sizer_23.Add(sizer_24_copy_3, 1, wx.EXPAND, 0)
sizer_23.Add((20, 20), 0, 0, 0)
sizer_22.Add(sizer_23, 1, wx.EXPAND, 0)
sizer_25.Add(self.loadButton, 0, 0, 0)
sizer_25.Add((20, 20), 0, 0, 0)
sizer_25.Add(self.storeButton, 0, 0, 0)
sizer_25.Add((20, 20), 0, 0, 0)
sizer_22.Add(sizer_25, 1, wx.EXPAND, 0)
sizer_22.Add((20, 20), 0, 0, 0)
sizer_21.Add(sizer_22, 0, 0, 0)
sizer_21.Add((20, 20), 0, 0, 0)
sizer_15.Add(sizer_21, 0, 0, 0)
self.SetSizer(sizer_15)
self.Layout()
self.SetSize((600, 450))
# end wxGlade
 
def onLoad(self, event): # wxGlade: MkSettingsDialog.<event_handler>
print "Loading MK Settings"
mk = MkProtocol.MkComm()
mk.open(comPort=self.app.settings["serialport"].value)
msg = mk.getSettingsMsg()
print "Index=",msg.getIndex()
print "Name=",msg.getName()
 
self.slider_GyroP.SetValue(msg.getSetting(SettingsMsg.IDX_STICK_P))
self.slider_GyroP.SetValue(msg.getSetting(SettingsMsg.IDX_STICK_I))
self.slider_GyroP.SetValue(msg.getSetting(SettingsMsg.IDX_STICK_D))
mk.close()
event.Skip()
def setApp(self, app):
self.app = app
# end of class MkSettingsDialog
 
 
 
 
class MeasureDialog(wx.Dialog):
def __init__(self, *args, **kwds):
# begin wxGlade: MeasureDialog.__init__
1162,12 → 1292,17
 
def OnInit(self):
wx.InitAllImageHandlers()
self.frame_1 = MainFrame(None, -1, "")
self.frame_1.setApp(self);
self.frame_1.setApp(self)
self.SetTopWindow(self.frame_1)
 
self.frame_1.CenterOnScreen()
self.frame_1.Show()
self.mkSettingsFrame = MkSettingsDialog(None, -1, "")
self.mkSettingsFrame.setApp(self);
self.mkSettingsFrame.Show()
 
return 1
 
def saveTests(self, filePath):
/VibrationTest/branches/ParameterTest/VibrationTest/VibrationTestGui.wxg
1,7 → 1,7
<?xml version="1.0"?>
<!-- generated by wxGlade 0.6.3 on Sat Nov 28 17:56:40 2009 -->
<!-- generated by wxGlade 0.6.3 on Fri Dec 11 18:20:40 2009 -->
 
<application path="C:\DATA\MK\SVN\Projects\VibrationTest\branches\ParameterTest\VibrationTest\VibrationTestGui.py" name="VibrationTestGui" class="App" option="0" language="python" top_window="frame_1" encoding="ISO-8859-15" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6" is_template="0">
<application path="D:\Fred\MK\SVN\Projects\VibrationTest\branches\ParameterTest\VibrationTest\VibrationTestGui.py" name="VibrationTestGui" class="App" option="0" language="python" top_window="frame_1" encoding="ISO-8859-15" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6" is_template="0">
<object class="MainFrame" name="frame_1" base="EditFrame">
<style>wxDEFAULT_FRAME_STYLE</style>
<title>VibrationTest</title>
915,4 → 915,368
</object>
</object>
</object>
<object class="MkSettingsDialog" name="MkSettingsDialog" base="EditFrame">
<style>wxDEFAULT_FRAME_STYLE</style>
<title>MK Settings</title>
<size>600, 450</size>
<object class="wxBoxSizer" name="sizer_15" base="EditBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="wxBoxSizer" name="sizer_21" base="EditBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>20</width>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="wxBoxSizer" name="sizer_22" base="EditBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>20</width>
</object>
</object>
<object class="sizeritem">
<flag>wxEXPAND</flag>
<border>0</border>
<option>1</option>
<object class="wxBoxSizer" name="sizer_23" base="EditBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<flag>wxEXPAND</flag>
<border>0</border>
<option>1</option>
<object class="wxBoxSizer" name="sizer_24" base="EditBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<flag>wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
<border>0</border>
<option>0</option>
<object class="wxStaticText" name="label_2" base="EditStaticText">
<style>wxALIGN_RIGHT</style>
<attribute>1</attribute>
<label>Gyro-P</label>
<font>
<size>10</size>
<family>default</family>
<style>normal</style>
<weight>bold</weight>
<underlined>0</underlined>
<face></face>
</font>
<size>80, 16</size>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>20</width>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="wxSlider" name="slider_GyroP" base="EditSlider">
<style>wxSL_HORIZONTAL|wxSL_LABELS</style>
<range>0, 255</range>
<background>#808080</background>
<size>400, -1</size>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>20</width>
</object>
</object>
<object class="sizeritem">
<flag>wxEXPAND</flag>
<border>0</border>
<option>1</option>
<object class="wxBoxSizer" name="sizer_24_copy" base="EditBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<flag>wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
<border>0</border>
<option>0</option>
<object class="wxStaticText" name="label_2_copy" base="EditStaticText">
<style>wxALIGN_RIGHT</style>
<attribute>1</attribute>
<label>Gyro-I</label>
<font>
<size>10</size>
<family>default</family>
<style>normal</style>
<weight>bold</weight>
<underlined>0</underlined>
<face></face>
</font>
<size>80, 16</size>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>20</width>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="wxSlider" name="slider_GyroI" base="EditSlider">
<style>wxSL_HORIZONTAL|wxSL_LABELS</style>
<range>0, 255</range>
<background>#808080</background>
<size>400, -1</size>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>20</width>
</object>
</object>
<object class="sizeritem">
<flag>wxEXPAND</flag>
<border>0</border>
<option>1</option>
<object class="wxBoxSizer" name="sizer_24_copy_1" base="EditBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<flag>wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
<border>0</border>
<option>0</option>
<object class="wxStaticText" name="label_2_copy_1" base="EditStaticText">
<style>wxALIGN_RIGHT</style>
<attribute>1</attribute>
<label>Gyro-D</label>
<font>
<size>10</size>
<family>default</family>
<style>normal</style>
<weight>bold</weight>
<underlined>0</underlined>
<face></face>
</font>
<size>80, 16</size>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>20</width>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="wxSlider" name="slider_GyroD" base="EditSlider">
<style>wxSL_HORIZONTAL|wxSL_LABELS</style>
<range>0, 255</range>
<background>#808080</background>
<size>400, -1</size>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>20</width>
</object>
</object>
<object class="sizeritem">
<flag>wxEXPAND</flag>
<border>0</border>
<option>1</option>
<object class="wxBoxSizer" name="sizer_24_copy_2" base="EditBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<flag>wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
<border>0</border>
<option>0</option>
<object class="wxStaticText" name="label_2_copy_2" base="EditStaticText">
<style>wxALIGN_RIGHT</style>
<attribute>1</attribute>
<label>Factor-I</label>
<font>
<size>10</size>
<family>default</family>
<style>normal</style>
<weight>bold</weight>
<underlined>0</underlined>
<face></face>
</font>
<size>80, 16</size>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>20</width>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="wxSlider" name="slider_FactorI" base="EditSlider">
<style>wxSL_HORIZONTAL|wxSL_LABELS</style>
<range>0, 255</range>
<background>#808080</background>
<size>400, -1</size>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>20</width>
</object>
</object>
<object class="sizeritem">
<flag>wxEXPAND</flag>
<border>0</border>
<option>1</option>
<object class="wxBoxSizer" name="sizer_24_copy_3" base="EditBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<flag>wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL</flag>
<border>0</border>
<option>0</option>
<object class="wxStaticText" name="label_2_copy_3" base="EditStaticText">
<style>wxALIGN_RIGHT</style>
<attribute>1</attribute>
<font>
<size>10</size>
<family>default</family>
<style>normal</style>
<weight>bold</weight>
<underlined>0</underlined>
<face></face>
</font>
<size>80, 16</size>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>20</width>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="wxSlider" name="slider_1_copy_3" base="EditSlider">
<style>wxSL_HORIZONTAL|wxSL_LABELS</style>
<range>0, 255</range>
<background>#808080</background>
<size>400, -1</size>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>20</width>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<flag>wxEXPAND</flag>
<border>0</border>
<option>1</option>
<object class="wxBoxSizer" name="sizer_25" base="EditBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="wxButton" name="loadButton" base="EditButton">
<label>Load</label>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>20</width>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="wxButton" name="storeButton" base="EditButton">
<label>Store</label>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>20</width>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>20</width>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>20</width>
</object>
</object>
</object>
</object>
</object>
</object>
</application>