Skip to content

Commit 1e88d05

Browse files
committed
QtVcp: OperatorValueLine documentation
1 parent 64919f1 commit 1e88d05

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

3.31 KB
Loading

docs/src/gui/qtvcp-widgets.adoc

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,53 @@ It is a comma separated list of keyword and data:
14211421
*`SAVE:yes`*::
14221422
Shows a save button.
14231423

1424+
[[sub:qtvcp:widgets:operatorvalueline]]
1425+
=== `OperatorValueLine` - Operator Value Line Entry Widget
1426+
1427+
The operator enters values into this widget, which will be applied to a template and then optionally issued to the MDI either immediately or applied at a later time. The widget supports the optional popup calculator or keyboard for touchscreen-friendly entry.
1428+
1429+
image::images/qtvcp_operator_value.png["QtVCP OperatorValueLine",scale="25%"]
1430+
1431+
1432+
==== Formatting MDI Command
1433+
The widget supports a formatting option which is passed to Python's string `format()` to produce the final output for the MDI command. The special token `{value}` can be inserted anywhere in this format string where the value should appear. The formatting property is called `mdi_command_format_option`, e.g.:
1434+
1435+
* `M3 S{value}` to start the spindle at the speed entered by the operator.
1436+
* `M6 T{value} G43 H{value}` to issue a tool change and tool length offset change from the tool number entered
1437+
1438+
==== Automatic vs Deferred MDI Issue
1439+
The widget may be configured to automatically issue the MDI command upon submit when `issue_mdi_on_submit_option` is set to `True`. If `False` issuing the command may be done at a later time via a signal or function call from another widget.
1440+
1441+
In cases where `issue_mdi_on_submit_option` is `False`, calling the `issue_mdi()` function will issue the command. Slots attached to widgets such as PushButtons can trigger the MDI command when pressed, e.g.:
1442+
1443+
----
1444+
def setSpindleSpeed(self, event):
1445+
self.w.lineSpindleSpeed.issue_mdi()
1446+
ACTION.SET_MANUAL_MODE()
1447+
1448+
def setToolNumber(self, event):
1449+
self.w.lineToolNumber.issue_mdi()
1450+
ACTION.SET_MANUAL_MODE()
1451+
----
1452+
1453+
==== Pending State Styling Example
1454+
1455+
The widget tracks whether a value entered is pending and has not yet been issued via the property `isPendingValue`. This may be used to style the widget via the stylesheet. This can be used to alert the operator that they entered a value but another action must be taken to apply it.
1456+
1457+
The following style sheet excerpt will highlight the entry widget with a cyan background when values are pending and have not been applied.
1458+
1459+
----
1460+
#lineSpindleSpeed[isPendingValue=true],
1461+
#lineToolNumber[isPendingValue=true] {
1462+
background: cyan;
1463+
}
1464+
1465+
#lineSpindleSpeed[isPendingValue=false],
1466+
#lineToolNumber[isPendingValue=false] {
1467+
background: none;
1468+
}
1469+
----
1470+
14241471
[[sub:qtvcp:widgets:mdiline]]
14251472
=== `MDILine` - MDI Commands Line Entry Widget
14261473

0 commit comments

Comments
 (0)