| | |
| | | package com.mes.service; |
| | | |
| | | import com.mes.s7.enhanced.EnhancedS7Serializer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | |
| | | * PLC自动测试服务 |
| | | * 定时模拟PLC行为,向PLC写入测试数据,用于自动测试MES程序 |
| | | * |
| | | * @author zhoush |
| | | * @author huang |
| | | * @date 2025/10/30 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class PlcAutoTestService { |
| | | |
| | | @Resource |
| | | private EnhancedS7Serializer s7Serializer; |
| | | |
| | | @Resource |
| | | private PlcTestWriteService plcTestWriteService; |
| | |
| | | // 自动测试间隔(毫秒) |
| | | @Value("${plc.auto.test.interval:5000}") |
| | | private long autoTestInterval; |
| | | |
| | | private static final int ON = 1; |
| | | private static final int OFF = 0; |
| | | |
| | | /** |
| | | * 定时自动测试任务 |