mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-09-28 22:53:14 +08:00
FIX: do something on machine lost
jira: [STUDIO-11324] Change-Id: I915ebe84dfad00910df01e7f289109c602b02c1b
This commit is contained in:
parent
d621bea938
commit
6c4757505a
@ -6918,6 +6918,10 @@ void DeviceManager::on_machine_alive(std::string json_str)
|
|||||||
it->second->dev_connection_type != connect_type ||
|
it->second->dev_connection_type != connect_type ||
|
||||||
it->second->bind_ssdp_version != ssdp_version)
|
it->second->bind_ssdp_version != ssdp_version)
|
||||||
{
|
{
|
||||||
|
if (it->second->bind_state != bind_state) {
|
||||||
|
OnMachineBindStateChanged(it->second, bind_state);
|
||||||
|
}
|
||||||
|
|
||||||
it->second->dev_ip = dev_ip;
|
it->second->dev_ip = dev_ip;
|
||||||
it->second->bind_state = bind_state;
|
it->second->bind_state = bind_state;
|
||||||
it->second->bind_sec_link = sec_link;
|
it->second->bind_sec_link = sec_link;
|
||||||
@ -7687,6 +7691,18 @@ std::string DeviceManager::get_filament_name_from_ams(int ams_id, int slot_id)
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DeviceManager::OnMachineBindStateChanged(MachineObject *obj, const std::string &new_state) {
|
||||||
|
if (!obj) { return; }
|
||||||
|
if (obj->dev_id == selected_machine) {
|
||||||
|
if (new_state == "free") { OnSelectedMachineLost();}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeviceManager::OnSelectedMachineLost() {
|
||||||
|
GUI::wxGetApp().sidebar().update_sync_status(nullptr);
|
||||||
|
GUI::wxGetApp().sidebar().load_ams_list(string(), nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
bool DeviceManager::check_filaments_printable(const std::string &tag_vendor, const std::string &tag_type, int ams_id, bool &in_blacklist, std::string &ac, std::string &info)
|
bool DeviceManager::check_filaments_printable(const std::string &tag_vendor, const std::string &tag_type, int ams_id, bool &in_blacklist, std::string &ac, std::string &info)
|
||||||
{
|
{
|
||||||
DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||||
|
@ -1484,6 +1484,9 @@ public:
|
|||||||
static bool is_virtual_slot(int ams_id);
|
static bool is_virtual_slot(int ams_id);
|
||||||
static std::string get_filament_name_from_ams(int ams_id, int slot_id);
|
static std::string get_filament_name_from_ams(int ams_id, int slot_id);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void OnMachineBindStateChanged(MachineObject* obj, const std::string &new_state);
|
||||||
|
void OnSelectedMachineLost();
|
||||||
};
|
};
|
||||||
|
|
||||||
class DeviceManagerRefresher : public wxObject
|
class DeviceManagerRefresher : public wxObject
|
||||||
|
Loading…
x
Reference in New Issue
Block a user