Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Update json.cpp #770

Merged
merged 4 commits into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ jobs:
run: make -j10 system
- name: Validate build
run: |
gridlabd -D keep_progress=TRUE -T 0 --validate
utilities/save_validation_errors || true
gridlabd -D keep_progress=TRUE -T 0 --validate || utilities/save_validation_errors
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
Expand Down
10 changes: 7 additions & 3 deletions gldcore/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,16 +273,20 @@ int GldJsonWriter::write_classes(FILE *fp)
}
if ( prop->unit != NULL )
{
write(",\n\t\t\t\t\"unit\" : \"%s\"",prop->unit->name);
len += write(",\n\t\t\t\t\"unit\" : \"%s\"",prop->unit->name);
}
if ( prop->default_value != NULL )
{
PROPERTYSPEC *spec = property_getspec(prop->ptype);
if ( spec != NULL && prop->default_value != spec->default_value )
{
write(",\n\t\t\t\t\"default\" : \"%s\"",prop->default_value);
len += write(",\n\t\t\t\t\"default\" : \"%s\"",prop->default_value);
}
}
if ( prop->description != NULL )
{
len += write(",\n\t\t\t\t\"description\" : \"%s\"",prop->description);
}
len += write("\n\t\t\t}");
}
len += write("\n\t\t}");
Expand Down Expand Up @@ -612,7 +616,7 @@ int GldJsonWriter::write_output(FILE *fp)
int len = 0;
json = fp;
len += write("{\t\"application\": \"gridlabd\",\n");
len += write("\t\"version\" : \"%u.%u.%u\"",global_version_major,global_version_minor,version);
len += write("\t\"version\" : \"%u.%u.%u\"",global_version_major,global_version_minor,global_version_patch);
if ( (global_filesave_options&FSO_MODULES) == FSO_MODULES )
{
len += write_modules(fp);
Expand Down