diff --git a/schema/ifcx-quantity-kinds.tsp b/schema/ifcx-quantity-kinds.tsp index b9398272..49c0153a 100644 --- a/schema/ifcx-quantity-kinds.tsp +++ b/schema/ifcx-quantity-kinds.tsp @@ -3,6 +3,7 @@ enum QuantityKind { PlaneAngle: "Plane angle"; ThermodynamicTemperatue: "Thermodynamic temperature", + CelsiusTemperature: "Celsius temperature", ElectricCurrent: "Electric current", Time: "Time", Frequency: "Frequency", @@ -15,4 +16,7 @@ enum QuantityKind Energy: "Energy", Power: "Power", Volume: "Volume", + MassDensity: "Mass density", + ThermalConductivity: "Thermal conductivity", + ThermalTransmittance: "Thermal transmittance" } \ No newline at end of file diff --git a/schema/out/@typespec/openapi3/openapi.yaml b/schema/out/@typespec/openapi3/openapi.yaml index 310cbeec..49065eb4 100644 --- a/schema/out/@typespec/openapi3/openapi.yaml +++ b/schema/out/@typespec/openapi3/openapi.yaml @@ -150,6 +150,7 @@ components: enum: - Plane angle - Thermodynamic temperature + - Celsius temperature - Electric current - Time - Frequency @@ -162,6 +163,9 @@ components: - Energy - Power - Volume + - Mass density + - Thermal conductivity + - Thermal transmittance code: type: string pattern: diff --git a/src/utils/python/populate_schema.py b/src/utils/python/populate_schema.py index bce61bf9..686ee390 100644 --- a/src/utils/python/populate_schema.py +++ b/src/utils/python/populate_schema.py @@ -3,8 +3,22 @@ obj = json.load(open(sys.argv[1])) known_quants = { - "volume": {"quantityKind": "Volume"}, - "height": {"quantityKind": "Length"} + "planeAngle": {"quantityKind": "Plane angle"}, # Added + "thermodynamicTemperatue": {"quantityKind": "Thermodynamic temperatue"}, # Added + "celsiusTemperature": {"quantityKind": "Celsius temperature"}, # Added + "electricCurrent": {"quantityKind": "Electric current"}, # Added + "time": {"quantityKind": "Time"}, # Added + "frequency": {"quantityKind": "Frequency"}, # Added + "mass": {"quantityKind": "Mass"}, # Added + "length": {"quantityKind": "Length"}, # Changed "height" into "length" ! + "linearVelocity": {"quantityKind": "Linear velocity"}, # Added + "force": {"quantityKind": "Force"}, # Added + "pressure": {"quantityKind": "Pressure"}, # Added + "area": {"quantityKind": "Area"}, # Added + "volume": {"quantityKind": "Volume"}, + "massDensity": {"quantityKind": "Mass density"}, # Added + "thermalConductivity": {"quantityKind": "Thermal conductivity"}, # Added + "thermalTransmittance": {"quantityKind": "Thermal transmittance"} # Added } def make_schema(v, path=[]): diff --git a/src/viewer/compose-flattened.ts b/src/viewer/compose-flattened.ts index b41dd2eb..8d1bc5d0 100644 --- a/src/viewer/compose-flattened.ts +++ b/src/viewer/compose-flattened.ts @@ -33,14 +33,175 @@ function TreeNodeToComposedObject(path: string, node: PostCompositionNode, schem { let postfix = ""; let quantityKind = schema.value.quantityKind; - if (quantityKind === "Length") + + if (quantityKind === "Plane angle") // Added + { + postfix = String.fromCodePoint(0x00B0); + } + else if (quantityKind === "Thermodynamic temperature") // Added + { + postfix = String.fromCodePoint(0x00B0) + "K"; + } + else if (quantityKind === "Celsius temperature") // Added + { + postfix = String.fromCodePoint(0x00B0) + "C"; + } + else if (quantityKind === "Electric current") // Added + { + postfix = "A"; + } + else if (quantityKind === "Time") // Added + { + postfix = "s"; + } + else if (quantityKind === "Frequency") // Added + { + postfix = "Hz"; + } + else if (quantityKind === "Mass") // Added + { // Though the prefix "Kilo" starts with an uppercase letter, + postfix = "kg"; // the respective abbreviation/ SI-symbol doesn't/ isn't one + } // (unlike presented in 'quantity-kinds_source_table.xlsx') + else if (quantityKind === "Length") { postfix = "m"; } + else if (quantityKind === "Linear velocity") // Added + { + postfix = "m/s"; + } + else if (quantityKind === "Force") // Added + { + postfix = "N"; + } + else if (quantityKind === "Pressure") // Added + { + postfix = "Pa"; + } + else if (quantityKind === "Area") // Added + { + postfix = "m" + String.fromCodePoint(0x00B2); + } + else if (quantityKind === "Energy") // Added + { + postfix = "J"; + } + else if (quantityKind === "Power") // Added + { + postfix = "W"; + } else if (quantityKind === "Volume") { postfix = "m" + String.fromCodePoint(0x00B3); } + else if (quantityKind === "Mass density") // Added + { + postfix = "kg/m" + String.fromCodePoint(0x00B3); + } + else if (quantityKind === "Thermal conductivity") // Added + { + postfix = "W/mK"; + } + else if (quantityKind === "Thermal transmittance") // Added + { + postfix = "W/m" + String.fromCodePoint(0x00B2) + "K"; + } + +/* // Other option to the many "else if" - statements above + + switch(quantityKind) { + case "Plane angle": + { + postfix = String.fromCodePoint(0x00B0); + break; + } + case "Thermodynamic temperature": + { + postfix = String.fromCodePoint(0x00B0) + "K"; + break; + } + case "Celsius temperature": + { + postfix = String.fromCodePoint(0x00B0) + "C"; + break; + } + case "Electric current": + { + postfix = "A"; + break; + } + case "Time": + { + postfix = "s"; + break; + } + case "Frequency": + { + postfix = "Hz"; + break; + } + case "Mass": + { + postfix = "kg"; // Though the prefix "Kilo" starts with an uppercase letter, + break; // the respective abbreviation/ SI-symbol doesn't/ isn't one + } // (unlike presented in 'quantity-kinds_source_table.xlsx') + case "Length": + { + postfix = "m"; + break; + } + case "Linear velocity": + { + postfix = "m/s"; + break; + } + case "Force": + { + postfix = "N"; + break; + } + case "Pressure": + { + postfix = "Pa"; + break; + } + case "Area": + { + postfix = "m" + String.fromCodePoint(0x00B2); + break; + } + case "Energy": + { + postfix = "J"; + break; + } + case "Power": + { + postfix = "W"; + break; + } + case "Volume": + { + postfix = "m" + String.fromCodePoint(0x00B3); + break; + } + case "Mass density": + { + postfix = "kg/m" + String.fromCodePoint(0x00B3); + break; + } + case "Thermal conductivity": + { + postfix = "W/mK"; + break; + } + case "Thermal transmittance": + { + postfix = "W/m" + String.fromCodePoint(0x00B2) + "K"; + break; + } + } +*/ co.attributes[attrName] = `${attr} ${postfix}`; } else