MCPcopy Create free account
hub / github.com/RGAA-Software/GoDesk / UpdateLines

Method UpdateLines

src/render_panel/ui/stat_chart.cpp:67–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 }
66
67 void StatChart::UpdateLines(const std::map<QString, std::vector<int32_t>>& value) {
68 ctx_->PostUITask([=, this]() {
69 auto beg = TimeUtil::GetCurrentTimestamp();
70 for (auto& [in_n, in_v] : value) {
71 for (auto& [n, s] : series_) {
72 if (in_n == n) {
73 QList<QPointF> points;
74 for (int i = 0; i < in_v.size(); i++) {
75 points.push_back(QPointF(i, in_v.at(i)));
76 }
77 ///s->clear();
78 s->replace(points);
79 break;
80 }
81 }
82 }
83 chart_view_->update();
84 auto end = TimeUtil::GetCurrentTimestamp();
85 //LOGI("UpdateLines UI, {}ms", (end-beg));
86 });
87 }
88
89}

Callers 1

UpdateUIMethod · 0.45

Calls 2

updateMethod · 0.80
PostUITaskMethod · 0.45

Tested by

no test coverage detected