| | |
| | | public class ZyStationConnectDriver implements ThreadHandler { |
| | | |
| | | private boolean connected = false; |
| | | private SiemensS7Net siemensNet; |
| | | private DeviceConfig deviceConfig; |
| | | private ZyStationConnectApi zyStationConnectApi; |
| | | |
| | | public ZyStationConnectDriver(SiemensS7Net siemensS7Net, DeviceConfig deviceConfig) { |
| | | this.siemensNet = siemensS7Net; |
| | | public ZyStationConnectDriver(DeviceConfig deviceConfig) { |
| | | this.deviceConfig = deviceConfig; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public boolean connect() { |
| | | if (deviceConfig.getFake() == 0) { |
| | | zyStationConnectApi = new ZyStationRealConnect(siemensNet, deviceConfig); |
| | | zyStationConnectApi = new ZyStationRealConnect(deviceConfig); |
| | | } else { |
| | | zyStationConnectApi = new ZyStationFakeConnect(deviceConfig); |
| | | } |