Weather App
 
Loading...
Searching...
No Matches
PanelStation.h
Go to the documentation of this file.
1
5
6 #pragma once
7 #include "Panel.h"
8 #include "HttpFetcher.h"
9 #include "LocalDB.h"
10
18 class PanelStation : public Panel {
19 public:
29 PanelStation(Panel* origin, std::string stationId, std::string stationName);
30
37
40 std::string stationId;
41 std::string stationName;
43
46 const int styleObjectSpacingX = 10;
47 const int styleObjectSpacingY = 10;
49
52
58
67 void OnDataFetched(wxThreadEvent& event);
68
71
74
78 void UpdateGUI();
79
85 void OnWindowResized(wxSizeEvent& event);
86
92 void OnWindowMaximized(wxMaximizeEvent& event);
93
99 void OnFullScreen(wxFullScreenEvent& event);
101
104 wxStaticText* textTop;
105
106 nlohmann::json data;
107
108 wxListBox* listSensors;
109
116 void ListSensors_OnItemDoubleClicked(wxCommandEvent& event);
117
118 wxButton* button_back;
119
126 void ButtonBack_OnButtonClick(wxCommandEvent& event);
128 };
129
Defines the HttpFetcher class for performing HTTP GET requests asynchronously.
Manages local storage and retrieval of JSON data for stations and sensors.
Defines the Panel class for managing wxWidgets panels.
Handles asynchronous HTTP GET requests.
Definition HttpFetcher.h:34
Panel(Panel *origin)
Constructs a new Panel and hides the previous one if provided.
void OnDataFetched(wxThreadEvent &event)
Event handler for processing fetched sensor data.
std::string stationName
Name of the selected station.
Definition PanelStation.h:41
void UpdateGUI()
Updates the graphical user interface. Resizes UI elements based on the current window size.
void ListSensors_OnItemDoubleClicked(wxCommandEvent &event)
Handles double-click events on the sensor list. Opens a new panel for the selected sensor.
wxButton * button_back
Button for navigating back to the previous panel.
Definition PanelStation.h:118
void OnFullScreen(wxFullScreenEvent &event)
Handles full-screen events.
const int styleObjectSpacingX
Horizontal spacing between UI elements.
Definition PanelStation.h:46
PanelStation(Panel *origin, std::string stationId, std::string stationName)
Constructor for PanelStation.
wxListBox * listSensors
List box displaying available sensors.
Definition PanelStation.h:108
wxStaticText * textTop
Static text displaying the station selection message.
Definition PanelStation.h:104
std::string stationId
Unique ID of the selected station.
Definition PanelStation.h:40
HttpFetcher * httpFetcher
Pointer to an HTTP fetcher instance.
Definition PanelStation.h:69
void ButtonBack_OnButtonClick(wxCommandEvent &event)
Handles click events on the "Back" button. Closes the panel and returns to the previous screen.
void OnWindowMaximized(wxMaximizeEvent &event)
Handles window maximization events.
void FetchParams()
Initiates fetching of sensor data for the selected station.
~PanelStation()
Destructor for PanelStation.
nlohmann::json data
JSON object holding sensor data.
Definition PanelStation.h:106
const int styleObjectSpacingY
Vertical spacing between UI elements.
Definition PanelStation.h:47
void OnWindowResized(wxSizeEvent &event)
Handles window resize events.