RTFormwork/项目代码/RTBasicsV1/F05染色检验/U_iniParam.pas

117 lines
4.0 KiB
ObjectPascal
Raw Normal View History

2024-07-07 09:35:27 +08:00
unit U_iniParam;
interface
uses
IniFiles, SysUtils;
var
Filename: string; //<2F>ļ<EFBFBD><C4BC><EFBFBD>
iParam2: integer;
bParam1: Boolean;
bParam2: Boolean;
SCXFlag: string; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ݴ˱<DDB4>־<EFBFBD><D6BE>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ׺ <20><><EFBFBD>ܰ<EFBFBD><DCB0><EFBFBD><EFBFBD><EFBFBD>ĸ 1,2
SCXCount: string; //<2F><>̨<EFBFBD><CCA8><EFBFBD><EFBFBD>
PortNoStr: string; //<2F>˿ں<CBBF>
DllName: string; //<2F>˿<EFBFBD>Dll<6C>ļ<EFBFBD>
DZCDYDllName: string; //<2F><><EFBFBD>ӳӵ<D3B3><D3B5><EFBFBD>Dll<6C>ļ<EFBFBD>
IsDZCDYDll: string; //<2F><><EFBFBD>õ<EFBFBD><C3B5>ӳӵ<D3B3><D3B5><EFBFBD>Dll<6C>ļ<EFBFBD>
MBDYDllName: string; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dll<6C>ļ<EFBFBD>
IsMBDYDll: string; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dll<6C>ļ<EFBFBD>
IsMBDYDllUnit: string; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dll<6C>ļ<EFBFBD><C4BC><EFBFBD>λ
LabQty: string; // <20><>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>
FMinLen, FMaxLen, FMinWeight, FMaxWeight: string;
FMPlace, FYPlace, FKgPlace: string;
function IsINIFile(): Boolean; //<2F>ж<EFBFBD>InI<6E><49><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
procedure ReadINIFile();
procedure WriteINIFile();
implementation
///////////////////////////////////////////////////////////////////
//<2F><>ȡini<6E>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ò<EFBFBD><C3B2><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
////////////////////////////////////////////////////////////////////
procedure ReadINIFile();
var
programIni: Tinifile; //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
begin
FileName := ExtractFilePath(Paramstr(0)) + 'DyeInspFile.INI';
programIni := Tinifile.create(FileName);
SCXFlag := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><CCA8>־', '1');
SCXCount := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>̨<EFBFBD><CCA8><EFBFBD><EFBFBD>', '1');
DZCDYDllName := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD>ӳӵ<D3B3><D3B5><EFBFBD>Dll<6C>ļ<EFBFBD>', '');
IsDZCDYDll := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD>õ<EFBFBD><C3B5>ӳ<EFBFBD>Dll<6C>ļ<EFBFBD>', '1');
MBDYDllName := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dll<6C>ļ<EFBFBD>', '');
IsMBDYDll := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dll<6C>ļ<EFBFBD>', '1');
IsMBDYDllUnit := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ', '1');
LabQty := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>', '2');
FMinLen := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '0');
FMaxLen := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '100');
FMinWeight := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '0');
FMaxWeight := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '50');
FMPlace := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD>С<EFBFBD><D0A1>λ', '1');
FYPlace := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD>С<EFBFBD><D0A1>λ', '0');
FKgPlace := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD>С<EFBFBD><D0A1>λ', '1');
programIni.Free;
end;
//////////////////////////////////////////////////////////////////
//д<><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>INI<4E>ļ<EFBFBD>
//<2F><><EFBFBD><EFBFBD>
//////////////////////////////////////////////////////////////////
procedure WriteINIFile();
var
programIni: Tinifile; //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
begin
FileName := ExtractFilePath(Paramstr(0)) + 'DyeInspFile.INI';
programIni := Tinifile.create(FileName);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><CCA8>־', SCXFlag);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>̨<EFBFBD><CCA8><EFBFBD><EFBFBD>', SCXCount);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27>˿ں<CBBF>', PortNoStr);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD>ӳӵ<D3B3><D3B5><EFBFBD>Dll<6C>ļ<EFBFBD>', DZCDYDllName);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD>õ<EFBFBD><C3B5>ӳ<EFBFBD>Dll<6C>ļ<EFBFBD>', IsDZCDYDll);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dll<6C>ļ<EFBFBD>', MBDYDllName);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dll<6C>ļ<EFBFBD>', IsMBDYDll);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ', IsMBDYDllUnit);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>', LabQty);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', FMinLen);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', FMaxLen);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', FMinWeight);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', FMaxWeight);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD>С<EFBFBD><D0A1>λ', FMPlace);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD>С<EFBFBD><D0A1>λ', FYPlace);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD>С<EFBFBD><D0A1>λ', FKgPlace);
programIni.Free;
end;
//////////////////////////////////////////////////////////////////
//<2F>ж<EFBFBD>InI<6E>ļ<EFBFBD><C4BC>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
//////////////////////////////////////////////////////////////////
function IsINIFile(): Boolean;
begin
FileName := ExtractFilePath(Paramstr(0)) + 'DyeInspFile.INI';
if FileExists(FileName) then
Result := true
else
Result := false;
end;
end.