91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 450KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-05
  • 語言: C#
  • 標簽: c#??

資源簡介

是一款溫度采集上位機程序源碼,可作為開發人員的案例

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?ZedGraph;
using?Microsoft.Win32;
//using?System.Windows.Forms.Clipboard;
namespace?WindowsApplication1
{
????public?partial?class?Form1?:?Form
????{
????????//GraphPane?myPane?=?zgc.GraphPane;
????????byte[]?buff?=?new?byte[30];
????????Boolean?isopen=false;
????????int?counter?=?0;
????????PointPairList?list?=?new?PointPairList();

???????//?LineItem?curve;
????????public?Form1()
????????{
????????????InitializeComponent();
????????}

????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????try
????????????{


????????????????if?(isopen?==?false)
????????????????{
????????????????????serialPort1.BaudRate?=?Convert.ToInt32(comboBox2.Text);
????????????????????serialPort1.PortName?=?comboBox1.Text;
????????????????????serialPort1.Open();
????????????????????serialPort1.Write(“s“);
????????????????????if?(Convert.ToUInt16(serialPort1.ReadLine())?!=?1820)
????????????????????{
????????????????????????MessageBox.Show(“沒找到設備“);
????????????????????????return;
????????????????????}
????????????????????button1.Text?=?“停止采集“;

????????????????????isopen?=?true;
????????????????????serialPort1.Write(“i“);
????????????????????label3.Text?=?“器件ID:“?+?serialPort1.ReadLine();
????????????????????serialPort1.Write(“j“);
????????????????????switch?(Convert.ToInt16(serialPort1.ReadLine()))
????????????????????{
????????????????????????case?127:
????????????????????????????label2.Text?=?“12位精度“;
????????????????????????????break;
????????????????????????case?31:
????????????????????????????label2.Text?=?“9位精度“;
????????????????????????????break;
????????????????????????case?63:
????????????????????????????label2.Text?=?“10位精度“;
????????????????????????????break;
????????????????????????case?95:
????????????????????????????label2.Text?=?“11位精度“;
????????????????????????????break;
????????????????????????default:
????????????????????????????label2.Text?=?“未知精度“;
????????????????????????????break;


????????????????????}
????????????????????timer1.Interval?=?Convert.ToInt32(Convert.ToDouble(trackBar1.Value?/?4)?*?1000);
????????????????????timer1.Start();
????????????????}
????????????????else
????????????????{
????????????????????timer1.Stop();
????????????????????serialPort1.Close();
????????????????????serialPort1.Dispose();
????????????????????button1.Text?=?“開始采集“;
????????????????????isopen?=?false;
????????????????}
????????????}
????????????catch?(System.TimeoutException)
????????????{
????????????????MessageBox.Show(“沒找到設備“);
????????????????timer1.Stop();
????????????????????serialPort1.Close();
????????????????????serialPort1.Dispose();
????????????????????button1.Text?=?“開始采集“;
????????????????????isopen?=?false;

????????????}
????????????catch?(Exception?ex)
????????

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????目錄??????????0??2012-06-10?13:30??ds18b20C

-----------?---------??----------?-----??----

??????????????2118395????????????????????107


評論

共有 條評論