Пример #1
0
 def __init__(self):
     self.root = tk.Tk()
     self.root.configure(bg = 'white')
     self.width, self.height = 1500, 1200
     self.root.geometry(str(self.width) + 'x' + str(self.height) + '+0+0')
     self.root.title('Weather App')
     tk.Label(self.root, text = 'Enter name of city:').place(x = 0, y = 0)
     self.city_input = tk.Entry(self.root, width = 20, font = 'Calibri 20')
     self.city_input.place(x = 0, y = 60)
     
     button = tk.Button(self.root, text = 'Get city data',
                        command = lambda: self.show_info())
     button.place(x = 0, y = 150)
     
     self.map = self.create_map()
     self.pin = Pin(self.root, self.map, self)
     self.add_bindings()
     self.create_panels()
Пример #2
0
c4 = Component((7, 11), (45, 10))
c5 = Component((14, 7), (35, 27))
c6 = Component((7, 10), (7, 18))
c7 = Component((18, 8), (47, 40))

cs = []
cs.append(c3)
cs.append(c4)
cs.append(c5)
cs.append(c6)
cs.append(c7)

start_pins = []
terminal_pins = []

ground_pin = Pin('GND', 'GND', 'GND', (0, 0))

net_1 = Net('N$1')
net_2 = Net('N$2')
net_3 = Net('N$3')
net_4 = Net('N$4')
net_5 = Net('N$5')
net_6 = Net('N$6')
net_7 = Net('N$7')
net_8 = Net('N$8')
net_9 = Net('N$9')

net_1.addPin(Pin('S1', 'N$1', 'X', (14, 20)))
net_1.addPin(Pin('T1', 'N$1', 'X', (34, 29)))
net_1.addPin(Pin('R1', 'N$1', 'X', (24, 40)))
Пример #3
0
import time

cs = []
first = Component((12, 18), (10, 16))
second = Component((12, 18), (33, 16))
third = Component((12, 18), (56, 16))
cs.append(first)
cs.append(second)
cs.append(third)
nets = []

net_1 = Net('N$1')
net_2 = Net('N$2')
net_3 = Net('N$3')

net_1.addPin(Pin('A1', 'N$1', 'X', (15, 15)))
net_1.addPin(Pin('B1', 'N$1', 'X', (37, 15)))
net_1.addPin(Pin('C1', 'N$1', 'X', (62, 34)))

net_2.addPin(Pin('A2', 'N$2', 'Y', (15, 34)))
net_2.addPin(Pin('B2', 'N$2', 'Y', (37, 34)))
net_2.addPin(Pin('C2', 'N$2', 'Y', (62, 15)))

net_3.addPin(Pin('A3', 'N$3', 'Z', (5, 20)))
net_3.addPin(Pin('B3', 'N$3', 'Z', (50, 42)))

nets.append(net_1)
nets.append(net_2)
nets.append(net_3)
map1 = Map(80, 50, cs, nets)
Пример #4
0
from Map import Net
import Router
import time
import MapPrinter

c1 = Component((7, 2), (0, 0))
c2 = Component((3, 2), (1, 3))
c3 = Component((3, 2), (5, 3))

cs = []
cs.append(c1)
cs.append(c2)
cs.append(c3)

net_1 = Net('N$1')
net_2 = Net('N$2')

net_1.addPin(Pin('A1', 'N$1', 'X', (3, 2)))
net_1.addPin(Pin('A2', 'N$1', 'X', (7, 0)))

net_2.addPin(Pin('B1', 'N$2', 'X', (7, 2)))
net_2.addPin(Pin('B2', 'N$2', 'X', (7, 5)))

nets = []
nets.append((net_1))
nets.append((net_2))

map1 = Map(9, 7, cs, nets)

MapPrinter.printMap(map1.space)
Router.route(map1, "router_output.txt")
Пример #5
0
from Map import Component
from Map import Map
from Map import Pin
from Map import Net
import Router
import time
import MapPrinter
import SearchAlgorithms as SA

c1 = Component((10, 3), (12, 8))

cs = []
cs.append(c1)

net_1 = Net('N$1')

net_1.addPin(Pin('A1', 'N$1', 'X', (3, 3)))
net_1.addPin(Pin('T', 'N$1', 'X', (17, 17)))

nets = []
nets.append((net_1))

sample = Pin('A1', 'N$1', 'X', (20, 20))
sample2 = Pin('A1', 'N$1', 'X', (9, 9))
map2 = Map(100, 100, [], [])
end = (40, 40)
d = SA.A_Star(sample, map2.space, end)
Пример #6
0
cs = []
first = Component((12, 18), (10, 16))
second = Component((12, 18), (33, 16))
third = Component((12, 18), (56, 16))
cs.append(first)
cs.append(second)
cs.append(third)
nets = []

net_1 = Net('N$1')
net_2 = Net('N$2')
net_3 = Net('N$3')
net_4 = Net('N$4')

net_1.addPin(Pin('A1', 'N$1', 'X', (15, 15)))
net_1.addPin(Pin('B1', 'N$1', 'X', (37, 15)))
net_1.addPin(Pin('C1', 'N$1', 'X', (62, 34)))

net_2.addPin(Pin('A2', 'N$2', 'Y', (15, 34)))
net_2.addPin(Pin('B2', 'N$2', 'Y', (37, 34)))
net_2.addPin(Pin('C2', 'N$2', 'Y', (62, 15)))
net_2.addPin(Pin('D2', 'N$2', 'Y', (37, 42)))
net_2.addPin(Pin('E2', 'N$2', 'Y', (4, 4)))

net_3.addPin(Pin('A3', 'N$3', 'Z', (5, 20)))
net_3.addPin(Pin('B3', 'N$3', 'Z', (50, 42)))

net_4.addPin(Pin('A4', 'N$4', 'ZZ', (29, 46)))
net_4.addPin(Pin('B4', 'N$4', 'ZZ', (21, 46)))