783da8e21a
Replace raw-JSON text inputs with rich UI: script parameter/return types use a JSON Schema builder (SchemaBuilder + JsonSchemaShapeParser, with a migration to convert existing definitions); alarm trigger config uses a type-aware editor with a flattened attribute picker (AlarmTriggerEditor). AlarmActor gains optional direction (rising/falling/either) on RateOfChange triggers.
18 lines
705 B
C#
18 lines
705 B
C#
namespace ScadaLink.CentralUI.ScriptAnalysis;
|
|
|
|
/// <summary>
|
|
/// Parses the parameter-definitions and return-definition JSON Schema written
|
|
/// by SchemaBuilder into a <see cref="ScriptShape"/>. Delegates to
|
|
/// <see cref="JsonSchemaShapeParser"/>, which also handles legacy flat-shape
|
|
/// rows during the transition window.
|
|
/// </summary>
|
|
public static class ScriptShapeParser
|
|
{
|
|
public static ScriptShape Parse(string name, string? parametersJson, string? returnJson)
|
|
{
|
|
var parameters = JsonSchemaShapeParser.ParseParameters(parametersJson);
|
|
var returnType = JsonSchemaShapeParser.ParseReturnType(returnJson);
|
|
return new ScriptShape(name, parameters, returnType);
|
|
}
|
|
}
|