mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
ENH: do not change ip when connection name is different
JIRA: STUDIO-4072 Change-Id: I6e72f894fa5eca91d5bbbfaca3e897be95c305e0 Signed-off-by: Stone Li <stone.li@bambulab.com> (cherry picked from commit 15075195334a2e42097f3542402e1f889f480d3b)
This commit is contained in:
parent
be53cf4c7a
commit
061a2cdb7e
2 changed files with 9 additions and 1 deletions
|
@ -4704,6 +4704,10 @@ void DeviceManager::on_machine_alive(std::string json_str)
|
||||||
if (j.contains("sec_link")) {
|
if (j.contains("sec_link")) {
|
||||||
sec_link = j["sec_link"].get<std::string>();
|
sec_link = j["sec_link"].get<std::string>();
|
||||||
}
|
}
|
||||||
|
std::string connection_name = "";
|
||||||
|
if (j.contains("connection_name")) {
|
||||||
|
connection_name = j["connection_name"].get<std::string>();
|
||||||
|
}
|
||||||
|
|
||||||
MachineObject* obj;
|
MachineObject* obj;
|
||||||
|
|
||||||
|
@ -4722,7 +4726,9 @@ void DeviceManager::on_machine_alive(std::string json_str)
|
||||||
// update properties
|
// update properties
|
||||||
/* ip changed */
|
/* ip changed */
|
||||||
obj = it->second;
|
obj = it->second;
|
||||||
if (obj->dev_ip.compare(dev_ip) != 0 && !obj->dev_ip.empty()) {
|
if (obj->dev_ip.compare(dev_ip) != 0 && !obj->dev_ip.empty()
|
||||||
|
&& obj->dev_connection_name.compare(connection_name) != 0
|
||||||
|
) {
|
||||||
BOOST_LOG_TRIVIAL(info) << "MachineObject IP changed from " << obj->dev_ip << " to " << dev_ip;
|
BOOST_LOG_TRIVIAL(info) << "MachineObject IP changed from " << obj->dev_ip << " to " << dev_ip;
|
||||||
obj->dev_ip = dev_ip;
|
obj->dev_ip = dev_ip;
|
||||||
/* ip changed reconnect mqtt */
|
/* ip changed reconnect mqtt */
|
||||||
|
@ -4754,6 +4760,7 @@ void DeviceManager::on_machine_alive(std::string json_str)
|
||||||
obj->dev_connection_type = connect_type;
|
obj->dev_connection_type = connect_type;
|
||||||
obj->bind_state = bind_state;
|
obj->bind_state = bind_state;
|
||||||
obj->bind_sec_link = sec_link;
|
obj->bind_sec_link = sec_link;
|
||||||
|
obj->dev_connection_name = connection_name;
|
||||||
|
|
||||||
//load access code
|
//load access code
|
||||||
AppConfig* config = Slic3r::GUI::wxGetApp().app_config;
|
AppConfig* config = Slic3r::GUI::wxGetApp().app_config;
|
||||||
|
|
|
@ -439,6 +439,7 @@ public:
|
||||||
float nozzle_diameter { 0.0f };
|
float nozzle_diameter { 0.0f };
|
||||||
std::string dev_connection_type; /* lan | cloud */
|
std::string dev_connection_type; /* lan | cloud */
|
||||||
std::string connection_type() { return dev_connection_type; }
|
std::string connection_type() { return dev_connection_type; }
|
||||||
|
std::string dev_connection_name; /* lan | eth */
|
||||||
void set_dev_ip(std::string ip) {dev_ip = ip;};
|
void set_dev_ip(std::string ip) {dev_ip = ip;};
|
||||||
bool has_access_right() { return !get_access_code().empty(); }
|
bool has_access_right() { return !get_access_code().empty(); }
|
||||||
std::string get_ftp_folder();
|
std::string get_ftp_folder();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue