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

Function populateThreeAxisDatasets

app/src/DataModel/ProjectModel.cpp:297–317  ·  view source on GitHub ↗

* @brief Populates a group with three canonical axis datasets per supplied layout. */

Source from the content-addressed store, hash-verified

295 * @brief Populates a group with three canonical axis datasets per supplied layout.
296 */
297static void populateThreeAxisDatasets(DataModel::Group& grp,
298 int baseIndex,
299 const ThreeAxisLayout& layout)
300{
301 grp.widget = QString::fromUtf8(layout.widgetTag);
302
303 DataModel::Dataset axes[3];
304 for (int i = 0; i < 3; ++i) {
305 axes[i].datasetId = i;
306 axes[i].groupId = grp.groupId;
307 axes[i].index = baseIndex + i;
308 axes[i].units = layout.units[i];
309 axes[i].widget = QString::fromUtf8(layout.axisWidgets[i]);
310 axes[i].title = layout.titles[i];
311 axes[i].wgtMin = layout.wgtMin[i];
312 axes[i].wgtMax = layout.wgtMax[i];
313 axes[i].plt = layout.plt;
314
315 grp.datasets.push_back(axes[i]);
316 }
317}
318
319/**
320 * @brief Builds widget refs for one group during auto-workspace synthesis.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected