dialogs/FBDVariableDialog.py
changeset 1259 8350222a81c3
parent 1250 7e6de17c687a
child 1571 486f94a8032c
equal deleted inserted replaced
1258:441f31474b50 1259:8350222a81c3
    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