RELEASE 3.4.0

This commit is contained in:
MikeTheWatchGuy 2018-09-18 12:05:44 -04:00
parent 9db96fd10f
commit 92bafa24f0
18 changed files with 101 additions and 77 deletions

View file

@ -6,6 +6,7 @@ import PySimpleGUI as sg
STEP_SIZE=1
SAMPLES = 6000
CANVAS_SIZE = (6000,500)
# globale used to communicate with thread.. yea yea... it's working fine
g_exit = False
@ -17,20 +18,23 @@ def ping_thread(args):
def main():
global g_exit, g_response_time
# start ping measurement thread
thread = Thread(target=ping_thread, args=(None,))
thread.start()
# sg.ChangeLookAndFeel('Black')
sg.ChangeLookAndFeel('Black')
sg.SetOptions(element_padding=(0,0))
layout = [ [sg.T('Ping times to Google.com', font='Any 18')],
[sg.Graph((6000,200), (0,0), (SAMPLES,500),background_color='black', key='graph')],
[sg.Quit()]]
layout = [ [sg.T('Ping times to Google.com', font='Any 12'), sg.Quit(pad=((100,0), 0), button_color=('white', 'black'))],
[sg.Graph(CANVAS_SIZE, (0,0), (SAMPLES,500),background_color='black', key='graph')],]
form = sg.FlexForm('Canvas test', grab_anywhere=True, background_color='black')
form = sg.FlexForm('Canvas test', grab_anywhere=True, background_color='black', no_titlebar=False, use_default_focus=False)
form.Layout(layout)
form.Finalize()
graph = form.FindElement('graph')
prev_response_time = None
i=0
prev_x, prev_y = 0, 0
@ -40,7 +44,6 @@ def main():
button, values = form.ReadNonBlocking()
if button == 'Quit' or values is None:
break
graph = form.FindElement('graph')
if g_response_time is None or prev_response_time == g_response_time:
continue
new_x, new_y = i, g_response_time[0]