Search in sources :

Example 1 with LinePositionParseException

use of org.openhab.binding.tinkerforge.internal.tools.Tools.LinePositionParseException in project openhab1-addons by openhab.

the class MBrickletOLED128x64Impl method write.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     *
     * @generated NOT
     */
@Override
public void write(String linePositionText) {
    try {
        LinePositionText linePostion = Tools.parseLinePostion(linePositionText, positionPrefix, positionSuffix, 1, 2, maxLine, maxColumn);
        tinkerforgeDevice.writeLine(linePostion.getLine(), linePostion.getPosition(), linePostion.getText());
    } catch (LinePositionParseException e) {
        logger.error("faulty input text", e);
    } catch (TimeoutException e) {
        TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);
    } catch (NotConnectedException e) {
        TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);
    }
}
Also used : LinePositionParseException(org.openhab.binding.tinkerforge.internal.tools.Tools.LinePositionParseException) NotConnectedException(com.tinkerforge.NotConnectedException) LinePositionText(org.openhab.binding.tinkerforge.internal.tools.LinePositionText) TimeoutException(com.tinkerforge.TimeoutException)

Example 2 with LinePositionParseException

use of org.openhab.binding.tinkerforge.internal.tools.Tools.LinePositionParseException in project openhab1-addons by openhab.

the class MBrickletOLE64x48Impl method write.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     *
     * @generated NOT
     */
@Override
public void write(String linePositionText) {
    try {
        LinePositionText linePostion = Tools.parseLinePostion(linePositionText, positionPrefix, positionSuffix, 1, 2, maxLine, maxColumn);
        tinkerforgeDevice.writeLine(linePostion.getLine(), linePostion.getPosition(), linePostion.getText());
    } catch (LinePositionParseException e) {
        logger.error("faulty input text", e);
    } catch (TimeoutException e) {
        TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);
    } catch (NotConnectedException e) {
        TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);
    }
}
Also used : LinePositionParseException(org.openhab.binding.tinkerforge.internal.tools.Tools.LinePositionParseException) NotConnectedException(com.tinkerforge.NotConnectedException) LinePositionText(org.openhab.binding.tinkerforge.internal.tools.LinePositionText) TimeoutException(com.tinkerforge.TimeoutException)

Aggregations

NotConnectedException (com.tinkerforge.NotConnectedException)2 TimeoutException (com.tinkerforge.TimeoutException)2 LinePositionText (org.openhab.binding.tinkerforge.internal.tools.LinePositionText)2 LinePositionParseException (org.openhab.binding.tinkerforge.internal.tools.Tools.LinePositionParseException)2