Skip to content
Merged
8 changes: 4 additions & 4 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"uuid": "^14.0.0",
"vite": "^6.3.5"
"vite": "^6.4.5"
}
}
88 changes: 49 additions & 39 deletions client/src/data/templates.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"libraries": {
"Buildings": "14.0.0"
"Buildings": "15.0.0"
},
"templates": [
{
Expand Down Expand Up @@ -241,6 +241,7 @@
"replaceable": false,
"options": [
"Buildings.Templates.Components.Actuators.Valve.typ",
"Buildings.Templates.Components.Actuators.Valve.l",
"Buildings.Templates.Components.Actuators.Valve.is_twoWay",
"Buildings.Templates.Components.Actuators.Valve.is_thrWay",
"Buildings.Templates.Components.Actuators.Valve.is_actTwo",
Expand Down Expand Up @@ -390,6 +391,20 @@
"Buildings.Templates.Components.Types.Valve"
]
},
{
"modelicaPath": "Buildings.Templates.Components.Actuators.Valve.l",
"type": "Real",
"name": "Valve leakage, l=Kv(y=0)/Kv(y=1)",
"group": "Configuration",
"tab": "",
"visible": true,
"enable": false,
"modifiers": {},
"replaceable": false,
"options": [],
"definition": false,
"shortExclType": false
},
{
"modelicaPath": "Buildings.Templates.Components.Actuators.Valve.is_twoWay",
"type": "Boolean",
Expand Down Expand Up @@ -794,13 +809,7 @@
{
"operator": "if",
"operands": [
{
"operator": "==",
"operands": [
"typ",
"Buildings.Templates.Components.Types.Valve.TwoWayModulating"
]
},
"is_twoWay",
{
"operator": "!=",
"operands": [
Expand Down Expand Up @@ -930,13 +939,13 @@
"tab": "",
"visible": false,
"modifiers": {
"realTrue": {
"expression": 1,
"final": true
},
"realFalse": {
"expression": 0,
"final": true
},
"realTrue": {
"expression": 1,
"final": true
}
},
"replaceable": false,
Expand Down Expand Up @@ -1062,13 +1071,13 @@
"tab": "",
"visible": false,
"modifiers": {
"t": {
"expression": 0.99,
"final": false
},
"h": {
"expression": 0.005,
"final": false
},
"t": {
"expression": 0.99,
"final": false
}
},
"replaceable": false,
Expand Down Expand Up @@ -1183,13 +1192,13 @@
"tab": "",
"visible": false,
"modifiers": {
"t": {
"expression": 0.01,
"final": false
},
"h": {
"expression": 0.005,
"final": false
},
"t": {
"expression": 0.01,
"final": false
}
},
"replaceable": false,
Expand Down Expand Up @@ -1308,20 +1317,12 @@
"final": true,
"redeclare": "Buildings.Fluid.Interfaces.PartialTwoPort.Medium"
},
"m_flow_nominal": {
"expression": "m_flow_nominal",
"final": true
},
"dp_nominal": {
"expression": "dpFixed_nominal",
"final": true
},
"allowFlowReversal": {
"expression": "allowFlowReversal",
"final": true
},
"show_T": {
"expression": "show_T",
"dp_nominal": {
"expression": "dpFixed_nominal",
"final": true
},
"from_dp": {
Expand All @@ -1331,6 +1332,14 @@
"linearized": {
"expression": "linearized",
"final": true
},
"m_flow_nominal": {
"expression": "m_flow_nominal",
"final": true
},
"show_T": {
"expression": "show_T",
"final": true
}
},
"replaceable": false,
Expand Down Expand Up @@ -2171,6 +2180,7 @@
"kindOfClass": "model",
"options": [
"Buildings.Templates.Components.Actuators.Valve.typ",
"Buildings.Templates.Components.Actuators.Valve.l",
"Buildings.Templates.Components.Actuators.Valve.is_twoWay",
"Buildings.Templates.Components.Actuators.Valve.is_thrWay",
"Buildings.Templates.Components.Actuators.Valve.is_actTwo",
Expand Down Expand Up @@ -13190,7 +13200,7 @@
{
"modelicaPath": "Buildings.Templates.ZoneEquipment.Components.Controls.G36VAVBoxReheat.have_reqNeeHea",
"type": "Boolean",
"value": false,
"value": true,
"name": "Set to true if the controller generates a 'Need Heat' request",
"group": "Configuration",
"tab": "",
Expand Down Expand Up @@ -13235,7 +13245,7 @@
{
"modelicaPath": "Buildings.Templates.ZoneEquipment.Components.Interfaces.ControllerG36VAVBox.have_reqNeeCoo",
"type": "Boolean",
"value": false,
"value": true,
"name": "Set to true if the controller generates a 'Need Cool' request",
"group": "Configuration",
"tab": "",
Expand Down Expand Up @@ -14531,7 +14541,7 @@
"value": 120,
"name": "Sample period of component, set to the same value as the trim and respond that process static pressure reset",
"group": "",
"tab": "Time-based suppresion",
"tab": "Time-based suppression",
"visible": true,
"enable": true,
"modifiers": {},
Expand All @@ -14546,7 +14556,7 @@
"value": 540,
"name": "Gain factor to calculate suppression time based on the change of the setpoint, seconds per Kelvin",
"group": "",
"tab": "Time-based suppresion",
"tab": "Time-based suppression",
"visible": true,
"enable": true,
"modifiers": {},
Expand All @@ -14561,7 +14571,7 @@
"value": 1800,
"name": "Maximum suppression time",
"group": "",
"tab": "Time-based suppresion",
"tab": "Time-based suppression",
"visible": true,
"enable": true,
"modifiers": {},
Expand Down Expand Up @@ -16151,7 +16161,7 @@
"value": 120,
"name": "Sample period of component, set to the same value as the trim and respond that process static pressure reset",
"group": "",
"tab": "Time-based suppresion",
"tab": "Time-based suppression",
"visible": true,
"enable": true,
"modifiers": {},
Expand All @@ -16166,7 +16176,7 @@
"value": 540,
"name": "Gain factor to calculate suppression time based on the change of the setpoint, seconds per Kelvin",
"group": "",
"tab": "Time-based suppresion",
"tab": "Time-based suppression",
"visible": true,
"enable": true,
"modifiers": {},
Expand All @@ -16181,7 +16191,7 @@
"value": 1800,
"name": "Maximum suppression time",
"group": "",
"tab": "Time-based suppresion",
"tab": "Time-based suppression",
"visible": true,
"enable": true,
"modifiers": {},
Expand Down Expand Up @@ -21131,7 +21141,7 @@
{
"modelicaPath": "Buildings.Controls.OBC.ASHRAE.G36.TerminalUnits.CoolingOnly.Controller.timSup",
"type": "Buildings.Controls.OBC.ASHRAE.G36.Generic.TimeSuppression",
"name": "Specify suppresion time due to the setpoint change and check if it has passed the suppresion period",
"name": "Specify suppression time due to the setpoint change and check if it has passed the suppression period",
"group": "",
"tab": "",
"visible": false,
Expand Down
2 changes: 2 additions & 0 deletions docs/sequence-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ The annotation is enclosed in square brackets `[]`

The annotation text and ONLY the annotation text (which includes the brackets) has a style applied: `Toggle`. This style is used as an identifier by the sequence document generation script to find annotations.

An annotation is a continuous stretch of text with the `Toggle` style within one paragraph: text with another style ends it. A Word comment anchored on an annotation, e.g. on a short ID, does not split it. A section removed by an annotation is removed with the comments anchored in it.

### Example Annotations:

+ `[YES CO2]` – Keep this section if a configuration has a CO2 sensor. Otherwise remove.
Expand Down
18 changes: 9 additions & 9 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 26 additions & 6 deletions server/scripts/sequence-doc/src/mogrifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
BOOKMARK_TAGS = ['{http://schemas.openxmlformats.org/wordprocessingml/2006/main}bookmarkEnd', "{http://schemas.openxmlformats.org/wordprocessingml/2006/main}bookmarkStart"]
SECTION_TAG = ["{http://schemas.openxmlformats.org/wordprocessingml/2006/main}sectPr"]
TABLE_TAG = '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}tbl'
W_NS = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'
RUN_PROPERTIES_TAG = f'{{{W_NS}}}rPr'
COMMENT_REFERENCE_TAG = f'{{{W_NS}}}commentReference'
ANNOTATION_STYLE = 'Toggle'
UNITS_SHORT_NAME = 'UNITS'

Expand Down Expand Up @@ -161,26 +164,40 @@ def get_column(table: Table, table_cell):
if cell.text == table_cell.text:
return column

def is_comment_reference(run):
''' True if the run only holds the reference mark of a comment, which is
not text of the document (docs/sequence-doc.md, "Annotations")
'''
content = [child for child in run.element if child.tag != RUN_PROPERTIES_TAG]
return len(content) == 1 and content[0].tag == COMMENT_REFERENCE_TAG

def create_control_structures(doc):
''' Sets up the control structure for Sections and Tables
'''
control_structures = []
run_op_lookup = {}

def close(annotation):
''' Adds an annotation once its last run is read '''
if annotation:
annotation['text'] = annotation['text'].strip()
if annotation['text']:
control_structures.append(annotation)

current = None

## Sections
for para in doc.paragraphs:
for run in para.runs:
if is_comment_reference(run):
continue
run_style_name = get_run_style_name(run)
if (
(current and run_style_name != ANNOTATION_STYLE)
or
(current and para is not current['paragraph'])
):
current['text'] = current['text'].strip()
if current['text']:
control_structures.append(current)
close(current)
current = None

if not current and run_style_name == ANNOTATION_STYLE:
Expand All @@ -195,22 +212,24 @@ def create_control_structures(doc):
run_op_lookup[run.element] = current
current['runs'].append(run)
current['text'] += run.text
close(current)
current = None

## Tables
for table in doc.tables:
for row in table.rows:
for cell in row.cells:
for para in cell.paragraphs:
for run in para.runs:
if is_comment_reference(run):
continue
run_style_name = get_run_style_name(run)
if (
(current and run_style_name != ANNOTATION_STYLE)
or
(current and para is not current['paragraph'])
):
current['text'] = current['text'].strip()
if current['text']:
control_structures.append(current)
close(current)
current = None

if not current and run_style_name == ANNOTATION_STYLE:
Expand All @@ -229,6 +248,7 @@ def create_control_structures(doc):
run.op = current
current['runs'].append(run)
current['text'] += run.text
close(current)

for op in control_structures:
tokens = utils.remove_empty_strings(re.split(r'\W+', op['text']))
Expand Down
Binary file not shown.
Loading