| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 557 人关注过本帖
标题:初学者做毕设求注释
只看楼主 加入收藏
半醉人间
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2011-5-11
收藏
 问题点数:0 回复次数:0 
初学者做毕设求注释
这是一个有关串口的程序请高手注释实现部分中的过程中的程序,刚学没多久,要做毕设可是看不懂
unit comm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, SUIButton, StdCtrls, SUIComboBox, Grids, SUIGrid, SPComm, Inifiles;

type
  TfrmComm = class(TForm)
    Comm1: TComm;
    GroupBox1: TGroupBox;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    suiComboBox1: TsuiComboBox;
    suiComboBox2: TsuiComboBox;
    suiComboBox3: TsuiComboBox;
    suiButton1: TsuiButton;
    procedure suiButton1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure Comm1ReceiveData(Sender: TObject; Buffer: PChar;
      BufferLength: Word);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmComm: TfrmComm;

implementation

uses main, DealWithReceiveData, pubvar;



{$R *.dfm}

procedure TfrmComm.suiButton1Click(Sender: TObject);
var
  dms_ini:TiniFile;
  CommBaud, CommName :string;
  CommParity : byte;
begin
  dms_ini:=TiniFile.Create(GetCurrentDir()+'\config.ini');
  with dms_ini do
  begin
    Writestring('Comm','CommName',suiComboBox1.Text);
    Writestring('Comm','CommBaud',suiComboBox2.Text);
    WriteInteger('Comm','CommParity',suiComboBox3.ItemIndex);
  end;
  dms_ini.Free;
  frmMenu.ReadConfig;
  close;
end;

procedure TfrmComm.FormShow(Sender: TObject);
var
  dms_ini:TiniFile;
  CommBaud, CommName :string;
  CommParity : byte;
begin
  dms_ini:=TiniFile.Create(GetCurrentDir()+'\config.ini');
  with dms_ini do
  begin
    CommName:=trim(readstring('Comm','CommName','1'));
    CommBaud:=trim(readstring('COMM','CommBaud','9600'));
    CommParity:=readInteger('COMM','CommParity',0);
  end;
  dms_ini.Free;
  suiComboBox1.Text :=   CommName ;
  suiComboBox2.Text :=   CommBaud ;
  suiComboBox3.ItemIndex :=   CommParity ;
end;

procedure (Sender: TObject; Buffer: PChar;
  BufferLength: Word);
var
  i : integer;
  RxBufTemp : array [0..1000] of byte;
  tempstr : string;
begin
  for i:=0 to bufferlength-1 do
  begin
    RxBufTemp[i]:=ord(Buffer[i]);  //求字符Buffer的编号
    tempstr:=tempstr+inttohex(ord(RxBufTemp[i]),2)+' ';
  end;
  frmMenu.RecordData('Rx : '+tempstr);
  if checkData(RxBufTemp, BufferLength, SysInfo) =1 then
  begin
    frmMenu.ResetTimer;
    DealWithData(SysInfo);
  end;
end;

end.
搜索更多相关主题的帖子: Windows 
2011-05-11 09:57
快速回复:初学者做毕设求注释
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016597 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved