Skip to content

Commit

Permalink
fix TOC?, remove references to math controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed Mar 28, 2024
1 parent 9ce0c36 commit 7c3c372
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 84 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Mycodo is open source software for the Raspberry Pi that couples inputs and outp
.. contents:: Table of Contents
:depth: 1


Quick Install
-------------

Expand Down
13 changes: 0 additions & 13 deletions mycodo/widgets/widget_gauge_angular.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,6 @@ def generate_page_variables(widget_unique_id, widget_options):
getLastDataGaugeAngular('{{each_widget.unique_id}}', '{{device_id}}', 'input', '{{measurement_id}}', {{widget_options['max_measure_age']}});
repeatLastDataGaugeAngular('{{each_widget.unique_id}}', '{{device_id}}', 'input', '{{measurement_id}}', {{widget_options['refresh_seconds']}}, {{widget_options['max_measure_age']}});
{%- endfor -%}
{% for each_math in math if each_math.unique_id == device_id %}
getLastDataGaugeAngular('{{each_widget.unique_id}}', '{{device_id}}', 'math', '{{measurement_id}}', {{widget_options['max_measure_age']}});
repeatLastDataGaugeAngular('{{each_widget.unique_id}}', '{{device_id}}', 'math', '{{measurement_id}}', {{widget_options['refresh_seconds']}}, {{widget_options['max_measure_age']}});
{%- endfor -%}
{% for each_function in function if each_function.unique_id == device_id %}
getLastDataGaugeAngular('{{each_widget.unique_id}}', '{{device_id}}', 'function', '{{measurement_id}}', {{widget_options['max_measure_age']}});
Expand Down Expand Up @@ -401,10 +396,6 @@ def generate_page_variables(widget_unique_id, widget_options):
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- for each_math in math if each_math.unique_id == device_id -%}
{{each_math.measure|safe}}
{%- endfor -%}
{%- for each_function in function if each_function.unique_id == device_id -%}
{{each_function.measure|safe}}
Expand Down Expand Up @@ -435,10 +426,6 @@ def generate_page_variables(widget_unique_id, widget_options):
{%- for each_input in input if each_input.unique_id == device_id -%}
{{' ' + dict_units[device_measurements_dict[measurement_id].unit]['unit']}}
{%- endfor -%}
{%- for each_math in math if each_math.unique_id == device_id -%}
{{' ' + each_math.measure_units|safe}}
{%- endfor -%}
{%- for each_function in function if each_function.unique_id == device_id -%}
{{' ' + each_function.measure_units|safe}}
Expand Down
25 changes: 0 additions & 25 deletions mycodo/widgets/widget_gauge_solid.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,6 @@ def generate_page_variables(widget_unique_id, widget_options):
getLastDataGaugeSolid('{{each_widget.unique_id}}', '{{device_id}}', 'input', '{{measurement_id}}', {{widget_options['max_measure_age']}});
repeatLastDataGaugeSolid('{{each_widget.unique_id}}', '{{device_id}}', 'input', '{{measurement_id}}', {{widget_options['refresh_seconds']}}, {{widget_options['max_measure_age']}});
{%- endfor -%}
{% for each_math in math if each_math.unique_id == device_id %}
getLastDataGaugeSolid('{{each_widget.unique_id}}', '{{device_id}}', 'math', '{{measurement_id}}', {{widget_options['max_measure_age']}});
repeatLastDataGaugeSolid('{{each_widget.unique_id}}', '{{device_id}}', 'math', '{{measurement_id}}', {{widget_options['refresh_seconds']}}, {{widget_options['max_measure_age']}});
{%- endfor -%}
{% for each_function in function if each_function.unique_id == device_id %}
getLastDataGaugeSolid('{{each_widget.unique_id}}', '{{device_id}}', 'function', '{{measurement_id}}', {{widget_options['max_measure_age']}});
Expand Down Expand Up @@ -408,16 +403,6 @@ def generate_page_variables(widget_unique_id, widget_options):
{{', ' + dict_measurements[device_measurements_dict[measurement_id].measurement]['name']}}
{%- endif -%}
{%- endfor -%}
{%- for each_math in math if each_math.unique_id == device_id and measurement_id in device_measurements_dict -%}
{{each_math.name}} (
{%- if not device_measurements_dict[measurement_id].single_channel -%}
{{'CH' + (device_measurements_dict[measurement_id].channel|int)|string}}
{%- endif -%}
{%- if device_measurements_dict[measurement_id].measurement -%}
{{', ' + dict_measurements[device_measurements_dict[measurement_id].measurement]['name']}}
{%- endif -%}
{%- endfor -%}
{%- for each_function in function if each_function.unique_id == device_id and measurement_id in device_measurements_dict -%}
{{each_function.name}} (
Expand Down Expand Up @@ -451,12 +436,6 @@ def generate_page_variables(widget_unique_id, widget_options):
return this.series.name + ':<b> ' + Highcharts.numberFormat(this.y, 2) + ' {{dict_units[device_measurements_dict[measurement_id].unit]['unit']}}</b><br>';
},
{%- endfor -%}
{%- for each_math in math if each_math.unique_id == device_id %}
pointFormatter: function () {
return this.series.name + '</span>:<b> ' + Highcharts.numberFormat(this.y, 2) + ' {{dict_units[device_measurements_dict[measurement_id].unit]['unit']}}</b><br>';
},
{%- endfor -%}
{%- for each_function in function if each_function.unique_id == device_id %}
pointFormatter: function () {
Expand All @@ -469,10 +448,6 @@ def generate_page_variables(widget_unique_id, widget_options):
{{' ' + dict_units[device_measurements_dict[measurement_id].unit]['unit']}}
{%- endfor -%}
{%- for each_math in math if each_math.unique_id == device_id -%}
{{' ' + dict_units[device_measurements_dict[measurement_id].unit]['unit']}}
{%- endfor -%}
{%- for each_function in function if each_function.unique_id == device_id -%}
{{' ' + dict_units[device_measurements_dict[measurement_id].unit]['unit']}}
{%- endfor -%}
Expand Down
5 changes: 0 additions & 5 deletions mycodo/widgets/widget_indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,6 @@
repeatLastDataIndicator('{{each_widget.unique_id}}', '{{each_input.unique_id}}', 'input', '{{measurement_id}}', {{widget_options['refresh_seconds']}}, {{widget_options['measurement_max_age']}}, {{each_widget.decimal_places}}, {{widget_options['option_invert']|int}});
{%- endfor -%}
{% for each_math in math if each_math.unique_id == device_id %}
getLastDataIndicator('{{each_widget.unique_id}}', '{{each_math.unique_id}}', 'math', '{{measurement_id}}', {{widget_options['measurement_max_age']}}, {{widget_options['decimal_places']}}, {{widget_options['option_invert']|int}});
repeatLastDataIndicator('{{each_widget.unique_id}}', '{{each_math.unique_id}}', 'math', '{{measurement_id}}', {{widget_options['refresh_seconds']}}, {{widget_options['measurement_max_age']}}, {{each_widget.decimal_places}}, {{widget_options['option_invert']|int}});
{%- endfor -%}
{% for each_output in output if each_output.unique_id == device_id %}
getLastDataIndicator('{{each_widget.unique_id}}', '{{each_output.unique_id}}', 'output', '{{channel_id}}', {{widget_options['measurement_max_age']}}, {{widget_options['decimal_places']}}, {{widget_options['option_invert']|int}});
repeatLastDataIndicator('{{each_widget.unique_id}}', '{{each_output.unique_id}}', 'output', '{{channel_id}}', {{widget_options['refresh_seconds']}}, {{widget_options['measurement_max_age']}}, {{each_widget.decimal_places}}, {{widget_options['option_invert']|int}});
Expand Down
43 changes: 2 additions & 41 deletions mycodo/widgets/widget_measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@

'widget_dashboard_head': """<!-- No head content -->""",

'widget_dashboard_title_bar': """<span style="padding-right: 0.5em; font-size: {{each_widget.font_em_name}}em">{{each_widget.name}}</span>""",
'widget_dashboard_title_bar': """<span class="widget-title-bar" style="padding-right: 0.5em; font-size: {{each_widget.font_em_name}}em">{{each_widget.name}}</span>""",

'widget_dashboard_body': """
{%- set device_id = widget_options['measurement'].split(",")[0] -%}
Expand All @@ -152,7 +152,7 @@
{%- for each_input in input if each_input.unique_id == device_id and measurement_id in device_measurements_dict -%}
<span style="font-size: {{widget_options['font_em_value']}}em" id="value-{{each_widget.unique_id}}"></span><span style="font-size: {{widget_options['font_em_unit']}}em">
<span class="widget-measurement-value" style="font-size: {{widget_options['font_em_value']}}em" id="value-{{each_widget.unique_id}}"></span><span class="widget-measurement-unit" style="font-size: {{widget_options['font_em_unit']}}em">
{%- if dict_measure_units[measurement_id] in dict_units and
dict_units[dict_measure_units[measurement_id]]['unit'] and
widget_options['enable_unit'] -%}
Expand Down Expand Up @@ -183,40 +183,6 @@
{{')'}}
{%- endif -%}
{%- endfor -%}
{%- for each_math in math if each_math.unique_id == device_id and measurement_id in device_measurements_dict -%}
<span style="font-size: {{widget_options['font_em_value']}}em" id="value-{{each_widget.unique_id}}"></span><span style="font-size: {{widget_options['font_em_unit']}}em">
{%- if dict_measure_units[measurement_id] in dict_units and
dict_units[dict_measure_units[measurement_id]]['unit'] and
widget_options['enable_unit'] -%}
{{' ' + dict_units[dict_measure_units[measurement_id]]['unit']}}
{%- endif -%}
</span>
{%- if widget_options['enable_name'] or widget_options['enable_channel'] or widget_options['enable_measurement'] -%}
<br/><span style="font-size: {{widget_options['font_em_timestamp']}}em">
{%- endif -%}
{%- if widget_options['enable_name'] -%}
{{each_math.name + ' '}}
{%- endif -%}
{%- if widget_options['enable_channel'] or widget_options['enable_measurement'] -%}
{{'('}}
{%- endif -%}
{%- if not device_measurements_dict[measurement_id].single_channel and widget_options['enable_channel'] -%}
{{'CH' + (device_measurements_dict[measurement_id].channel|int)|string}}
{%- endif -%}
{%- if widget_options['enable_channel'] and widget_options['enable_measurement'] -%}
{{', '}}
{%- endif -%}
{%- if widget_options['enable_measurement'] and device_measurements_dict[measurement_id].measurement -%}
{{dict_measurements[device_measurements_dict[measurement_id].measurement]['name']}}
{%- endif -%}
{%- if widget_options['enable_channel'] or widget_options['enable_measurement'] -%}
{{')'}}
{%- endif -%}
{%- endfor -%}
{%- for each_function in function if each_function.unique_id == device_id and measurement_id in device_measurements_dict -%}
Expand Down Expand Up @@ -413,11 +379,6 @@
getLastDataMeasurement('{{each_widget.unique_id}}', '{{each_input.unique_id}}', 'input', '{{measurement_id}}', {{widget_options['measurement_max_age']}}, {{widget_options['decimal_places']}});
repeatLastDataMeasurement('{{each_widget.unique_id}}', '{{each_input.unique_id}}', 'input', '{{measurement_id}}', {{widget_options['refresh_seconds']}}, {{widget_options['measurement_max_age']}}, {{widget_options['decimal_places']}});
{%- endfor -%}
{% for each_math in math if each_math.unique_id == device_id %}
getLastDataMeasurement('{{each_widget.unique_id}}', '{{each_math.unique_id}}', 'math', '{{measurement_id}}', {{widget_options['measurement_max_age']}}, {{widget_options['decimal_places']}});
repeatLastDataMeasurement('{{each_widget.unique_id}}', '{{each_math.unique_id}}', 'math', '{{measurement_id}}', {{widget_options['refresh_seconds']}}, {{widget_options['measurement_max_age']}}, {{widget_options['decimal_places']}});
{%- endfor -%}
{% for each_function in function if each_function.unique_id == device_id %}
getLastDataMeasurement('{{each_widget.unique_id}}', '{{each_function.unique_id}}', 'function', '{{measurement_id}}', {{widget_options['measurement_max_age']}}, {{widget_options['decimal_places']}});
Expand Down

0 comments on commit 7c3c372

Please sign in to comment.