equal
deleted
inserted
replaced
49 element |
49 element |
50 """ |
50 """ |
51 |
51 |
52 class FBDVariableDialog(BlockPreviewDialog): |
52 class FBDVariableDialog(BlockPreviewDialog): |
53 |
53 |
54 def __init__(self, parent, controller, tagname): |
54 def __init__(self, parent, controller, tagname, exclude_input=False): |
55 """ |
55 """ |
56 Constructor |
56 Constructor |
57 @param parent: Parent wx.Window of dialog for modal |
57 @param parent: Parent wx.Window of dialog for modal |
58 @param controller: Reference to project controller |
58 @param controller: Reference to project controller |
59 @param tagname: Tagname of project POU edited |
59 @param tagname: Tagname of project POU edited |
|
60 @param exclude_input: Exclude input from variable class selection |
60 """ |
61 """ |
61 BlockPreviewDialog.__init__(self, parent, controller, tagname, |
62 BlockPreviewDialog.__init__(self, parent, controller, tagname, |
62 size=wx.Size(400, 380), title=_('Variable Properties')) |
63 size=wx.Size(400, 380), title=_('Variable Properties')) |
63 |
64 |
64 # Init common sizers |
65 # Init common sizers |
110 # Add buttons sizer to sizers |
111 # Add buttons sizer to sizers |
111 self.MainSizer.AddSizer(self.ButtonSizer, border=20, |
112 self.MainSizer.AddSizer(self.ButtonSizer, border=20, |
112 flag=wx.ALIGN_RIGHT|wx.BOTTOM|wx.LEFT|wx.RIGHT) |
113 flag=wx.ALIGN_RIGHT|wx.BOTTOM|wx.LEFT|wx.RIGHT) |
113 |
114 |
114 # Set options that can be selected in class combo box |
115 # Set options that can be selected in class combo box |
115 for choice in VARIABLE_CLASSES_DICT.itervalues(): |
116 for var_class, choice in VARIABLE_CLASSES_DICT.iteritems(): |
116 self.Class.Append(choice) |
117 if not exclude_input or var_class != INPUT: |
117 self.Class.SetStringSelection(VARIABLE_CLASSES_DICT[INPUT]) |
118 self.Class.Append(choice) |
|
119 self.Class.SetSelection(0) |
118 |
120 |
119 # Extract list of variables defined in POU |
121 # Extract list of variables defined in POU |
120 self.RefreshVariableList() |
122 self.RefreshVariableList() |
121 |
123 |
122 # Refresh values in name list box |
124 # Refresh values in name list box |