From beac355a0f1b5f75020760c36061283e44e9636c Mon Sep 17 00:00:00 2001
From: curtis <curtis@i-mps.com>
Date: 星期二, 24 三月 2026 08:48:20 +0800
Subject: [PATCH] doc

---
 ErrList.pas |   78 ++++++++++++++++++++++++++++++++++-----
 1 files changed, 68 insertions(+), 10 deletions(-)

diff --git a/ErrList.pas b/ErrList.pas
index f4b82eb..9e60021 100644
--- a/ErrList.pas
+++ b/ErrList.pas
@@ -5,7 +5,8 @@
 uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, OleCtrls, Menus, StdCtrls, Buttons, ComCtrls, ExtCtrls,inifiles,
-  iisUnit,iis_ImageProcess, EnImgScr,mpsBarco,BarcodesFinder, EnMisc, EnDiGrph;
+  iisUnit,iis_ImageProcess, EnImgScr,mpsBarco,BarcodesFinder, EnMisc, EnDiGrph,
+  LogFile;
 
 type
   TErrlistForm = class(TForm)
@@ -39,6 +40,7 @@
     ImageScrollBox2: TImageScrollBox;
     ImageScrollBox3: TImageScrollBox;
     Button1: TButton;
+    LogFile1: TLogFile;
     procedure ExitBtClick(Sender: TObject);
     procedure ImmediateBtClick(Sender: TObject);
     procedure FormCreate(Sender: TObject);
@@ -89,21 +91,23 @@
     //********�Q�r�w���I��T********
 
     ISB_BW: TImageScrollBox;
-    SP1:TShape;//20170630 �s�[
+    {SP1:TShape;//20170630 �s�[
     SP2:TShape;//20170630 �s�[
     SP3:TShape;//20170630 �s�[
     SP4:TShape;//20170630 �s�[
     SP5:TShape;//20170630 �s�[
     SP6:TShape;//20170630 �s�[
     SP7:TShape;//20170630 �s�[
-    SP8:TShape;//20170630 �s�[
+    SP8:TShape;//20170630 �s�[ }
+    SP : TShape;
 
     procedure WMHotKey(var Msg: TWMHotKey); message WM_HOTKEY;
     Procedure ShowOMRErr(Idx:Integer); //�e���W�q�XOMR�ˮ֥���
     Procedure ShowRelaOMRErr(Relaidx:Integer); //�e���W�q�X���YOMR�ˮ֥���
     Procedure GetOMRErrini(Index:String); //���ˮ֥���ini
     Procedure InitialData;
-    procedure ImageScrollBox1NewGraphic(const Graphic: TDibGraphic);  //��_����������A
+    procedure ImageScrollBox1NewGraphic(const Graphic: TDibGraphic);
+    function logTimeString: String;  //��_����������A
   public
     { Public declarations }
     iniPath : String;
@@ -305,6 +309,8 @@
 end;
 
 procedure TErrlistForm.FormCreate(Sender: TObject);
+var
+  i : Integer;
 begin
   MyHotkeyid1 := GlobalAddAtom('MyHotkeyid1')- $C000;
   RegisterHotKey(Handle, MyHotkeyid1,MOD_CONTROL,Ord('D'));
@@ -312,7 +318,17 @@
   SiteList := TStringlist.Create;
   RelaSiteList := TStringlist.Create;
   ISB_BW:=TImageScrollBox.Create(Self);
-  SP1:= TShape.Create(self);
+  for i := 1 to 30 do
+  begin
+    Sp := TShape.Create(self);
+    Sp.Name := 'SP'+inttostr(i);
+  end;
+  for i := 1 to 30 do
+  begin
+    Sp := TShape.Create(self);
+    Sp.Name := 'SP_R'+inttostr(i);
+  end;
+  {SP1:= TShape.Create(self);
   SP1.Name := 'SP1';
   SP2:= TShape.Create(self);
   SP2.Name := 'SP2';
@@ -327,27 +343,43 @@
   SP7:= TShape.Create(self);
   SP7.Name := 'SP7';
   SP8:= TShape.Create(self);
-  SP8.Name := 'SP8';
+  SP8.Name := 'SP8'; }
 end;
 
 procedure TErrlistForm.FormDestroy(Sender: TObject);
+var
+  i : Integer;
 begin
   SiteList.Free;
   RelaSiteList.Free;
   ISB_BW.Free;
-  SP1.Free;
+  for i := 1 to 30 do
+  begin
+    TShape(FindComponent('SP'+inttostr(i))).Free;
+  end;
+  for i := 1 to 30 do
+  begin
+    TShape(FindComponent('SP_R'+inttostr(i))).Free;
+  end;
+  {SP1.Free;
   SP2.Free;
   SP3.Free;
   SP4.Free;
   SP5.Free;
   SP6.Free;
   SP7.Free;
-  SP8.Free;
+  SP8.Free;}
 end;
 
 procedure TErrlistForm.ImmediateBtClick(Sender: TObject);
 begin
   ModalResult := mrOK;
+  LogFile1.LogToFile(logTimeString+'�ߧY�e��');
+end;
+
+function TErrlistForm.logTimeString: String;
+begin
+Result:=FormatDateTime('yyyymmdd hh:mm:ss',now)+'  ';
 end;
 
 procedure TErrlistForm.RelaNextBtClick(Sender: TObject);
@@ -373,6 +405,8 @@
 end;
 
 Procedure TErrlistForm.InitialData;  //��_����������A
+var
+  i : Integer;
 begin
   SitePreBt.Enabled := False;
   SiteNextBt.Enabled := False;
@@ -388,6 +422,14 @@
   Siteidx := 1;
   RelaSiteidx := 1;
   DeleteBt.Enabled := False;
+  for i := 1 to 30 do
+  begin
+    TShape(FindComponent('SP'+inttostr(i))).Parent := nil;
+  end;
+  for i := 1 to 30 do
+  begin
+    TShape(FindComponent('SP_R'+inttostr(i))).Parent := nil;
+  end;
 end;
 
 Procedure TErrlistForm.GetOMRErrini(Index:String); //���ˮ֥���ini
@@ -464,7 +506,8 @@
       //if MpsViewX2.FileName <> RelaFileName then
       //begin
         ImageScrollBox2.LoadFromFile(RelaFileName,1);
-        FindPoint(ImageScrollBox2.Graphic,UpLPoint_Rela,UpRPoint_Rela,DownLPoint_Rela,'');
+        //FindPoint(ImageScrollBox2.Graphic,UpLPoint_Rela,UpRPoint_Rela,DownLPoint_Rela,'');
+        FindPoint(ImageScrollBox2.Graphic,UpLPoint,UpRPoint,DownLPoint,NowW,NowH,ANCHOR);
         //GetFFPoint(MpsViewX2,RelaFileName); //��FreeForm���Q�r�I���
 
       //end;
@@ -521,12 +564,27 @@
 var
   Site : String;
   iRect : TRect;
+  SP:TShape;
 begin
   if RelaIdx > RelaSiteList.Count then Exit;
 
+  //SP := TShape(FindComponent('SP'+inttostr(RelaIdx+1))); //20170327 �b�j�餤�n�ϥΦh�վB�n
+  SP := TShape(FindComponent('SP_R'+inttostr(RelaIdx)));  //20240314 Hong �令�o��
+  SP.Brush.Color :=$00FEFAAD;
+  SP.Parent := ImageScrollBox2;
+  SP.Pen.Style := psSolid;
+  SP.Pen.Color := $00FEFAAD;
+  SP.Pen.Width := 1;
+  SP.Pen.Mode := pmMask;
+  SP.Left := iRect.Left;
+  SP.Top := iRect.Top;
+  SP.Width := iRect.Right-iRect.Left;
+  SP.Height := iRect.Bottom-iRect.Top;
+
   Site := RelaSiteList.Strings[RelaIdx-1];
   iRect := CM_Str2Rect(Site,ImageScrollBox1.Graphic.XDotsPerInch,UpLPoint_Rela);
-  ShowKeyinRect(ImageScrollBox2,iRect);
+  //ShowKeyinRect(ImageScrollBox2,iRect);
+  SetKeyinRect_New(ImageScrollBox2,Site,'','',UpLPoint,UpRPoint,sp);
 end;
 
 procedure TErrlistForm.SiteNextBtClick(Sender: TObject);

--
Gitblit v1.8.0