Skip to content

Commit

Permalink
Merged hotfix/hot2 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddavo committed Sep 6, 2016
2 parents 5066f84 + 1a7dfe6 commit 6c11db3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 27 deletions.
Binary file modified Example.inv
Binary file not shown.
4 changes: 3 additions & 1 deletion Interface2.glade
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ http://ddavo.me</property>
<property name="label" translatable="yes">Ping!</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
</object>
<packing>
Expand Down Expand Up @@ -1277,7 +1279,7 @@ http://ddavo.me</property>
</object>
<object class="GtkApplicationWindow" id="window_switch-table">
<property name="can_focus">False</property>
<property name="window_position">center</property>
<property name="window_position">center-on-parent</property>
<property name="skip_taskbar_hint">True</property>
<property name="urgency_hint">True</property>
<child>
Expand Down
35 changes: 10 additions & 25 deletions Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ def packet_received(self, pck, port=None):
if int(macd,2) in dic and ttl > 0:
pck.animate(self, dic[int(macd,2)])

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

self.update()

def load(self):
ObjetoBase.load(self)
self.pingwin = PingWin(self)
self.builder.get_object("grid_rclick-sendpkg").connect("activate", self.pingwin.show)

class ip():
def __init__(self, *args, ipstr="None"):
self.str = ipstr
Expand Down Expand Up @@ -1406,26 +1411,6 @@ def update(self):
submenu1 = self.builder.get_object("grid_rclick-sendpkg").get_submenu()
print("Compcon: ", [x.name for x in self.compcon()])

'''
for child in submenu1.get_children():
if child.link.__class__.__name__ == "Switch" or child.link.__class__.__name__ == "Hub":
child.hide()
for con in self.compcon():
if con.uuid not in [x.link.uuid for x in submenu1.get_children()]:
print("Not yet")
MeIt = Gtk.MenuItem.new_with_label(con.name)
MeIt.link = con
MeIt.connect("activate", self.send_pck)
submenu1.append(MeIt)
MeIt.show()
con.update()
else:
print("\033[91m",con, "ya está en submenu1\033[0m")
pass
print("self.connections", self.connections)
'''

if self.IP != None:
objlst.update(self,"IP", str(self.IP))

Expand Down Expand Up @@ -1639,9 +1624,8 @@ def send(self, de):
to = de.connections[1]
self.animate(de, to)

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

self.entry.connect("changed", self.filter_ip)
self.win.connect("delete-event", self.destroy)

def filter_ip(self, entry):
if entry.get_text().strip("") == "":
Expand Down Expand Up @@ -2144,8 +2129,8 @@ def do_ping(self, widget):

def show(self, widget):
self.win.show()
def destroy(self):
self.win.hide()
def destroy(self, window, event):
window.hide()
return True

class about(Gtk.AboutDialog):
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ Si instalas la versión más reciente de Ubuntu 16, no es necesaria la descarga
- [x] Hacer que las MAC sean una clase
- [x] Tabla de enrutamiento para los Switch
- [x] Renovar lo de la izquierda con labels
- [ ] Enviar ping a una dirección IP
- [x] Enviar ping a una dirección IP
- [ ] Añadir botón de Reset para las tablas de los Switches
- [ ] Diálogo de barra de progreso al abrir un archivo.
- [ ] Aplicar la gestión de puertos del Switch al Hub
- [ ] Poder "seleccionar"
- [ ] Máscaras de red para las ip.
- [ ] ARP
Expand Down

0 comments on commit 6c11db3

Please sign in to comment.