diff --git a/src/print_status_panel.cpp b/src/print_status_panel.cpp index 91c970e..fe8c508 100644 --- a/src/print_status_panel.cpp +++ b/src/print_status_panel.cpp @@ -22,7 +22,7 @@ LV_IMG_DECLARE(cancel); LV_IMG_DECLARE(emergency); LV_IMG_DECLARE(back); -constexpr double pi() { return std::atan(1)*4; } +double pi() { return std::atan(1)*4; } PrintStatusPanel::PrintStatusPanel(KWebSocketClient &websocket_client, std::mutex &lock, diff --git a/src/setting_panel.cpp b/src/setting_panel.cpp index 8a6384d..da53c49 100644 --- a/src/setting_panel.cpp +++ b/src/setting_panel.cpp @@ -24,7 +24,9 @@ LV_IMG_DECLARE(print); SettingPanel::SettingPanel(KWebSocketClient &c, std::mutex &l, lv_obj_t *parent, SpoolmanPanel &sm) : ws(c) , cont(lv_obj_create(parent)) +#ifndef OS_ANDROID , wifi_panel(l) +#endif , sysinfo_panel() , spoolman_panel(sm) , wifi_btn(cont, &network_img, "WIFI", &SettingPanel::_handle_callback, this) @@ -44,6 +46,9 @@ SettingPanel::SettingPanel(KWebSocketClient &c, std::mutex &l, lv_obj_t *parent, lv_obj_set_size(cont, LV_PCT(100), LV_PCT(100)); spoolman_btn.disable(); +#ifdef OS_ANDROID + wifi_btn.disable(); +#endif static lv_coord_t grid_main_row_dsc[] = {LV_GRID_FR(2), LV_GRID_FR(5), LV_GRID_FR(5), LV_GRID_TEMPLATE_LAST}; static lv_coord_t grid_main_col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(1), @@ -82,7 +87,9 @@ void SettingPanel::handle_callback(lv_event_t *event) { if (btn == wifi_btn.get_container()) { spdlog::trace("wifi pressed"); +#ifndef OS_ANDROID wifi_panel.foreground(); +#endif } else if (btn == sysinfo_btn.get_container()) { spdlog::trace("setting system info pressed"); sysinfo_panel.foreground(); diff --git a/src/setting_panel.h b/src/setting_panel.h index f31e189..ed58186 100644 --- a/src/setting_panel.h +++ b/src/setting_panel.h @@ -1,7 +1,12 @@ #ifndef __SETTING_PANEL_H__ #define __SETTING_PANEL_H__ +#include "platform.h" + +#ifndef OS_ANDROID #include "wifi_panel.h" +#endif + #include "sysinfo_panel.h" #include "spoolman_panel.h" #include "printer_select_panel.h" @@ -29,7 +34,11 @@ class SettingPanel { private: KWebSocketClient &ws; lv_obj_t *cont; + +#ifndef OS_ANDROID WifiPanel wifi_panel; +#endif + SysInfoPanel sysinfo_panel; SpoolmanPanel &spoolman_panel; PrinterSelectPanel printer_select_panel; diff --git a/src/websocket_client.cpp b/src/websocket_client.cpp index a9a9379..8e3585b 100644 --- a/src/websocket_client.cpp +++ b/src/websocket_client.cpp @@ -18,7 +18,7 @@ using namespace hv; using json = nlohmann::json; -KWebSocketClient::KWebSocketClient(EventLoopPtr loop = NULL) +KWebSocketClient::KWebSocketClient(EventLoopPtr loop) : WebSocketClient(loop) , id(0) {