gait management system

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;

namespace Gait_Monitoring_System
{
    public partial class FormMain : Form
    {
        private double tm = 0;
        private double tm1 = 0;//温度
        private double pm = 0;
        private double pm1 = 0;//压力
        private double bm = 0;
        private double bm1 = 0;//血氧

        private double ss, st = 0;//时间间隔
        private List<double> TM = new List<double>(100);
        private List<double> PM = new List<double>(100);
        private List<double> BM = new List<double>(100);
        private List<double> TM1 = new List<double>(100);
        private List<double> PM1 = new List<double>(100);
        private List<double> BM1 = new List<double>(100);
         
        private Queue<double> Tm = new Queue<double>(100);
        private Queue<double> Tm1 = new Queue<double>(100);
        private Queue<double> Pm = new Queue<double>(100);
        private Queue<double> Pm1 = new Queue<double>(100);
        private Queue<double> Bm = new Queue<double>(100);
        private Queue<double> Bm1 = new Queue<double>(100);
        private bool Ready = true;
        private bool contrl = false;
        //端口  
        private SerialPort serialport = new SerialPort();
        private SerialPort serialport1 = new SerialPort();
        private SerialPort serialport2 = new SerialPort();
        public FormMain()
        {
            InitializeComponent();
        }
        //温度监测图表
        private void DistanceData_Line() {
            this.chart1.ChartAreas.Clear();
            chart1.BackColor = System.Drawing.Color.Transparent;
            ChartArea chartarea = new ChartArea("温度监测");
            this.chart1.ChartAreas.Add(chartarea);
            //X轴
            chartarea.AxisX.MajorGrid.LineColor = System.Drawing.Color.Transparent;
            chartarea.AxisX.MajorTickMark.Enabled = false;
            chartarea.AxisX.LineColor = Color.Teal;
            chartarea.AxisX.LabelStyle.ForeColor = Color.Teal;
            chartarea.AxisX.MajorTickMark.LineColor = Color.Teal;
            //Y轴
            chartarea.AxisY.MajorGrid.LineColor = System.Drawing.Color.Transparent;
            chartarea.AxisY.MajorTickMark.Enabled = false;
            chartarea.AxisY.LineColor = Color.Teal;
            chartarea.AxisY.LabelStyle.ForeColor = Color.Teal;
            chartarea.AxisY.MajorTickMark.LineColor = Color.Teal;
            chartarea.AxisX.ScrollBar.Enabled = false;
            chartarea.AxisX.Interval = 5;
            chartarea.AxisX.MajorGrid.LineColor = System.Drawing.Color.Transparent;
            chartarea.AxisY.MajorGrid.LineColor = System.Drawing.Color.Transparent;
            chartarea.BackColor = System.Drawing.Color.Transparent;
            //表头
            this.chart1.Titles.Clear();
            this.chart1.Titles.Dispose();
            //this.chart1.Titles.Add("温度监测");
            //this.chart1.Titles[0].Text = "温度监测";
            //this.chart1.Titles[0].ForeColor = Color.White;
            //this.chart1.Titles[0].Font = new System.Drawing.Font("Microsoft sans serif",12f);
            //定义存储和显示点的容器
            this.chart1.Series.Clear();
            Series series = new Series("R");
            series.IsVisibleInLegend = false;
            series.ChartType = SeriesChartType.SplineArea;
            //series.ChartArea = "温度监测";
            //series.Color = Color.White;
            series.MarkerBorderWidth = 2;
            series.MarkerSize = 4;
            series.MarkerStyle = MarkerStyle.Diamond;
            series.ToolTip = "温度右"+"#VAL \r\n #AXISLABEL";
            chart1.Series.Add(series);
        }
        //血氧
        private void Blood_line() {
            //定义表区域
            this.chart2.ChartAreas.Clear();
            chart2.BackColor = System.Drawing.Color.Transparent;
            ChartArea chartarea = new ChartArea("血氧右");
            this.chart2.ChartAreas.Add(chartarea);
            chartarea.BorderColor = System.Drawing.Color.Transparent;
            //X轴属性
            chartarea.AxisX.MajorGrid.LineColor = System.Drawing.Color.Transparent;
            chartarea.AxisX.MajorTickMark.Enabled = false;
            chartarea.AxisX.MajorTickMark.LineColor = Color.Teal;
            chartarea.AxisX.LabelStyle.ForeColor = Color.Teal;
            chartarea.AxisX.LineColor = Color.Teal;
            //Y轴属性
            chartarea.AxisY.MajorGrid.LineColor = Color.Black;
            chartarea.AxisY.MajorGrid.Enabled = false;
            chartarea.AxisY.LabelStyle.ForeColor = Color.Teal;
            chartarea.AxisY.LineColor = Color.Teal;
            chartarea.AxisY.MajorTickMark.LineColor = Color.Teal;
            //网格
            chartarea.AxisX.ScrollBar.Enabled = false;
            chartarea.AxisX.Interval = 5;
            chartarea.AxisX.MajorGrid.LineColor = System.Drawing.Color.Transparent;
            chartarea.AxisY.MajorGrid.LineColor = System.Drawing.Color.Transparent;
            chartarea.BackColor = System.Drawing.Color.Transparent;
            //表头
            this.chart2.Titles.Clear();
            //this.chart2.Titles.Add("血氧");
            //this.chart2.Titles[0].Text = "血氧右";
            this.chart2.Titles[0].ForeColor = Color.White;
            this.chart2.Titles[0].Font = new System.Drawing.Font("Microsoft sans serif",12f);
            //定义存储和显示点的容器
            this.chart2.Series.Clear();
            Series series = new Series("R");
            series.IsVisibleInLegend = false;
            series.ChartType=SeriesChartType.SplineArea;
            //series.ChartArea = "血氧右";
            //series.MarkerBorderWidth = 2;
            series.MarkerSize = 4;
            series.MarkerStyle = MarkerStyle.Diamond;
            series.ToolTip = "血氧右"+"#VAL \r\n #AXISLABEL";
            chart2.Series.Add(series);
            
        }
        private void Presure_line() {
            //定义表区域
            this.chart3.ChartAreas.Clear();
            chart3.BackColor = System.Drawing.Color.Transparent;
            ChartArea chartarea = new ChartArea("压力右");
            this.chart3.ChartAreas.Add(chartarea);
            //X轴
            chartarea.AxisX.MajorGrid.LineColor = System.Drawing.Color.Transparent;
            chartarea.AxisX.MajorTickMark.Enabled = false;
            chartarea.AxisX.LineColor = Color.Teal;
            chartarea.AxisX.LabelStyle.ForeColor = Color.Teal;
            chartarea.AxisX.MajorTickMark.LineColor = Color.Teal;
            //Y轴
            chartarea.AxisY.MajorGrid.LineColor = System.Drawing.Color.Transparent;
            chartarea.AxisY.MajorTickMark.Enabled = false;
            chartarea.AxisY.MajorTickMark.LineColor = Color.Teal;
            chartarea.AxisY.LabelStyle.ForeColor = Color.Teal;
            chartarea.AxisY.LineColor = Color.Teal;
            chartarea.AxisX.ScrollBar.Enabled = false;
            chartarea.AxisX.Interval = 5;
            chartarea.AxisX.MajorGrid.LineColor = System.Drawing.Color.Transparent;
            chartarea.AxisY.MajorGrid.LineColor = System.Drawing.Color.Transparent;
            chartarea.BackColor = System.Drawing.Color.Transparent;
            //表头
            this.chart3.Titles.Clear();
            //this.chart3.Titles.Add("压力右");
            //this.chart3.Titles[0].Text = "压力右";
            this.chart3.Titles[0].ForeColor = Color.Red;
            this.chart3.Titles[0].Font = new System.Drawing.Font("Microsoft sans serif",12f);
            //定义存储和显示点的容器
            this.chart3.Series.Clear();
            Series series = new Series("R");
            series.IsVisibleInLegend=false;
            //series.ChartArea = "压力右";
            series.ChartType = SeriesChartType.SplineArea;
            //series.Color = Color.Red;
            series.MarkerBorderWidth = 2;
            series.MarkerSize = 4;
            series.MarkerStyle = MarkerStyle.Diamond;
            series.ToolTip = "压力右" + "#VAL \n\r #AXISLABEL";
            chart3.Series.Add(series);
        }
        //画图格式方法
        private void TBP_line(Chart chart3,String name)
        {
            //定义表区域
            chart3.ChartAreas.Clear();
            chart3.BackColor = System.Drawing.Color.Transparent;
            ChartArea chartarea = new ChartArea(name);
            chart3.ChartAreas.Add(chartarea);
            //x轴
            chartarea.AxisX.MajorGrid.LineColor = System.Drawing.Color.Transparent;
            chartarea.AxisX.MajorTickMark.Enabled = false;
            chartarea.AxisX.LineColor = Color.DarkCyan;
            chartarea.AxisX.LabelStyle.ForeColor = Color.DarkCyan;
            chartarea.AxisX.MajorTickMark.LineColor = Color.DarkCyan;
            //y轴
            chartarea.AxisY.MajorGrid.LineColor = System.Drawing.Color.Transparent;
            chartarea.axisY.MajorTickMark.Enabled = false;
            chartarea.AxisY.MajorTickMark.LineColor = Color.DarkCyan;
            chartarea.AxisY.LineColor = Color.DarkCyan;
            chartarea.AxisY.LabelStyle.ForeColor = Color.DarkCyan;
            chartarea.AxisX.ScrollBar.Enabled = false;
            chartarea.AxisX.Interval = 5;
            chartarea.AxisX.MajorGrid.LineColor = System.Drawing.Color.Transparent;
            chartarea.AxisY.MajorGrid.LineColor = System.Drawing.Color.Transparent;
            chartarea.BackColor = System.Drawing.Color.Transparent;
            //表头
            chart3.Titles.Clear();
            //chart3.Titles.Add(name);
            //chart3.Titles[0].Text = name;
            //chart3.Titles[0].ForeColor = Color.Red;
           // chart3.Titles[0].Font = new System.Drawing.Font("Microsoft sans serif", 12f);
            //定义存储和显示点的容器
            chart3.Series.Clear();
            Series series = new Series("L");
            series.IsVisibleInLegend = false;
            series.ChartArea = name;
            series.ChartType = SeriesChartType.SplineArea;
            //series.Color = Color.Red;
            series.MarkerBorderWidth = 2;
            series.MarkerSize = 4;
            series.MarkerStyle = MarkerStyle.Diamond;
            series.ToolTip = name + "#VAL \n\r #AXISLABEL";
            chart3.Series.Add(series);
        }
        //入口参数:
        //距离:dM
        //速度:vM
        private void ChartData() { 
            if(Tm.Count>10){
                Tm.Dequeue();
                Bm.Dequeue();
                Pm.Dequeue();
                Tm1.Dequeue();
                Bm1.Dequeue();
                Pm1.Dequeue();
            }
            if(Ready == true){
                TM.Add(tm);
                BM.Add(bm);
                PM.Add(pm);
                TM1.Add(tm1);
                BM1.Add(bm1);
                PM1.Add(pm1);
                Tm.Enqueue(tm);
                Tm1.Enqueue(tm1);
                Bm.Enqueue(bm);
                Bm1.Enqueue(bm1);
                Pm.Enqueue(pm);
                Pm1.Enqueue(pm1);
            }
            
            for (int i = 0; i < Tm.Count; i++) {
                this.chart1.Series[0].Points.AddY(Tm.ElementAt(i));
                this.chart2.Series[0].Points.AddY(Bm.ElementAt(i));
                this.chart3.Series[0].Points.AddY(Pm.ElementAt(i));
                this.chart4.Series[0].Points.AddY(Tm1.ElementAt(i));
                this.chart5.Series[0].Points.AddY(Bm1.ElementAt(i));
                this.chart6.Series[0].Points.AddY(Pm1.ElementAt(i));
            }
            //MessageBox.Show(Tm.Count.ToString());

        }
        private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
        {

        }

        //云图
        private void Draw() { 
            byte[] _intensity = new byte[8];
            int[] _pres = new int[8];
            Random random = new Random();
            for (int i = 0; i < 8; i++) {
                int randkey = random.Next(0,4096);
                _pres[i] = randkey;
            }
            for (int i = 0; i < 8; i++) {
                _intensity[i] = judge(_pres[i]);
            }
        }

        private byte judge(int i)
        {
            if(i==0){
                return (byte)0;
            }
            else if (i < 800 && i > 0 || i == 800) {
                return (byte)50;

            }
            else if (i > 800 && i < 1600 || i == 1600) {
                return (byte)100;
            }
            else if (i > 1600 && i < 2400 || i == 2400) {
                return (byte)150;

            }
            else if (i > 2400 && i < 3200 || i == 3200) { 
                return (byte)200;
            }
            else {
                return (byte)250;
            }
            //throw new NotImplementedException();
        }
        List<Point> _heatpoints = new List<Point>();
        float _brushStop = 1.0F;
        private int _heatpointRadius = 20;
        public void drawMarsk(byte[] _intensity) { 
            _heatpoints.Add(new Point(90,100));
            _heatpoints.Add(new Point(90,140));
            _heatpoints.Add(new Point(90, 180));
            _heatpoints.Add(new Point(90, 220));
            _heatpoints.Add(new Point(120, 100));

        }
        private void FormMain_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“ssDataSet.yonghu”中。您可以根据需要移动或删除它。
            //this.yonghuTableAdapter.Fill(this.ssDataSet.yonghu);
           //绑定事件
            serialport.PortName = "COM5";//cbbComList.SelectedItem.ToString();
            serialport.BaudRate = 9600;//Convert.ToInt32(cbbBaudRate.SelectedItem.ToString());
            //serialport.Parity = (Parity)Convert.ToInt32("");//cbbParity.SelectedIndex.ToString());
            serialport.DataBits = Convert.ToInt32("8");//cbbDataBits.SelectedItem.ToString());
            serialport.StopBits = (StopBits)Convert.ToInt32("1");//cbbStopBits.SelectedItem.ToString());
            //
            serialport1.PortName = "COM6";
            serialport1.BaudRate = 9600;
            serialport1.DataBits = Convert.ToInt32("8");
            serialport1.StopBits = (StopBits)Convert.ToInt32("1");
            //
            serialport2.PortName = "COM7";
            serialport2.BaudRate = 9600;
            serialport2.DataBits = Convert.ToInt32("8");
            serialport2.StopBits = (StopBits)Convert.ToInt32("1");
            try
            {
                serialport.Open();
                serialport1.Open();
                serialport2.Open();
            }
            catch (Exception exception) {
                MessageBox.Show("未连接设备");
            }
            serialport.DataReceived += new SerialDataReceivedEventHandler(serialport_DataReceived);
            //MessageBox.Show(s);
            //画图
            //DistanceData_Line();
            //Blood_line();
            //Presure_line();
        }
        //测试
        private void test() {
            string p = "B5B1C7B0D1B9C1A62076616C31203D2030202076616C32203D2030202076616C33203D2030202076616C34203D203133202076616C35203D203020200D0A2076616C36203D2030202076616C37203D2030202076616C38203D2030202076616C39203D203020200D0AB5B1C7B0CEC2B6C8203D2033360D0AB5B1C7B0D1AAD1F5203D203938";
            p = p.Replace(" ", "");

            MatchCollection mc = Regex.Matches(p, @"\(203D20?(.+?)\)");
            foreach (Match m in mc)
            {
                MessageBox.Show(m.Groups[0].Value);
            }
        }
        //编码
        private string encoding_Byte2(string pressure4)
        {
            string s = "";
            byte[] array = new byte[2];
            for (int i = 0; i < 2; i++)
            {
                System.Text.ASCIIEncoding asciiEncoding = new ASCIIEncoding();
                array[i] = (byte)(Convert.ToInt32(Convert.ToByte(pressure4.Substring(i*2,2), 16)));
                s = asciiEncoding.GetString(array);
                //s += s;
            }
            return s;
        }
        //编码
        private string encoding(string pressure1) {
            System.Text.ASCIIEncoding asciiEncoding = new ASCIIEncoding();
            byte[] array = new byte[1];
            array[0] = (byte)(Convert.ToInt32(Convert.ToByte(pressure1, 16)));
            string s = asciiEncoding.GetString(array);
            return s;
        }
        private MatchCollection getValue(string str, string s, string e) {
            //Regex rg = new Regex("?<=(" + s + "))[.\\s\\S]*?(?=(" + e + "))", RegexOptions.Multiline | RegexOptions.Singleline);
            //return rg.Match(str).Value;
            MatchCollection mc = Regex.Matches(str, "?<=(" + s + "))[.\\s\\S]*?(?=(" + e + "))", RegexOptions.Multiline|RegexOptions.Singleline);
            return mc;
        }
        private void panel1_Paint(object sender, PaintEventArgs e)
        {

        }
        
        private Random random = new Random();
        private void serialport_DataReceived(object sender, SerialDataReceivedEventArgs e) {
            
            //数据变量
            byte[] datas = new byte[serialport.BytesToRead];
            //读取数据
            serialport.Read(datas, 0, datas.Length);
            //输出数据
            this.add_Data(datas);
            //Thread.Sleep(1000);
        }

        private void add_Data(byte[] datas)
        {
            //如果为空抛出异常
            if(datas==null){
                throw new NotImplementedException();
            }
            //数据流
            //StringBuilder stringbuilder = new StringBuilder();
            //for(int i=0;i<datas.Length;i++){
            //    stringbuilder.AppendFormat("{0:x2}"+"",datas[i]);
            //}
            add_Content(new ASCIIEncoding().GetString(datas));
            
            //add_Content(stringbuilder.ToString().ToUpper());
        }
        string[] presure = new string[26];
        private void add_Content(string p)
        {
            if (p == null)
            {
                throw new NotImplementedException();
            }

            try
            {
                //MessageBox.Show(p);
                //p = p.Replace(" ", "");
                //label1.t
                //MessageBox.Show(p);
                
                //Get the word which between two dots(,)
                string[] sArray1 = p.Split(' ');
                for (int i = 0; i < 26; i++)
                {
                    presure[i] = sArray1[i];
                }
                this.BeginInvoke(new MethodInvoker(delegate
                {
                    BloodOxygenValue_1.Text = presure[1];
                    BloodOxygenValue_6.Text = presure[1];
                    temperat5.Text = presure[2];
                    temperature1.Text = presure[2];
                    temperature2.Text = presure[3];
                    temperature3.Text = presure[4];
                    temperature4.Text = presure[5];
                    temperature5.Text = presure[6];
                    temperature6.Text = presure[7];
                    temperature7.Text = presure[8];
                    temperature8.Text = presure[9];

                    label9.Text = View1(presure[10]);
                    label10.Text = View1(presure[11]);
                    label11.Text = View1(presure[12]);
                    label12.Text = View1(presure[13]);
                    label13.Text = View1(presure[14]);
                    label14.Text = View1(presure[15]);
                    label15.Text = View1(presure[16]);
                    PresureValue_1.Text = View1(presure[17]);
                    //PresureValue_2.Text = presure[18];
                    presure1.Text = View1(presure[18]);
                    presure2.Text = View1(presure[19]);
                    presure3.Text = View1(presure[20]);
                    presure4.Text = View1(presure[21]);
                    presure5.Text = View1(presure[22]);
                    presure6.Text = View1(presure[23]);
                    presure7.Text = View1(presure[24]);
                    presure8.Text = View1(presure[25]);
                    //presure9.Text = presure[27];
                    //if (chkAutoLine.Checked && RecieveBox.Text.Length > 0)
                    //{
                    //    RecieveBox.AppendText("\r\n");
                    //}
                    //RecieveBox.AppendText(content);
                }));
            }
            catch (Exception e) {
                //MessageBox.Show("1");
            }
            //label9.Text = presure[0];
            //Thread th = new Thread(View1);
            //th.Start();
            //label9.Text = presure[0];
            //foreach (string i in sArray1) {
            //    //MessageBox.Show(i);
            //    label9.Text = sArray1[0] + "N";
            //}
                
            //Regex r = new Regex(@"^.*?,(?<word>[\w\s]+),.*$",
            //                RegexOptions.Compiled | RegexOptions.IgnoreCase);
            //foreach (Match m in r.Matches(p))
            //{
            //    foreach (Capture c in m.Captures)
            //    {
            //        string word = c.Value;//The word you want?
            //        MessageBox.Show(word);
            //    }
            //}
            //string pressure = p.Substring(0, 32);
            //View(p);
        }

        private String  View1(string p)
        {
            double volt = Convert.ToDouble(p);
            return (0.203335 * volt -50.915).ToString();
        }
        private void View(string p)
        {
            string pressure1 = p.Substring(18 + 14, 4);
            string pressure2 = p.Substring(18 + 20 + 14, 4);
            string pressure3 = p.Substring(18 + 20 + 20 + 14, 4);
            string pressure4 = p.Substring(18 + 20 + 20 + 20 + 14, 4);
            string pressure5 = p.Substring(18 + 20 + 20 + 20 + 22 + 14, 4);
            string pressure6 = p.Substring(18 + 20 + 20 + 20 + 22 + 26 + 14, 4);
            string pressure7 = p.Substring(18 + 20 + 20 + 20 + 22 + 26 + 20 + 14, 4);
            string pressure8 = p.Substring(18 + 20 + 20 + 20 + 22 + 26 + 20 + 20 + 14, 4);
            string pressure9 = p.Substring(18 + 20 + 20 + 20 + 22 + 26 + 20 + 20 + 20 + 14, 4);
            string tempture1 = p.Substring(18 + 20 + 20 + 20 + 22 + 26 + 20 + 20 + 20 + 20 + 26, 4);
            string BloodOxygen1 = p.Substring(18 + 20 + 20 + 20 + 22 + 26 + 20 + 20 + 20 + 20 + 30 + 26, 4);
            //MessageBox.Show(BloodOxygen1);

            label9.Text = encoding_Byte2(pressure1) + "N";
            label10.Text = encoding_Byte2(pressure2) + "N";
            label11.Text = encoding_Byte2(pressure3) + "N";
            label12.Text = encoding_Byte2(pressure4) + "N";
            label13.Text = encoding_Byte2(pressure5) + "N";
            label14.Text = encoding_Byte2(pressure6) + "N";
            label15.Text = encoding_Byte2(pressure7) + "N";
            //PresureValue_2.Text = encoding_Byte2(pressure8) + "N";
            temperature2.Text = encoding_Byte2(tempture1) + "℃";
            BloodOxygenValue_1.Text = encoding_Byte2(BloodOxygen1) + "%";
            PresureValue_1.Text = encoding_Byte2(pressure9) + "N";
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            //serialport.DataReceived += new SerialDataReceivedEventHandler(serialport_DataReceived);
            //Random random = new Random();
            // tm = random.Next(20,37);
            // bm = random.Next(90,100);
            // pm = random.Next(100,120);
            // tm1 = random.Next(20,37);
            // bm1 = random.Next(90,100);
            // pm1 = random.Next(100,120);
            //FlyData_Line();
            DistanceData_Line();
            Blood_line();
            Presure_line();
            TBP_line(this.chart4,"温度左");
            TBP_line(this.chart5,"压力左");
            TBP_line(this.chart6,"血氧左");
            ChartData();
            while (true)
            {
                //时间
                time.Text = DateTime.Now.ToString();
                // //初始化
                // double temperatureValue_1 = 37.327,
                //         presureValue_1 = 90,
                //         presureValue_2 = 75,
                //         bloodOxygenValue_1 = 81, 
                //         temperatureValue_5 = 33.123,
                //         presureValue_9 = 80,
                //         presureValue_10 =81,
                //         bloodOxygenValue_5=91,
                //         temperatureValue_6 = 34.143,
                //         presureValue_11 = 71,
                //         presureValue_12=78,
                //         bloodOxygenValue_6=93,
                //         temperatureValue_10 = 34.123,
                //         presureValue_19 = 31,
                //         presureValue_20=32,
                //         bloodOxygenValue_10=94;
                // double[] temperatureValue 
                //     = new double[10]{37.131,36.123,36.561,35.135,37.841,37.315,36.624,38.315,37.256,38.412};
                // double[] presureValue
                //     = new double[20] { 116.123, 116.561, 115.135, 115.135, 117.841, 117.315, 116.624, 118.315, 117.256, 
                //         117.131, 116.123, 116.561, 118.412, 117.131,  117.841, 117.315, 116.624, 118.315, 117.256, 118.412 };
                // double[] bloodOxygenValue
                //     = new double[10] { 97.131, 96.123, 96.561, 95.135, 97.841, 97.315, 96.624, 98.315, 97.256, 98.412 };
                // double rd = random.Next(-500, 500);
                // double rd_100 = rd/100;
                //MessageBox.Show("提示" + rd);
                //赋值
                //group1
                
                //temperature2.Text = (temperatureValue_1 + rd_100).ToString() + "℃";
                //PresureValue_1.Text = (presureValue_1 + rd_100).ToString() + "N";
                PresureValue_2.Text = (presureValue_2 + rd_100).ToString() + "N"; 
                //BloodOxygenValue_1.Text = (bloodOxygenValue_1 + rd_100).ToString() + "%";
                group5
                //TemperatureValue_5.Text = (temperatureValue_5 + rd_100).ToString() + "℃";
                //PresureValue_9.Text = (presureValue_9 + rd_100).ToString() + "N";
                //PresureValue_10.Text = (presureValue_10 + rd_100).ToString() + "N";
                //BloodOxygenValue_5.Text = (bloodOxygenValue_5 + rd_100).ToString() + "%"; 
                group6
                //temperature8.Text = (temperatureValue_6 + rd_100).ToString() + "℃";
                //presure8.Text = (presureValue_11 + rd_100).ToString() + "N";
                //temperat5.Text = (presureValue_12 + rd_100).ToString() + "℃";
                //BloodOxygenValue_6.Text = (bloodOxygenValue_6 + rd_100).ToString() + "%"; 
                group10
                //TemperatureValue_10.Text = (temperatureValue_10 + rd_100).ToString() + "℃";
                //PresureValue_19.Text = (presureValue_19 + rd_100).ToString() + "N";
                //PresureValue_20.Text = (presureValue_20 + rd_100).ToString() + "N";
                //BloodOxygenValue_10.Text = (bloodOxygenValue_10 + rd_100).ToString() + "%"; 

                Label[] temperatureLabel=new Label[10];
                foreach(Control oCon in this.Controls){
                    int iNameLength = oCon.Name.Length;
                }
                
                for(int i=1;i<11;i++){
                    //temperatureLabel[i]= (Label)Controls["TemperatureValue_"+i.ToString()];
                    //temperatureLabel[i] = (Label)Controls["TemperatureValue_1"];
                    //temperatureLabel[i].Text = (presureValue[i] + rd_100).ToString() + "℃";
                }
                //textBox1.Text = (wd1 + rd / 100).ToString() + "℃";
                //画图
                Bitmap bitmap = new Bitmap(150,250);

                return;
            }
        }

        private void xy2_Click(object sender, EventArgs e)
        {

        }

        private void label48_Click(object sender, EventArgs e)
        {

        }

        private void label95_Click(object sender, EventArgs e)
        {

        }

        private void toolTip2_Popup(object sender, PopupEventArgs e)
        {

        }

        private void pictureBox8_Click(object sender, EventArgs e)
        {

        }

        private void chart5_Click(object sender, EventArgs e)
        {

        }

        private void label9_Click(object sender, EventArgs e)
        {

        }

        private void chart4_Click(object sender, EventArgs e)
        {

        }

        private void chart1_Click(object sender, EventArgs e)
        {

        }
        private void pictureBox33_Click(object sender, EventArgs e)
        { 
        }

        private void timer2_Tick(object sender, EventArgs e)
        {

        }
    }
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值