Advertisement
jsbsan

DisplayAzul

Oct 21st, 2013
1,752
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GAMBAS 1.32 KB | None | 0 0
  1. ' Gambas class file
  2.  
  3. Inherits Display
  4.  
  5. Private temperatura As Single
  6. Private humedad As Single
  7. Private presion As Single
  8. Private EstadoTiempo As String
  9. Private misDatosMeteorologicos As Subject
  10. Private obs As ObservardorDisplay
  11.  
  12. Private formDisplay As FormDisplayAzul
  13.  
  14. Public Sub _new(DatosMet As Subject)
  15.  
  16.   obs = New ObservardorDisplay(Me)
  17.   misDatosMeteorologicos = DatosMet
  18.   DatosMet.RegistrarObservador(obs) 'me añado como observador!!!
  19.  
  20.   'formulario...
  21.   formDisplay = New FormDisplayAzul
  22.  
  23. End
  24.  
  25. Public Sub update(tem As Single, hume As Single, pres As Single, Estado As String)
  26.  
  27.   temperatura = tem
  28.   humedad = hume
  29.   presion = pres
  30.   EstadoTiempo = Estado
  31.  
  32.   muestraDisplay()
  33.  
  34. End
  35.  
  36. Public Sub muestraDisplay()
  37.  
  38.   If formDisplay = Null Then formDisplay = New FormDisplayAzul
  39.  
  40.   formDisplay.valorhumedad = humedad
  41.   formDisplay.valorpresion = presion
  42.   formDisplay.valortemperatura = temperatura
  43.   formDisplay.iconoEstadoTiempo = EstadoTiempo
  44.   formDisplay.actualizarValores() 'llama a la funcion de actualizacion antes de mostrar!!!
  45.   formDisplay.Show()
  46.  
  47. End
  48.  
  49. Public Sub borradoObservador()
  50.   'borrado de objetos para evitar referencias circulares al cerrar el programa...
  51.  
  52.   misDatosMeteorologicos.BorrarObservador(obs)
  53.   obs = Null
  54.   Try formDisplay.Close()
  55.  
  56. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement