/// <summary>
        /// 新增传感器
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnInsertSensor_OnClick(object sender, RoutedEventArgs e)
        {
            if (lstCoor.SelectedItem != null)
            {
                _coordinator = GetListboxSelected();
                Sensor sensor = new Sensor();

                if (lstCoor != null)
                {
                    sensor.CoordinatorID = _coordinator.ID;

                    WindowSensorInfo windowSensorInfo = new WindowSensorInfo(sensor, true);
                    if (windowSensorInfo.ShowDialog() == true)
                    {
                        _coordinator             = GetListboxSelected();
                        lvSensorList.ItemsSource = ShowSensorData.ShowSensorDatasList(_coordinator);
                        lblSensorCount.Content   = "数量:" + lvSensorList.Items.Count;
                    }
                }
            }
            else
            {
                MessageBox.Show("请先选择协调器!");
            }
        }
 /// <summary>
 /// 编辑传感器信息
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BtnUpdateSensor_OnClick(object sender, RoutedEventArgs e)
 {
     if (lstCoor.SelectedItem != null)
     {
         ShowSensorData showSensorData = GetListviewSelected();
         if (showSensorData != null)
         {
             Sensor sensor;
             sensor = SensorApp.GetList().Where(p => p.Name == showSensorData.Name).First();
             WindowSensorInfo windowSensorInfo = new WindowSensorInfo(sensor, false);
             if (windowSensorInfo.ShowDialog() == true)
             {
                 _coordinator             = GetListboxSelected();
                 lvSensorList.ItemsSource = ShowSensorData.ShowSensorDatasList(_coordinator);
                 lblSensorCount.Content   = "数量:" + lvSensorList.Items.Count;
             }
         }
         else
         {
             MessageBox.Show("请先选择编辑的传感器");
         }
     }
 }