示例#1
0
        public FormFUTMain()
        {
            InitializeComponent();

            //initial data
            deviceParams = new DeviceParams();
            fut          = new FutNet(deviceParams);
            obsTar       = new ObsTar();
            obsTar.id    = -1;

            //开启设备信息交换
            futServerThread = new Thread(new ThreadStart(StartFutServer));
            futServerThread.IsBackground = true;
            futServerThread.Start();

            //开启总控信息交换
            futTwin       = new FutTwin(deviceParams, obsTar);
            futTwinThread = new Thread(new ThreadStart(futTwin.ConnectToHost));
            futTwinThread.IsBackground = true;
            futTwinThread.Start();

            //enable timer to update status per 100ms
            timerUpdateStatus.Enabled = true;

            //初始化观测界面窗口
            frmStartObs = new StartObs(fut.mDeviceConnections, deviceParams, obsTar, futTwin);
        }
示例#2
0
        public StartObs(Dictionary <string, Socket> _deviceConnections, DeviceParams _deviceParams, ObsTar _obsTar, FutTwin _futTwin)
        {
            InitializeComponent();
            deviceConnections = _deviceConnections;
            deviceParams      = _deviceParams;
            obsTar            = _obsTar;
            futTwin           = _futTwin;

            textBoxRA.Text       = "5:00:00";
            textBoxDEC.Text      = "40:00:00";
            textBoxColor.Text    = "10";
            textBoxExpTime.Text  = "5";
            textBoxAmount.Text   = "3";
            textBoxFileName.Text = "test";

            targetList = new List <ListViewItem>();
            //tarList = new Dictionary<string, ListViewItem>();
            //backgroundWorker = new BackgroundWorker();
            //backgroundWorker.WorkerReportsProgress = true;
            //backgroundWorker.DoWork += new DoWorkEventHandler(ObsTargetList);

            tmrObs           = new System.Timers.Timer(500);
            tmrObs.Elapsed  += new System.Timers.ElapsedEventHandler(CheckObsTar);
            tmrObs.AutoReset = true;
            tmrObs.Enabled   = true;

            //listview setting
            listView1.GridLines     = true;
            listView1.MultiSelect   = true;
            listView1.FullRowSelect = true;
        }