严智鑫
2024-04-16 e208aa1ef8e861dba168e8d83ab3066fc9f1e02d
UnLoadGlassModule/src/main/java/com/mes/config/AppRunnerConfig.java
@@ -1,23 +1,51 @@
package com.mes.config;
import com.mes.service.Plcaction;
import com.mes.service.DownGlassInfoService;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import com.mes.service.PLCAutoMes;
import com.mes.service.Plchome;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Component
class AppStartup implements ApplicationListener<ContextRefreshedEvent> {
@Order(1)
    private final DownGlassInfoService downGlassInfoService;
    public AppStartup(DownGlassInfoService downGlassInfoService) {
        this.downGlassInfoService = downGlassInfoService;
    }
public class AppRunnerConfig implements ApplicationRunner {
    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        Plcaction.setDownGlassInfoService(downGlassInfoService);
        new Plcaction().start();
    public void run(ApplicationArguments args) throws Exception {
        // TODO Auto-generated method stub
        //
        System.out.println("启动完成");
        //  new PlcHold().start();
       new PLCAutoMes().start();
    new Plchome().start();
        //  new PlcLayout().start();
        //  new Plcalarm().start();
        //  new Plcsign().start();
        //  new Plcstate().start();
        //  new PlcPositioning1().start();
        //  new PlcParameter2().start();
        //  new PLCAutomaticParameterSetting().start();
        //  new PlcManualonePosition().start();
        //  new PlcManualonePosition2().start();
        //  new PlcServoManualone().start();
        //  new PLCManualJog().start();
        //  new Plclog().start();
        //  new PlcInteractionState().start();
        //new PlcParameter1Review().start();
        //new PLCAutomaticParameterSettingReview2().start();
    // new PLCManualJogReview().start();
    }
}
}