MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / Dashboard

Method Dashboard

app/src/UI/Dashboard.cpp:150–251  ·  view source on GitHub ↗

* @brief Constructs the Dashboard, wires reset signals and loads persisted settings. */

Source from the content-addressed store, hash-verified

148 * @brief Constructs the Dashboard, wires reset signals and loads persisted settings.
149 */
150UI::Dashboard::Dashboard()
151 : m_points(kDefaultPlotPoints)
152 , m_widgetCount(0)
153 , m_updateRequired(false)
154 , m_showActionPanel(true)
155 , m_terminalEnabled(false)
156 , m_notificationLogEnabled(false)
157 , m_clockEnabled(false)
158 , m_stopwatchEnabled(false)
159 , m_autoHideToolbar(false)
160 , m_persistSettings(true)
161 , m_autoLayoutMargin(0)
162 , m_autoLayoutSpacing(-1)
163 , m_updateRetryInProgress(false)
164 , m_layoutValid(false)
165 , m_streamAvailable(false)
166 , m_plotTimeRange(10.0)
167 , m_plotDisplayTimeSec(0)
168 , m_pltXAxis(kDefaultPlotPoints)
169 , m_multipltXAxis(kDefaultPlotPoints)
170{
171 // clang-format off
172 connect(&CSV::Player::instance(), &CSV::Player::openChanged, this, [=, this] { resetData(true); }, Qt::QueuedConnection);
173 connect(&MDF4::Player::instance(), &MDF4::Player::openChanged, this, [=, this] { resetData(true); }, Qt::QueuedConnection);
174 connect(&IO::ConnectionManager::instance(), &IO::ConnectionManager::connectedChanged, this, [=, this] {
175 if (!IO::ConnectionManager::instance().isConnected())
176 resetData(true);
177 }, Qt::QueuedConnection);
178 connect(&AppState::instance(), &AppState::projectFileChanged, this, [=, this] { resetData(); }, Qt::QueuedConnection);
179 connect(&DataModel::FrameBuilder::instance(), &DataModel::FrameBuilder::jsonFileMapChanged, this, [this] {
180 m_sourceRawFrames.clear();
181 m_datasetReferences.clear();
182 m_valuePushes.clear();
183 m_plotClocks.clear();
184 }, Qt::QueuedConnection);
185 connect(&AppState::instance(), &AppState::operationModeChanged, this, [=, this] {
186 const auto mode = AppState::instance().operationMode();
187 if (mode == SerialStudio::ProjectFile) {
188 const int project_pts = DataModel::ProjectModel::instance().pointCount();
189 if (project_pts > 0 && m_points != project_pts) {
190 m_points = project_pts;
191 Q_EMIT pointsChanged();
192 }
193
194 const double project_range = DataModel::ProjectModel::instance().plotTimeRange();
195 if (project_range > 0 && !qFuzzyCompare(m_plotTimeRange, project_range)) {
196 m_plotTimeRange = project_range;
197 Q_EMIT plotTimeRangeChanged();
198 }
199 } else {
200 if (m_points != kDefaultPlotPoints) {
201 m_points = kDefaultPlotPoints;
202 Q_EMIT pointsChanged();
203 }
204
205 const double saved
206 = qMax(0.001, SerialStudio::toDouble(m_settings.value("Dashboard/PlotTimeRange", 10.0)));
207 if (!qFuzzyCompare(m_plotTimeRange, saved)) {

Callers

nothing calls this directly

Calls 6

operationModeMethod · 0.80
pointCountMethod · 0.80
isConnectedMethod · 0.45
clearMethod · 0.45
plotTimeRangeMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected