mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-29 22:02:10 +00:00
FIX: move network hold to MainFrame
jira: [STUDIO-10994] Change-Id: I2c30ba3b0f17d52079332634a9a2dd138859e083 (cherry picked from commit 506e82cb02a79d97a30effde53fe85c7d278858c)
This commit is contained in:
@@ -17,6 +17,9 @@
|
||||
#include "CameraPopup.hpp"
|
||||
#include "libslic3r/calib.hpp"
|
||||
#include "libslic3r/Utils.hpp"
|
||||
|
||||
#include <wx/object.h>
|
||||
|
||||
#define USE_LOCAL_SOCKET_BIND 0
|
||||
|
||||
#define DISCONNECT_TIMEOUT 30000.f // milliseconds
|
||||
@@ -1356,15 +1359,19 @@ private:
|
||||
time_t xcam__save_remote_print_file_to_storage_start_time = 0;
|
||||
};
|
||||
|
||||
class DeviceManagerRefresher;
|
||||
class DeviceManager
|
||||
{
|
||||
private:
|
||||
NetworkAgent* m_agent { nullptr };
|
||||
NetworkAgent* m_agent { nullptr };
|
||||
DeviceManagerRefresher* m_refresher{nullptr};
|
||||
|
||||
public:
|
||||
static bool EnableMultiMachine;
|
||||
|
||||
DeviceManager(NetworkAgent* agent = nullptr);
|
||||
~DeviceManager();
|
||||
NetworkAgent *get_agent() const{ return m_agent; }
|
||||
void set_agent(NetworkAgent* agent);
|
||||
|
||||
std::mutex listMutex;
|
||||
@@ -1373,6 +1380,9 @@ public:
|
||||
std::map<std::string, MachineObject*> localMachineList; /* dev_id -> MachineObject*, localMachine SSDP */
|
||||
std::map<std::string, MachineObject*> userMachineList; /* dev_id -> MachineObject* cloudMachine of User */
|
||||
|
||||
void start_refresher();
|
||||
void stop_refresher();
|
||||
|
||||
void keep_alive();
|
||||
void check_pushing();
|
||||
|
||||
@@ -1468,6 +1478,26 @@ public:
|
||||
static void update_local_machine(const MachineObject& m);
|
||||
};
|
||||
|
||||
class DeviceManagerRefresher : public wxObject
|
||||
{
|
||||
wxTimer *m_timer{nullptr};
|
||||
int m_timer_interval_msec = 1000;
|
||||
|
||||
DeviceManager *m_manager{nullptr};
|
||||
|
||||
public:
|
||||
DeviceManagerRefresher(DeviceManager* manger);
|
||||
~DeviceManagerRefresher();
|
||||
|
||||
public:
|
||||
void Start() { m_timer->Start(m_timer_interval_msec); }
|
||||
void Stop() { m_timer->Stop(); }
|
||||
|
||||
protected:
|
||||
virtual void on_timer(wxTimerEvent &event);
|
||||
};
|
||||
|
||||
|
||||
// change the opacity
|
||||
void change_the_opacity(wxColour& colour);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user