Example #1
0
        def onClick_start():
            global globalFlag
            controller.show_frame(inProgress)
            t = threading.Thread(target=gifStart)
            t.start()
            opt = getV()
            print(opt)
            print(txtBox.get())
            COM = txtBox2.get()
            try:
                value = int(txtBox.get())
                if value > 0:
                    t1 = threading.Thread(target=startPos,
                                          args=(opt, value, COM))
                    t1.start()

                else:
                    avg.logWrite(
                        "  [ERROR]: Unaccepted value - Negative values\n")
                    #droneAnimation(False)
                    globalFlag = False
                    controller.show_frame(Stopped)
            except Exception:
                avg.logWrite(
                    "  [ERROR]: Unaccepted value - string or float has passed\n"
                )
                globalFlag = False
                controller.show_frame(Stopped)
Example #2
0
        def onClick_start ():
            global toStart
            global globalFlag
            opt=getV()
            print(opt)
            print(txtBox.get())
            COM=txtBox2.get()
            try:
                value = int(txtBox.get())
                if value>0:
                    controller.show_frame(inProgress)
##                    t1=threading.Thread(target=startPos,args=(opt,value,COM))
##                    t1.start()
                    startPos(opt,value,COM)
                    
                    
                else:
                    avg.logWrite("  [ERROR]: Unaccepted value - Negative values\n")
                    #droneAnimation(False)
                    globalFlag=False
                    controller.show_frame(Stopped)
            except Exception:
                avg.logWrite("  [ERROR]: Unaccepted value - string or float has passed\n")
                globalFlag=False
                controller.show_frame(Stopped)
Example #3
0
def startPos(opt,value,COM):
    global globalFlag
    globalFlag=True
    pross=avg.start_pos(opt,value,COM)
##    pross=True
    if pross==None:
        app.show_frame(Stopped)
    else:
        app.show_frame(Done)
    globalFlag=False
Example #4
0
 def onClick_start ():
     global toStart
     global globalFlag
     opt=getV()
     ##print(opt)
     ##print(txtBox.get())
     COM=txtBox2.get()
     try:
         value = int(txtBox.get())
         if value>0:
             controller.show_frame(inProgress)
             startPos(opt,value,COM)
         else:
             avg.logWrite("  [ERROR]: Unaccepted value - Negative values\n")
             #droneAnimation(False)
             globalFlag=False
             controller.show_frame(Stopped)
             ShowDialog("Error",'Unaccepted value - Negative values')
     except Exception:
         avg.logWrite("  [ERROR]: Unaccepted value - string or float has passed\n")
         globalFlag=False
         controller.show_frame(Stopped)
         ShowDialog("Error",'Unaccepted value - Enter numbers only,\nPlease follow instructions above!')
Example #5
0
def startPos(opt, value, COM):
    global globalFlag
    pross = avg.start_pos(opt, value, COM)
    if pross == None:
        globalFlag = False
Example #6
0
def quit():
    avg.logWrite("  [DEBUG]: User press quit btn\n")
    app.quit()
Example #7
0
#!/usr/bin/python3
import tkinter as tk
from tkinter import ttk
from tkinter import *
from PIL import Image, ImageTk
import time
#from AnimatedGif import *
import AvgPosGen as avg
from _thread import start_new_thread
from multiprocessing import Process
import threading
avg.logOpen()
globalFlag = True


def quit():
    avg.logWrite("  [DEBUG]: User press quit btn\n")
    app.quit()


def gifStart():
    global globalFlag
    imagelist = []
    for i in range(1, 76):
        imagelist.append('Images/drone (' + str(i) + ').gif')
        # extract width and height info
    photo = ImageTk.PhotoImage(file=imagelist[0])
    width = photo.width()
    height = photo.height()
    canvas = tk.Canvas(width=width, height=height, highlightthickness=0)
    canvas.place(x=200, y=160)
Example #8
0
import tkinter as tk
from tkinter import ttk
from tkinter import *
from PIL import Image, ImageTk
import time
#from AnimatedGif import *
import AvgPosGen as avg
from _thread import start_new_thread
from multiprocessing import Process
import threading
from tkinter import messagebox as mb
avg.logOpen()
globalFlag = False
toStart = False

def quitapp():
    quit()

def ShowDialog(title, text):
    t=threading.Thread(target=mb.showerror, args=(title, text))
    t.start()

def gifStart():
    global globalFlag
    imagelist=[]
    for i in range (1,76):
        imagelist.append('Images/drone ('+str(i)+').gif')
            # extract width and height info
    photo = ImageTk.PhotoImage(file=imagelist[0])
    width = photo.width()
    height = photo.height()