{------------------------------------------------------------------------------}
|
{µ¥ÔªÃû³Æ£ºuInit.pas }
|
{Ä£¿éÃû³Æ£º³õʼ»¯º¯Êý¿â }
|
{Ä£¿é˵Ã÷£º°üÀ¨Ö÷½ø³ÌÆô¶¯Ê±£¬È«¾Ö±äÁ¿³õʼ»¯¡¢ÏµÍ³Ä¿Â¼³õʼ»¯¡¢ÅäÖüÓÔØ }
|
{½¨Á¢ÈÕÆÚ£º2009-12-20 }
|
{ÐÞ¸ÄÐ޸ģº2023-02-21 }
|
{°æÈ¨ËùÓУºÀîÁ¼Í¥ liangtingli@outlook.com }
|
{------------------------------------------------------------------------------}
|
|
unit uInit;
|
|
interface
|
|
uses
|
Windows, Classes, Messages, Forms, Dialogs, SysUtils, StrUtils, DateUtils,
|
StdCtrls, Variants, ComCtrls, Buttons, Math, IniFiles, Graphics, ShellAPI,
|
SQLite3, SQLiteTable3;
|
|
{ÉêÃ÷È«¾Ö¹«¹²µ÷Óú¯Êý}
|
procedure OpenOnScreenKeyboard();
|
procedure InitGlobal();
|
procedure InitSystemDir();
|
procedure InitDatas();
|
procedure LoadSystemInfo();
|
procedure LoadOptions();
|
procedure SaveOptions();
|
function GetCurrMsgPos(index:Integer):TPoint;
|
|
//ÊÚȨÎļþ¼ì²éÄ£¿é
|
function GetMachineCode():String;
|
function CheckLicense(sFilename, sCode:String):Boolean;
|
procedure RegCheckMode();
|
procedure RegCheck1Mode();
|
//±£´æcsvÊý¾Ý
|
procedure WriteCsvFile(name: string; mois,temp,water: Double);
|
//ˢйÊÕÏÂë
|
procedure RefashFaultCode(cod:Integer);
|
implementation
|
|
uses
|
uMain, log4me, uDM, PubUtils, MsgVar, Global, uSaveData, CpuidInfo, UntDes;
|
|
{º¯Êý·½·¨}
|
|
//------- µ÷ÓÃÈý·½¼üÅÌ ------------------------------------
|
//µ÷ÓÃosk¼üÅÌ
|
procedure OpenOnScreenKeyboard();
|
type TWow64DisableWow64FsRedirection = function(var Wow64FsEnableRedirection: LongBool): LongBool; StdCall;
|
type TWow64RevertWow64FsRedirection = function(var Wow64RevertWow64FsRedirection: LongBool): LongBool; StdCall;
|
var
|
hHandle: THandle;
|
Wow64DisableWow64FsRedirection: TWow64DisableWow64FsRedirection;
|
Wow64RevertWow64FsRedirection: TWow64RevertWow64FsRedirection;
|
OldValue: LongBool;
|
rs: Integer;
|
begin
|
//Çл»32λÎļþϵͳ
|
try
|
hHandle := GetModuleHandle('kernel32.dll');
|
@Wow64DisableWow64FsRedirection := GetProcAddress(hHandle, 'Wow64DisableWow64FsRedirection');
|
if ((hHandle <> 0) and (@Wow64DisableWow64FsRedirection <> nil)) then
|
Wow64DisableWow64FsRedirection(OldValue);
|
except
|
end;
|
//µ÷ÓÃoskÆÁÄ»¼üÅÌ
|
rs := ShellExecute(Application.Handle, 'open', 'osk.exe', nil, nil, SW_SHOWNORMAL);
|
if rs <= 32 then begin
|
ShowMessage(Format('´íÎó£ºÎÞ·¨´ò¿ªÆÁÄ»¼üÅÌ£¬´íÎó´úÂë-[%d].',[rs]));
|
log4Info(Format('´íÎó£ºÎÞ·¨´ò¿ªÆÁÄ»¼üÅÌ£¬´íÎó´úÂë-[%d].',[rs]));
|
end
|
else
|
log4Info('ϵͳ£ºÉÏλ»úÈí¼þ´ò¿ª osk ϵͳÆÁÄ»¼üÅÌ.');
|
//ÓûØ64λÎļþϵͳ
|
try
|
hHandle := GetModuleHandle('kernel32.dll');
|
@Wow64RevertWow64FsRedirection := GetProcAddress(hHandle, 'Wow64RevertWow64FsRedirection');
|
if ((hHandle <> 0) and (@Wow64RevertWow64FsRedirection <> nil)) then
|
Wow64RevertWow64FsRedirection(OldValue);
|
except
|
end;
|
end;
|
|
//---------------------------------------------------------------------------
|
//³õʼ»¯È«¾Ö±äÁ¿
|
procedure InitGlobal();
|
begin
|
//³ÌÐò·¾¶
|
glAppPath := ExtractFilePath(Application.ExeName);
|
|
//configDB file
|
glConfig_db := glAppPath + CONFIG_DIR + t_Config + '.db';
|
glConn_db := glAppPath + CONFIG_DIR + t_Conn + '.db';
|
glGrain_db := glAppPath + CONFIG_DIR + t_Grain + '.db';
|
glWeight_db := glAppPath + CONFIG_DIR + t_Weight + '.db';
|
glManager_db := glAppPath + CONFIG_DIR + t_Manager + '.db';
|
glData_db := glAppPath + CONFIG_DIR + t_Data + '.db';
|
//³õʼ»¯CalcÈ«¾Ö±äÁ¿
|
glCalcOutput := '';
|
glCurrFocus := 0;
|
//³õʼ»¯ÊÖ¶¯Ä£Ê½·µ»Ø¿ÚÁîÖµ
|
frmMain.sLoginPwd := '';
|
//³õʼ»¯Ñù±¾´æ´¢±äÁ¿
|
smp.flag := false;
|
smp.info := '';
|
smp.prefix := '';
|
smp.dir := '';
|
end;
|
|
//³õʼ»¯ÏµÍ³Ä¿Â¼
|
procedure InitSystemDir();
|
var
|
path : String;
|
begin
|
//´´½¨ÅäÖÃÎļþ¼Ð
|
path := glAppPath + CONFIG_DIR;
|
if not DirectoryExists(path) then ForceDirectories(path);
|
|
//´´½¨Êý¾ÝÎļþ¼Ð
|
path := glAppPath + DATA_DIR;
|
if not DirectoryExists(path) then ForceDirectories(path);
|
|
//´´½¨ÈÕÖ¾Îļþ¼Ð
|
path := glAppPath + LOG_DIR;
|
if not DirectoryExists(path) then ForceDirectories(path);
|
end;
|
|
//³õʼ»¯Êý¾Ý²É¼¯½á¹¹
|
procedure InitDatas();
|
begin
|
//³õʼ»¯Datas²âÁ¿Êý¾Ý
|
Datas.Voltage := 0; //Ôʼµçƽ
|
Datas.Weight := 0; //ÖØÁ¿
|
Datas.Temp := 0; //ζÈ
|
Datas.Humid:= 0; //ʪ¶È
|
//³õʼ»¯×Ô¶¯¼ì²â±êÇ©
|
frmMain.lblAutoRet.Caption := '';
|
frmMain.lblAutoRet_error.Caption := '';
|
end;
|
|
//¼ÓÔØÏµÍ³ÐÅÏ¢½çÃæ
|
procedure LoadSystemInfo();
|
begin
|
with frmMain do begin
|
//³õʼ»¯Ë®·ÖÒÇ´®¿ÚÏÂÀ²Ëµ¥
|
cbSerialPort.Items.Clear;
|
EnumComPorts(cbSerialPort.Items);
|
//¼ÓÔØË®·ÖÒDzÎÊý
|
cbSerialPort.Text := WrConn.SerialPort;
|
edtBaud.Text := IntToStr(WrConn.baud);
|
edtParity.Text := WrConn.parity;
|
edtData_bit.Text := IntToStr(WrConn.data_bit);
|
edtStop_bit.Text := IntToStr(WrConn.stop_bit);
|
cbAutoRun.Checked := glAutoRun;
|
//Ôö¼ÓÁ½¸öʱ¼äÉèÖÃÖµ
|
edtTime1.Text := IntToStr(glTime1);
|
edtTime2.Text := IntToStr(glTime2);
|
|
//¼ÓÔØPLC²ÎÊý
|
edtIP.Text := PlcConn.ip;
|
edtPort.Text := IntToStr(PlcConn.port);
|
|
//¼ÓÔØÊÖ¶¯¼ì²âºÍ²ÎÊýÅäÖýçÃæµÄÊý¾Ý´æ´¢²ÎÊý
|
cbTestAutoSave.Checked := smp.flag;
|
edtSampleName.Text := smp.info;
|
cbAutoSave.Checked := smp.flag;
|
edtPrefix.Text := smp.prefix;
|
edtDir.Text := smp.dir;
|
|
//¼ÓÔØµÇ¼¿ÚÁî
|
edtPassword.Text := SysConfig.password;
|
edtDelay.Text := IntToStr(SysConfig.delay);
|
end;
|
end;
|
|
//¼ÓÔØ²ÎÊýµ½½çÃæ
|
procedure LoadOptions();
|
begin
|
with frmMain do begin
|
//ÊÖ¶¯¼ì²â½çÃæ
|
mtManClock.Value := 0;
|
edtMoisture.Text := '';
|
edtWeightRatio.Text := '';
|
edtWeight.Text := '';
|
edtTemp.Text := '';
|
edtWater.Text := '';
|
lbType.ItemIndex := Grain.Code-1; //Á¸ÖÖ´úÂëÓë½çÃæItemIndexµÄ¶ÔÓ¦¹ØÏµ
|
sLabel15.Caption := Format('Á¸Ê³ÖÖÀà - [%s]',[Grain.Name]);
|
sLabel3.Caption := Format('Ñ¡Ôñ - [%s]',[Grain.Name]);
|
//ÒÇÆ÷У׼½çÃæ
|
lbType1.ItemIndex := Grain.Code-1;
|
edtAutoCoef1.Text := Grain.coef[0];
|
edtAutoCoef2.Text := Grain.coef[1];
|
edtAutoCoef3.Text := Grain.coef[2];
|
edtAutoCoef4.Text := Grain.coef[3];
|
edtAutoCoef5.Text := Grain.coef[4];
|
//²ÎÊýÉèÖýçÃæ
|
edtVolume.Text := FloatToStr(SysConfig.Volume);
|
edtTare.Text := FloatToStr(SysConfig.Tare);
|
edtFreq.Text := FloatToStr(SysConfig.Freq);
|
edtDecay.Text:= FloatToStr(SysConfig.Decay);
|
edtStartFreq.Text := FloatToStr(SysConfig.StartFreq);
|
edtStopFreq.Text := FloatToStr(SysConfig.StopFreq);
|
edtStep.Text := IntToStr(SysConfig.Step);
|
lbASK.ItemIndex := SysConfig.Ask; //ASK´úÂëÓë½çÃæItemIndexµÄ¶ÔÓ¦¹ØÏµ
|
//ϵͳÐÅÏ¢½çÃæ
|
lblVersion.Caption := Format('°æ±¾ %s ', [glFileVersion]);
|
end;
|
end;
|
|
//±£´æ½çÃæ²ÎÊý
|
procedure SaveOptions();
|
begin
|
//
|
end;
|
|
//------ ¹¦Äܺ¯Êý -------------------------------------------------------------
|
//»ñÈ¡µ±Ç°½¹µãÊäÈë¿òµÄ¾ø¶Ô×ø±ê
|
function GetCurrMsgPos(index:Integer):TPoint;
|
var
|
x1,y1 : Integer; //ÐÞÕýÖµ
|
x3,x45,y2 : Integer;
|
begin
|
with frmMain do begin
|
x1 := edtMois1.Width + 5;
|
y1 := edtMois1.Height - 40;
|
x3 := edtMois1.Width - 8;
|
x45 := -473;
|
y2 := -250;
|
case index of
|
1:begin
|
Result.X := Left+edtMois1.Left+x1;
|
Result.Y := Top+edtMois1.Top+y1;
|
end;
|
2:begin
|
Result.X := Left+edtMois2.Left+x1;
|
Result.Y := Top+edtMois2.Top+y1;
|
end;
|
3:begin
|
Result.X := Left+edtMois3.Left+x3;
|
Result.Y := Top+edtMois3.Top+y1;
|
end;
|
4:begin
|
Result.X := Left+edtMois4.Left+x45;
|
Result.Y := Top+edtMois4.Top+y1;
|
end;
|
5:begin
|
Result.X := Left+edtMois5.Left+x45;
|
Result.Y := Top+edtMois5.Top+y1;
|
end;
|
6:begin
|
Result.X := Left+edtManCoef1.Left+x1;
|
Result.Y := Top+edtManCoef1.Top+y2;
|
end;
|
7:begin
|
Result.X := Left+edtManCoef2.Left+x1;
|
Result.Y := Top+edtManCoef2.Top+y2;
|
end;
|
8:begin
|
Result.X := Left+edtManCoef3.Left+x3;
|
Result.Y := Top+edtManCoef3.Top+y2;
|
end;
|
9:begin
|
Result.X := Left+edtManCoef4.Left+x45;
|
Result.Y := Top+edtManCoef4.Top+y2;
|
end;
|
10:begin
|
Result.X := Left+edtManCoef5.Left+x45;
|
Result.Y := Top+edtManCoef5.Top+y2;
|
end;
|
11:begin
|
Result.X := Left+edtIp.Left+edtIp.Width+35;
|
Result.Y := Top+edtIp.Top+edtIp.Height+70;
|
end;
|
12:begin
|
Result.X := Left+edtPort.Left+edtPort.Width+30;
|
Result.Y := Top+edtPort.Top+edtPort.Height+70;
|
end;
|
13:begin
|
Result.X := Left+edtTime1.Left+edtTime1.Width+35;
|
Result.Y := Top+edtTime1.Top+edtTime1.Height+190;
|
end;
|
14:begin
|
Result.X := Left+edtTime2.Left+edtTime2.Width+35;
|
Result.Y := Top+edtTime2.Top+edtTime2.Height+190;
|
end;
|
15:begin
|
Result.X := Left+edtWeight1.Left+edtWeight1.Width+5;
|
Result.Y := Top+edtWeight1.Top+edtWeight1.Height-50;
|
end;
|
16:begin
|
Result.X := Left+edtWeight2.Left+edtWeight2.Width+5;
|
Result.Y := Top+edtWeight2.Top+edtWeight2.Height-50;
|
end;
|
17:begin
|
Result.X := Left+edtWeight3.Left-475;
|
Result.Y := Top+edtWeight3.Top+edtWeight3.Height-50;
|
end;
|
18:begin
|
Result.X := Left+edtWeight3.Left-220;
|
Result.Y := Top+edtWeight3.Top+edtWeight3.Height-120;
|
end;
|
19:begin
|
Result.X := Left+edtWeight3.Left-220;
|
Result.Y := Top+edtWeight3.Top+edtWeight3.Height-20;
|
end;
|
20:begin
|
Result.X := Left+edtVolume.Left+edtVolume.Width+5;
|
Result.Y := Top+edtVolume.Top+edtVolume.Height-45;
|
end;
|
21:begin
|
Result.X := Left+edtTare.Left+edtTare.Width+5;
|
Result.Y := Top+edtTare.Top+edtTare.Height-45;
|
end;
|
22:begin
|
Result.X := Left+edtDelay.Left+edtDelay.Width+35;
|
Result.Y := Top+edtDelay.Top+edtDelay.Height+240;
|
end;
|
23:begin
|
Result.X := Left+edtPassword.Left+edtPassword.Width+35;
|
Result.Y := Top+edtPassword.Top+edtPassword.Height+225;
|
end;
|
24:begin
|
Result.X := Left+edtManVal.Left+x1;
|
Result.Y := Top+edtManVal.Top-40;
|
end;
|
25:begin
|
Result.X := Left+edtIntercept.Left+x1;
|
Result.Y := Top+edtIntercept.Top-80;
|
end;
|
end;
|
end;
|
end;
|
|
//------- ϵͳÊÚȨÏà¹Øº¯Êý -----------------------------------------------------
|
//¼ÆËã±¾»ú»úÆ÷Â룬Êä³ö»úÆ÷ÂëÃÜÎÄ
|
function GetMachineCode():String;
|
var
|
ss : string;
|
begin
|
SetCPU(GetCurrentProcess,1);
|
ss := GetCnCPUID();
|
//Éú³ÉÒ»¸ö»úÆ÷Âë
|
Result := EncryStrHex(ss, sConfig);
|
end;
|
|
//ÊÚȨÎļþУÑ飬·µ»ØÐ£Ñé½á¹û
|
//Èë²Î£ºsfilename-УÑéÎļþ
|
// sCode-¼ÆËã±¾»ú»úÆ÷Âë
|
//·µ»Ø£ºtrue-УÑé³É¹¦£»false-УÑéʧ°Ü
|
function CheckLicense(sFilename, sCode:String):Boolean;
|
var
|
i : Integer;
|
sDecry : String; //½âÃܺóµÄÃ÷ÎÄ
|
sl : TStringList;
|
begin
|
//ÈÝ´í´¦Àí
|
if not FileExists(sFileName) then begin
|
Result := false;
|
Exit;
|
end;
|
|
//»ñÈ¡ÃÜÎÄ
|
sl := TStringlist.Create();
|
try
|
sl.LoadFromFile(sFilename);
|
sDecry := Trim(sl.Text);
|
finally
|
FreeAndNil(sl);
|
end;
|
|
//¶ÔÃÜÎÄÐÅÏ¢½øÐнâÂ룬°´Ä¬ÈÏlevel=8
|
for i:=1 to 8 do
|
sDecry := DecryStrHex(sDecry, sConfig); //±àÂë,Éú³ÉÃ÷ÎÄ
|
|
//»ñÈ¡RegCode+RegDate+RegLevel+RegType+RegKey »úÆ÷Âë
|
sDESMachineCode := SplitStr(sDecry,' ',0);
|
sDESDate := SplitStr(sDecry,' ',1);
|
sDESLevel := SplitStr(sDecry,' ',2);
|
sDESType := SplitStr(sDecry,' ',3);
|
sDESKey := SplitStr(sDecry,' ',4);
|
|
//·µ»Ø±È½Ï»úÆ÷Âë
|
Result := AnsiSameStr(sCode, sDESMachineCode);
|
end;
|
//LicenseÊÚȨ¼ì²éÄ£¿é£¬Èçδע²áÔò×Ô¶¯Í˳ö
|
procedure RegCheckMode();
|
var
|
sl : TStringList;
|
sLicFile, sMchCod, sLicText : String;
|
begin
|
//======ÑéÖ¤ÊÚȨÎļþ===============================
|
sLicFile := glAppPath + LICENSE_FILE;
|
sMchCod := GetMachineCode();
|
if CheckLicense(sLicFile, sMchCod) then
|
glRegSuccess := true
|
else begin
|
//´æ×¢²áÂë
|
sl := TStringList.Create();
|
sl.Add('»úÆ÷Â룺' + sMchCod);
|
sl.Add('Éú³ÉÈÕÆÚ£º' + FormatDateTime('yyyy-mm-dd hh:nn:ss',Now()));
|
sl.SaveToFile(glAppPath+'»úÆ÷Âë.txt');
|
FreeAndNil(sl);
|
//ÌáʾҪ»ñÈ¡ÊÚȨÎļþ
|
glRegSuccess := false; //×¢²áʧ°Ü£¬µ÷Õû±êÖ¾£¬×¼±¸ÊÍ·ÅÍ˳ö¶¨Ê±Æ÷
|
sLicText := '¾¯¸æ£ºÏµÍ³ÉÐδע²á£¬ÒÑÔÚÈí¼þĿ¼Éú³É [»úÆ÷Âë] Îļþ£¬Ç뽫¸ÃÎļþÌṩ¸øÏµÍ³¹©Ó¦ÉÌ£¬ÒÔ»ñÈ¡ÕýʽÊÚȨÎļþ£¡';
|
MessageBox(frmMain.handle,PChar(sLicText),'×¢²áÌáʾ¶Ô»°¿ò',MB_OK+MB_ICONWARNING);
|
//¿ªÆôÍ˳ö¶¨Ê±Æ÷, 0.5sÄÚÍ˳ö
|
dm.tmRegFault.Enabled := true;
|
end;
|
end;
|
|
//¾²Ä¬ÊÚȨ¼ì²éÄ£¿é
|
procedure RegCheck1Mode();
|
var
|
sLicFile, sMchCod : String;
|
begin
|
sLicFile := glAppPath + LICENSE_FILE;
|
sMchCod := GetMachineCode();
|
if not CheckLicense(sLicFile, sMchCod) then
|
dm.tmRegFault.Enabled := true;
|
end;
|
|
//------------------------------------------------------------------------------
|
function GetLastNum(const FileName: string): Integer;
|
var
|
FileStream: TextFile;
|
LastDataLine,Line,Fields: string;
|
begin
|
Result := 0;
|
// ¼ì²éÎļþÊÇ·ñ´æÔÚ
|
if not FileExists(FileName) then Exit;
|
|
// ´ò¿ªÎļþ
|
AssignFile(FileStream, FileName);
|
try
|
Reset(FileStream);
|
// Ìø¹ý±êÌâÐÐ
|
if not Eof(FileStream) then ReadLn(FileStream);
|
// ¶ÁÈ¡ÎļþµÄÿһÐÐ
|
LastDataLine := '';
|
while not Eof(FileStream) do begin
|
ReadLn(FileStream, Line);
|
if Line <> '' then
|
LastDataLine := Trim(Line);
|
end;
|
// ½âÎö×îºóÒ»ÐÐ
|
if LastDataLine <> '' then begin
|
Fields := SplitStr(LastDataLine,',',0);
|
Result := StrToIntDef(Fields,0);
|
end;
|
finally
|
CloseFile(FileStream);
|
end;
|
end;
|
|
// ½«¼ì²â½á¹û±£´æµ½ csvÎļþ
|
procedure WriteCsvFile(name: string; mois,temp,water: Double);
|
var
|
pMyFile: textFile;
|
sfile,sTitle,sMsg,time : string;
|
no : integer;
|
begin
|
//³õʼ»¯Â·¾¶ºÍ±êÌâ
|
sFile := smp.dir + smp.prefix + FormatDateTime('yyyymmdd', Now) + '.csv';
|
sTitle:= 'ÐòºÅ,Ñù±¾ÐÅÏ¢,º¬Ë®ÂÊ,ζÈ,ʪ¶È,ÈÕÆÚ';
|
|
//¶ÁÈ¡ÎļþÀúÊ·noÐòºÅ
|
no := GetLastNum(sFile)+1;
|
time := FormatDateTime('yyyy-mm-dd hh:nn:ss', Now);
|
sMsg := Format('%d,%s,%.2f,%.2f,%.2f,%s', [no,name,mois,temp,water,time]);
|
try
|
AssignFile(pMyFile,sFile);
|
if FileExists(sFile) then
|
Append(pMyFile)
|
else begin
|
ReWrite(pMyFile);
|
WriteLn(pMyFile,sTitle); //н¨csv£¬ÏÈдÈë±êÌâ
|
end;
|
WriteLn(pMyFile,sMsg); //дÈëÄÚÈÝ
|
finally
|
CloseFile(pMyFile);
|
end;
|
end;
|
|
//Ë¢ÐÂÉ豸¹ÊÕÏÂë
|
procedure RefashFaultCode(cod:Integer);
|
var
|
str : string;
|
begin
|
//·Òëcod
|
if cod=0 then str := 'Õý³£'
|
else if cod=1 then str := 'ÉÏ·§ÃÅ¿¨×¡'
|
else if cod=2 then str := 'Ï·§ÃÅ¿¨×¡'
|
else str := '䶨Òå';
|
//Êä³öµ½½çÃæ
|
with frmMain do begin
|
sLabel72.Caption := Format('É豸״̬-[%s]',[str]); //¸üе÷Õû½Ø¾à½çÃæ
|
sLabel73.Caption := Format('É豸״̬-[%s]',[str]); //¸üÐÂÊÖ¶¯¼ì²â½çÃæ
|
sLabel74.Caption := Format('É豸״̬-[%s]',[str]); //¸üÐÂ×Ô¶¯Ä£Ê½½çÃæ
|
sLabel75.Caption := Format('É豸״̬-[%s]',[str]); //¸üÐÂÊÖ¶¯Ð£×¼½çÃæ
|
sLabel76.Caption := Format('É豸״̬-[%s]',[str]); //¸üÐÂÊÖ¶¯Ä£Ê½½çÃæ
|
end;
|
//ÐÞ¸ÄÑùʽ
|
with frmMain do begin
|
if cod=0 then begin
|
sLabel72.Font.Color := clLime;
|
sLabel73.Font.Color := clLime;
|
sLabel74.Font.Color := clLime;
|
sLabel75.Font.Color := clLime;
|
sLabel76.Font.Color := clLime;
|
end
|
else if (cod=1)or(cod=2) begin
|
sLabel72.Font.Color := clRed;
|
sLabel73.Font.Color := clRed;
|
sLabel74.Font.Color := clRed;
|
sLabel75.Font.Color := clRed;
|
sLabel76.Font.Color := clRed;
|
end
|
else begin
|
sLabel72.Font.Color := clSilver;
|
sLabel73.Font.Color := clSilver;
|
sLabel74.Font.Color := clSilver;
|
sLabel75.Font.Color := clSilver;
|
sLabel76.Font.Color := clSilver;
|
end;
|
end;
|
end;
|
|
end.
|