- 博客(0)
- 资源 (12)
- 收藏
- 关注
ACReport delphi XE 10
ACReport 支持 delphi XE 10 新版本 国内优秀的报表组件。ACReport delphi XE 10测试可以正常安装。
2016-03-01
delphi 串口编程
串口 实现
function TFTransForm.OpenPort:Boolean;
var
ret:Integer;
begin
OpenPort := false;
ret := sio_open(GCommData.Port);
if ret <> SIO_OK then
begin
MxShowError('sio_open',ret);
Exit;
end;
if PortSet() = false then
begin
sio_close(GCommData.Port);
Exit;
end;
OpenPort := true;
GbOpen := true;
SwitchMenu();
ShowStatus();
end;
procedure TFTransForm.ClosePort;
begin
sio_close (GCommData.Port);
GbOpen := False;
SwitchMenu();
ShowStatus();
end;
function TFTransForm.PortSet:boolean;
var
port : LongInt;
mode : LongInt;
hw,sw : LongInt;
ret : LongInt;
begin
port := GCommData.Port;
mode := GCommData.Parity or GCommData.ByteSize or GCommData.StopBits;
PortSet := false;
if GCommData.Hw then
hw := 3 { bit0 and bit1 }
else
hw := 0;
if GCommData.Sw then
sw := 12 { bit2 and bit3 }
else
sw := 0;
ret := sio_ioctl(port,GCommData.BaudRate,mode);
if ret<>SIO_OK then
begin
MxShowError('sio_ioctl',ret);
Exit;
end;
ret := sio_flowctrl(port,hw or sw);
if ret<>SIO_OK then
begin
MxShowError('sio_flowctrl',ret);
Exit;
end;
ret := sio_DTR(port,Integer(GCommData.Dtr));
if ret<>SIO_OK then
begin
MxShowError('sio_DTR',ret);
Exit;
end;
if not GCommData.Hw then
begin
ret := sio_RTS(port,Integer(GCommData.Rts));
if ret<>SIO_OK then
begin
MxShowError('sio_RTS',ret);
Exit;
end;
end;
ShowStatus();
PortSet := True;
end;
2011-04-12
abstractfactory delphi实现的例子
Abstractfactory
Factory模式对于对象的创建给予开发人员提供了很好的实现策略,但是Factory模式仅仅局限于一类类(就是说Product是一类,有一个共同的基类),如果我们要为不同类的类提供一个对象创建的接口,那就要用AbstractFactory了;AbstractFactory模式就是用来解决这类问题的:要创建一组相关或者相互依赖的对象
2008-09-25
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人