Skip to content

Commit

Permalink
Update to 2.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tobydox committed Feb 25, 2021
1 parent 6beba8f commit 1709499
Show file tree
Hide file tree
Showing 11 changed files with 243 additions and 13 deletions.
3 changes: 2 additions & 1 deletion InCore.Foundation/NftFlow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ This property holds the network interface to transmit traffic to for this flow.
protocol
++++++++


This property holds the protocol which to match. It has to be set to a protocol such as TCP or UDP in order to use source or destination port matching (:ref:`sourcePorts <property_NftFlow_sourcePorts>`/:ref:`destinationPorts <property_NftFlow_destinationPorts>`).

:**› Type**: :ref:`NftRule.Protocol <enum_NftRule_Protocol>`
:**› Default**: :ref:`NftRule.AllProtocols <enumitem_NftRule_AllProtocols>`
:**› Signal**: protocolChanged()
:**› Attributes**: Writable

Expand Down
134 changes: 134 additions & 0 deletions InCore.IO/UsbPrinter.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@

.. _object_UsbPrinter:


:index:`UsbPrinter`
-------------------

Description
***********

The UsbPrinter object allows controlling a printer connected to a local USB port. When opened, data such as PostScript or ZPL can be sent to the printer using the :ref:`IoDevice.write() <method_IoDevice_write>` method.

This object was introduced in InCore 2.3.

:**› Inherits**: :ref:`File <object_File>`

Overview
********

Properties
++++++++++

.. hlist::
:columns: 3

* :ref:`index <property_UsbPrinter_index>`
* :ref:`File.error <property_File_error>`
* :ref:`File.errorString <property_File_errorString>`
* :ref:`File.fileName <property_File_fileName>`
* :ref:`File.storage <property_File_storage>`
* :ref:`IoDevice.append <property_IoDevice_append>`
* :ref:`IoDevice.atEnd <property_IoDevice_atEnd>`
* :ref:`IoDevice.autoOpen <property_IoDevice_autoOpen>`
* :ref:`IoDevice.bytesAvailable <property_IoDevice_bytesAvailable>`
* :ref:`IoDevice.canReadLine <property_IoDevice_canReadLine>`
* :ref:`IoDevice.deviceErrorString <property_IoDevice_deviceErrorString>`
* :ref:`IoDevice.isOpen <property_IoDevice_isOpen>`
* :ref:`IoDevice.isWritable <property_IoDevice_isWritable>`
* :ref:`IoDevice.nameArgument <property_IoDevice_nameArgument>`
* :ref:`IoDevice.pos <property_IoDevice_pos>`
* :ref:`IoDevice.readOnly <property_IoDevice_readOnly>`
* :ref:`IoDevice.size <property_IoDevice_size>`
* :ref:`IoDevice.truncate <property_IoDevice_truncate>`
* :ref:`IoDevice.unbuffered <property_IoDevice_unbuffered>`
* :ref:`Object.objectId <property_Object_objectId>`
* :ref:`Object.parent <property_Object_parent>`

Methods
+++++++

.. hlist::
:columns: 2

* :ref:`File.remove() <method_File_remove>`
* :ref:`File.sync() <method_File_sync>`
* :ref:`IoDevice.close() <method_IoDevice_close>`
* :ref:`IoDevice.flush() <method_IoDevice_flush>`
* :ref:`IoDevice.open() <method_IoDevice_open>`
* :ref:`IoDevice.peekAll() <method_IoDevice_peekAll>`
* :ref:`IoDevice.read() <method_IoDevice_read>`
* :ref:`IoDevice.readAll() <method_IoDevice_readAll>`
* :ref:`IoDevice.readLine() <method_IoDevice_readLine>`
* :ref:`IoDevice.sync() <method_IoDevice_sync>`
* :ref:`IoDevice.write() <method_IoDevice_write>`
* :ref:`Object.fromJson() <method_Object_fromJson>`
* :ref:`Object.toJson() <method_Object_toJson>`

Signals
+++++++

.. hlist::
:columns: 1

* :ref:`File.errorOccurred() <signal_File_errorOccurred>`
* :ref:`IoDevice.lineAvailableForRead() <signal_IoDevice_lineAvailableForRead>`
* :ref:`IoDevice.readyRead() <signal_IoDevice_readyRead>`
* :ref:`Object.completed() <signal_Object_completed>`

Enumerations
++++++++++++

.. hlist::
:columns: 1

* :ref:`File.Error <enum_File_Error>`



Properties
**********


.. _property_UsbPrinter_index:

.. _signal_UsbPrinter_indexChanged:

.. index::
single: index

index
+++++

This property holds the index of the printer which to communicate with.

:**› Type**: SignedInteger
:**› Default**: ``0``
:**› Signal**: indexChanged()
:**› Attributes**: Writable


.. _example_UsbPrinter:


Example
*******

.. code-block:: qml
import InCore.IO 2.3
UsbPrinter {
index: 0
autoOpen: true
onIsOpenChanged: {
console.log("printing")
// print QR code on ZPL-based label printer
write("^XA
^FO20,20^BQ,2,10^FDQA,0123456789ABCD 2D code^FS
^XZ")
flush();
}
}
1 change: 1 addition & 0 deletions InCore.IO/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ Objects
SerialPortBusNode
SerialPortManager
Sht3x
UsbPrinter
21 changes: 9 additions & 12 deletions InCore.OpcUa/OpcUaClient.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,25 +94,22 @@ Example
Application {
OpcUaClient {
OpcUaEndpointDiscovery { }
OpcUaConnection { }
OpcUaConnection {
// ...
}
OpcUaNodeId {
identifier: "s=Machine"
ns: "Demo Namespace"
ns: "Example Namespace"
id: machineNodeId
}
OpcUaMethodNode {
nodeId: OpcUaNodeId {
identifier: "s=Machine.Stop"
ns: "Demo Namespace"
OpcUaValueNode {
nodeId: OpcUaRelativeNodeId {
startNode: machineNodeId
path: [ OpcUaRelativeNodePath { ns: "Example Namespace"; browseName: "Example Value" } ]
}
objectNodeId: machineNodeId
id: stopMethod
onValueChanged: console.log("Example value", value)
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions InCore.OpcUa/OpcUaConnection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,6 @@ writeNodeAttributesFinished(Variant value)
Please refer to the `Qt OPC UA Connection QML type <https://doc.qt.io/QtOPCUA/qml-qtopcua-connection.html#writeNodeAttributesFinished-signal>`_ documentation.


Example
*******
See :ref:`OpcUaClient example <example_OpcUaClient>` on how to use OpcUaConnection.
40 changes: 40 additions & 0 deletions InCore.OpcUa/OpcUaEndpointDiscovery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,43 @@ Please refer to the `Qt OPC UA EndpointDiscovery QML type <https://doc.qt.io/QtO
:**› Returns**: :ref:`QOpcUaEndpointDescription <enum_OpcUaEndpointDiscovery_QOpcUaEndpointDescription>`



.. _example_OpcUaEndpointDiscovery:


Example
*******

.. code-block:: qml
import InCore.Foundation 2.3
import InCore.OpcUa 2.3
Application {
OpcUaClient {
OpcUaEndpointDiscovery {
serverUrl: "opc.tcp://192.168.1.2:4840"
onEndpointsChanged: {
if (status.isGood) {
if (status.status === OpcUaStatus.GoodCompletesAsynchronusly)
return; // wait until finished
if (count > 0) {
console.log("Using endpoint", at(0).endpointUrl, at(0).securityPolicy);
connection.connectToEndpoint(at(0));
} else {
console.log("No endpoints retrieved")
}
} else {
console.log("Error fetching endpoints:", status.status);
}
}
}
OpcUaConnection {
id: connection
backend: availableBackends[0]
defaultConnection: true
}
}
}
42 changes: 42 additions & 0 deletions InCore.OpcUa/OpcUaMethodNode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,45 @@ callMethod()
Please refer to the `Qt OPC UA MethodNode QML type <https://doc.qt.io/QtOPCUA/qml-qtopcua-methodnode.html#callMethod-method>`_ documentation.



.. _example_OpcUaMethodNode:


Example
*******

.. code-block:: qml
import InCore.Foundation 2.3
import InCore.OpcUa 2.3
Application {
OpcUaClient {
OpcUaConnection {
// ...
}
OpcUaMethodNode {
id: pingMethod
nodeId: OpcUaNodeId { identifier: "s=Machine.Ping"; ns: "Example Namespace" }
objectNodeId: OpcUaNodeId { identifier: "s=Machine"; ns: "Example Namespace" }
inputArguments: [
OpcUaMethodArgument {
value: 123.456
type: OpcUaConstants.Double
},
OpcUaMethodArgument {
value: "Hello world"
type: OpcUaConstants.String
}
]
onOutputArgumentsChanged: console.log("Method returned", JSON.stringify(outputArguments))
}
}
Timer {
onTriggered: pingMethod.callMethod()
}
}
3 changes: 3 additions & 0 deletions InCore.OpcUa/OpcUaNodeId.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ Please refer to the `Qt OPC UA NodeId QML type <https://doc.qt.io/QtOPCUA/qml-qt

:**› Attributes**: Writable

Example
*******
See :ref:`OpcUaClient example <example_OpcUaClient>` on how to use OpcUaNodeId.
3 changes: 3 additions & 0 deletions InCore.OpcUa/OpcUaRelativeNodeId.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ Please refer to the `Qt OPC UA RelativeNodeId QML type <https://doc.qt.io/QtOPCU

:**› Attributes**: Writable

Example
*******
See :ref:`OpcUaClient example <example_OpcUaClient>` on how to use OpcUaRelativeNodeId.
3 changes: 3 additions & 0 deletions InCore.OpcUa/OpcUaRelativeNodePath.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,6 @@ Please refer to the `Qt OPC UA RelativeNodePath QML type <https://doc.qt.io/QtOP

:**› Attributes**: Writable

Example
*******
See :ref:`OpcUaClient example <example_OpcUaClient>` on how to use OpcUaRelativeNodePath.
3 changes: 3 additions & 0 deletions InCore.OpcUa/OpcUaValueNode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,6 @@ dataChangeOccurred(Variant value)
Please refer to the `Qt OPC UA ValueNode QML type <https://doc.qt.io/QtOPCUA/qml-qtopcua-valuenode.html#dataChangeOccurred-signal>`_ documentation.


Example
*******
See :ref:`OpcUaClient example <example_OpcUaClient>` on how to use OpcUaValueNode.

0 comments on commit 1709499

Please sign in to comment.