io.qt.serialbus.QModbusDevice Maven / Gradle / Ivy
Show all versions of qtjambi-serialbus Show documentation
package io.qt.serialbus;
import io.qt.*;
/**
* The base class for Modbus classes, QModbusServer and QModbusClient
* Java wrapper for Qt class QModbusDevice
*/
public abstract class QModbusDevice extends io.qt.core.QObject
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* This variable stores the meta-object for the class.
*/
public static final io.qt.core.@NonNull QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QModbusDevice.class);
@NativeAccess
private static final class ConcreteWrapper extends QModbusDevice {
@NativeAccess
private ConcreteWrapper(QPrivateConstructor p) { super(p); }
@Override
@QtUninvokable
protected void close(){
close_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void close_native(long __this__nativeId);
@Override
@QtUninvokable
protected boolean open(){
return open_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean open_native(long __this__nativeId);
}
/**
* Java wrapper for Qt enum QModbusDevice::ConnectionParameter
*/
public enum ConnectionParameter implements QtEnumerator {
/**
* Representing QModbusDevice:: SerialPortNameParameter
*/
SerialPortNameParameter(0),
/**
* Representing QModbusDevice:: SerialParityParameter
*/
SerialParityParameter(1),
/**
* Representing QModbusDevice:: SerialBaudRateParameter
*/
SerialBaudRateParameter(2),
/**
* Representing QModbusDevice:: SerialDataBitsParameter
*/
SerialDataBitsParameter(3),
/**
* Representing QModbusDevice:: SerialStopBitsParameter
*/
SerialStopBitsParameter(4),
/**
* Representing QModbusDevice:: NetworkPortParameter
*/
NetworkPortParameter(5),
/**
* Representing QModbusDevice:: NetworkAddressParameter
*/
NetworkAddressParameter(6);
static {
QtJambi_LibraryUtilities.initialize();
}
private ConnectionParameter(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
@Override
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull ConnectionParameter resolve(int value) {
switch (value) {
case 0: return SerialPortNameParameter;
case 1: return SerialParityParameter;
case 2: return SerialBaudRateParameter;
case 3: return SerialDataBitsParameter;
case 4: return SerialStopBitsParameter;
case 5: return NetworkPortParameter;
case 6: return NetworkAddressParameter;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* Java wrapper for Qt enum QModbusDevice::Error
*/
public enum Error implements QtEnumerator {
/**
* Representing QModbusDevice:: NoError
*/
NoError(0),
/**
* Representing QModbusDevice:: ReadError
*/
ReadError(1),
/**
* Representing QModbusDevice:: WriteError
*/
WriteError(2),
/**
* Representing QModbusDevice:: ConnectionError
*/
ConnectionError(3),
/**
* Representing QModbusDevice:: ConfigurationError
*/
ConfigurationError(4),
/**
* Representing QModbusDevice:: TimeoutError
*/
TimeoutError(5),
/**
* Representing QModbusDevice:: ProtocolError
*/
ProtocolError(6),
/**
* Representing QModbusDevice:: ReplyAbortedError
*/
ReplyAbortedError(7),
/**
* Representing QModbusDevice:: UnknownError
*/
UnknownError(8),
/**
* Representing QModbusDevice:: InvalidResponseError
*/
InvalidResponseError(9);
static {
QtJambi_LibraryUtilities.initialize();
}
private Error(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
@Override
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull Error resolve(int value) {
switch (value) {
case 0: return NoError;
case 1: return ReadError;
case 2: return WriteError;
case 3: return ConnectionError;
case 4: return ConfigurationError;
case 5: return TimeoutError;
case 6: return ProtocolError;
case 7: return ReplyAbortedError;
case 8: return UnknownError;
case 9: return InvalidResponseError;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* Java wrapper for Qt enum QModbusDevice::IntermediateError
* This enum was introduced in Qt 6.0.
*/
public enum IntermediateError implements QtEnumerator {
/**
* Representing QModbusDevice:: ResponseCrcError
*/
ResponseCrcError(0),
/**
* Representing QModbusDevice:: ResponseRequestMismatch
*/
ResponseRequestMismatch(1);
static {
QtJambi_LibraryUtilities.initialize();
}
private IntermediateError(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
@Override
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull IntermediateError resolve(int value) {
switch (value) {
case 0: return ResponseCrcError;
case 1: return ResponseRequestMismatch;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* Java wrapper for Qt enum QModbusDevice::State
*/
public enum State implements QtEnumerator {
/**
* Representing QModbusDevice:: UnconnectedState
*/
UnconnectedState(0),
/**
* Representing QModbusDevice:: ConnectingState
*/
ConnectingState(1),
/**
* Representing QModbusDevice:: ConnectedState
*/
ConnectedState(2),
/**
* Representing QModbusDevice:: ClosingState
*/
ClosingState(3);
static {
QtJambi_LibraryUtilities.initialize();
}
private State(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
@Override
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull State resolve(int value) {
switch (value) {
case 0: return UnconnectedState;
case 1: return ConnectingState;
case 2: return ConnectedState;
case 3: return ClosingState;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* See QModbusDevice:: errorOccurred(QModbusDevice::Error)
*/
public final @NonNull Signal1 errorOccurred = new Signal1<>();
/**
* See QModbusDevice:: stateChanged(QModbusDevice::State)
*/
public final @NonNull Signal1 stateChanged = new Signal1<>();
/**
* See QModbusDevice:: QModbusDevice(QObject*)
*/
public QModbusDevice(io.qt.core.@Nullable QObject parent){
super((QPrivateConstructor)null);
initialize_native(this, parent);
}
private native static void initialize_native(QModbusDevice instance, io.qt.core.QObject parent);
/**
* See QModbusDevice:: connectDevice()
*/
@QtUninvokable
public final boolean connectDevice(){
return connectDevice_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean connectDevice_native(long __this__nativeId);
/**
* See QModbusDevice:: connectionParameter(QModbusDevice::ConnectionParameter)const
*/
@QtUninvokable
public final java.lang.Object connectionParameter(io.qt.serialbus.QModbusDevice.@NonNull ConnectionParameter parameter){
return connectionParameter_native_QModbusDevice_ConnectionParameter_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), parameter.value());
}
@QtUninvokable
private native java.lang.Object connectionParameter_native_QModbusDevice_ConnectionParameter_constfct(long __this__nativeId, int parameter);
/**
* See QModbusDevice:: device()const
*/
@QtUninvokable
public final io.qt.core.@Nullable QIODevice device(){
return device_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QIODevice device_native_constfct(long __this__nativeId);
/**
* See QModbusDevice:: disconnectDevice()
*/
@QtUninvokable
public final void disconnectDevice(){
disconnectDevice_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void disconnectDevice_native(long __this__nativeId);
/**
* See QModbusDevice:: error()const
*/
@QtUninvokable
public final io.qt.serialbus.QModbusDevice.@NonNull Error error(){
return io.qt.serialbus.QModbusDevice.Error.resolve(error_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int error_native_constfct(long __this__nativeId);
/**
* See QModbusDevice:: errorString()const
*/
@QtUninvokable
public final java.lang.@NonNull String errorString(){
return errorString_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String errorString_native_constfct(long __this__nativeId);
/**
* See QModbusDevice:: setConnectionParameter(QModbusDevice::ConnectionParameter, QVariant)
*/
@QtUninvokable
public final void setConnectionParameter(io.qt.serialbus.QModbusDevice.@NonNull ConnectionParameter parameter, java.lang.Object value){
setConnectionParameter_native_QModbusDevice_ConnectionParameter_cref_QVariant(QtJambi_LibraryUtilities.internal.nativeId(this), parameter.value(), value);
}
@QtUninvokable
private native void setConnectionParameter_native_QModbusDevice_ConnectionParameter_cref_QVariant(long __this__nativeId, int parameter, java.lang.Object value);
/**
* See QModbusDevice:: setError(QString, QModbusDevice::Error)
*/
@QtUninvokable
protected final void setError(java.lang.@NonNull String errorText, io.qt.serialbus.QModbusDevice.@NonNull Error error){
setError_native_cref_QString_QModbusDevice_Error(QtJambi_LibraryUtilities.internal.nativeId(this), errorText, error.value());
}
@QtUninvokable
private native void setError_native_cref_QString_QModbusDevice_Error(long __this__nativeId, java.lang.String errorText, int error);
/**
* See QModbusDevice:: setState(QModbusDevice::State)
*/
@QtUninvokable
protected final void setState(io.qt.serialbus.QModbusDevice.@NonNull State newState){
setState_native_QModbusDevice_State(QtJambi_LibraryUtilities.internal.nativeId(this), newState.value());
}
@QtUninvokable
private native void setState_native_QModbusDevice_State(long __this__nativeId, int newState);
/**
* See QModbusDevice:: state()const
*/
@QtUninvokable
public final io.qt.serialbus.QModbusDevice.@NonNull State state(){
return io.qt.serialbus.QModbusDevice.State.resolve(state_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int state_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
protected abstract void close();
@QtUninvokable
private native void close_native(long __this__nativeId);
/**
*
*/
@QtUninvokable
protected abstract boolean open();
@QtUninvokable
private native boolean open_native(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QModbusDevice(QPrivateConstructor p) { super(p); }
/**
* Constructor for internal use only.
* It is not allowed to call the declarative constructor from inside Java.
* @hidden
*/
@NativeAccess
protected QModbusDevice(QDeclarativeConstructor constructor) {
super((QPrivateConstructor)null);
initialize_native(this, constructor);
}
@QtUninvokable
private static native void initialize_native(QModbusDevice instance, QDeclarativeConstructor constructor);
/**
* Overloaded constructor for {@link #QModbusDevice(io.qt.core.QObject)}
* with parent = null
.
*/
public QModbusDevice() {
this((io.qt.core.QObject)null);
}
}