2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.plclogo.internal.config;
15 import static org.openhab.binding.plclogo.internal.PLCLogoBindingConstants.*;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
20 * The {@link PLCDigitalConfiguration} is a base class for configuration
21 * of Siemens LOGO! PLC digital input/outputs blocks.
23 * @author Alexander Falkenstern - Initial contribution
26 public class PLCDigitalConfiguration extends PLCCommonConfiguration {
28 private String kind = "";
31 public String getBlockKind() {
36 * Set Siemens LOGO! blocks kind.
37 * Can be I, Q, M, NI or NQ for digital blocks and
38 * AI, AM, AQ, NAI or NAQ for analog
40 * @param kind Siemens LOGO! blocks kind
42 public void setBlockKind(final String kind) {
43 this.kind = kind.trim();
47 public String getChannelType() {
48 boolean isInput = kind.equalsIgnoreCase(I_DIGITAL) || kind.equalsIgnoreCase(NI_DIGITAL);
49 return isInput ? DIGITAL_INPUT_ITEM : DIGITAL_OUTPUT_ITEM;