curtis
22小時前 3af5c004b4f2d2005d22ee85dccc2c80a66b1556
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;
@@ -180,27 +184,37 @@
  S := TStringlist.Create;
  S1 := TStringlist.Create;
  ini := Tinifile.Create(iniPath+'Checkerr.ini');
  try
    if FileExists(iniPath+'RemoveMemo.dat') then
      S.LoadFromFile(iniPath+'RemoveMemo.dat');
    ini.WriteBool(NowIndex,'Del',True);
    S.Add(ini.ReadString(NowIndex,'Reason',''));
    S.SaveToFile(iniPath+'RemoveMemo.dat');
    i := ErrListLV.ItemIndex;
    ErrListLV.Items.Delete(ErrListLV.ItemIndex);
    if ErrListLV.Items.Count = 0 then
    Ingnore := ini.ReadBool(NowIndex,'Ingnore',False);
    if True then
    begin
      ImmediateBt.Enabled := True;
      S1.Add('Y');
      S1.SaveToFile(iniPath+'OMRCheckOk.dat');
      ini.WriteBool(NowIndex,'Del',True);
      S.Add(ini.ReadString(NowIndex,'Reason',''));
      S.SaveToFile(iniPath+'RemoveMemo.dat');
      i := ErrListLV.ItemIndex;
      ErrListLV.Items.Delete(ErrListLV.ItemIndex);
      if ErrListLV.Items.Count = 0 then
      begin
        ImmediateBt.Enabled := True;
        S1.Add('Y');
        S1.SaveToFile(iniPath+'OMRCheckOk.dat');
      end
      else
      begin
        if i <= ErrListLV.Items.Count -1 then
        begin
          ErrListLV.ItemIndex := i;
          ErrListLVclick(nil);
        end;
      end;
    end
    else
    begin
      if i <= ErrListLV.Items.Count -1 then
      begin
        ErrListLV.ItemIndex := i;
        ErrListLVclick(nil);
      end;
      Showmessage(Format(_msg('%s¦³¤£¥i©¿²¤¶µ¥ØµLªk±j­¢°e¥ó'),['']));
    end;
  finally
@@ -239,7 +253,7 @@
        ErrListLV.Items.Delete(i);
        if ErrListLV.Items.Count = 0 then
        begin
          //ImmediateBt.Enabled := True;
          ImmediateBt.Enabled := True;
          S1.Add('Y');
          S1.SaveToFile(iniPath+'OMRCheckOk.dat');
        end;
@@ -295,6 +309,8 @@
end;
procedure TErrlistForm.FormCreate(Sender: TObject);
var
  i : Integer;
begin
  MyHotkeyid1 := GlobalAddAtom('MyHotkeyid1')- $C000;
  RegisterHotKey(Handle, MyHotkeyid1,MOD_CONTROL,Ord('D'));
@@ -302,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';
@@ -317,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);
@@ -363,6 +405,8 @@
end;
Procedure TErrlistForm.InitialData;  //«ì´_¦¨¥¼¿ï¨úª¬ºA
var
  i : Integer;
begin
  SitePreBt.Enabled := False;
  SiteNextBt.Enabled := False;
@@ -378,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
@@ -454,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;
@@ -511,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);