综合管理平台数据库数据模拟程序
Administrator
2021-03-25 578faecf2a59d3062c96aed307b6df80c87a315d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.thread;
 
import java.util.List;
 
import com.mode.Device_Inf;
import com.mode.Manage_Util;
import com.sql.MysqlConnPool;
import com.thread.devs.Manage_Simul_Motor_Thread;
 
public class Manage_Simul_Server {
    public MysqlConnPool pool;
    public List<Device_Inf> devices;
        
    public Manage_Simul_Server(MysqlConnPool pool, List<Device_Inf> devices) {
        this.pool = pool;
        this.devices = devices;
    }
 
    public void run() {
        if(devices.size() > 0) {
            for(int i=0;i<devices.size();i++) {
                Device_Inf dev = devices.get(i);
                //System.out.println(dev);
                switch(dev.getSystem_id()) {
                    case Manage_Util.DEV_TYPE_DYNAMICLOAD:{
                        
                    }break;
                    case Manage_Util.DEV_TYPE_4MWPOWER:{
                        
                    }break; 
                    case Manage_Util.DEV_TYPE_2MWPOWER:{
                        
                    }break;
                    case Manage_Util.DEV_TYPE_MOTOR:{
                        Manage_Simul_Motor_Thread motor_thread = new Manage_Simul_Motor_Thread(pool, dev);
                        new Thread(motor_thread).start();
                    }break;
                }
            }
        }
    }
    
}