Exemplo n.º 1
0
    def DrawPreview(self):
        """
        Refresh preview panel of graphic element
        Override BlockPreviewDialog function
        """
        # Get type selected in library panel
        values = self.LibraryPanel.GetSelectedBlock()

        # If a block type is selected in library panel
        if values is not None:
            # Set graphic element displayed, creating a FBD block element
            self.Element = FBD_Block(
                self.Preview,
                values["type"], (self.BlockName.GetValue()
                                 if self.BlockName.IsEnabled() else ""),
                extension=self.Inputs.GetValue(),
                inputs=values["inputs"],
                executionControl=self.ExecutionControl.GetValue(),
                executionOrder=self.ExecutionOrder.GetValue())

        # Reset graphic element displayed
        else:
            self.Element = None

        # Call BlockPreviewDialog function
        BlockPreviewDialog.DrawPreview(self)
Exemplo n.º 2
0
    def DrawPreview(self):
        """
        Refresh preview panel of graphic element
        Override BlockPreviewDialog function
        """
        # Set graphic element displayed, creating a SFC divergence
        self.Element = SFC_Divergence(self.Preview, self.GetDivergenceType(),
                                      self.Sequences.GetValue())

        # Call BlockPreviewDialog function
        BlockPreviewDialog.DrawPreview(self)
Exemplo n.º 3
0
    def DrawPreview(self):
        """
        Refresh preview panel of graphic element
        Override BlockPreviewDialog function
        """
        # Set graphic element displayed, creating a FBD connection element
        self.Element = FBD_Connector(self.Preview, self.GetConnectionType(),
                                     self.ConnectionName.GetValue())

        # Call BlockPreviewDialog function
        BlockPreviewDialog.DrawPreview(self)
Exemplo n.º 4
0
    def DrawPreview(self):
        """
        Refresh preview panel of graphic element
        Override BlockPreviewDialog function
        """
        # Set graphic element displayed, creating a SFC transition
        self.Element = SFC_Transition(self.Preview)
        self.Element.SetType(*self.GetTransitionType())
        self.Element.SetPriority(self.Priority.GetValue())

        # Call BlockPreviewDialog function
        BlockPreviewDialog.DrawPreview(self)
Exemplo n.º 5
0
    def DrawPreview(self):
        """
        Refresh preview panel of graphic element
        Override BlockPreviewDialog function
        """

        # Set graphic element displayed, creating a power rail element
        self.Element = LD_PowerRail(self.Preview,
                                    self.GetPowerRailType(),
                                    connectors=self.PinNumber.GetValue())

        return BlockPreviewDialog.DrawPreview(self)
Exemplo n.º 6
0
    def DrawPreview(self):
        """
        Refresh preview panel of graphic element
        Override BlockPreviewDialog function
        """
        value = self.ElementVariable.GetValue()

        # Set graphic element displayed, creating a LD element
        self.Element = self.ElementClass(self.Preview,
                                         self.GetElementModifier(), value)

        button = self.ButtonSizer.GetAffirmativeButton()
        button.Enable(value != "")

        # Call BlockPreviewDialog function
        BlockPreviewDialog.DrawPreview(self)
Exemplo n.º 7
0
    def DrawPreview(self):
        """
        Refresh preview panel of graphic element
        Override BlockPreviewDialog function
        """
        value = self.ElementVariable.GetValue()

        # Set graphic element displayed, creating a LD element
        self.Element = self.ElementClass(self.Preview,
                                         self.GetElementModifier(), value)

        button = wx.FindWindowById(wx.ID_OK, self)
        button.Enable(value != "")

        # Call BlockPreviewDialog function
        BlockPreviewDialog.DrawPreview(self)
Exemplo n.º 8
0
    def DrawPreview(self):
        """
        Refresh preview panel of graphic element
        Override BlockPreviewDialog function
        """
        # Set graphic element displayed, creating a SFC step element
        self.Element = SFC_Step(self.Preview, self.StepName.GetValue(),
                                self.Initial)

        # Update connectors of SFC step element according to check boxes value
        for name, control in self.ConnectorsCheckBox.iteritems():
            if control.IsChecked():
                getattr(self.Element, "Add" + name.capitalize())()
            else:
                getattr(self.Element, "Remove" + name.capitalize())()

        # Call BlockPreviewDialog function
        BlockPreviewDialog.DrawPreview(self)
Exemplo n.º 9
0
    def DrawPreview(self):
        """
        Refresh preview panel of graphic element
        Override BlockPreviewDialog function
        """
        # Get expression value to put in FBD variable element
        name = self.Expression.GetValue()

        # Set graphic element displayed, creating a FBD variable element
        self.Element = FBD_Variable(
            self.Preview,
            self.VARIABLE_CLASSES_DICT_REVERSE[
                self.Class.GetStringSelection()],
            name,
            self.VariableList.get(name, ("", ""))[1],
            executionOrder=self.ExecutionOrder.GetValue())

        # Call BlockPreviewDialog function
        BlockPreviewDialog.DrawPreview(self)