| | |
| | | package com.mes.job; |
| | | |
| | | import com.kangaroohy.milo.runner.subscription.SubscriptionCallback; |
| | | import com.kangaroohy.milo.service.MiloService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | |
| | | @Slf4j |
| | | public class OpcCacheGlassTask { |
| | | |
| | | // @Autowired |
| | | // MiloService miloService; |
| | | // |
| | | // @Autowired |
| | | // SubscriptionCallback cacheGlassSubscriptionCallback; |
| | | // |
| | | // @Scheduled(fixedDelay = Long.MAX_VALUE) |
| | | // public void startOpcTask() throws Exception { |
| | | // miloService.subscriptionFromOpcUa(Arrays.asList("my.device.x1", "my.device.x2"), cacheGlassSubscriptionCallback); |
| | | // } |
| | | @Autowired(required = false) |
| | | MiloService miloService; |
| | | |
| | | @Resource(name = "cacheGlassStartCallback") |
| | | SubscriptionCallback cacheGlassStartCallback; |
| | | |
| | | @Scheduled(fixedDelay = Long.MAX_VALUE) |
| | | public void startOpcTask() throws Exception { |
| | | // miloService.subscriptionFromOpcUa(Arrays.asList("C101-WL.S7-1200.plc_task_state", "D101-WL.S7-1200.plc_task_state"), cacheGlassStartCallback); |
| | | miloService.subscriptionFromOpcUa(Arrays.asList("mes.dec.edg_storage_device_one_task[1].task_state", "D101-WL.S7-1200.plc_task_state"), cacheGlassStartCallback); |
| | | log.info("--------------------s---------------------------"); |
| | | } |
| | | } |