Ejemplo n.º 1
0
        /// <summary>
        /// 设置继电器器列表
        /// </summary>

        private void SetListRelay()
        {
            lstRelay.Items.Clear();

            foreach (ES.Domain.Sensor relay in SensorApp.GetRelayList())
            {
                Label lbl = new Label();
                lbl.Content = relay.Name + "  " + "地址:" + Converts.ByteToString((byte)relay.Address);
                lbl.Tag     = relay;
                lstRelay.Items.Add(lbl);
            }
            this.lstRelay.SelectedIndex = 0;
        }
Ejemplo n.º 2
0
        public override string GetData()
        {
            string state = "";

            if (this.Data[0] == 0x01)
            {
                state = "有烟";
            }
            else
            {
                state = "无烟";
            }
            return("状态:" + Converts.ByteToString(this.Data[0]) + "  " + state);
        }
        /// <summary>
        /// 显示传感器集合
        /// </summary>
        /// <returns></returns>
        public static ObservableCollection <ShowSensorData> ShowSensorDatasList(Coordinator coordinator)
        {
            ObservableCollection <ShowSensorData> observableCollection = new ObservableCollection <ShowSensorData>();

            foreach (Sensor sensor in GetCoorList(coordinator))
            {
                ShowSensorData showSensor = new ShowSensorData();
                showSensor.Name    = sensor.Name;
                showSensor.Address = Converts.ByteToString((byte)sensor.Address);
                showSensor.State   = "未连接";
                observableCollection.Add(showSensor);
            }
            return(observableCollection);
        }
Ejemplo n.º 4
0
        public WindowSensorInfo(Sensor sensor, bool isInsert)
        {
            InitializeComponent();


            cboType.ItemsSource = SensorTypeApp.GetList();
            _isInsert           = isInsert;
            _sensor             = sensor;
            tbName.Text         = _sensor.Name;
            GetType();   //获取传感器类型

            if (isInsert != true)
            {
                tbAddress.Text = Converts.ByteToString((byte)_sensor.Address);
            }
            else
            {
                tbAddress.Text = _sensor.Address.ToString();
            }
        }
 public override string GetData()
 {
     return("状态:" + Converts.ByteToString(this.Data[0]));
 }