* @brief Shared property bag for assistant.script.dryRun and assistant.script.apply. */
| 222 | * @brief Shared property bag for assistant.script.dryRun and assistant.script.apply. |
| 223 | */ |
| 224 | static QJsonObject scriptPropsBag() |
| 225 | { |
| 226 | QJsonObject props; |
| 227 | props[QStringLiteral("kind")] = |
| 228 | stringEnumProperty(QStringLiteral("Script surface to validate or apply."), |
| 229 | QStringList{QStringLiteral("frame_parser"), |
| 230 | QStringLiteral("transform"), |
| 231 | QStringLiteral("painter"), |
| 232 | QStringLiteral("output_widget"), |
| 233 | QStringLiteral("end_to_end")}); |
| 234 | props[QStringLiteral("code")] = |
| 235 | makeProperty(QStringLiteral("string"), QStringLiteral("Script source to validate/apply.")); |
| 236 | props[QStringLiteral("language")] = |
| 237 | makeProperty(QStringLiteral("integer"), |
| 238 | QStringLiteral("0 = JavaScript, 1 = Lua, 2 = Built-In (frame_parser only; " |
| 239 | "pass the JSON template descriptor {\"template\": id, " |
| 240 | "\"params\": {...}} as `code`).")); |
| 241 | props[Keys::SourceId] = |
| 242 | makeProperty(QStringLiteral("integer"), QStringLiteral("Optional source id, default 0.")); |
| 243 | props[QStringLiteral("inputBytes")] = |
| 244 | makeProperty(QStringLiteral("string"), |
| 245 | QStringLiteral("[frame_parser] Raw stream bytes as UTF-8 text. Lossy " |
| 246 | "for binary -- prefer inputBytesHex.")); |
| 247 | props[QStringLiteral("inputBytesHex")] = |
| 248 | makeProperty(QStringLiteral("string"), |
| 249 | QStringLiteral("[frame_parser, recommended] Raw stream bytes as a hex " |
| 250 | "string. Binary-safe; required for COBS / Modbus / " |
| 251 | "any non-ASCII protocol.")); |
| 252 | props[Keys::DecoderMethod] = |
| 253 | makeProperty(QStringLiteral("integer"), |
| 254 | QStringLiteral("[frame_parser] 0=PlainText, 1=Hexadecimal, 2=Base64, " |
| 255 | "3=Binary. Binary is the only decoder safe for non-text.")); |
| 256 | props[Keys::FrameDetection] = |
| 257 | makeProperty(QStringLiteral("integer"), |
| 258 | QStringLiteral("[frame_parser] 0=EndDelimiterOnly, 1=StartAndEnd, " |
| 259 | "2=NoDelimiters, 3=StartDelimiterOnly.")); |
| 260 | props[Keys::FrameStart] = |
| 261 | makeProperty(QStringLiteral("string"), QStringLiteral("[frame_parser] Start delimiter.")); |
| 262 | props[Keys::FrameEnd] = |
| 263 | makeProperty(QStringLiteral("string"), QStringLiteral("[frame_parser] End delimiter.")); |
| 264 | props[Keys::HexadecimalDelimiters] = |
| 265 | makeProperty(QStringLiteral("boolean"), |
| 266 | QStringLiteral("[frame_parser] Treat frameStart / frameEnd as hex bytes.")); |
| 267 | props[Keys::ChecksumAlgorithm] = makeProperty( |
| 268 | QStringLiteral("string"), QStringLiteral("[frame_parser] Checksum name (or empty for none).")); |
| 269 | props[QStringLiteral("operationMode")] = makeProperty( |
| 270 | QStringLiteral("integer"), QStringLiteral("[frame_parser] 0=ProjectFile, 2=QuickPlot.")); |
| 271 | props[QStringLiteral("sampleFrame")] = makeProperty( |
| 272 | QStringLiteral("string"), QStringLiteral("[end_to_end only] Single pre-extracted frame body.")); |
| 273 | props[QStringLiteral("sampleFrames")] = |
| 274 | makeProperty(QStringLiteral("array"), |
| 275 | QStringLiteral("[end_to_end only] Multiple pre-extracted frame bodies.")); |
| 276 | props[QStringLiteral("values")] = |
| 277 | makeProperty(QStringLiteral("array"), QStringLiteral("Sample values for transform tests.")); |
| 278 | props[QStringLiteral("inputValue")] = |
| 279 | makeProperty(QStringLiteral("string"), |
| 280 | QStringLiteral("[output_widget] Optional sample value to run transmit() " |
| 281 | "against so runtime errors and the produced bytes surface.")); |
no test coverage detected