-
Notifications
You must be signed in to change notification settings - Fork 3
Position
George Joseph edited this page Oct 20, 2019
·
1 revision
Derived from Element -> Widget
A "position" widget is a composite of one or more buttons representing the printer's axes current position and state. Clicking a button homes that axis.
{
/*
* All attributes of Element and Widget apply here.
*/
"id": "main_position",
"type": "position",
"element_defaults": {
"style": {
"height": "2.5em", "margin-top": "5px"
},
/*
* The buttons will change color depending on whether
* the axis is homed or not.
*
* The status field controlling the state is defined below
* in "axes".
*/
"state": {
"states": [
{"state": false, "classes": "btn-warning"},
{"state": true, "classes": "btn-success"}
]
}
},
/* You could have the buttons laid out in a row or column */
"direction": "column",
/*
* There should be 1 entry in the "axes" array for each axis you want
* to display and control.
*/
"axes": [
{
/* The label to display to the left of the position */
"label": "X:",
/* The axis designator to use in the G28 "home" command */
"gcode_axis": "X",
/* The status object field containing the current position */
"position_field": "${status.move.axes[0].machinePosition.toFixed(3).padStart(7)}",
/* The status object field indicating whether the axis is homed or not */
"state_field": "${status.move.axes[0].homed}"
},
{
"label": "Y:",
"gcode_axis": "Y",
"position_field": "${status.move.axes[1].machinePosition.toFixed(3).padStart(7)}",
"state_field": "${status.move.axes[1].homed}"
},
{
"label": "Z:",
"gcode_axis": "Z",
"position_field": "${status.move.axes[2].machinePosition.toFixed(3).padStart(7)}",
"state_field": "${status.move.axes[2].homed}"
},
]
}