Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Gambas class file
- Inherits Display
- Private temperatura As Single
- Private humedad As Single
- Private presion As Single
- Private EstadoTiempo As String
- Private misDatosMeteorologicos As Subject
- Private obs As ObservardorDisplay
- Private formDisplay As FormDisplayAzul
- Public Sub _new(DatosMet As Subject)
- obs = New ObservardorDisplay(Me)
- misDatosMeteorologicos = DatosMet
- DatosMet.RegistrarObservador(obs) 'me añado como observador!!!
- 'formulario...
- formDisplay = New FormDisplayAzul
- End
- Public Sub update(tem As Single, hume As Single, pres As Single, Estado As String)
- temperatura = tem
- humedad = hume
- presion = pres
- EstadoTiempo = Estado
- muestraDisplay()
- End
- Public Sub muestraDisplay()
- If formDisplay = Null Then formDisplay = New FormDisplayAzul
- formDisplay.valorhumedad = humedad
- formDisplay.valorpresion = presion
- formDisplay.valortemperatura = temperatura
- formDisplay.iconoEstadoTiempo = EstadoTiempo
- formDisplay.actualizarValores() 'llama a la funcion de actualizacion antes de mostrar!!!
- formDisplay.Show()
- End
- Public Sub borradoObservador()
- 'borrado de objetos para evitar referencias circulares al cerrar el programa...
- misDatosMeteorologicos.BorrarObservador(obs)
- obs = Null
- Try formDisplay.Close()
- End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement