Skip to content

Commit

Permalink
Schema (legacy): add units
Browse files Browse the repository at this point in the history
  • Loading branch information
PMeira committed Mar 5, 2024
1 parent 94b304e commit 9362666
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/CAPI/CAPI_Schema.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,7 @@ function prepareClassSchema(clsidx: Integer; cls: TDSSClass; enumIds: TClassName
poffset2: PtrInt;
param2: TJSONData;
prop: TJSONObject;
units: String;
begin
props := TJSONArray.Create();
localEnums := TJSONArray.Create();
Expand Down Expand Up @@ -1222,6 +1223,16 @@ function prepareClassSchema(clsidx: Integer; cls: TDSSClass; enumIds: TClassName
if (PropertyType[i] = TPropertyType.DeprecatedAndRemoved) or (TPropertyFlag.Deprecated in PropertyFlags[i]) then
prop.Add('deprecationMessage', PropertyDeprecatedMessage[i]);

units := extractUnits(PropertyFlags[i]);
if units <> '' then
begin
if units = 'ToD-hour' then
begin
units := 'hour (0-24)';
end;
prop.Add('units', units);
end;

props.Add(prop);
end;

Expand Down

0 comments on commit 9362666

Please sign in to comment.