File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -2150,6 +2150,33 @@ bool MainWindow::LoadUIConfiguration(int version, const YAML::Node& node)
2150
2150
return false ;
2151
2151
}
2152
2152
2153
+ // Measurements
2154
+ auto measurements = node[" measurements" ];
2155
+ if (measurements)
2156
+ {
2157
+ // Make the measurements dialog
2158
+ if (!m_measurementsDialog)
2159
+ {
2160
+ m_measurementsDialog = make_shared<MeasurementsDialog>(m_session);
2161
+ AddDialog (m_measurementsDialog);
2162
+ }
2163
+
2164
+ int index;
2165
+ int stream;
2166
+ for (auto m : measurements)
2167
+ {
2168
+ auto sin = m.as <string>();
2169
+ if (2 != sscanf (sin.c_str (), " %d/%d" , &index, &stream))
2170
+ {
2171
+ index = atoi (sin.c_str ());
2172
+ stream = 0 ;
2173
+ }
2174
+
2175
+ m_measurementsDialog->AddStream (
2176
+ StreamDescriptor (static_cast <OscilloscopeChannel*>(m_session.m_idtable [index]), stream));
2177
+ }
2178
+ }
2179
+
2153
2180
LogTrace (" ui config loaded\n " );
2154
2181
return true ;
2155
2182
}
@@ -2504,6 +2531,18 @@ YAML::Node MainWindow::SerializeUIConfiguration()
2504
2531
// Serialize dialogs
2505
2532
node[" dialogs" ] = SerializeDialogs ();
2506
2533
2534
+ // Serialize measurements
2535
+ if (m_measurementsDialog)
2536
+ {
2537
+ auto measurements = m_measurementsDialog->GetStreams ();
2538
+
2539
+ YAML::Node mnode;
2540
+ for (auto stream : measurements)
2541
+ mnode.push_back (to_string (m_session.m_idtable .emplace (stream.m_channel )) + " /" + to_string (stream.m_stream ));
2542
+
2543
+ node[" measurements" ] = mnode;
2544
+ }
2545
+
2507
2546
return node;
2508
2547
}
2509
2548
You can’t perform that action at this time.
0 commit comments