Commit d33dc402 authored by Julio Tambara's avatar Julio Tambara
Browse files

Backup, antes de modificar a forma de plot (draw para plot).

Tentando diminuir o tempo de plot/draw.
parent f8f604c0
......@@ -4,11 +4,14 @@
import os
import sys
import numpy as np
import time
import Tkinter as tk
import tkMessageBox
import tkFileDialog
import matplotlib.pyplot as plt
import matplotlib.pyplot
from matplotlib import pyplot, lines
import time
import pexpect
import subprocess
......@@ -23,7 +26,7 @@ import Image, ImageTk
timer1=None
##############################################################################
......@@ -330,10 +333,12 @@ def testeerro(Data): # mensagens de erros
def graphic2(): #trata as informações que foram salvas em graphic1
print time.time()-timer1
for G in Grafico:
G.temp.set_xdata(range(int(M[Grafico.index(G)].Controle['Nmr_canais']))) #Atualiza o range do plot
G.temp.set_ydata(M[Grafico.index(G)].Data)
print time.time()-timer1
for G in Grafico:
if G.limupdtx or G.limupdty: #se a flag do updat x/y estiver true...
# if Control['Logaritmo']:
......@@ -343,21 +348,25 @@ def graphic2(): #trata as informações que foram salvas em graphic1
# else:
G.a.relim() #vai dar update automático no tamanho do gráfico
G.a.autoscale_view(scaley=G.limupdty,scalex=G.limupdtx)
for G in Grafico:
if G.limupdtx == True:
grid(G.a, int(M[Grafico.index(G)].Controle['Nmr_canais']))
Control['text_cursor']='Cursor '
print 'Antes do Draw'
print time.time()-timer1
for G in Grafico:
Control['text_cursor']= Control['text_cursor'] + G.title + ':(' +str(G.Cursor['x']) + ','+str(M[Grafico.index(G)].Data[G.Cursor['x']])+ ') '
G.f.canvas.draw() #DRAW!
Interface['labels'][1+3*len(Grafico)].configure(text= Control['text_cursor'])
print time.time()-timer1
def graphic(): # Le os dados provenientes dos módulos
def graphic(): # Le os dados provenientes dos módulos
global timer1
timer1= time.time()
for Mod in M:
testeerro(Mod.Read_Data())
......@@ -370,7 +379,7 @@ def graphic(): # Le os dados provenientes dos módulos
aux=aux+3 #CUIDADO para implementar + de 2 módulos Interface['labels'] deve ser re-organizado
graphic2()
print time.time()-timer1
def realtimeplot(): # Funcao recursiva para plot em tempo real
......@@ -595,12 +604,14 @@ def lldt(): #Definir o lower level detection trueshot
def Open_About():
AboutWin= tk.Toplevel()
#http://stackoverflow.com/questions/20251161/tkinter-tclerror-image-pyimage3-doesnt-exist - LINK SALVADOR AboutWin.minsize(600,600)
#http://stackoverflow.com/questions/20251161/tkinter-tclerror-image-pyimage3-doesnt-exist - LINK SALVADOR
AboutWin.resizable(width=False, height=False)
AboutWin.configure(bg='white')
AboutWin.title('About')
tk.Label(AboutWin, text="Authors: Julio Cesar Ferreira Tambara ",bg='white' ).pack(side='top',fill='x')
tk.Label(AboutWin, text=" Mateus Vicente Wrasse Wiebusch Müller ",bg='white').pack(side='top',fill='x')
tk.Label(AboutWin, text="Rudder: Rafael Pereti Pezzi ",bg='white').pack(side='top',fill='x')
tk.Label(AboutWin, text="Advisor: Rafael Pereti Pezzi ",bg='white').pack(side='top',fill='x')
imagens = tk.Frame(AboutWin,takefocus=0,bg='white')
Imagem_load =os.path.dirname(os.path.realpath(__file__))+ "/Imagens"
......@@ -809,11 +820,12 @@ def key_5(event):# 'motion_notify_event'
def key_6(event): #'button_release_event'
G=G_cursor
if event.inaxes != G.a.axes:
if event.button == 3:
FocusControl['aux_click']='g1'
rig_but_menu.tk_popup(event.x, root.winfo_height() - int(event.y)-20)
rig_but_menu.tk_popup(event.x, root.winfo_height() - int(event.y)-20,0)
if event.button is not 2:
(G.x0 , G.x1) = G.a.get_xlim()
(G.y0 , G.y1) = G.a.get_ylim()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment