| 260 | } |
| 261 | |
| 262 | void ViewStatus::load_session(QJsonArray measure_array, int version) |
| 263 | { |
| 264 | if (_session->get_device()->get_work_mode() != DSO){ |
| 265 | return; |
| 266 | } |
| 267 | |
| 268 | for(int i = 0; i < (int)_mrects.size(); i++) |
| 269 | { |
| 270 | std::get<1>(_mrects[i]) = -1; |
| 271 | std::get<2>(_mrects[i]) = DSO_MS_BEGIN; |
| 272 | } |
| 273 | |
| 274 | for (const QJsonValue &measure_value : measure_array) |
| 275 | { |
| 276 | QJsonObject m_obj = measure_value.toObject(); |
| 277 | int index = m_obj["site"].toInt(); |
| 278 | int sig_index = m_obj["index"].toInt(); |
| 279 | |
| 280 | if (version >= 3){ |
| 281 | Signal *trace = NULL; |
| 282 | |
| 283 | for(auto s : _session->get_signals()){ |
| 284 | if (s->get_name().toInt() == sig_index){ |
| 285 | trace = s; |
| 286 | break; |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | if (trace == NULL) |
| 291 | continue; |
| 292 | sig_index = trace->get_index(); |
| 293 | } |
| 294 | |
| 295 | enum DSO_MEASURE_TYPE ms_type = DSO_MEASURE_TYPE(m_obj["type"].toInt()); |
| 296 | set_measure(index, false, sig_index, ms_type); |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | } // namespace view |
| 301 | } // namespace pv |
no test coverage detected