forked from viewit/OrcaSlicer-KX
* Fix calls to depreciated wxPen constructor * Fix use of wxTimerEvent * Fix unrecognized character escape sequence * Fix signed/unsigned mismatch At least as much as possible without significantly altering parts of the application * Clean unreferenced variables * fix mistyped namespace selector * Update deprecated calls * Fix preprocessor statement * Remove empty switch statements * Change int vector used as bool to bool vector * Remove empty control statements and related unused code * Change multi character constant to string constant * Fix discarded return value json::parse was being called on the object, rather than statically like it should be. Also, the value was not being captured. * Rename ICON_SIZE def used by MultiMachine By having the definition in the header, it causes issues when other files define ICON_SIZE. By renaming it to MM_ICON_SIZE, this lessens the issue. It would probably be ideal to have the definitions in the respective .cpp that use them, but it would make it less convenient to update the values if needed in the future. * Remove unused includes * Fix linux/macOS compilation * Hide unused-function errors on non-Windows systems * Disable signed/unsigned comparison mismatch error * Remove/Disable more unused variables Still TODO: check double for loop in Print.cpp * Remove unused variable that was missed * Remove unused variables in libraries in the src folder * Apply temporary fix for subobject linkage error * Remove/Disable last set of unused variables reported by GCC * remove redundant for loop * fix misspelled ifdef check * Update message on dialog * Fix hard-coded platform specific modifier keys * Remove duplicate for loop * Disable -Wmisleading-indentation warning * disable -Wswitch warning * Remove unused local typedefs * Fix -Wunused-value * Fix pragma error on Windows from subobject linkage fix * Fix -Waddress * Fix null conversions (-Wconversion-null) --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
167 lines
4.2 KiB
C++
167 lines
4.2 KiB
C++
#ifndef slic3r_Monitor_hpp_
|
|
#define slic3r_Monitor_hpp_
|
|
|
|
#include "Tabbook.hpp"
|
|
#include <wx/notebook.h>
|
|
#include <wx/scrolwin.h>
|
|
#include <wx/sizer.h>
|
|
#include <wx/bmpcbox.h>
|
|
#include <wx/bmpbuttn.h>
|
|
#include <wx/treectrl.h>
|
|
#include <wx/imaglist.h>
|
|
#include <wx/artprov.h>
|
|
#include <wx/xrc/xmlres.h>
|
|
#include <wx/string.h>
|
|
#include <wx/stattext.h>
|
|
#include <wx/gdicmn.h>
|
|
#include <wx/font.h>
|
|
#include <wx/colour.h>
|
|
#include <wx/settings.h>
|
|
#include <wx/sizer.h>
|
|
#include <wx/grid.h>
|
|
#include <wx/dataview.h>
|
|
#include <wx/panel.h>
|
|
#include <wx/statline.h>
|
|
#include <wx/bitmap.h>
|
|
#include <wx/image.h>
|
|
#include <wx/icon.h>
|
|
#include <wx/bmpbuttn.h>
|
|
#include <wx/button.h>
|
|
#include <wx/gbsizer.h>
|
|
#include <wx/statbox.h>
|
|
#include <wx/tglbtn.h>
|
|
#include <wx/popupwin.h>
|
|
#include <wx/spinctrl.h>
|
|
#include <wx/artprov.h>
|
|
#include <wx/webrequest.h>
|
|
#include <map>
|
|
#include <vector>
|
|
#include <memory>
|
|
#include "Event.hpp"
|
|
#include "libslic3r/ProjectTask.hpp"
|
|
#include "wxExtensions.hpp"
|
|
#include "slic3r/GUI/MsgDialog.hpp"
|
|
#include "slic3r/GUI/DeviceManager.hpp"
|
|
#include "slic3r/GUI/MonitorBasePanel.h"
|
|
#include "slic3r/GUI/StatusPanel.hpp"
|
|
#include "slic3r/GUI/UpgradePanel.hpp"
|
|
#include "slic3r/GUI/HMSPanel.hpp"
|
|
#include "slic3r/GUI/AmsWidgets.hpp"
|
|
#include "Widgets/SideTools.hpp"
|
|
#include "SelectMachine.hpp"
|
|
|
|
namespace Slic3r {
|
|
namespace GUI {
|
|
|
|
class MediaFilePanel;
|
|
|
|
class AddMachinePanel : public wxPanel
|
|
{
|
|
protected:
|
|
Button* m_button_add_machine;
|
|
wxStaticText* m_staticText_add_machine;
|
|
wxStaticBitmap* m_bitmap_empty;
|
|
|
|
void on_add_machine(wxCommandEvent& event);
|
|
|
|
public:
|
|
|
|
AddMachinePanel(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString);
|
|
~AddMachinePanel();
|
|
|
|
void msw_rescale();
|
|
};
|
|
|
|
class MonitorPanel : public wxPanel
|
|
{
|
|
private:
|
|
Tabbook* m_tabpanel{ nullptr };
|
|
wxSizer* m_main_sizer{ nullptr };
|
|
|
|
AddMachinePanel* m_status_add_machine_panel;
|
|
StatusPanel* m_status_info_panel;
|
|
MediaFilePanel* m_media_file_panel;
|
|
UpgradePanel* m_upgrade_panel;
|
|
HMSPanel* m_hms_panel;
|
|
|
|
/* side tools */
|
|
SideTools* m_side_tools{nullptr};
|
|
wxStaticBitmap* m_bitmap_printer_type;
|
|
wxStaticBitmap* m_bitmap_arrow;
|
|
wxStaticText* m_staticText_printer_name;
|
|
wxStaticBitmap* m_bitmap_wifi_signal;
|
|
wxBoxSizer * m_side_tools_sizer;
|
|
SelectMachinePopup m_select_machine;
|
|
|
|
/* images */
|
|
wxBitmap m_signal_strong_img;
|
|
wxBitmap m_signal_middle_img;
|
|
wxBitmap m_signal_weak_img;
|
|
wxBitmap m_signal_no_img;
|
|
wxBitmap m_printer_img;
|
|
wxBitmap m_arrow_img;
|
|
|
|
int last_wifi_signal = -1;
|
|
int last_status;
|
|
bool m_initialized { false };
|
|
bool update_flag{false};
|
|
wxTimer* m_refresh_timer = nullptr;
|
|
|
|
public:
|
|
MonitorPanel(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL);
|
|
~MonitorPanel();
|
|
|
|
enum PrinterTab {
|
|
PT_STATUS = 0,
|
|
PT_MEDIA = 1,
|
|
PT_UPDATE = 2,
|
|
PT_HMS = 3,
|
|
PT_DEBUG = 4,
|
|
PT_MAX_NUM = 5
|
|
};
|
|
|
|
void init_bitmap();
|
|
void init_timer();
|
|
void init_tabpanel();
|
|
Tabbook* get_tabpanel() { return m_tabpanel; };
|
|
void set_default();
|
|
wxWindow* create_side_tools();
|
|
|
|
void on_sys_color_changed();
|
|
void msw_rescale();
|
|
|
|
StatusPanel* get_status_panel() {return m_status_info_panel;};
|
|
void select_machine(std::string machine_sn);
|
|
void on_update_all(wxMouseEvent &event);
|
|
void on_timer();
|
|
void on_select_printer(wxCommandEvent& event);
|
|
void on_printer_clicked(wxMouseEvent &event);
|
|
void on_size(wxSizeEvent &event);
|
|
|
|
/* update apis */
|
|
//void update_ams(MachineObject* obj);
|
|
void update_all();
|
|
|
|
void update_hms_tag();
|
|
bool Show(bool show);
|
|
|
|
void update_side_panel();
|
|
void show_status(int status);
|
|
|
|
std::string get_string_from_tab(PrinterTab tab);
|
|
|
|
MachineObject *obj { nullptr };
|
|
std::string last_conn_type = "undedefined";
|
|
|
|
void stop_update() {update_flag = false;};
|
|
void start_update() {update_flag = true;};
|
|
|
|
void jump_to_HMS(wxCommandEvent& e);
|
|
};
|
|
|
|
|
|
} // GUI
|
|
} // Slic3r
|
|
|
|
#endif /* slic3r_Tab_hpp_ */
|