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

Function serialize

app/src/DataModel/Frame.h:349–366  ·  view source on GitHub ↗

* @brief Serializes an OutputWidget to a QJsonObject. */

Source from the content-addressed store, hash-verified

347 * @brief Serializes an OutputWidget to a QJsonObject.
348 */
349[[nodiscard]] inline QJsonObject serialize(const OutputWidget& w)
350{
351 QJsonObject obj;
352 obj.insert(Keys::Icon, w.icon);
353 obj.insert(Keys::Title, w.title);
354 obj.insert(Keys::SourceId, w.sourceId);
355 obj.insert(Keys::OutputType, static_cast<int>(w.type));
356 obj.insert(Keys::OutputMinValue, w.minValue);
357 obj.insert(Keys::OutputMaxValue, w.maxValue);
358 obj.insert(Keys::OutputStepSize, w.stepSize);
359 obj.insert(Keys::OutputInitialValue, w.initialValue);
360 if (w.monoIcon)
361 obj.insert(Keys::OutputMonoIcon, true);
362
363 obj.insert(Keys::TransmitFunction, w.transmitFunction);
364 obj.insert(Keys::OutputTxEncoding, w.txEncoding);
365 return obj;
366}
367
368/**
369 * @brief Deserializes an OutputWidget from a QJsonObject (Frame.cpp: uses SerialStudio::toDouble).

Callers 15

deriveFrameConfigMethod · 0.85
Concepts.hFile · 0.85
buildFrameConfigMethod · 0.85
buildProjectMethod · 0.85
handleResourcesReadMethod · 0.85
processItemsMethod · 0.85
buildDatasetObjectFunction · 0.85
datasetGetAlarmBandsMethod · 0.85
groupsListMethod · 0.85
getDataMethod · 0.85

Calls 3

isEmptyMethod · 0.80
emptyMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected