Skip to content

Commit 6c11db3

Browse files
committed
Merged hotfix/hot2 into master
2 parents 5066f84 + 1a7dfe6 commit 6c11db3

File tree

4 files changed

+17
-27
lines changed

4 files changed

+17
-27
lines changed

Example.inv

18.6 KB
Binary file not shown.

Interface2.glade

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ http://ddavo.me</property>
151151
<property name="label" translatable="yes">Ping!</property>
152152
<property name="visible">True</property>
153153
<property name="can_focus">True</property>
154+
<property name="can_default">True</property>
155+
<property name="has_default">True</property>
154156
<property name="receives_default">True</property>
155157
</object>
156158
<packing>
@@ -1277,7 +1279,7 @@ http://ddavo.me</property>
12771279
</object>
12781280
<object class="GtkApplicationWindow" id="window_switch-table">
12791281
<property name="can_focus">False</property>
1280-
<property name="window_position">center</property>
1282+
<property name="window_position">center-on-parent</property>
12811283
<property name="skip_taskbar_hint">True</property>
12821284
<property name="urgency_hint">True</property>
12831285
<child>

Main.py

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ def packet_received(self, pck, port=None):
12721272
if int(macd,2) in dic and ttl > 0:
12731273
pck.animate(self, dic[int(macd,2)])
12741274

1275-
elif int(macd,2) in [x[0] for x in self.table]:
1275+
elif int(macd,2) in [x[0] for x in self.table] and ttl >= 0:
12761276
for x in self.table:
12771277
if x[0] == int(macd,2):
12781278
pck.animate(self, self.pdic[x[1]])
@@ -1346,6 +1346,11 @@ def __init__(self, x, y, *args, name="Default", maxconnections=1, ip=None):
13461346

13471347
self.update()
13481348

1349+
def load(self):
1350+
ObjetoBase.load(self)
1351+
self.pingwin = PingWin(self)
1352+
self.builder.get_object("grid_rclick-sendpkg").connect("activate", self.pingwin.show)
1353+
13491354
class ip():
13501355
def __init__(self, *args, ipstr="None"):
13511356
self.str = ipstr
@@ -1406,26 +1411,6 @@ def update(self):
14061411
submenu1 = self.builder.get_object("grid_rclick-sendpkg").get_submenu()
14071412
print("Compcon: ", [x.name for x in self.compcon()])
14081413

1409-
'''
1410-
for child in submenu1.get_children():
1411-
if child.link.__class__.__name__ == "Switch" or child.link.__class__.__name__ == "Hub":
1412-
child.hide()
1413-
for con in self.compcon():
1414-
if con.uuid not in [x.link.uuid for x in submenu1.get_children()]:
1415-
print("Not yet")
1416-
MeIt = Gtk.MenuItem.new_with_label(con.name)
1417-
MeIt.link = con
1418-
MeIt.connect("activate", self.send_pck)
1419-
submenu1.append(MeIt)
1420-
MeIt.show()
1421-
con.update()
1422-
else:
1423-
print("\033[91m",con, "ya está en submenu1\033[0m")
1424-
pass
1425-
1426-
print("self.connections", self.connections)
1427-
'''
1428-
14291414
if self.IP != None:
14301415
objlst.update(self,"IP", str(self.IP))
14311416

@@ -1639,9 +1624,8 @@ def send(self, de):
16391624
to = de.connections[1]
16401625
self.animate(de, to)
16411626

1642-
#Composición de movimientos lineales en eje x e y
16431627
#Siendo t=fps/s, v=px/s, v default = 84
1644-
def animate(self, start, end, fps=120, v=200, color=None, port=None):
1628+
def animate(self, start, end, fps=30, v=200, color=None, port=None):
16451629
if color == None:
16461630
if self.color != None:
16471631
color = self.color
@@ -2092,6 +2076,7 @@ def __init__(self, obj):
20922076
self.ping.connect("clicked", self.do_ping)
20932077

20942078
self.entry.connect("changed", self.filter_ip)
2079+
self.win.connect("delete-event", self.destroy)
20952080

20962081
def filter_ip(self, entry):
20972082
if entry.get_text().strip("") == "":
@@ -2144,8 +2129,8 @@ def do_ping(self, widget):
21442129

21452130
def show(self, widget):
21462131
self.win.show()
2147-
def destroy(self):
2148-
self.win.hide()
2132+
def destroy(self, window, event):
2133+
window.hide()
21492134
return True
21502135

21512136
class about(Gtk.AboutDialog):

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ Si instalas la versión más reciente de Ubuntu 16, no es necesaria la descarga
5656
- [x] Hacer que las MAC sean una clase
5757
- [x] Tabla de enrutamiento para los Switch
5858
- [x] Renovar lo de la izquierda con labels
59-
- [ ] Enviar ping a una dirección IP
59+
- [x] Enviar ping a una dirección IP
60+
- [ ] Añadir botón de Reset para las tablas de los Switches
61+
- [ ] Diálogo de barra de progreso al abrir un archivo.
62+
- [ ] Aplicar la gestión de puertos del Switch al Hub
6063
- [ ] Poder "seleccionar"
6164
- [ ] Máscaras de red para las ip.
6265
- [ ] ARP

0 commit comments

Comments
 (0)