Exemple #1
0
	def __init__(self, parent, title):
		super().__init__(parent, title= title)
		self.Center()
		self.controlador = Controlador()

		panel1= wx.Panel(self)
		self.l_autor= wx.StaticText(panel1, -1, 'Autor:')
		self.in_autor= wx.TextCtrl(panel1, -1)
		self.in_autor.SetFocus()
		self.l_titulo = wx.StaticText(panel1, -1, 'Título:')
		self.in_titulo= wx.TextCtrl(panel1)
		self.l_horas= wx.StaticText(panel1, -1, 'Horas')
		self.in_horas= wx.SpinCtrl(panel1)
		self.in_horas.SetRange(0,24)
		self.l_minutos= wx.StaticText(panel1, -1, 'Minutos')
		self.in_minutos= wx.SpinCtrl(panel1)
		self.in_minutos.SetRange(0,59)
		self.l_segundos= wx.StaticText(panel1, -1, 'Segundos')
		self.in_segundos= wx.SpinCtrl(panel1)
		self.in_segundos.SetRange(0,59)
		self.l_marcos= wx.StaticText(panel1, -1, 'Marcos')
		self.in_marcos= wx.SpinCtrl(panel1)
		self.in_marcos.SetRange(0,74)
		self.bt_reproducir= wx.Button(panel1, -1, '&Reproducir')
		#self.Bind(wx.EVT_BUTTON, Programa.reproducir_pausar, self.bt_reproducir)
		self.bt_aceptar= wx.Button(panel1, wx.ID_OK, '&Aceptar')
		self.bt_cancelar= wx.Button(panel1, wx.ID_CANCEL, '&Cancelar')

		self.getTiempo()
Exemple #2
0
def main():
    objenc = ObjectEncoder("datos.json")
    vista = Vista()
    ctrl = Controlador(vista, objenc)
    vista.setControlador(ctrl)
    ctrl.iniciar()
    ctrl.guardar()
def init(top, gui, *args, **kwargs):
    global w, top_level, root, controlador
    w = gui
    top_level = top
    root = top

    controlador = Controlador(gui=w)
    controlador.configurar_gui()
Exemple #4
0
 def __init__(self, sys_argv, port):
     """Constructor de la clase, crea todo lo necesario
     para empezar el proyecto
     """
     super(Chat, self).__init__(sys_argv)
     self.cliente = Cliente('0.0.0.0', port)
     self.controlador = Controlador(self.cliente)
     self.igchat = GUIChat(self.controlador, self.cliente)
     self.cliente.seConecto()
     t1 = threading.Thread(target=self.cliente.enviado)
     t1.setDaemon(True)
     t1.start()
     time.sleep(0.001)
     self.igchat.show()
    def __init__(self):
        """
            Inicia los componentes
        """
        root = Tk()
        frame = Frame(root, height=500)
        frame.pack(fill=BOTH, expand=1)
        b_lateral = Frame(frame, width=150, height=500, bg="#dedede")
        b_lateral.pack(side=LEFT, fill=BOTH)
        canvas = Canvas(frame, bg="#000000", width=600, height=500)
        canvas.pack(side=LEFT, fill=BOTH, expand=1)
        controlador = Controlador(root, canvas, None)
        controlador.crear_barra(b_lateral)

        menu = Menu(root, tearoff=0)

        #se asocia  el evento doble click
        canvas.bind("<Double-Button-1>", controlador.doble_click_izquierdo)

        canvas.bind("<Button-3>",
                    lambda event: controlador.create_pop_menu(event, menu))

        #se inicia la interfaz c <
        root.mainloop()
Exemple #6
0
from factura import Factura
from controlador import Controlador
from datetime import datetime

controlador = Controlador()

while True:

    print("**********MENU**********")
    print("Actualmente hay ", controlador.numFacturas(), " registradas")
    print("1.- Añadir Factura")
    print("2.- Listar Facturas Pendientes de Pago")
    print("3.- Listar Facturas Pagadas")
    print("4.- Pagar Factura")
    print("5.- Salir")

    while True:
        try:
            op = int(input("Introduce una opción: "))
            if op <= 5 and op >= 1:
                break
            else:
                print("Introduce un número del 1 al 5!")
        except ValueError:
            print("Introduce un valor numérico!")

    if op == 5:
        print("Adiós, vuelve pronto!")
        break

    if op == 1:
Exemple #7
0
def Simulador(virus):
    # Initialize glfw
    if not glfw.init():
        sys.exit()

    width = 700
    height = 700

    window = glfw.create_window(width, height, 'Simulador de contagios', None, None)

    if not window:
        glfw.terminate()
        sys.exit()

    glfw.make_context_current(window)
    controlador = Controlador()

    # Connecting the callback function 'on_key' to handle keyboard events
    glfw.set_key_callback(window, controlador.on_key)

    # Assembling the shader program (pipeline) with both shaders
    pipeline = es.SimpleTransformShaderProgram()
    pipeline_texturas = es.SimpleTextureTransformShaderProgram()

    # Setting up the clear screen color
    glClearColor(245 / 255, 222 / 255, 179 / 255, 1.0)

    # Our shapes here are always fully painted
    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)

    # magia para que no se vea negro el png
    glEnable(GL_BLEND)
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)

    poblacion_modelo = Poblacion(virus)
    individuos = crearPersonas(poblacion_modelo)

    personitas = crearObjetosDibujo(individuos)
    controlador.setModelo(poblacion_modelo)
    controlador.setDibujos(personitas)

    print(personitas[1][1].getPosicion())

    t0 = 0

    while not glfw.window_should_close(window):  # Dibujando --> 1. obtener el input
        # Using GLFW to check for input events
        glfw.poll_events()  # OBTIENE EL INPUT --> CONTROLADOR --> MODELOS

        # Clearing the screen in both, color and depth
        glClear(GL_COLOR_BUFFER_BIT)

        # Reconocer la logica

        # DIBUJAR LOS MODELOS

        glUseProgram(pipeline.shaderProgram)
        for dibujo in personitas:
            if dibujo[1].isVivo():
                dibujo[0].draw(pipeline, dibujo[1].isContagiado())

        # Calculamos el dt
        ti = glfw.get_time()
        margen = 1
        dt = ti - t0
        if dt > margen:
            t0 = glfw.get_time()

        # Once the render is done, buffers are swapped, showing only the complete scene.
        glfw.swap_buffers(window)

    glfw.terminate()
Exemple #8
0
from libro import Libro
from controlador import Controlador

con = Controlador()

while True:
    print("---------- COLECCION DE LIBROS ------------")
    print("El numero de libros registrados es ",con.getNumLibros())
    print("1.- Anyadir libros")
    print("2.- Eliminar libros")
    print("3.- Listar libros")
    print("4.- Libro con menor valoracion")
    print("5.- Libro con mayor valoracion")
    print("6.- Salir")

    op = int(input("Selecciona una opcion: "))

    if op == 1:
        while True:
            try:
                isbn = int(input("Introduce el ISBN: "))
                if isbn == 0:
                    print("----------------------")
                    print("El ISBN no puede ser 0")
                    print("----------------------")
                else:
                    break
            except ValueError:
                print("--------------------")
                print("El ISBN no es valido")
                print("--------------------")