mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
ENH:add track events
Change-Id: I7fb685013f243d6394a94a3c9500016b247ea0a8
This commit is contained in:
parent
c582e64e0d
commit
6f298ac6f1
2 changed files with 93 additions and 8 deletions
|
@ -514,6 +514,24 @@ void MonitorPanel::show_status(int status)
|
|||
|
||||
if (last_status == status)
|
||||
return;
|
||||
|
||||
if (last_status & (int)MonitorStatus::MONITOR_CONNECTING != 0) {
|
||||
NetworkAgent* agent = wxGetApp().getAgent();
|
||||
json j;
|
||||
j["dev_id"] = obj ? obj->dev_id : "obj_nullptr";
|
||||
if (status & (int)MonitorStatus::MONITOR_DISCONNECTED != 0) {
|
||||
j["result"] = "failed";
|
||||
if (agent) {
|
||||
agent->track_event("connect_dev", j.dump());
|
||||
}
|
||||
}
|
||||
else if (status & (int)MonitorStatus::MONITOR_NORMAL != 0) {
|
||||
j["result"] = "success";
|
||||
if (agent) {
|
||||
agent->track_event("connect_dev", j.dump());
|
||||
}
|
||||
}
|
||||
}
|
||||
last_status = status;
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << "monitor: show_status = " << status;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue