Exemple #1
0
 def createPanels(self):
     self.title = 'New difference fact'
     self.entity1 = DomEntPanel(self, 'First entity:', 1, pos=(0,0), axis='a')
     self.entity2 = DomEntPanel(self, 'Second entity:', 2, pos=(0,1), axis='a')
     self.domain = DomainPanel(self, 'Domain:', 3, pos=(0,2))
     self.number = NumberPanel(self, 'Difference:', 4, pos=(0,3))
     self.buttons = ButtonPanel(self, 5, pos=(1,0), span=(1,4))
Exemple #2
0
 def createPanels(self):
     self.title = 'New comparison fact'
     self.entity1 = DomEntPanel(self, 'First entity:', 1, pos=(0,0), axis='a')
     self.entity2 = DomEntPanel(self, 'Second entity:', 2, pos=(0,1), axis='a')
     self.domain = DomainPanel(self, 'Domain:', 3, pos=(0,2))
     self.operator = OperatorPanel(self, 'Operator:', 4, pos=(0,3))
     self.buttons = ButtonPanel(self, 5, pos=(1,0), span=(1,4))
Exemple #3
0
class UnequalFactGUI(GenericFactGUI):
    def createPanels(self):
        self.title = 'New unequality fact'
        self.entity1 = DomEntPanel(self, 'Vertical entity:', 1, pos=(0,0), axis='v')
        self.entity2 = DomEntPanel(self, 'Horizontal entity:', 2, pos=(0,1), axis='h')
        self.buttons = ButtonPanel(self, 3, pos=(1,0), span=(1,2))

    def show(self):
        if self.dialog.ShowModal() == wx.ID_OK:
            d1, e1 = self.entity1.result
            d2, e2 = self.entity2.result
            return Unequal(self.factgui.solver.table, d1, e1, d2, e2)
        else:
            return None

    def validate(self):
        condition = self.entity1.ready and self.entity2.ready and self.differenceOK()
        self.buttons.enableOK(condition)
Exemple #4
0
class DifferenceFactGUI(GenericFactGUI):
    def createPanels(self):
        self.title = 'New difference fact'
        self.entity1 = DomEntPanel(self, 'First entity:', 1, pos=(0,0), axis='a')
        self.entity2 = DomEntPanel(self, 'Second entity:', 2, pos=(0,1), axis='a')
        self.domain = DomainPanel(self, 'Domain:', 3, pos=(0,2))
        self.number = NumberPanel(self, 'Difference:', 4, pos=(0,3))
        self.buttons = ButtonPanel(self, 5, pos=(1,0), span=(1,4))

    def show(self):
        if self.dialog.ShowModal() == wx.ID_OK:
            d1, e1 = self.entity1.result
            d2, e2 = self.entity2.result
            domain = self.domain.result
            number = self.number.result
            return Difference(self.factgui.solver.table, d1, e1, d2, e2, domain, number)
        else:
            return None

    def validate(self):
        condition = self.entity1.ready and self.entity2.ready \
                    and self.domain.ready and self.number.ready
        self.buttons.enableOK(condition)
Exemple #5
0
 def createPanels(self):
     self.title = 'New unequality fact'
     self.entity1 = DomEntPanel(self, 'Vertical entity:', 1, pos=(0,0), axis='v')
     self.entity2 = DomEntPanel(self, 'Horizontal entity:', 2, pos=(0,1), axis='h')
     self.buttons = ButtonPanel(self, 3, pos=(1,0), span=(1,2))