MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / load_session

Method load_session

DSView/pv/view/viewstatus.cpp:262–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260}
261
262void 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

Callers 1

load_config_from_jsonMethod · 0.80

Calls 6

get_work_modeMethod · 0.80
get_deviceMethod · 0.80
sizeMethod · 0.80
get_nameMethod · 0.80
DSO_MEASURE_TYPEEnum · 0.70
get_indexMethod · 0.45

Tested by

no test coverage detected