mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
ENH:add humidity display/surplus material
Change-Id: I1a04df257c9b09fef7ff06cfa192644478a30716
This commit is contained in:
@@ -334,7 +334,7 @@ MachineObject::MachineObject(NetworkAgent* agent, std::string name, std::string
|
||||
ams_insert_flag = false;
|
||||
ams_power_on_flag = false;
|
||||
ams_support_use_ams = false;
|
||||
ams_humidity = -1;
|
||||
ams_humidity = 5;
|
||||
|
||||
/* signals */
|
||||
wifi_signal = "";
|
||||
@@ -2531,6 +2531,18 @@ int MachineObject::parse_json(std::string payload)
|
||||
}
|
||||
if (!curr_ams) continue;
|
||||
|
||||
if (it->contains("humidity")) {
|
||||
std::string humidity = (*it)["humidity"].get<std::string>();
|
||||
|
||||
try {
|
||||
curr_ams->humidity = atoi(humidity.c_str());
|
||||
}
|
||||
catch (...) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (it->contains("tray")) {
|
||||
std::set<std::string> tray_id_set;
|
||||
for (auto it = curr_ams->trayList.begin(); it != curr_ams->trayList.end(); it++) {
|
||||
|
||||
Reference in New Issue
Block a user