⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 quxianhuizhi.pas

📁 显示热传感器18b20测得的实时温度
💻 PAS
字号:
unit quxianhuizhi;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons, StdCtrls, sgr_def, sgr_data, DB, ADODB;

type
  Tqxhz = class(TForm)
    sp_XYPlot1: Tsp_XYPlot;
    Label1: TLabel;
    Label2: TLabel;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    sp_XYLine1: Tsp_XYLine;
    ADOQuerywdcj1: TADOQuery;
    ADOConnection1: TADOConnection;
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  qxhz: Tqxhz;

implementation
{$R *.dfm}

procedure Tqxhz.SpeedButton2Click(Sender: TObject);
begin
close;
end;

procedure Tqxhz.SpeedButton1Click(Sender: TObject);
var
temp:double;
x:integer;
y:double;
begin
    x:=0;
    ADOQuerywdcj1.Close;
    ADOQuerywdcj1.SQL.Clear;
    ADOQuerywdcj1.sql.Add('select * from 采集表');
    ADOQuerywdcj1.open;
  if ADOQuerywdcj1.RecordCount>0 then
  begin
  while not ADOQuerywdcj1.Eof do
    begin
     temp:=ADOQuerywdcj1.fieldbyname('温度').AsFloat;
     y:=temp ;
     sp_XYLine1.LineAttr.Width:=1;
     sp_XYLine1.LineAttr.Color:=clred;
     sp_XYLine1.InsertXY(0,x,y);
     x:=x+1;
     ADOQuerywdcj1.Next;
       end;
        end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -