UCHumitempure.cs 1.7 KB
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace OnlineStore.XLRStore
{
    public partial class UCHumitempure : UserControl
    {
        public UCHumitempure()
        {
            InitializeComponent();
        }
        public string HumiName
        {
            set
            {
                try
                {
                    this.Invoke(new Action(() =>
                    {
                        groupBox1.Text = value;
                    }));
                }
                catch { }
            }
        }
        public double Tempure
        {
            set
            {
                try
                {
                    this.Invoke(new Action(() =>
                    {
                        lblTempure.Text = $"温度:{value}℃";
                    }));
                }
                catch { }
            }
        }
        public double Humiti
        {
            set
            {
                try
                {
                    this.Invoke(new Action(() =>
                    {
                        lblHumiti.Text = $"湿度:{value}%";
                    }));
                }
                catch { }
            }
        }
        public double Nitrogen
        {
            set
            {
                try
                {
                    this.Invoke(new Action(() =>
                    {
                        lblNitrogen.Text = $"氮气:{value}%";
                    }));
                }
                catch { }
            }
        }
    }
}