parametrized_command => parametric_command
This commit is contained in:
parent
ebc7352a42
commit
84c9403e65
3 changed files with 8 additions and 8 deletions
|
|
@ -120,8 +120,8 @@ The following example config should explain the available options:
|
|||
# Controls consist at least of a name, a type and type-specific further attributes. Currently recognized types are
|
||||
# - section: Creates a visual section in the UI, you can use this to separate functional blocks
|
||||
# - command: Creates a button that sends a defined GCODE command to the printer when clicked
|
||||
# - parametrized_command: Creates a button that sends a parametrized GCODE command to the printer, parameters
|
||||
# needed for the command are added to the UI as input fields and are named
|
||||
# - parametric_command: Creates a button that sends a parameterized GCODE command to the printer, parameters
|
||||
# needed for the command are added to the UI as input fields, are named and can such be referenced from the command
|
||||
#
|
||||
# The following example defines a control for enabling the cooling fan with a variable speed defined by the user
|
||||
# (default 255) and a control for disabling the fan, all within a section named "Fan".
|
||||
|
|
@ -130,7 +130,7 @@ The following example config should explain the available options:
|
|||
type: section
|
||||
children:
|
||||
- name: Enable Fan
|
||||
type: parametrized_command
|
||||
type: parametric_command
|
||||
command: M106 S%(speed)s
|
||||
input:
|
||||
- name: Speed (0-255)
|
||||
|
|
|
|||
|
|
@ -398,7 +398,7 @@ function ControlsViewModel() {
|
|||
}
|
||||
|
||||
self._enhanceControl = function(control) {
|
||||
if (control.type == "parametrized_command") {
|
||||
if (control.type == "parametric_command") {
|
||||
for (var i = 0; i < control.input.length; i++) {
|
||||
control.input[i].value = control.input[i].default;
|
||||
}
|
||||
|
|
@ -437,7 +437,7 @@ function ControlsViewModel() {
|
|||
dataType: "json",
|
||||
data: "command=" + command.command
|
||||
})
|
||||
} else if (command.type="parametrized_command") {
|
||||
} else if (command.type="parametric_command") {
|
||||
var data = {"command": command.command};
|
||||
for (var i = 0; i < command.input.length; i++) {
|
||||
data["parameter_" + command.input[i].parameter] = command.input[i].value;
|
||||
|
|
@ -457,8 +457,8 @@ function ControlsViewModel() {
|
|||
return "customControls_sectionTemplate";
|
||||
case "command":
|
||||
return "customControls_commandTemplate";
|
||||
case "parametrized_command":
|
||||
return "customControls_parametrizedCommandTemplate";
|
||||
case "parametric_command":
|
||||
return "customControls_parametricCommandTemplate";
|
||||
default:
|
||||
return "customControls_emptyTemplate";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@
|
|||
<button class="btn" data-bind="text: name, enable: $root.isOperational(), click: function() { $root.sendCustomCommand($data) }"></button>
|
||||
</form>
|
||||
</script>
|
||||
<script type="text/html" id="customControls_parametrizedCommandTemplate">
|
||||
<script type="text/html" id="customControls_parametricCommandTemplate">
|
||||
<form class="form-inline">
|
||||
<!-- ko foreach: input -->
|
||||
<label data-bind="text: name"></label>
|
||||
|
|
|
|||
Loading…
Reference in a new issue