| | |
| | | * @Description |
| | | */ |
| | | //使起作用,本类注解@Component,并在PipIrrMwRtuApplication注解@EnableScheduling |
| | | @Component |
| | | //@Component |
| | | public class TestMsResource { |
| | | |
| | | // 设置定时N秒一次 |
| | | @Scheduled(cron = "0/4 * * * * ?") |
| | | //@Scheduled(cron = "0/4 * * * * ?") |
| | | public void test1() throws Exception { |
| | | MsObj msObj = new MsObj() ; |
| | | setAttr4OpenCloseValve("开阀", msObj) ; |
| | |
| | | } |
| | | |
| | | // 设置定时N秒一次 |
| | | @Scheduled(cron = "0/6 * * * * ?") |
| | | //@Scheduled(cron = "0/6 * * * * ?") |
| | | public void test2() throws Exception { |
| | | MsObj msObj = new MsObj() ; |
| | | setAttr4OpenCloseValve("关阀", msObj) ; |
| | |
| | | } |
| | | |
| | | // 设置定时N秒一次 |
| | | @Scheduled(cron = "0/10 * * * * ?") |
| | | //@Scheduled(cron = "0/10 * * * * ?") |
| | | public void test4() throws Exception { |
| | | MsObj msObj = new MsObj() ; |
| | | setAttr4StateAlarm("阀态", msObj) ; |
| | |
| | | } |
| | | |
| | | // 设置定时N秒一次 |
| | | @Scheduled(cron = "0/15 * * * * ?") |
| | | //@Scheduled(cron = "0/15 * * * * ?") |
| | | public void test3() throws Exception { |
| | | MsObj msObj = new MsObj() ; |
| | | setAttr4StateAlarm("阀态", msObj) ; |