Example #1
0
 def goCreateInvoice(self):
     self.user = self.chooseUser.currentText()
     self.company = self.chooseCompany.currentText()
     self.desc = self.jobDesc.toPlainText()
     self.PO = self.PONum.toPlainText() if self.PONeeded else None
     self.stDate = self.startDate.date().toPyDate()
     self.endDate = self.endDate.date().toPyDate()
     self.session = Automate.Automate(self.user, self.company)
     self.session.createDoc(self.desc, self.stDate, self.endDate, self.PO)
     infoWin = InfoWindow(self)
     infoWin.exec()
Example #2
0
def build_automate(s):
    stack = []
    if len(s) == 0:
        raise BadRegexp.BadRegexp("empty regexp")

    for item in s:
        # simple items
        if item == '1':
            stack.append(Automate.Automate("#"))
        elif item in ['a', 'b', 'c']:
            stack.append(Automate.Automate(item))

        # operations
        elif item == '.':
            if len(stack) < 2:
                raise BadRegexp.BadRegexp("concatenation error")
            b = stack.pop()
            a = stack.pop()
            stack.append(a.merge(b))

        elif item == '+':
            if len(stack) < 2:
                raise BadRegexp.BadRegexp("addition error")
            b = stack.pop()
            a = stack.pop()
            stack.append(a.add(b))

        elif item == '*':
            if len(stack) < 1:
                raise BadRegexp.BadRegexp("star error")
            a = stack.pop()
            stack.append(a.star())
        else:
            raise BadRegexp.BadRegexp("invalid symbol")

    if len(stack) != 1:
        raise BadRegexp.BadRegexp("few operations")

    return stack[0]
Example #3
0
from Automate import *

if __name__ == '__main__':
    input = ""
    while input != "O":
        automate = Automate()
        try:
            print(automate)
            print("==determinisation et completion==")
            automate.determinisation_et_completion_synchrone()
            print(automate)
            print("==minimisation==")
            automate.minimisation()
            print(automate)
            print("==complémentarisation==")
            automate.automate_complementaire()
        except:
            print(f"Erreur sur le fichier {automate.filename}")
        input = askstring_or_tk("Voulez vous arrĂȘtez ? (O)ui (*)Non")
Example #4
0
pathLogFile = "logs/{}.log".format(sys.argv[1].split("/")[-1][:-6])
outputFile = "output/{}.txt".format(sys.argv[1].split("/")[-1][:-6])

### INPUT ###
filepath_input = sys.argv[2]
words = readFile(filepath_input)

## INIT FILE ##
with open(pathLogFile, "w") as logFile:
    logFile.write("")
with open(outputFile, "w") as out:
    out.write("")

### AUTOMATON ###
filepath_automate = sys.argv[1]
auto = Automate(filepath_automate)
auto.toDot("graphInitial.dot")

## DETERMINISE ##
auto = auto.determinise()
auto.toDot("graphDeter.dot")

### TREATMENT ###
for word in words:
    output, result = analyse(auto, word)
    textOut = ""
    for c in output:
        textOut += c

    with open(pathLogFile, "a+") as logFile:
        if result:
Example #5
0
#!/usr/bin/python3
# -*- coding:Utf-8 -*-
from tkinter import *
from threading import Thread
import time
from AnalyseGcode import *
from Automate import *
from ButtonFlipFlop import *
from CmdsIntermed import *
from DataParam import *
from DisplayList import *
from EntryRegx import *
from PanelBroche import *
from PanelButtonsCmd import *
from PanelButtonsXYZ import *
from PanelDisplayCmdsMotors import *
from PanelDisplayGcode import *
from PanelDisplayPiece import *
from PanelDisplayXYZ import *
from PanelMoteurs import *
from PanelSettingsMan import *
from PanelTrace import *
from ScrolledText import *
from ThreadMoteurs import *
from WinParam import *
print("Fin des imports")
ag = AnalSyntaxGcode()
am = Automate(None, None)
bff = ButtonFlipFlop()