• 大小: 109KB
    文件类型: .zip
    金币: 2
    下载: 2 次
    发布日期: 2021-06-12
  • 语言: C#
  • 标签: c#  温度湿度  绘图  

资源简介

用c# 开发的 显示下位机无线传送来的温度湿度 ,和统计温度湿度历史数据的 程序

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Runtime.InteropServices;

namespace EnviromentMonitor
{
    public partial class child : Form
    { 
        
        public bool dataPrepare=false;
        public Point mousePoint;
        public string readString;
        public string zeroTime;
        public Int32 filePosition;
        public class Pic
        {
            public Point[] pointTemp=new Point[5000];
            public Point[] pointHumid = new Point[5000];

            private Int32 pointNum;
            public Int16 count = 0;
            public Int32 Height;
            public Int32 Humidity;
            public Int32 Temperature;
            public string HumidityString;
            public string TemperatureString;
            public string DisplayString;
            public bool newPicture = false;
            public Color backColor;
            public Pen humidPen;
            public Pen tempPen;
            public Font wordFont;
            public Int32 d_value;

            public void init(PictureBox picbox Pen hpen Pen tPen Font wFont Int32 dv)
            {
                Height = picbox.Height;
                d_value = dv;
                humidPen = hpen;
                tempPen = tPen;
                wordFont = wFont;
                backColor = picbox.BackColor;
                pointNum = 0;
            
            }

            public Point movePoint(Point p Int32 x Int32 y)
            {
                return (new Point(p.X +x p.Y + y));
            }

            public void updataData(Point h Point tTextBox tb)
            {
                pointTemp[pointNum] = movePoint(t d_value0);
                pointHumid[pointNum] = movePoint(h d_value0);
                pointTemp[pointNum].Y = Height - pointTemp[pointNum].Y*5-d_value;
                pointHumid[pointNum].Y = Height - pointHumid[pointNum].Y*5-d_value;
                pointNum++;
            }

            public void draw_line(Int32 startXInt32 endXGraphics g)
            {
                Int32 i = 0;
                
                for (i = 0; i < pointNum-1; i++)
                {
                    if (pointHumid[i].X >= startX + d_value && pointHumid[i].X <= endX + d_value)
                    {
                        g.DrawLine(humidPen movePoint(pointHumid[i] -startX 0) movePoint(pointHumid[i+1] -startX 0));
                    }
                    if (pointTemp[i].X >= startX + d_value && pointTemp[i].X <= endX + d_value)
                    {
                        g.DrawLine(tempPen movePoint(pointTemp[i] -startX 0) movePoint(pointTemp[i+1] -startX 0));
                    }
                }

           

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-04-22 19:54  port asistance422\
     文件         914  2014-03-25 15:37  port asistance422\port asistance.sln
     文件       34816  2014-04-22 22:50  port asistance422\port asistance.suo
     目录           0  2014-04-22 20:44  port asistance422\WindowsFormsApplication1\
     目录           0  2014-04-22 19:54  port asistance422\WindowsFormsApplication1\bin\
     目录           0  2014-04-22 21:46  port asistance422\WindowsFormsApplication1\bin\Debug\
     文件       28160  2014-04-22 22:48  port asistance422\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
     文件       58880  2014-04-22 22:48  port asistance422\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb
     文件       11600  2014-04-22 22:50  port asistance422\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe
     文件         490  2009-08-31 00:40  port asistance422\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest
     目录           0  2014-04-19 20:57  port asistance422\WindowsFormsApplication1\bin\Release\
     文件       17002  2014-04-22 21:50  port asistance422\WindowsFormsApplication1\child_data.cs
     文件        5688  2014-04-22 21:13  port asistance422\WindowsFormsApplication1\child_data.designer.cs
     文件        6388  2014-04-22 20:30  port asistance422\WindowsFormsApplication1\child_data.resx
     文件           3  2014-04-19 20:58  port asistance422\WindowsFormsApplication1\DataClasses1.dbml
     文件           3  2014-04-19 20:58  port asistance422\WindowsFormsApplication1\DataClasses1.dbml.layout
     文件        1703  2014-04-19 20:58  port asistance422\WindowsFormsApplication1\DataClasses1.designer.cs
     文件           3  2014-04-19 20:59  port asistance422\WindowsFormsApplication1\DataClasses2.dbml
     文件           3  2014-04-19 20:59  port asistance422\WindowsFormsApplication1\DataClasses2.dbml.layout
     文件        1703  2014-04-19 20:59  port asistance422\WindowsFormsApplication1\DataClasses2.designer.cs
     文件       15988  2014-04-22 19:53  port asistance422\WindowsFormsApplication1\Deal_data.cs
     文件       21168  2014-04-22 22:48  port asistance422\WindowsFormsApplication1\main_port.cs
     文件        6970  2014-04-22 22:48  port asistance422\WindowsFormsApplication1\main_port.Designer.cs
     文件        6550  2014-04-22 22:48  port asistance422\WindowsFormsApplication1\main_port.resx
     目录           0  2014-04-22 19:54  port asistance422\WindowsFormsApplication1\obj\
     目录           0  2014-04-22 19:54  port asistance422\WindowsFormsApplication1\obj\x86\
     目录           0  2014-04-22 22:48  port asistance422\WindowsFormsApplication1\obj\x86\Debug\
     文件         180  2014-04-22 19:46  port asistance422\WindowsFormsApplication1\obj\x86\Debug\Deal_data.Form1.resources
     文件        4440  2014-03-25 20:30  port asistance422\WindowsFormsApplication1\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        6350  2014-04-22 22:48  port asistance422\WindowsFormsApplication1\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件         180  2014-04-22 21:50  port asistance422\WindowsFormsApplication1\obj\x86\Debug\EnviromentMonitor.child.resources
............此处省略20个文件信息

评论

共有 条评论