commit af86d3f8b0ff5565b67ecd5a9a7cd7ec68066544
parent b9cc793277a126129a01dd5f8e0efdfa25e1f6ae
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Mon, 16 Jan 2023 17:47:01 +0100
Rename some fields in yaml files
Diffstat:
6 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/doc/city_generator2-input.5.txt b/doc/city_generator2-input.5.txt
@@ -85,17 +85,18 @@ _______
-------------------------------------
-<building> ::= " -id: " <name>
- " model: " <cmode-name>
- " data: " <dataset-name>
+<buildings> ::= " -name: " <name>
+ " construction_mode: " <cmode-name>
+ " dataset: " <dataset-name>
" height: " <height>
- " polygon: [" <vertices> "]" # At least 3 vertices
+ " footprint: [" <vertices> "]" # At least 3 vertices
<name> ::= STRING
-<cmode-name> ::= "construction_Mode_0" | "construction_Mode_1"
+<cmode-name> ::= "Construction_Mode_0" | "Construction_Mode_1"
-<dataset-name> ::= STRING
+<dataset-name> ::= STRING # The name must be found in a catalog file
+ # with the same construction mode
<height> ::= <REAL> # in ]0, INF)
@@ -129,18 +130,18 @@ _______
<catalog-file> ::= <catalog-file_0 > | <catalog-file_1>
<catalog-file-0> ::= <construction-mode-0>
- "sets:"
+ "datasets:"
<datasets-0>
<catalog-file-1> ::= <construction-mode-1>
- "sets:"
+ "datasets:"
<datasets-1>
-------------------------------------
-<construction-mode-0> ::= "construction_mode_type: construction_Mode_0"
+<construction-mode-0> ::= "construction_mode: Construction_Mode_0"
-<construction-mode-1> ::= "construction_mode_type: construction_Mode_1"
+<construction-mode-1> ::= "construction_mode: Construction_Mode_1"
-------------------------------------
diff --git a/doc/city_generator2.1.txt.in b/doc/city_generator2.1.txt.in
@@ -65,7 +65,7 @@ MANDATORY OPTIONS
*-m* _file_::
Read a city map file which is a text file in yaml 1.1 format containing the
description of the ground and a list of buildings. The description of an
- individual building include its footprint and construction mode among other
+ individual building includes its footprint and construction mode among other
things.
Please refer to *city_generator2-input*(5) for more information on formats.
diff --git a/src/cg_city_parsing_schemas.h b/src/cg_city_parsing_schemas.h
@@ -85,15 +85,15 @@ static const struct cyaml_schema_value double2_schema = {
};
static const cyaml_schema_field_t city_building_fields_schema[] = {
- CYAML_FIELD_STRING_PTR("id", /* TODO: rename "name" */
+ CYAML_FIELD_STRING_PTR("name",
CYAML_FLAG_POINTER, struct parsed_city_building, name, 0, CYAML_UNLIMITED),
- CYAML_FIELD_ENUM("model", /* TODO: rename "construction_mode" */
+ CYAML_FIELD_ENUM("construction_mode",
CYAML_FLAG_CASE_INSENSITIVE, struct parsed_city_building, cmode_type,
city_building_types_strings, CYAML_ARRAY_LEN(city_building_types_strings)),
- CYAML_FIELD_STRING_PTR("data", /* TODO: rename "parameter_set" */
+ CYAML_FIELD_STRING_PTR("dataset",
CYAML_FLAG_POINTER, struct parsed_city_building, dataset_name, 0, CYAML_UNLIMITED),
{
- .key = "polygon", /*TODO: rename "external_polygon" */
+ .key = "footprint",
.value = {
.type = CYAML_SEQUENCE,
.flags = CYAML_FLAG_POINTER | CYAML_FLAG_FLOW,
@@ -123,7 +123,7 @@ static const cyaml_schema_field_t city_fields_schema[] = {
CYAML_FIELD_MAPPING("ground", CYAML_FLAG_DEFAULT,
struct parsed_city, ground, ground_fields_schema),
{
- .key = "building", /* TODO: rename "buildings" */
+ .key = "buildings",
.value = {
.type = CYAML_SEQUENCE,
.flags = CYAML_FLAG_POINTER,
diff --git a/src/cg_construction_mode_0_parsing_schemas.h b/src/cg_construction_mode_0_parsing_schemas.h
@@ -60,7 +60,7 @@ static const struct cyaml_schema_value dataset_cmode_0_schema = {
static const cyaml_schema_field_t cmode_0_fields_schemas[] = {
CYAML_FIELD_IGNORE("contructive_mode_type", CYAML_FLAG_DEFAULT),
{
- .key = "sets",
+ .key = "datasets",
.value = {
.type = CYAML_SEQUENCE,
.flags = CYAML_FLAG_POINTER,
diff --git a/src/cg_construction_mode_1_parsing_schemas.h b/src/cg_construction_mode_1_parsing_schemas.h
@@ -95,7 +95,7 @@ static const struct cyaml_schema_value dataset_cmode_1_schema = {
static const cyaml_schema_field_t cmode_1_fields_schemas[] = {
CYAML_FIELD_IGNORE("contructive_mode_type", CYAML_FLAG_DEFAULT),
{
- .key = "sets",
+ .key = "datasets",
.value = {
.type = CYAML_SEQUENCE,
.flags = CYAML_FLAG_POINTER,
diff --git a/src/cg_construction_modes_parsing_schemas.h b/src/cg_construction_modes_parsing_schemas.h
@@ -48,7 +48,7 @@ static const cyaml_schema_field_t construction_mode_fields_schemas[] = {
CYAML_FIELD_ENUM("contructive_mode_type",
CYAML_FLAG_CASE_INSENSITIVE, struct parsed_cmode, cmode_type,
city_building_types_strings, CYAML_ARRAY_LEN(city_building_types_strings)),
- CYAML_FIELD_IGNORE("sets", CYAML_FLAG_DEFAULT),
+ CYAML_FIELD_IGNORE("datasets", CYAML_FLAG_DEFAULT),
CYAML_FIELD_END
};