Exemplo n.º 1
0
def button11_click():
    hide_tracking_buttons()
    hide_coordinate_buttons()
    hide_navigate_buttons()
    hide_images_buttons()
    output_lab.place_forget()
    labelImg.place_forget()
    label_img_coord1.place_forget()
    label_img_coord2.place_forget()

    # click_event
    frame.place(x=225, y=75, width=600, height=350)
    # frame.bind("<Button-1>", click)

    reload_images()
    labelImg1.config(image=imageAutomatic)
    labelImg1.place(x=50, y=50, width=500, height=250)
    labelImg1.Image = imageNavigate
    labelImg1.bind("<Button-1>", click1)

    global center
    center = distance_calculator.center(500, 250)
    print(center)

    # global text
    # text = "Abstand von {} zum Mittelpunkt: {}".format(point,dist)

    functionsG.set_current_position()
    functionsG.set_old_position(image_na)
    functionsG.latest_position()
Exemplo n.º 2
0
def release():
    global bu2_blocked
    if not bu2_blocked:
        functionsG.set_current_position()
        functionsG.reference_point()
        comment('Referenzpunkt wurde angefahren')
        output_lab.place_forget()
Exemplo n.º 3
0
def button_click():
    hide_focus_windows()
    hide_tracking_buttons()
    hide_coordinate_buttons()
    hide_navigate_buttons()
    hide_images_buttons()
    labelImg.place_forget()
    label_img_coord1.place_forget()
    label_img_coord2.place_forget()

    # buttonModeTest.place_forget()

    # Image appropriate to the latest Position
    frame.place(x=225, y=75, width=600, height=350)
    labelImg1.config(image=imageAutomatic)
    labelImg1.place(x=50, y=50, width=500, height=250)
    labelImg1.Image = imageNavigate

    # output("Motoren fahren an die zuletzt aufgenommene Position")
    # output_lab = output_label_img()

    read_coordinates('alte Position:')
    output_lab.config(text=str(text),
                      bg='#E0ECF8',
                      anchor=NW,
                      font=('times', 20, 'italic'))
    output_lab.place(x=225, y=450, width=600, height=200)

    # functionsG.set_current_position()
    # functionsG.set_old_position(image_na)
    # old_posi = read_save_position.read_old_position(image_na)
    # a_posi = old_posi[0]
    # b_posi = old_posi[1]
    # c_posi = old_posi[2]
    # print(a_posi, b_posi, c_posi)
    if not bu2_blocked:  # False
        # functionsG.motor(a_posi, 1, 'a')
        # functionsG.motor(a_posi, 1, 'b')
        # functionsG.motor(a_posi, 1, 'c')
        # read_save_position.save_position(a_posi, b_posi, c_posi)

        functionsG.set_current_position()
        functionsG.set_old_position(image_na)
        functionsG.latest_position()

    else:
        print("Motoren sind gesperrt")
        output("Motoren sind gesperrt")
        output_lab.config(text=str(text),
                          bg='#E0ECF8',
                          anchor=NW,
                          font=('times', 20, 'italic'))
        output_lab.place(x=225, y=450, width=600, height=200)
        stop()
Exemplo n.º 4
0
    def fetch(entries):
        global bu2_blocked, text
        ind = 0
        for entry in entries:
            field = entry[0]
            text = entry[1].get()
            print('%s: "%s"' % (field, text))
            if ind == 0:
                m_a = int(entry[1].get())
                ind += 1
            elif ind == 1:
                m_b = int(entry[1].get())
                ind += 1
            elif ind == 2:
                m_c = int(entry[1].get())
                ind += 1
            elif ind == 3:
                delay = int(entry[1].get())
                print(delay)
                ind = 0
                # TODO
                # wait wird falsch uebertragen

                if not bu2_blocked:  # False
                    functionsG.set_current_position()
                    # functionsG.set_old_position(image_na)
                    functionsG.coordinate2(m_a, m_b, m_c, delay)

                    # read_coordinates('neue Koordinaten:')
                    read('new angle position:')
                    output_lab.config(text=str(text),
                                      bg='#E0ECF8',
                                      anchor=NW,
                                      font=('times', 20, 'italic'))
                    label_img_coord2.place_forget()

                else:
                    label_img_coord2.place_forget()

                    print("Motoren sind gesperrt")
                    output("Motoren sind gesperrt!")
                    output_lab.config(text=text,
                                      bg='#E0ECF8',
                                      anchor=NW,
                                      font=('times', 20, 'italic'))
                    print(text)
                    output_lab.place(x=225, y=450, width=600, height=200)
                    stop()
Exemplo n.º 5
0
def button3_click():
    global bu2_blocked, text

    hide_focus_windows()
    hide_tracking_buttons()
    hide_coordinate_buttons()
    hide_images_buttons()
    labelImg.place_forget()
    label_img_coord1.place_forget()
    label_img_coord2.place_forget()

    # TODO
    functionsG.set_old_position(image_na)

    read_coordinates('alte Daten:')
    output_lab.config(text=str(text),
                      bg='#E0ECF8',
                      anchor=NW,
                      font=('times', 20, 'italic'))
    output_lab.place(x=225, y=425, width=600, height=200)

    button1.place(x=250, y=140, width=100, height=20)
    button2.place(x=175, y=180, width=100, height=20)
    button3.place(x=325, y=180, width=100, height=20)
    button4.place(x=250, y=220, width=100, height=20)
    button5.place(x=235, y=260, width=40, height=20)
    button6.place(x=325, y=260, width=40, height=20)
    # button7.place(x=585, y=325, width=180, height=20)
    labelImg2.config(image=imageNavigate)
    labelImg2.place(x=500, y=110, width=350, height=190)

    # read_coordinates('')
    # output_lab.config(text=str(text), bg='#E0ECF8', anchor=NW, font=('times', 20, 'italic'))

    if not bu2_blocked:  # False
        functionsG.set_current_position()
        functionsG.latest_position()

    else:
        print("Motoren sind gesperrt")
        output("Motoren sind gesperrt")
        output_lab.config(text=str(text),
                          bg='#E0ECF8',
                          anchor=NW,
                          font=('times', 20, 'italic'))
        output_lab.place(x=225, y=450, width=600, height=200)
        stop()
Exemplo n.º 6
0
def button12_click():
    hide_coordinate_buttons()
    hide_navigate_buttons()
    hide_images_buttons()
    output_lab.place_forget()
    labelImg.place_forget()
    label_img_coord1.place_forget()
    label_img_coord2.place_forget()

    frame.place(x=225, y=75, width=600, height=350)

    # TODO
    # koennte man noch verbessern
    # get_latest_images()
    reload_images()

    labelImg1.config(image=imageAutomatic)
    labelImg1.place(x=50, y=50, width=500, height=250)
    labelImg1.Image = imageNavigate
    labelImg1.bind("<Button-1>", click2)

    buttonColor1.place(x=175, y=460, width=140, height=30)
    buttonColor2.place(x=175, y=520, width=140, height=30)
    buttonColor3.place(x=175, y=580, width=140, height=30)

    text_box_label1.place(x=370, y=460, width=30, height=30)
    text_box_label2.place(x=370, y=520, width=30, height=30)
    text_box_label3.place(x=370, y=580, width=30, height=30)
    text_box1.place(x=400, y=460, width=140, height=30)
    text_box2.place(x=400, y=520, width=140, height=30)
    text_box3.place(x=400, y=580, width=140, height=30)
    text_box_button.place(x=370, y=640, width=170, height=30)

    global bu2_blocked
    if not bu2_blocked:  # False
        functionsG.set_old_position(image_na)
        functionsG.set_current_position()
        functionsG.latest_position()
Exemplo n.º 7
0
def button21_click():
    hide_coordinate_buttons()
    output('Geben Sie die gewünschten Koordinaten ein, '
           'die Werte dürfen zwischen x[0-500] & y[0-250] liegen')
    output_label_coord()

    ind = Image.open("coordinates.jpeg")
    pht = ImageTk.PhotoImage(ind)  # photo
    # img = Label(master=frameGui, image=photo)  # funktioniert nur mit master=frameGui
    # img.place(x=150, y=325, width=750, height=100)
    label_img_coord1.config(image=pht)
    label_img_coord1.place(x=250, y=350, width=550, height=260)

    global bu2_blocked
    if not bu2_blocked:
        functionsG.set_old_position(image_na)
        functionsG.set_current_position()
        functionsG.latest_position()

    def fetch(entries):
        global bu2_blocked, text
        ind = 0
        for entry in entries:
            field = entry[0]
            text = entry[1].get()
            print('%s: "%s"' % (field, text))
            if ind == 0:
                x = int(entry[1].get())
                ind += 1
            elif ind == 1:
                y = int(entry[1].get())
                ind += 1
            elif ind == 2:
                delay = int(entry[1].get())
                ind = 0
                # TODO
                # wait wird falsch uebertragen

                if not bu2_blocked:  # False
                    # old_posi = read_save_position.read_old_position(image_na)
                    # a_posi = old_posi[0]
                    # b_posi = old_posi[1]
                    # c_posi = old_posi[2]
                    # functionsG.set_old_position(image_na)
                    # functionsG.set_current_position()
                    # functionsG.latest_position()
                    functionsG.coordinate1(x, y, delay)

                    # read_coordinates('neue Koordinaten:')
                    read('')

                    output_lab.config(text=str(text),
                                      bg='#E0ECF8',
                                      anchor=NW,
                                      font=('times', 20, 'italic'))
                    # output_lab.place(x=225, y=450, width=600, height=200)
                    label_img_coord1.place_forget()

                else:
                    label_img_coord1.place_forget()

                    print("Motoren sind gesperrt")
                    output("Motoren sind gesperrt!")
                    output_lab.config(text=str(text),
                                      bg='#E0ECF8',
                                      anchor=NW,
                                      font=('times', 20, 'italic'))
                    output_lab.place(x=225, y=450, width=600, height=200)
                    stop()

    def makeform(root, fields):
        entries = []
        for field in fields:
            row = Frame(root)
            lab = Label(row, width=15, text=field, anchor='w')
            ent = Entry(row)
            row.pack(side=TOP, fill=X, padx=5, pady=5)
            lab.pack(side=LEFT)
            ent.pack(side=RIGHT, expand=YES, fill=X)
            entries.append((field, ent))
        return entries

    if __name__ == '__main__':
        root = Tk()
        root.title('Eingabe der Werte')
        ents = makeform(root, fields)
        root.bind('<Return>', (lambda event, e=ents: fetch(e)))
        b1 = Button(root,
                    text='Daten verschicken',
                    command=(lambda e=ents: fetch(e)))
        b1.pack(side=LEFT, padx=5, pady=5)
        b2 = Button(root, text='quit', command=root.destroy)
        b2.pack(side=LEFT, padx=5, pady=5)
        root.mainloop()
Exemplo n.º 8
0
def start_position():
    functionsG.update_position(0, 0, 0)
    functionsG.set_current_position()
    functionsG.start_position()