wether station gui client
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gui.py 8.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. #!/usr/bin/env python
  2. # -*- coding: UTF-8 -*-
  3. #
  4. # generated by wxGlade 0.9.3 on Mon Sep 7 11:55:26 2020
  5. #
  6. import wx
  7. # begin wxGlade: dependencies
  8. # end wxGlade
  9. # begin wxGlade: extracode
  10. # end wxGlade
  11. class Wetation(wx.Frame):
  12. def __init__(self, *args, **kwds):
  13. # begin wxGlade: Wetation.__init__
  14. kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
  15. wx.Frame.__init__(self, *args, **kwds)
  16. self.SetSize((800, 628))
  17. self.date = wx.StaticText(self, wx.ID_ANY, "xx.xx.xxxx", style=wx.ALIGN_LEFT)
  18. self.time = wx.StaticText(self, wx.ID_ANY, "xx:xx", style=wx.ALIGN_RIGHT)
  19. self.heading_out_envdata = wx.StaticText(self, wx.ID_ANY, u"Außentemperatur")
  20. self.out_humidity = wx.StaticText(self, wx.ID_ANY, "- %", style=wx.ALIGN_RIGHT)
  21. self.out_pressure = wx.StaticText(self, wx.ID_ANY, "- mbar", style=wx.ALIGN_RIGHT)
  22. self.out_temperature_min = wx.StaticText(self, wx.ID_ANY, u"-.- °C", style=wx.ALIGN_RIGHT)
  23. self.out_temperature_max = wx.StaticText(self, wx.ID_ANY, u"-.- °C", style=wx.ALIGN_RIGHT)
  24. self.out_temperature = wx.StaticText(self, wx.ID_ANY, u"-.- °C", style=wx.ALIGN_RIGHT)
  25. self.heading_in_envdata = wx.StaticText(self, wx.ID_ANY, "Innentemperatur")
  26. self.in_humidity = wx.StaticText(self, wx.ID_ANY, "- %", style=wx.ALIGN_RIGHT)
  27. self.in_pressure = wx.StaticText(self, wx.ID_ANY, "- mbar", style=wx.ALIGN_RIGHT)
  28. self.in_temperature_min = wx.StaticText(self, wx.ID_ANY, u"-.- °C", style=wx.ALIGN_RIGHT)
  29. self.in_temperature_max = wx.StaticText(self, wx.ID_ANY, u"-.- °C", style=wx.ALIGN_RIGHT)
  30. self.in_temperature = wx.StaticText(self, wx.ID_ANY, u"-.- °C", style=wx.ALIGN_RIGHT)
  31. self.heading_garage = wx.StaticText(self, wx.ID_ANY, "Garage")
  32. self.gate_oc = wx.Button(self, wx.ID_ANY, "Garage")
  33. self.gate_close = wx.StaticText(self, wx.ID_ANY, "Close")
  34. self.gate_position = wx.Slider(self, wx.ID_ANY, 50, 0, 100)
  35. self.gate_open = wx.StaticText(self, wx.ID_ANY, "Open")
  36. self.__set_properties()
  37. self.__do_layout()
  38. self.Bind(wx.EVT_BUTTON, self.gate_oc_evt, self.gate_oc)
  39. # end wxGlade
  40. def __set_properties(self):
  41. # begin wxGlade: Wetation.__set_properties
  42. self.SetTitle("frame")
  43. self.SetBackgroundColour(wx.Colour(250, 249, 255))
  44. self.SetForegroundColour(wx.Colour(35, 35, 142))
  45. self.date.SetBackgroundColour(wx.Colour(35, 35, 142))
  46. self.date.SetForegroundColour(wx.Colour(255, 255, 255))
  47. self.date.SetFont(wx.Font(24, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  48. self.time.SetBackgroundColour(wx.Colour(35, 35, 142))
  49. self.time.SetForegroundColour(wx.Colour(255, 255, 255))
  50. self.time.SetFont(wx.Font(24, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  51. self.heading_out_envdata.SetBackgroundColour(wx.Colour(35, 35, 142))
  52. self.heading_out_envdata.SetForegroundColour(wx.Colour(250, 249, 255))
  53. self.heading_out_envdata.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  54. self.out_humidity.SetFont(wx.Font(24, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  55. self.out_pressure.SetFont(wx.Font(24, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  56. self.out_temperature_min.SetFont(wx.Font(24, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  57. self.out_temperature_max.SetFont(wx.Font(24, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  58. self.out_temperature.SetFont(wx.Font(48, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  59. self.heading_in_envdata.SetBackgroundColour(wx.Colour(35, 35, 142))
  60. self.heading_in_envdata.SetForegroundColour(wx.Colour(250, 249, 255))
  61. self.heading_in_envdata.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  62. self.in_humidity.SetFont(wx.Font(24, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  63. self.in_pressure.SetFont(wx.Font(24, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  64. self.in_temperature_min.SetFont(wx.Font(24, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  65. self.in_temperature_max.SetFont(wx.Font(24, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  66. self.in_temperature.SetFont(wx.Font(48, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  67. self.heading_garage.SetBackgroundColour(wx.Colour(35, 35, 142))
  68. self.heading_garage.SetForegroundColour(wx.Colour(250, 249, 255))
  69. self.heading_garage.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  70. self.heading_garage.Hide()
  71. self.gate_oc.Hide()
  72. self.gate_close.Hide()
  73. self.gate_position.Enable(False)
  74. self.gate_position.Hide()
  75. self.gate_open.Hide()
  76. # end wxGlade
  77. def __do_layout(self):
  78. # begin wxGlade: Wetation.__do_layout
  79. sizer_main = wx.BoxSizer(wx.VERTICAL)
  80. sizer_8 = wx.BoxSizer(wx.HORIZONTAL)
  81. sizer_env_data_in = wx.BoxSizer(wx.HORIZONTAL)
  82. sizer_9 = wx.BoxSizer(wx.VERTICAL)
  83. sizer_5 = wx.BoxSizer(wx.VERTICAL)
  84. sizer_env_data_out = wx.BoxSizer(wx.HORIZONTAL)
  85. sizer_7 = wx.BoxSizer(wx.VERTICAL)
  86. sizer_4 = wx.BoxSizer(wx.VERTICAL)
  87. sizer_date_time = wx.BoxSizer(wx.HORIZONTAL)
  88. spacer_1 = wx.StaticText(self, wx.ID_ANY, "")
  89. spacer_1.SetBackgroundColour(wx.Colour(35, 35, 142))
  90. spacer_1.SetFont(wx.Font(5, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  91. sizer_main.Add(spacer_1, 0, wx.EXPAND, 0)
  92. sizer_date_time.Add(self.date, 1, wx.EXPAND | wx.LEFT, 0)
  93. sizer_date_time.Add(self.time, 1, wx.EXPAND | wx.RIGHT, 0)
  94. sizer_main.Add(sizer_date_time, 0, wx.EXPAND, 0)
  95. spacer_2 = wx.StaticText(self, wx.ID_ANY, "")
  96. spacer_2.SetBackgroundColour(wx.Colour(35, 35, 142))
  97. spacer_2.SetFont(wx.Font(5, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  98. sizer_main.Add(spacer_2, 0, wx.EXPAND, 0)
  99. sizer_main.Add((20, 20), 0, 0, 0)
  100. sizer_main.Add(self.heading_out_envdata, 0, wx.EXPAND, 0)
  101. sizer_4.Add(self.out_humidity, 1, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, 0)
  102. sizer_4.Add(self.out_pressure, 1, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, 0)
  103. sizer_env_data_out.Add(sizer_4, 1, wx.EXPAND, 0)
  104. sizer_7.Add(self.out_temperature_min, 1, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, 0)
  105. sizer_7.Add(self.out_temperature_max, 1, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, 0)
  106. sizer_env_data_out.Add(sizer_7, 1, wx.EXPAND, 0)
  107. sizer_env_data_out.Add((50, 20), 0, 0, 0)
  108. sizer_env_data_out.Add(self.out_temperature, 2, wx.ALIGN_RIGHT | wx.RIGHT, 0)
  109. sizer_main.Add(sizer_env_data_out, 0, wx.EXPAND, 0)
  110. sizer_main.Add((20, 20), 0, 0, 0)
  111. sizer_main.Add(self.heading_in_envdata, 0, wx.EXPAND, 0)
  112. sizer_5.Add(self.in_humidity, 1, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, 0)
  113. sizer_5.Add(self.in_pressure, 1, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, 0)
  114. sizer_env_data_in.Add(sizer_5, 1, wx.EXPAND, 0)
  115. sizer_9.Add(self.in_temperature_min, 1, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, 0)
  116. sizer_9.Add(self.in_temperature_max, 1, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, 0)
  117. sizer_env_data_in.Add(sizer_9, 1, wx.EXPAND, 0)
  118. sizer_env_data_in.Add((50, 20), 0, 0, 0)
  119. sizer_env_data_in.Add(self.in_temperature, 2, wx.ALIGN_RIGHT | wx.RIGHT, 0)
  120. sizer_main.Add(sizer_env_data_in, 0, wx.EXPAND, 0)
  121. sizer_main.Add((10, 10), 1, 0, 0)
  122. sizer_main.Add(self.heading_garage, 0, wx.EXPAND, 0)
  123. sizer_8.Add(self.gate_oc, 0, 0, 0)
  124. sizer_8.Add(self.gate_close, 0, wx.ALIGN_CENTER, 0)
  125. sizer_8.Add(self.gate_position, 1, wx.EXPAND, 0)
  126. sizer_8.Add(self.gate_open, 0, wx.ALIGN_CENTER, 0)
  127. sizer_main.Add(sizer_8, 0, wx.EXPAND, 0)
  128. self.SetSizer(sizer_main)
  129. self.Layout()
  130. # end wxGlade
  131. def gate_oc_evt(self, event): # wxGlade: Wetation.<event_handler>
  132. print("Event handler 'gate_oc_evt' not implemented!")
  133. event.Skip()
  134. # end of class Wetation
  135. class MyApp(wx.App):
  136. def OnInit(self):
  137. self.wetation = Wetation(None, wx.ID_ANY, "")
  138. self.SetTopWindow(self.wetation)
  139. self.wetation.Show()
  140. return True
  141. # end of class MyApp
  142. if __name__ == "__main__":
  143. app = MyApp(0)
  144. app.MainLoop()