Skip to content

Commit

Permalink
Merge pull request #330 from andlaus/random_fixes
Browse files Browse the repository at this point in the history
Random fixes
  • Loading branch information
andlaus authored Aug 9, 2024
2 parents 3c18607 + 21f784d commit 9af7857
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion odxtools/parameterinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,16 @@ def parameter_info(param_list: Iterable[Parameter], quoted_names: bool = False)
val_str = ""
if scale.lower_limit is not None:
val_str = f"({repr(scale.lower_limit.value)})"
of.write(f" {repr(scale.compu_const)}{val_str}\n")

if scale.compu_const is None:
of.write(f" <ERROR in ODX data: no value specified>\n")
else:
vt = scale.compu_const.vt
v = scale.compu_const.v
if vt is not None:
of.write(f" \"{vt}\" {val_str}\n")
else:
of.write(f" {v}\n")

elif isinstance(cm, IdenticalCompuMethod):
bdt = dop.physical_type.base_data_type
Expand Down
2 changes: 1 addition & 1 deletion odxtools/templates/macros/printCompuMethod.xml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{%- if limit_obj.value_raw is none %}
{#- #}/>
{%- else %}
{#- #}>{{- limit_obj.value_raw }}</{{tag_name}}>
{#- #}>{{- limit_obj.value_raw | e }}</{{tag_name}}>
{%- endif -%}
{%- endif -%}
{%- endmacro -%}
Expand Down

0 comments on commit 9af7857

Please sign in to comment.