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

📄 star.pas

📁 用户名:SYSTEM 密码:空 第一次运行请先恢复数据库 DATABASE 到SQL服务器
💻 PAS
字号:
unit Star;

interface
uses SysUtils,inifiles,forms;
const IniFileName='SunhingStar.ini';
type
    TMachineInfo=Record
                       Com:String;
                       MachineStart:Integer;
                       MachineEnd:Integer;
    end;
Procedure SetComA(IntCom:Integer);
Function HelloA:Boolean;
function SetCallNoA(DeviceNo:Integer):Boolean;
Function SetTimeA:Boolean;
Function GetRecordA(strFileName:String):Boolean;
Function SetOpenA:Boolean;
Function SetCloseA:Boolean;
Function SetNormalA:Boolean;
Function QryStatusA:Boolean;
Function SendStrA( strCommand:String):string;
Function ShowMyFormA(iParm:Integer):Boolean;
function SetOffDayA(strDays:string):Boolean;
function DeviceInitA:Boolean;
Function SetDevNoA(const intDeviceNo:Integer):Boolean;

Function GetMachineSet:TMachineInfo;
Procedure SetMachine(MachineInfo:TMachineinfo);

implementation

procedure SetCom(IntCom:Integer);stdcall;external 'kqjCom.dll';
Function Hello:Boolean;stdcall;external 'kqjCom.dll';
function SetCallNo(DeviceNo:Integer):Boolean;stdcall;external 'kqjCom.dll';
Function SetTime:Boolean;stdcall;external 'kqjCom.dll';
Function GetRecord(strFileName:String):Boolean;stdcall;external 'kqjCom.dll';
Function SetOpen:Boolean;stdcall;external 'kqjCom.dll';
Function SetClose:Boolean;stdcall;external 'kqjCom.dll';
Function SetNormal:Boolean;stdcall;external 'kqjCom.dll';
Function QryStatus:Boolean;stdcall;external 'kqjCom.dll';
Function SendStr( strCommand:String):String;stdcall; external 'kqjCom.dll';
Function ShowMyForm(iParm:Integer):Boolean;stdcall; external 'kqjCom.dll';
function SetOffDay(strDays:string):Boolean;stdcall; external 'kqjCom.dll';
function DeviceInit:Boolean;stdcall; external 'kqjCom.dll';
Function SetDevNo(intDeviceNo:Integer):Boolean;stdcall; external 'kqjCom.dll';

procedure SetComA(IntCom:Integer);
Begin
  SetCom(IntCom);
end;
Function HelloA:Boolean;
Begin
   Result:=Hello;
end;
function SetCallNoA(DeviceNo:Integer):Boolean;
Begin
   Result:=SetCallNo(DeviceNo);
end;
Function SetTimeA:Boolean;
Begin
   Result:=SetTime;
end;
Function GetRecordA(strFileName:String):Boolean;
Begin
    Result:=GetRecord(strFileName);
end;
Function SetOpenA:Boolean;
Begin
    Result:=SetOpen;
end;
Function SetCloseA:Boolean;
Begin
   Result:=SetClose;
end;
Function SetNormalA:Boolean;
Begin
    Result:=SetNormal;
end;
Function QryStatusA:Boolean;
Begin
    Result:=QryStatus;
end;
Function SendStrA( strCommand:String):string;
Begin
    Result:=SendStrA( strCommand);
end;
Function ShowMyFormA(iParm:Integer):Boolean;
Begin
    Result:=ShowMyFormA(iParm)
end;
function SetOffDayA(strDays:string):Boolean;
Begin
   Result:=SetOffDay(strDays)
end;
function DeviceInitA:Boolean;
Begin
   Result:=DeviceInit;
end;
Function SetDevNoA(const intDeviceNo:Integer):Boolean;
Begin
   Result:=SetDevNo(intDeviceNo)
end;


Function GetMachineSet:TMachineInfo;
var
  temMachineInfo:TMachineInfo;
  temIniFile:TIniFile;
begin

  temIniFile:=TiniFile.Create(ExtractFileDir(application.ExeName)+'\'+IniFileName);
  temMachineInfo.Com :=temIniFile.ReadString('Sunhing','Com','COM1');
  temMachineInfo.MachineStart:=temIniFile.ReadInteger('Sunhing','MachineStart',1);
  temMachineInfo.MachineEnd:=temIniFile.ReadInteger('Sunhing','MachineEnd',1);
  teminiFile.Free;
  Result:=temMachineInfo;
end;
Procedure SetMachine(MachineInfo:TMachineinfo);
var
  temIniFile:TIniFile;
begin
  temIniFile:=TiniFile.Create(ExtractFileDir(application.ExeName)+'\'+IniFileName);
  temIniFile.WriteString('Sunhing','Com',MachineInfo.Com );
  temIniFile.WriteInteger('Sunhing','MachineStart',Machineinfo.MachineStart );
  temIniFile.WriteInteger('Sunhing','MachineEnd',MachineInfo.MachineEnd );
  teminiFile.Free;
end;


end.

⌨️ 快捷键说明

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