Commit a0bb7f95 authored by Matheus Müller's avatar Matheus Müller

Adicao de camadas e elementos para cada camada

parent fae5b316
No preview for this file type
......@@ -5,7 +5,7 @@
2.55583126551 0.135204081633
4.20347394541 0.614540816327
6.04962779156 0.454081632653
7.06203473946 0.326530612245
8.23325062035 0.262755102041
9.20595533499 0.108214285714
9.841191067 0.0463775510204
10.0 0
......@@ -602,108 +602,108 @@
0.454081632653
0.454081632653
0.454081632653
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.326530612245
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
0.262755102041
......@@ -918,70 +918,70 @@
0.108214285714
0.108214285714
0.108214285714
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0463775510204
0.0
0.0
0.0
......
# -*- coding: iso-8859-15 -*-
import Tkinter as tk
from numpy import arange, math
from PTE import *
Frms = list()
Ldict = list()
Laycount = 0
##############################################################################
##############################################################################
class Layer:
global Ldict
def self_destruct():
return 0
def elem_select(i):
return 0
def addel(self):
i = int(self.Ecount)
self.Elements[i]=dict(name="New",symbol="Hf",mass=178.,Z=72,LineShape=200.,profundidademax=10.)
self.Ebuttons.insert(i, tk.Button(self.Frames[6], text=i, command = lambda i=i : elem_select(i) ))
self.Ebuttons[i].grid(column=0, row=i)
self.Spinboxes.insert(i, tk.Spinbox(self.Frames[7], from_=0, to=1, increment=0.05, bd=5 ))
self.Spinboxes[i].grid(column=0, row=i)
self.Ecount = self.Ecount + 1
def rmvel(self):
return 0
def __init__(self, canvas, count):
self.Number=count
self.Ecount=0
self.Elements=dict()
self.Ebuttons=list()
self.Spinboxes=list()
self.Frames=list()
self.LandE=list()
self.Buttons=list()
self.LabelFrm = tk.LabelFrame(canvas, text = 'Layer %d' %int(Laycount+1), relief='raised', bd=2)
self.LabelFrm.grid(column=(Laycount%4), row=int(math.floor(Laycount/4)) )
for i in range(2):
self.Frames.insert(i, tk.Frame(self.LabelFrm))
for i in arange(2,4):
self.Frames.insert(i, tk.Frame(self.Frames[0]))
for i in arange(4,6):
self.Frames.insert(i, tk.Frame(self.Frames[2]))
for i in arange(6,8):
self.Frames.insert(i, tk.Frame(self.Frames[1]))
self.Frames[0].pack(side='top')
self.Frames[1].pack(side='bottom')
self.Frames[2].pack(side='left')
self.Frames[3].pack(side='right')
self.Frames[4].pack(side='left')
self.Frames[5].pack(side='right')
self.Frames[6].pack(side='left')
self.Frames[7].pack(side='right')
self.LandE.insert(0, tk.Label(self.Frames[4], width=14, pady=2, text='dƐ/dx') )
self.LandE.insert(1, tk.Label(self.Frames[4], width=14, pady=2, text='dω²/dx') )
for i in arange(2,4):
self.LandE.insert(i, tk.Entry(self.Frames[5], width=11) )
for i in range(4):
self.LandE[i].pack()
self.Buttons.insert(0, tk.Button(self.Frames[4], command=lambda i=i :Ldict[self.Number].addel(), text='Add element',width=11))
self.Buttons.insert(1, tk.Button(self.Frames[5], command=lambda i=i :Ldict[self.Number].rmvel(), text='Remove element',width=11))
for i in range(2):
self.Buttons[i].pack()
##############################################################################
##############################################################################
def addlay(Laycanvas):
global Laycount, Ldict
Ldict.insert(Laycount, Layer(Laycanvas, Laycount))
Laycount = Laycount + 1
##############################################################################
def rmvlay():
global Laycount, Ldict
if Laycount > 0:
Ldict[Laycount].self_destruct()
Laycount = Laycount - 1
##############################################################################
##############################################################################
def layers():
global Laycount, Ldict
Laycount = 0
laywin = tk.Tk()
laywin.title('Layers')
laywin.minsize(400,400)
laywin.geometry('400x400+200+400')
for i in range(2):
Frms.insert(i, tk.Frame(laywin))
Frms[0].pack(side='top')
Frms[1].pack(side='bottom')
Laycanvas = tk.Canvas(Frms[1])
Laycanvas.pack(fill='both',expand=0)
##############################################################################
def addlay():
return 0
def rmvlay():
return 0
##############################################################################
butadd = tk.Button(Frms[0], command=addlay, text='Add layer', bd=1, height=1,width=10, pady='4')
butadd = tk.Button(Frms[0], command=lambda i=i :addlay(Laycanvas), text='Add layer', bd=1, height=1,width=10, pady='4')
butadd.pack(side='left')
butrmv = tk.Button(Frms[0], command=rmvlay, text='Remove layer', bd=1, height=1,width=10, pady='4')
butrmv = tk.Button(Frms[0], command=lambda i=i :rmvlay, text='Remove layer', bd=1, height=1,width=10, pady='4')
butrmv.pack(side='left')
##############################################################################
laywin.mainloop()
##############################################################################
##############################################################################
This diff is collapsed.
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