Ejemplo n.º 1
0
    def __init__(self, data):

        root = self.root = tk.Tk()
        root.resizable(0,0)
        root.title(str("Edit Block: ") + str(data['name']))
        self.data = data 
        self.root = root

        if data['type'] != 'corner':
            tk.Label(root, text="Name:").grid(row=0, column=0, pady=10)
            self.inputName = tk.Entry(root)
            self.inputName.insert(tk.END, self.data['name'])
            self.inputName.grid(row=0,column=1,columnspan=2,sticky="EW", pady=10, padx=(0,10))

        if data['type'] == 'input' or data['type'] == 'function':
            self.editInput(root)
        elif data['type'] == 'sum':
            self.editSum(root)
        elif data['type'] == "system":
            if data['code']['type'] == "TF":
                self.editSystemTF(root)
            else:
                self.editSystemSS(root)
        
        if data['type'] != 'corner':
            tk.Button(root, width=11, text="Save", command=self.save_button).grid(row=4, column=0, pady=(5,10), padx=(10,0))
        tk.Button(root, width=11, text="Cancel", command=self.cancel_button).grid(row=4, column=1, pady=(5,10), padx=(10,10))
        tk.Button(root, width=11, text="Remove Block", command=self.remove_button).grid(row=4, column=2, pady=(5,10), padx=(0,10))
        
        dialogTools.center(root)
Ejemplo n.º 2
0
    def __init__(self):

        root = self.root = tk.Tk()
        root.resizable(0, 0)
        root.title("Run Simulation")

        tk.Label(root, text="Sampling Time:").grid(row=0,
                                                   column=0,
                                                   pady=10,
                                                   padx=10,
                                                   sticky="E")
        self.T = tk.Entry(root, width=5)
        self.T.insert(tk.END, "0.01")
        self.T.grid(row=0, column=1, sticky="EW", padx=(0, 10))
        tk.Label(root, text="Simulation Time:").grid(row=1,
                                                     column=0,
                                                     pady=(0, 10),
                                                     padx=10,
                                                     sticky="E")
        self.tf = tk.Entry(root, width=5)
        self.tf.insert(tk.END, "30")
        self.tf.grid(row=1, column=1, sticky="EW", padx=(0, 10))

        tk.Button(root, width=11, text="Run",
                  command=self.execute_button).grid(row=2,
                                                    column=0,
                                                    pady=(0, 10),
                                                    padx=10)
        tk.Button(root, width=11, text="Cancel",
                  command=self.cancel_button).grid(row=2,
                                                   column=1,
                                                   pady=(0, 10),
                                                   padx=(0, 10))

        dialogTools.center(root)
Ejemplo n.º 3
0
    def __init__(self, title, array):

        root = self.root = Tk()
        root.title(str(title))

        for i in range(len(array)):
            message = Label(root, text=array[i])
            message.grid(row=i, column=0, padx=10, pady=(5, 5))

        dialogTools.center(root)
Ejemplo n.º 4
0
    def __init__(self):

        root = self.root = tk.Tk()
        root.resizable(0,0)
        root.title(str("Create Corner"))
        self.root = root

        self.dropdownButton1()
        self.dropdownButton2()        

        tk.Button(root, width=11, text="Create", command=self.save_button).grid(row=2, column=0, pady=10, padx=(10,5))
        tk.Button(root, width=11, text="Cancel", command=self.cancel_button).grid(row=2, column=1, pady=10, padx=(5,10))
        
        dialogTools.center(root)
Ejemplo n.º 5
0
    def __init__(self, code):

        root = self.root = tk.Tk()
        root.resizable(0, 0)
        root.title("Import Code and Packages")

        self.inputCode = ScrolledText(root, height=5, width=50)
        self.inputCode.insert(tk.END, code)
        self.inputCode.grid(row=0, column=0, columnspan=2)
        tk.Button(root, width=11, text="Save",
                  command=self.save_button).grid(row=1, column=0)
        tk.Button(root, width=11, text="Cancel",
                  command=self.cancel_button).grid(row=1, column=1)

        dialogTools.center(root)
Ejemplo n.º 6
0
    def __init__(self, data):

        root = self.root = tk.Tk()
        root.resizable(0, 0)
        root.title(str("Edit Block: ") + str(data['name']))
        self.root = root
        self.data = data
        tk.Label(root, text="legend:").grid(row=1, column=1)
        tk.Label(root, text="color:").grid(row=1, column=2)
        count = 0
        self.code = []
        for block in data['blocks']:
            if block.type in ['system', 'function', 'input', 'sum']:
                count += 1
                self.code.append({
                    'name': block.name,
                    'type': block.type,
                    **self.listLine(count, block.name, block.name)
                })

        tk.Button(root, width=11, text="Save",
                  command=self.save_button).grid(row=0,
                                                 column=0,
                                                 pady=(10, 10))
        tk.Button(root, width=11, text="Cancel",
                  command=self.cancel_button).grid(row=0,
                                                   column=1,
                                                   pady=(10, 10))
        tk.Button(root,
                  width=11,
                  text="Remove Block",
                  command=self.remove_button).grid(row=0,
                                                   column=2,
                                                   pady=(10, 10))

        dialogTools.center(root)
Ejemplo n.º 7
0
    def __init__(self,b1, b2,b3):

        root = self.root = tk.Tk()
        root.title('Add new Block')
        
        # button frame
        frm_2 = tk.Frame(root)
        frm_2.pack(padx=10, pady=10)

        # buttons
        btn_1 = tk.Button(frm_2, width=10, text=b1)
        btn_1['command'] = lambda: self.button_action(b1)
        btn_1.pack(side='left')
        btn_1.focus_set()
        
        btn_2 = tk.Button(frm_2, width=10, text=b2)
        btn_2['command'] = lambda: self.button_action(b2)
        btn_2.pack(side='left')

        btn_3 = tk.Button(frm_2, width=10, text=b3)
        btn_3['command'] = lambda: self.button_action(b3)
        btn_3.pack(side='left')

        dialogTools.center(root)