wether station gui client
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

gui.py 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #!/usr/bin/env python
  2. # -*- coding: UTF-8 -*-
  3. #
  4. # generated by wxGlade 0.9.3 on Wed Sep 9 07:31:16 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, 655))
  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ßen")
  20. self.out_humidity = wx.StaticText(self, wx.ID_ANY, "- %", style=wx.ALIGN_RIGHT)
  21. self.out_pressure = wx.StaticText(self, wx.ID_ANY, "- hPa", 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, "Innen")
  26. self.in_humidity = wx.StaticText(self, wx.ID_ANY, "- %", style=wx.ALIGN_RIGHT)
  27. self.in_pressure = wx.StaticText(self, wx.ID_ANY, "- hPa", 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(16, 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(16, 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(16, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  70. self.gate_oc.SetMinSize((100, 50))
  71. self.gate_position.Enable(False)
  72. # end wxGlade
  73. def __do_layout(self):
  74. # begin wxGlade: Wetation.__do_layout
  75. sizer_main = wx.BoxSizer(wx.VERTICAL)
  76. sizer_8 = wx.BoxSizer(wx.HORIZONTAL)
  77. sizer_env_data_in = wx.BoxSizer(wx.HORIZONTAL)
  78. sizer_9 = wx.BoxSizer(wx.VERTICAL)
  79. sizer_5 = wx.BoxSizer(wx.VERTICAL)
  80. sizer_env_data_out = wx.BoxSizer(wx.HORIZONTAL)
  81. sizer_7 = wx.BoxSizer(wx.VERTICAL)
  82. sizer_4 = wx.BoxSizer(wx.VERTICAL)
  83. sizer_date_time = wx.BoxSizer(wx.HORIZONTAL)
  84. spacer_1 = wx.StaticText(self, wx.ID_ANY, "")
  85. spacer_1.SetBackgroundColour(wx.Colour(35, 35, 142))
  86. spacer_1.SetFont(wx.Font(5, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  87. sizer_main.Add(spacer_1, 0, wx.EXPAND, 0)
  88. sizer_date_time.Add(self.date, 1, wx.EXPAND | wx.LEFT, 0)
  89. sizer_date_time.Add(self.time, 1, wx.EXPAND | wx.RIGHT, 0)
  90. sizer_main.Add(sizer_date_time, 0, wx.EXPAND, 0)
  91. spacer_2 = wx.StaticText(self, wx.ID_ANY, "")
  92. spacer_2.SetBackgroundColour(wx.Colour(35, 35, 142))
  93. spacer_2.SetFont(wx.Font(5, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
  94. sizer_main.Add(spacer_2, 0, wx.EXPAND, 0)
  95. sizer_main.Add((20, 20), 0, 0, 0)
  96. sizer_main.Add(self.heading_out_envdata, 0, wx.EXPAND, 0)
  97. sizer_4.Add(self.out_humidity, 1, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, 0)
  98. sizer_4.Add(self.out_pressure, 1, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, 0)
  99. sizer_env_data_out.Add(sizer_4, 1, wx.EXPAND, 0)
  100. sizer_7.Add(self.out_temperature_min, 1, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, 0)
  101. sizer_7.Add(self.out_temperature_max, 1, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, 0)
  102. sizer_env_data_out.Add(sizer_7, 1, wx.EXPAND, 0)
  103. sizer_env_data_out.Add((50, 20), 0, 0, 0)
  104. sizer_env_data_out.Add(self.out_temperature, 2, wx.ALIGN_RIGHT | wx.RIGHT, 0)
  105. sizer_main.Add(sizer_env_data_out, 0, wx.EXPAND, 0)
  106. sizer_main.Add((20, 20), 0, 0, 0)
  107. sizer_main.Add(self.heading_in_envdata, 0, wx.EXPAND, 0)
  108. sizer_5.Add(self.in_humidity, 1, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, 0)
  109. sizer_5.Add(self.in_pressure, 1, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, 0)
  110. sizer_env_data_in.Add(sizer_5, 1, wx.EXPAND, 0)
  111. sizer_9.Add(self.in_temperature_min, 1, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, 0)
  112. sizer_9.Add(self.in_temperature_max, 1, wx.ALIGN_RIGHT | wx.EXPAND | wx.RIGHT, 0)
  113. sizer_env_data_in.Add(sizer_9, 1, wx.EXPAND, 0)
  114. sizer_env_data_in.Add((50, 20), 0, 0, 0)
  115. sizer_env_data_in.Add(self.in_temperature, 2, wx.ALIGN_RIGHT | wx.RIGHT, 0)
  116. sizer_main.Add(sizer_env_data_in, 0, wx.EXPAND, 0)
  117. sizer_main.Add((10, 10), 1, 0, 0)
  118. sizer_main.Add(self.heading_garage, 0, wx.EXPAND, 0)
  119. sizer_8.Add(self.gate_oc, 0, 0, 0)
  120. sizer_8.Add(self.gate_close, 0, wx.ALIGN_CENTER, 0)
  121. sizer_8.Add(self.gate_position, 1, wx.EXPAND, 0)
  122. sizer_8.Add(self.gate_open, 0, wx.ALIGN_CENTER, 0)
  123. sizer_main.Add(sizer_8, 0, wx.EXPAND, 0)
  124. self.SetSizer(sizer_main)
  125. self.Layout()
  126. # end wxGlade
  127. def gate_oc_evt(self, event): # wxGlade: Wetation.<event_handler>
  128. print("Event handler 'gate_oc_evt' not implemented!")
  129. event.Skip()
  130. # end of class Wetation
  131. class MyApp(wx.App):
  132. def OnInit(self):
  133. self.wetation = Wetation(None, wx.ID_ANY, "")
  134. self.SetTopWindow(self.wetation)
  135. self.wetation.Show()
  136. return True
  137. # end of class MyApp
  138. if __name__ == "__main__":
  139. app = MyApp(0)
  140. app.MainLoop()