mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-18 08:22:06 +00:00
ENH:try again after subscription failure
jira:[Try again after subscription failure] Change-Id: Ibfb1e8e26eb166d786a372632a86ef98030db034
This commit is contained in:
@@ -1884,6 +1884,12 @@ void GUI_App::init_networking_callbacks()
|
||||
}
|
||||
);
|
||||
|
||||
m_agent->set_on_subscribe_failure_fn([this](std::string dev_id) {
|
||||
CallAfter([this, dev_id] {
|
||||
on_start_subscribe_again(dev_id);
|
||||
});
|
||||
});
|
||||
|
||||
m_agent->set_on_local_connect_fn(
|
||||
[this](int state, std::string dev_id, std::string msg) {
|
||||
if (m_is_closing) {
|
||||
@@ -2230,7 +2236,8 @@ void GUI_App::on_start_subscribe_again(std::string dev_id)
|
||||
MachineObject* obj = dev->get_selected_machine();
|
||||
if (!obj) return;
|
||||
|
||||
if ( (dev_id == obj->dev_id) && obj->is_connecting() ) {
|
||||
if ( (dev_id == obj->dev_id) && obj->is_connecting() && obj->subscribe_counter > 0) {
|
||||
obj->subscribe_counter--;
|
||||
if(wxGetApp().getAgent()) wxGetApp().getAgent()->set_user_selected_machine(dev_id);
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": dev_id=" << obj->dev_id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user