setting output screen logic

This commit is contained in:
Vitor Henrique
2021-01-03 15:01:52 -06:00
parent 9f5dc0ae71
commit 0aa0c14a4b
12 changed files with 173 additions and 136 deletions

View File

@@ -111,7 +111,7 @@
<!-- /ko -->
<!-- ko if: ($data.output_type() == "pwm" ) -->
<!-- <div class="control-group">
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: pwm_temperature_linked"> {{ _('Link PWM to Temperature') }}
@@ -121,11 +121,11 @@
duty cycle when print is complete.
</span>
</div>
</div> -->
</div>
<!-- /ko -->
<!-- ko if: ($data.output_type() == "pwm" && $data.pwm_temperature_linked()) -->
<!-- <div class="control-group">
<div class="control-group">
<label class="control-label">{{ _('Duty A') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: duty_a">
@@ -148,7 +148,7 @@
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: temperature_b">
</div>
</div> -->
</div>
<!-- /ko -->
<!-- ko if: ($data.output_type() == "regular" || ($data.output_type() == "pwm" && !$data.pwm_temperature_linked()) ) -->
@@ -253,41 +253,41 @@
<!-- /ko -->
<!-- ko if: ($data.output_type() == "regular" || $data.output_type() == "temp_hum_control" ) -->
<!-- <div class="control-group">
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: active_low"> {{ _('Active Low') }}
</label>
<span class="help-inline">Active low means that the GPIO will turn on when receive a low signal (ground) from Raspberry PI</span>
</div>
</div> -->
</div>
<!-- /ko -->
<!-- ko if: ($data.output_type() == "regular" || $data.output_type() == "gcode_output" || $data.output_type() == "shell_output" || $data.output_type() == "ledstrip") -->
<!-- <div class="control-group">
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: hide_btn_ui"> {{ _('Hide UI Button') }}
</label>
<span class="help-inline">If you plan to use a physical button (INPUT) and want to hide the button from enclosure tab check this.</span>
</div>
</div> -->
</div>
<!-- ko ifnot: ($data.output_type() == "ledstrip") -->
<!-- <div class="control-group">
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: show_on_navbar"> {{ _('Show Button on Navbar') }}
</label>
<span class="help-inline">Add shortcut on navbar to toggle output</span>
</div>
</div> -->
</div>
<!-- /ko -->
<!-- /ko -->
<!-- ko if: ($data.output_type() == "temperature_alarm" || $data.output_type() == "temp_hum_control" || ($data.output_type() == "pwm" && $data.pwm_temperature_linked())) -->
<!-- ko if: ($data.temp_ctr_type() == "heater" || $data.temp_ctr_type() == "cooler" || ($data.output_type() == "pwm" && $data.pwm_temperature_linked())) -->
<!-- <div class="control-group">
<div class="control-group">
<label class="control-label">Temperature Sensor</label>
<div class="controls">
<select data-bind="options: $root.settings_temperature_sensors, optionsText: 'label',
@@ -295,10 +295,10 @@
</select>
<span class="help-inline">Temperature sensor responsible for geting the value to be used. Configured on the input side of the plugin.</span>
</div>
</div> -->
</div>
<!-- /ko -->
<!-- ko if: ($data.temp_ctr_type() == "dehumidifier") -->
<!-- <div class="control-group">
<div class="control-group">
<label class="control-label">Temperature Sensor</label>
<div class="controls">
<select data-bind="options: $root.settings_hum_sensors, optionsText: 'label',
@@ -306,12 +306,12 @@
</select>
<span class="help-inline">Temperature sensor responsible for geting the value to be used. Configured on the input side of the plugin.</span>
</div>
</div> -->
</div>
<!-- /ko -->
<!-- /ko -->
<!-- ko if: ($data.output_type() == "temp_hum_control") -->
<!-- <div class="control-group">
<div class="control-group">
<label class="control-label">{{ _('Temp Control Type') }}</label>
<div class="controls">
<label class="radio">
@@ -325,7 +325,7 @@
<label class="radio">
<input type="radio" value="dehumidifier" name="optradio" data-bind="checked: temp_ctr_type"> {{ _('Dehumidifier') }}</label>
</div>
</div> -->
</div>
<!-- ko if: ($data.auto_startup() || $data.startup_with_server())-->
<!-- <div class="control-group">
@@ -346,18 +346,18 @@
</div> -->
<!-- ko if: ($data.temp_ctr_type() == "heater") -->
<!-- <div class="control-group">
<div class="control-group">
<label class="control-label">{{ _('Maximum Temperature') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: temp_ctr_max_temp">
<span class="help-inline">Maximun temperature that the enclosure should reach, if this temperature is hit, the heater will be disabled until
it's set temperature is set again.</span>
</div>
</div> -->
</div>
<!-- /ko -->
<!-- /ko -->
<!-- ko if: ($data.output_type() == "temperature_alarm") -->
<!-- <div data-bind="attr: {id: 'temp_controlled_' + $index() }">
<div data-bind="attr: {id: 'temp_controlled_' + $index() }">
<div class="control-group">
<label class="control-label">{{ _('Set Temperature') }}</label>
<div class="controls">
@@ -384,7 +384,7 @@
<span class="help-inline">When the event happen, you want to turn the controlled IO HIGH or LOW?</span>
</div>
</div>
</div> -->
</div>
<!-- /ko -->
<!-- ko if: ($data.output_type() == "pwm") -->
<!-- <div class="control-group">

View File

@@ -39,6 +39,7 @@ $(function () {
self.temperature_b = ko.observable();
self.pwm_frequency = ko.observable();
self.default_duty_cycle = ko.observable();
self.pwm_linked_temp_sensor = ko.observable();
// led strip output
self.led_trip_gpio_clk = ko.observable()
self.led_strip_gpio_data = ko.observable()
@@ -92,6 +93,10 @@ $(function () {
};
self.showColorPicker = function(){
};
self.toOutputData = function () {
var output_data = {
index_id: "",

View File

@@ -29,7 +29,7 @@
</div>
<div class="controls">
<label class="radio">
<input type="radio" name="output_type_radio" value="neopixel" data-bind="checked: outputEditor.output_type"> {{ _('NeoPixel Direct') }}
<input type="radio" name="output_type_radio" value="neopixel" data-bind="checked: outputEditor.output_type"> {{ _('NeoPixel') }}
</span>
</label>
</div>

View File

@@ -7,7 +7,7 @@
<span class="help-inline">GPIO number that will be controlled.</span>
</div>
</div>
<!-- ko if: (outputEditor.output_type() == "regular" || outputEditor.output_type() == "temp_hum_control" ) -->
<div class="control-group">
<div class="controls">
<label class="checkbox">
@@ -16,5 +16,6 @@
<span class="help-inline">Active low means that the GPIO will turn on when receive a low signal (ground) from Raspberry PI</span>
</div>
</div>
<!-- /ko -->
</form>

View File

@@ -6,7 +6,7 @@
<input type="text" class="input-block-level" data-bind="value: outputEditor.led_trip_gpio_clk">
<span class="help-inline">Choose any GPIO pin to provide the Clock signal</span>
</div>
<label class="control-label">{{ _('DAT') }}</label>
<label class="control-label">{{ _('DATA') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.led_strip_gpio_data">
<span class="help-inline">Choose any GPIO pin to provide the Data</span>
@@ -15,7 +15,7 @@
<div class="control-group">
<label class="control-label">{{ _('Color') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.default_led_strip_color, click: $root.showColorPicker()">
<input type="text" class="input-block-level" data-bind="value: outputEditor.default_led_strip_color, click: outputEditor.showColorPicker()">
<span class="help-inline">Value needs to follow the format rgb(value_red,value_green,value_blue) where values should be between 0 and 255</span>
</div>
</div>

View File

@@ -34,16 +34,20 @@
<!-- /ko -->
<!-- ko if: (outputEditor.output_type() == "temperature_alarm") -->
<li><a href="#settings_outputs_edit_dialog_temperature_alarm" data-toggle="tab">{{ _('Temperature Alarm) }}</a></li>
<li><a href="#settings_outputs_edit_dialog_temperature_alarm" data-toggle="tab">{{ _('Temperature Alarm') }}</a></li>
<!-- /ko -->
<!-- ko if: (outputEditor.output_type() == "shell_output") -->
<li><a href="#settings_outputs_edit_dialog_shell_output" data-toggle="tab">{{ _('Shell Output') }}</a></li>
<!-- /ko -->
<!-- ko ifnot: (outputEditor.output_type() == "gcode_output" || outputEditor.output_type() == "temperature_alarm" || outputEditor.output_type() == "shell_output") -->
<li><a href="#settings_outputs_edit_dialog_schedule" data-toggle="tab">{{ _('Schedule') }}</a></li>
<!-- /ko -->
<!-- ko if: (outputEditor.output_type() == "regular" || outputEditor.output_type() == "gcode_output" || outputEditor.output_type() == "shell_output") -->
<li><a href="#settings_outputs_edit_dialog_other" data-toggle="tab">{{ _('Other') }}</a></li>
<!-- /ko -->
</ul>
@@ -73,7 +77,7 @@
</div>
<div id="settings_outputs_edit_dialog_temp_hum_control" class="tab-pane">
{% include "output_editor/temp_control_output.jinja2" %}
{% include "output_editor/temp_hum_control_output.jinja2" %}
</div>
<div id="settings_outputs_edit_dialog_temperature_alarm" class="tab-pane">
@@ -85,11 +89,11 @@
</div>
<div id="settings_outputs_edit_dialog_schedule" class="tab-pane">
{% include "output_editor/shell_script_output.jinja2" %}
{% include "output_editor/schedule_config.jinja2" %}
</div>
<div id="settings_outputs_edit_dialog_other" class="tab-pane">
{% include "output_editor/shell_script_output.jinja2" %}
{% include "output_editor/other_config.jinja2" %}
</div>
</div>

View File

@@ -17,7 +17,7 @@
<div class="control-group">
<label class="control-label">{{ _('Default Color') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.default_neopixel_color, attr: {name: 'colorpicker' } , click: $root.showColorPicker()">
<input type="text" class="input-block-level" data-bind="value: outputEditor.default_neopixel_color, attr: {name: 'colorpicker' } , click: outputEditor.showColorPicker()">
<span class="help-inline">Value needs to follow the format rgb(value_red,value_green,value_blue) where values should be between 0 and 255</span>
</div>
</div>

View File

@@ -1,21 +1,22 @@
<form class="form-horizontal">
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: outputEditor.hide_btn_ui"> {{ _('Hide UI Button') }}
</label>
<span class="help-inline">If you plan to use a physical button (INPUT) and want to hide the button from enclosure tab check this.</span>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: outputEditor.hide_btn_ui"> {{ _('Hide UI Button') }}
</label>
<span class="help-inline">If you plan to use a physical button (INPUT) and want to hide the button from enclosure
tab check this.</span>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: outputEditor.show_on_navbar"> {{ _('Show Button on Navbar') }}
</label>
<span class="help-inline">Add shortcut on navbar to toggle output</span>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: outputEditor.show_on_navbar"> {{ _('Show Button on Navbar') }}
</label>
<span class="help-inline">Add shortcut on navbar to toggle output</span>
</div>
</div>
</form>
</form>

View File

@@ -1,54 +1,70 @@
<form class="form-horizontal">
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: outputEditor.pwm_temperature_linked"> {{ _('Link PWM to Temperature') }}
</label>
<span class="help-inline">Link PWM ouput to temperature. PWM output will be interpolated between the point from duty A, temperature A -> duty
B, temperature B. This output will automatically start when a print starts and will default to the default
duty cycle when print is complete.
</span>
</div>
</div>
<div class="control-group">
<label class="control-label">{{ _('Duty A') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.duty_a">
</div>
</div>
<div class="control-group">
<label class="control-label">{{ _('Temperature A') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.temperature_a">
</div>
</div>
<div class="control-group">
<label class="control-label">{{ _('Duty B') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.duty_b">
</div>
</div>
<div class="control-group">
<label class="control-label">{{ _('Temperature B') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.temperature_b">
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: outputEditor.pwm_temperature_linked">
{{ _('Link PWM to Temperature') }}
</label>
<span class="help-inline">Link PWM ouput to temperature. PWM output will be interpolated between the point from
duty A, temperature A -> duty
B, temperature B. This output will automatically start when a print starts and will default to the default
duty cycle when print is complete.
</span>
</div>
</div>
<!-- ko if: outputEditor.pwm_temperature_linked -->
<div class="control-group">
<label class="control-label">Temperature Sensor</label>
<div class="controls">
<select data-bind="options: $root.settings_hum_sensors, optionsText: 'label',
optionsValue: 'index_id', value: outputEditor.pwm_linked_temp_sensor">
</select>
<span class="help-inline">Temperature sensor responsible for getting the value to be used. Configured on the
input side of the plugin.</span>
</div>
</div>
<div class="control-group">
<label class="control-label">{{ _('Duty A') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.duty_a">
</div>
</div>
<div class="control-group">
<label class="control-label">{{ _('Temperature A') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.temperature_a">
</div>
</div>
<div class="control-group">
<label class="control-label">{{ _('Duty B') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.duty_b">
</div>
</div>
<div class="control-group">
<label class="control-label">{{ _('Temperature B') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.temperature_b">
</div>
</div>
<!-- /ko -->
<div class="control-group">
<label class="control-label">{{ _('PWM Frequency') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.pwm_frequency">
<span class="help-inline">Value is in Hz</span>
</div>
</div>
<div class="control-group">
<label class="control-label">{{ _('Default Duty Cycle') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.default_duty_cycle">
<span class="help-inline">Value is in percentage, between 0 and 100</span>
<!-- ko if: outputEditor.pwm_temperature_linked -->
<span class="help-inline">Default duty cycle that will be set if "auto shutdown" is enabled on the Schedule tab</span>
<!-- /ko -->
</div>
</div>
<div class="control-group">
<label class="control-label">{{ _('PWM Frequency') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.pwm_frequency">
<span class="help-inline">Value is in Hz</span>
</div>
</div>
<div class="control-group">
<label class="control-label">{{ _('Default Duty Cycle') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.default_duty_cycle">
<span class="help-inline">Value is in percentage, between 0 and 100</span>
</div>
</div>
</form>
</form>

View File

@@ -30,38 +30,35 @@
<!-- /ko -->
<!-- ko ifnot: ((outputEditor.output_type() == "regular" || outputEditor.output_type() == "pwm") && outputEditor.toggle_timer()) -->
<!-- ko ifnot: (outputEditor.output_type() == "gcode_output" || outputEditor.output_type() == "temperature_alarm" || outputEditor.output_type() == "shell_output") -->
<!-- ko ifnot: (outputEditor.output_type() == "pwm" && outputEditor.pwm_temperature_linked()) -->
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: outputEditor.startup_with_server"> {{ _('Start with server') }}
</label>
<span class="help-inline">Choose if output should turn on automatically when OctoPrint starts</span>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: outputEditor.auto_startup"> {{ _('Auto Startup') }}
</label>
<span class="help-inline">Choose if output should turn on automatically when print starts</span>
</div>
</div>
<!-- /ko -->
<!-- ko if: outputEditor.auto_startup -->
<div>
<!-- ko ifnot: (outputEditor.output_type() == "pwm" && outputEditor.pwm_temperature_linked()) -->
<div class="control-group">
<label class="control-label">{{ _('Startup Delay') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.startup_time_delay">
<span class="help-inline">Time delay in seconds to turn on GPIO when print starts</span>
<label class="checkbox">
<input type="checkbox" data-bind="checked: outputEditor.startup_with_server"> {{ _('Start with server') }}
</label>
<span class="help-inline">Choose if output should turn on automatically when OctoPrint starts</span>
</div>
</div>
</div>
<!-- /ko -->
<!-- /ko -->
<!-- ko ifnot: (outputEditor.output_type() == "gcode_output" || outputEditor.output_type() == "temperature_alarm" || outputEditor.output_type() == "shell_output") -->
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: outputEditor.auto_startup"> {{ _('Auto Startup') }}
</label>
<span class="help-inline">Choose if output should turn on automatically when print starts</span>
</div>
</div>
<!-- /ko -->
<!-- ko if: outputEditor.auto_startup -->
<div>
<div class="control-group">
<label class="control-label">{{ _('Startup Delay') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.startup_time_delay">
<span class="help-inline">Time delay in seconds to turn on GPIO when print starts</span>
</div>
</div>
</div>
<!-- /ko -->
<div class="control-group">
<div class="controls">
<label class="checkbox">
@@ -70,8 +67,6 @@
<span class="help-inline">Choose if output should turn off automatically when print finishes</span>
</div>
</div>
<!-- /ko -->
<!-- ko if: outputEditor.auto_shutdown -->
<div class="control-group">
<div class="controls">
@@ -89,7 +84,7 @@
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.shutdown_time_delay">
<span class="help-inline">Time delay in seconds to turn on GPIO when print finishes.</span>
<span class="label label-important">Attention</span>
<!-- <span class="label label-important">Attention</span> -->
</div>
</div>
</div>

View File

@@ -3,14 +3,14 @@
<div class="control-group">
<label class="control-label">Temperature Sensor</label>
<div class="controls">
<select data-bind="options: $root.settings_hum_sensors, optionsText: 'label',
<select data-bind="options: $root.settings_hum_sensors, optionsText: 'label',
optionsValue: 'index_id', value: outputEditor.alarm_linked_temp_sensor">
</select>
<span class="help-inline">Temperature sensor responsible for getting the value to be used. Configured on the input side of the plugin.</span>
</select>
<span class="help-inline">Temperature sensor responsible for getting the value to be used. Configured on the
input side of the plugin.</span>
</div>
</div>
<div data-bind="attr: {id: 'temp_controlled_' + $index() }">
</div>
<div>
<div class="control-group">
<label class="control-label">{{ _('Set Temperature') }}</label>
<div class="controls">

View File

@@ -1,6 +1,6 @@
<form class="form-horizontal">
<!-- ko if: (outputEditor.temp_ctr_type() == "heater" || outputEditor.temp_ctr_type() == "cooler") -->
<div class="control-group">
<label class="control-label">Temperature Sensor</label>
<div class="controls">
@@ -10,6 +10,18 @@
<span class="help-inline">Temperature sensor responsible for getting the value to be used. Configured on the input side of the plugin.</span>
</div>
</div>
<!-- /ko -->
<!-- ko if: (outputEditor.temp_ctr_type() == "dehumidifier") -->
<div class="control-group">
<label class="control-label">Humidity Sensor</label>
<div class="controls">
<select data-bind="options: $root.settings_hum_sensors, optionsText: 'label',
optionsValue: 'index_id', value: outputEditor.temp_ctr_linked_sensor">
</select>
<span class="help-inline">Humidity sensor responsible for getting the value to be used. Configured on the input side of the plugin.</span>
</div>
</div>
<!-- /ko -->
<div class="control-group">
<label class="control-label">{{ _('Temp Control Type') }}</label>
@@ -31,7 +43,7 @@
<label class="control-label">{{ _('Default Value') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: outputEditor.temp_ctr_default_value">
<span class="help-inline">Default temperature / humidity that temperature control will be set when the print starts or the server starts.</span>
<span class="help-inline">Default temperature / humidity that temperature control will be set IF auto startup is set on schedule tab.</span>
</div>
</div>
@@ -43,6 +55,7 @@
</div>
</div>
<!-- ko if: (outputEditor.temp_ctr_type() == "heater") -->
<div class="control-group">
<label class="control-label">{{ _('Maximum Temperature') }}</label>
<div class="controls">
@@ -51,4 +64,6 @@
it's set temperature is set again.</span>
</div>
</div>
<!-- /ko -->
</form>