public FocuserNet(FocuserUser focUser) { m_focUser = focUser; m_ip = IPAddress.Parse("190.168.1.115"); m_ep = new IPEndPoint(m_ip, 30001); m_sktDev = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP); m_errMsg = ""; m_connected = false; //启动housekeeping线程 m_timerHousekeep = new Timer(new TimerCallback(HouseKeeping), null, 0, 10000); }
public MainForm() { InitializeComponent(); timerFocUpdateStat.Interval = 100; timerFocUpdateStat.Enabled = true; //connect to device driver focuserUser = new FocuserUser(); focuserUser.ConnectDevice(); //connect to host focuserNet = new FocuserNet(focuserUser); focNetThd = new Thread(new ThreadStart(focuserNet.ConnectToHost)); focNetThd.IsBackground = true; focNetThd.Start(); }