35 lines
		
	
	
		
			898 B
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			35 lines
		
	
	
		
			898 B
		
	
	
	
		
			C#
		
	
	
	
| 
								 | 
							
								using System;
							 | 
						|||
| 
								 | 
							
								using System.Collections.Generic;
							 | 
						|||
| 
								 | 
							
								using System.Linq;
							 | 
						|||
| 
								 | 
							
								using System.Text;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace elelab
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    public class unart_manage
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        public static int com_count = 20;
							 | 
						|||
| 
								 | 
							
								        public static ele_base[] com_manage = new ele_base[com_count];
							 | 
						|||
| 
								 | 
							
								        public static void clearComs(){
							 | 
						|||
| 
								 | 
							
								            com_manage = new ele_base[com_count];
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        public static void init_sys()
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            for (int i = 0; i < com_count; i++)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                ele_base s1 = new ele_base();
							 | 
						|||
| 
								 | 
							
								                if (com_manage[i] == null)
							 | 
						|||
| 
								 | 
							
								                    com_manage[i] = s1;
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        public static bool init_com_sys(int com, bool modify)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            if (com_manage[com].port_state == false)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                com_manage[com].init(com, modify);
							 | 
						|||
| 
								 | 
							
								                return true;
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            return false;
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |