| | |
| | | |
| | | import com.iailab.module.data.channel.kio.entity.ChannelKioDeviceEntity; |
| | | import com.iailab.module.data.channel.kio.service.ChannelKioDeviceService; |
| | | import com.iailab.module.data.channel.opcua.collector.OpcUaUtils; |
| | | import com.iailab.module.data.common.enums.CommonConstant; |
| | | import com.iailab.module.data.common.enums.DataSourceType; |
| | | import com.iailab.module.data.common.utils.TagUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.eclipse.milo.opcua.sdk.client.OpcUaClient; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | return kingIOClient; |
| | | } |
| | | |
| | | public String getTagValue(String sourceId, String tagName) throws Exception { |
| | | KingIOClient client = this.getClient(sourceId); |
| | | String value = client.getTagValue(tagName); |
| | | public String getTagValue(String sourceId, String tagName) { |
| | | String value = CommonConstant.BAD_VALUE.toString(); |
| | | try{ |
| | | KingIOClient client = this.getClient(sourceId); |
| | | value = client.getTagValue(tagName); |
| | | }catch (Exception ex){ |
| | | ex.printStackTrace(); |
| | | return value; |
| | | } |
| | | return value; |
| | | } |
| | | |