public void RefreshCameraUI()
        {
            DataTable dt        = new DataTable();
            CamereBLL camereBLL = new CamereBLL();
            DataSet   ds        = camereBLL.GetCameraList("");

            dt = ds.Tables[0];
            dataGridView1.DataSource = null;
            dataGridView1.Rows.Clear();
            dataGridView1.DataSource = dt;
        }
Beispiel #2
0
        /// <summary>
        /// 获取相机序列化数据
        /// </summary>
        /// <returns>反馈序列化数据</returns>
        private List <VM_Content> GetCameraInfo(CameraStatus flag, ref string test)
        {
            IList <VM_CameraParameters> camerList = new List <VM_CameraParameters>();
            CamereBLL camereBLL = new CamereBLL();
            DataSet   ds        = new DataSet();

            ds        = camereBLL.GetCameraList("");
            camerList = IListDataSet.DataSetToIList <VM_CameraParameters>(ds, 0);
            //if (m_VoltageLevel == 0)
            //{
            //    camerList = camerList.Where(s => s.exposureMode == "0").ToList();
            //}
            //else
            //{
            //    camerList = camerList.Where(s => s.exposureMode == m_VoltageLevel.ToString()).ToList();
            //}
            camerList = camerList.Where(s => s.exposureMode == m_VoltageLevel.ToString()).ToList();
            IList <VM_Content> camerList2 = new List <VM_Content>();

            if (flag == CameraStatus.Start)
            {
                camerList2.Add(new VM_Content {
                    startTag = "Y", isMulti = "N", illumination = "1", station = "heifei", CameraParameters = camerList
                });
            }
            else if (flag == CameraStatus.Stop)
            {
                camerList2.Add(new VM_Content {
                    startTag = "N", isMulti = "N", illumination = "1", station = "heifei", CameraParameters = camerList
                });
            }
            else
            {
                camerList2.Add(new VM_Content {
                    startTag = "N", isMulti = "N", illumination = "1", station = "heifei", CameraParameters = camerList
                });
            }

            //序列化
            var lists = Newtonsoft.Json.JsonConvert.SerializeObject(camerList2);

            test = lists.ToString();
            //反序列化
            //Newtonsoft.Json.JsonConvert.DeserializeObject<List<VM_Content>>(lists);
            return(null);
        }