* @brief Represents a single unit of sensor data with optional metadata and * graphing. Fully aligned and stack-optimized. */
| 402 | * graphing. Fully aligned and stack-optimized. |
| 403 | */ |
| 404 | struct alignas(8) Dataset { |
| 405 | int index = 0; ///< Frame offset index |
| 406 | int xAxisId = kXAxisTime; ///< X-axis: -2 = time (default), else dataset uniqueId |
| 407 | int waterfallYAxis = 0; ///< Y source for the waterfall -- 0 = Time, else dataset uniqueId |
| 408 | int groupId = 0; ///< Owning group ID |
| 409 | int sourceId = 0; ///< Source this dataset belongs to |
| 410 | int uniqueId = -1; ///< Persisted stable identity (-1 = unassigned, compute legacy) |
| 411 | int datasetId = 0; ///< Unique ID within group |
| 412 | int fftSamples = 256; ///< Number of samples for FFT |
| 413 | int fftSamplingRate = 100; ///< Sampling rate for FFT |
| 414 | int transformLanguage = -1; ///< Transform script language (-1 = unset, 0 = JS, 1 = Lua) |
| 415 | bool fft = false; ///< Enables FFT processing |
| 416 | bool led = false; ///< Enables LED widget |
| 417 | bool log = false; ///< Enables logging |
| 418 | bool plt = false; ///< Enables plotting |
| 419 | bool waterfall = false; ///< Enables waterfall (spectrogram) widget -- Pro |
| 420 | bool overviewDisplay = false; ///< Show in overview |
| 421 | bool isNumeric = false; ///< True if value was parsed as numeric |
| 422 | bool virtual_ = false; ///< True if dataset is generated rather than parsed directly |
| 423 | bool hideOnDashboard = false; ///< Suppress dataset-level dashboard tile (painter still sees it) |
| 424 | bool enabled = true; ///< False excludes the dataset from frame building (editor-only) |
| 425 | double fftMin = 0; ///< Minimum value (for FFT) |
| 426 | double fftMax = 0; ///< Maximum value (for FFT) |
| 427 | double pltMin = 0; ///< Minimum value (for plots) |
| 428 | double pltMax = 0; ///< Maximum value (for plots) |
| 429 | double wgtMin = 0; ///< Minimum value (for widgets) |
| 430 | double wgtMax = 0; ///< Maximum value (for widgets) |
| 431 | double ledHigh = 80; ///< LED activation threshold |
| 432 | double numericValue = 0; ///< Parsed numeric value after transforms |
| 433 | double rawNumericValue = 0; ///< Parsed numeric value before transforms |
| 434 | int displayTickCount = 5; ///< Preferred major-tick count on analog widgets (0 = auto) |
| 435 | int decimalPoints = -1; ///< Fixed value-display decimals; overrides displayFormat (-1 = auto) |
| 436 | QString value; ///< Raw string value after transforms |
| 437 | QString rawValue; ///< Raw string value before transforms |
| 438 | QString title; ///< Human-readable title |
| 439 | QString units; ///< Measurement units (e.g., degC) |
| 440 | QString widget; ///< Widget type (bar, gauge, etc.) |
| 441 | QString transformCode; ///< Optional per-dataset transform script |
| 442 | QString displayFormat = |
| 443 | QStringLiteral("0d"); ///< Tick/value label format on analog widgets ("0d" = integer) |
| 444 | std::vector<AlarmBand> alarmBands; ///< Colour-banded alarm zones (empty = no alarms) |
| 445 | }; |
| 446 | |
| 447 | static_assert(sizeof(Dataset) % alignof(Dataset) == 0, "Unaligned Dataset struct"); |
| 448 |