168 self.SizerDic["SlaveState_up_sizer"].Add(self.ButtonDic[button_name]) |
168 self.SizerDic["SlaveState_up_sizer"].Add(self.ButtonDic[button_name]) |
169 for statictext_name, statictext_label, textctrl_name in sub_item: |
169 for statictext_name, statictext_label, textctrl_name in sub_item: |
170 self.StaticTextDic[statictext_name] = wx.StaticText(self, label=_(statictext_label)) |
170 self.StaticTextDic[statictext_name] = wx.StaticText(self, label=_(statictext_label)) |
171 self.TextCtrlDic[textctrl_name] = wx.TextCtrl(self, size=wx.DefaultSize, style=wx.TE_READONLY) |
171 self.TextCtrlDic[textctrl_name] = wx.TextCtrl(self, size=wx.DefaultSize, style=wx.TE_READONLY) |
172 self.SizerDic["SlaveState_up_sizer"].AddMany([self.StaticTextDic[statictext_name], |
172 self.SizerDic["SlaveState_up_sizer"].AddMany([self.StaticTextDic[statictext_name], |
173 self.TextCtrlDic[textctrl_name]]) |
173 self.TextCtrlDic[textctrl_name]]) |
174 |
174 |
175 for button_name, button_label, button_tooltipstring, event_method in [ |
175 for button_name, button_label, button_tooltipstring, event_method in [ |
176 ("StartTimerButton", "Start State Monitoring", "Slave State Update Restart", self.StartTimer), |
176 ("StartTimerButton", "Start State Monitoring", "Slave State Update Restart", self.StartTimer), |
177 ("StopTimerButton", "Stop State Monitoring", "Slave State Update Stop", self.CurrentStateThreadStop)]: |
177 ("StopTimerButton", "Stop State Monitoring", "Slave State Update Stop", self.CurrentStateThreadStop)]: |
178 self.ButtonDic[button_name] = wx.Button(self, label=_(button_label)) |
178 self.ButtonDic[button_name] = wx.Button(self, label=_(button_label)) |
550 else: |
550 else: |
551 self.SDOs = data |
551 self.SDOs = data |
552 |
552 |
553 self.CreateGrid(len(self.SDOs), 8) |
553 self.CreateGrid(len(self.SDOs), 8) |
554 SDOCellSize = [(0, 65), (1, 65), (2, 50), (3, 55), |
554 SDOCellSize = [(0, 65), (1, 65), (2, 50), (3, 55), |
555 (4, 40), (5, 200), (6, 250), (7, 85)] |
555 (4, 40), (5, 200), (6, 250), (7, 85)] |
556 |
556 |
557 for (index, size) in SDOCellSize: |
557 for (index, size) in SDOCellSize: |
558 self.SetColSize(index, size) |
558 self.SetColSize(index, size) |
559 |
559 |
560 self.SetRowLabelSize(0) |
560 self.SetRowLabelSize(0) |
1191 """ |
1191 """ |
1192 |
1192 |
1193 wx.Panel.__init__(self, parent, -1, size=(350, 500)) |
1193 wx.Panel.__init__(self, parent, -1, size=(350, 500)) |
1194 |
1194 |
1195 self.Tree = wx.gizmos.TreeListCtrl(self, -1, size=(350, 500), |
1195 self.Tree = wx.gizmos.TreeListCtrl(self, -1, size=(350, 500), |
1196 style=wx.TR_DEFAULT_STYLE |
1196 style=(wx.TR_DEFAULT_STYLE |
1197 | wx.TR_FULL_ROW_HIGHLIGHT |
1197 | wx.TR_FULL_ROW_HIGHLIGHT |
1198 | wx.TR_HIDE_ROOT |
1198 | wx.TR_HIDE_ROOT |
1199 | wx.TR_COLUMN_LINES |
1199 | wx.TR_COLUMN_LINES |
1200 | wx.TR_ROW_LINES) |
1200 | wx.TR_ROW_LINES)) |
1201 |
1201 |
1202 self.Tree.AddColumn("Description", width=200) |
1202 self.Tree.AddColumn("Description", width=200) |
1203 self.Tree.AddColumn("Value", width=140) |
1203 self.Tree.AddColumn("Value", width=140) |
1204 self.Tree.SetMainColumn(0) |
1204 self.Tree.SetMainColumn(0) |
1205 |
1205 |
1670 reg_enum_dictionary[reg_sub_value] = reg_sub_value_description |
1670 reg_enum_dictionary[reg_sub_value] = reg_sub_value_description |
1671 |
1671 |
1672 # add a description to register sub table description dictionary |
1672 # add a description to register sub table description dictionary |
1673 if reg_bit_range is not "" and reg_sub_description is not "": |
1673 if reg_bit_range is not "" and reg_sub_description is not "": |
1674 self.RegisterSubGridDict[reg_index].append([reg_bit_range, |
1674 self.RegisterSubGridDict[reg_index].append([reg_bit_range, |
1675 reg_sub_description, reg_enum_dictionary]) |
1675 reg_sub_description, |
|
1676 reg_enum_dictionary]) |
1676 |
1677 |
1677 def ParseData(self): |
1678 def ParseData(self): |
1678 """ |
1679 """ |
1679 Transform the data into dec, hex, string, and description |
1680 Transform the data into dec, hex, string, and description |
1680 """ |
1681 """ |
1776 self.PageRange[index][0] += page_row[iter] |
1777 self.PageRange[index][0] += page_row[iter] |
1777 self.PageRange[index][1] += page_row[iter] |
1778 self.PageRange[index][1] += page_row[iter] |
1778 |
1779 |
1779 # Update table |
1780 # Update table |
1780 for index in range(4): |
1781 for index in range(4): |
1781 self.RegisterNotebook.RegPage[index].UpdateMainTable(self.MainRow[index], self.MainCol, |
1782 self.RegisterNotebook.RegPage[index].UpdateMainTable( |
1782 self.PageRange[index][0], self.PageRange[index][1], |
1783 self.MainRow[index], |
1783 reg_compact_data) |
1784 self.MainCol, |
|
1785 self.PageRange[index][0], |
|
1786 self.PageRange[index][1], |
|
1787 reg_compact_data) |
1784 |
1788 |
1785 # Compact View Checkbox is False |
1789 # Compact View Checkbox is False |
1786 else: |
1790 else: |
1787 self.CompactFlag = False |
1791 self.CompactFlag = False |
1788 # Setting original rows, cols and range |
1792 # Setting original rows, cols and range |
1792 for index in range(4): |
1796 for index in range(4): |
1793 self.PageRange.append([512*index, 512*(index+1)]) |
1797 self.PageRange.append([512*index, 512*(index+1)]) |
1794 |
1798 |
1795 # Update table |
1799 # Update table |
1796 for index in range(4): |
1800 for index in range(4): |
1797 self.RegisterNotebook.RegPage[index].UpdateMainTable(self.MainRow[index], self.MainCol, |
1801 self.RegisterNotebook.RegPage[index].UpdateMainTable( |
1798 self.PageRange[index][0], self.PageRange[index][1], |
1802 self.MainRow[index], |
1799 self.RegMonitorData) |
1803 self.MainCol, |
|
1804 self.PageRange[index][0], |
|
1805 self.PageRange[index][1], |
|
1806 self.RegMonitorData) |
1800 |
1807 |
1801 |
1808 |
1802 # ------------------------------------------------------------------------------- |
1809 # ------------------------------------------------------------------------------- |
1803 # For Register Access Notebook (divide index range) |
1810 # For Register Access Notebook (divide index range) |
1804 # ------------------------------------------------------------------------------- |
1811 # ------------------------------------------------------------------------------- |
2085 @param parent: RegisterNotebook object |
2092 @param parent: RegisterNotebook object |
2086 @param data: data |
2093 @param data: data |
2087 """ |
2094 """ |
2088 # lset label name and size |
2095 # lset label name and size |
2089 Register_SubTable_Label = [(0, "Bits"), (1, "Name"), |
2096 Register_SubTable_Label = [(0, "Bits"), (1, "Name"), |
2090 (2, "Value"), (3, "Enum")] |
2097 (2, "Value"), (3, "Enum")] |
2091 |
2098 |
2092 for (index, label) in Register_SubTable_Label: |
2099 for (index, label) in Register_SubTable_Label: |
2093 self.SetColLabelValue(index, label) |
2100 self.SetColLabelValue(index, label) |
2094 |
2101 |
2095 self.SetColSize(1, 200) |
2102 self.SetColSize(1, 200) |