Changeset 370 for ISPProgrammer


Ignore:
Timestamp:
May 31, 2012, 6:29:12 AM (13 years ago)
Author:
chronos
Message:
  • Modified: ISPProgrammer now use updated component oriented TJobProgressView from Common package.
Location:
ISPProgrammer
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • ISPProgrammer/Dallas/UDallasProgrammer.pas

    r363 r370  
    4444    procedure LoadFromRegistry(Root: HKEY; Key: string); override;
    4545    procedure SaveToRegistry(Root: HKEY; Key: string); override;
    46     procedure Read; override;
    47     procedure Write; override;
     46    procedure Read(Job: TJob); override;
     47    procedure Write(Job: TJob); override;
    4848    procedure Erase; override;
    49     procedure Verify; override;
     49    procedure Verify(Job: TJob); override;
    5050    procedure Reset; override;
    5151    function ReadIdentification: string; override;
     
    212212end;
    213213
    214 procedure TDallasProgrammer.Read;
     214procedure TDallasProgrammer.Read(Job: TJob);
    215215var
    216216  Value: string;
     
    236236
    237237  //HexFile.SaveToStringList(HexData);
    238   JobProgressView.CurrentJob.Progress.Max := 65535 div 32;
     238  Job.Progress.Max := 65535 div 32;
    239239  //Request.Size := 0;
    240240  //ResponseClear;
     
    266266      ResponseLock.Release;
    267267    end;
    268     JobProgressView.CurrentJob.Progress.Value := I;
    269     if JobProgressView.CurrentJob.Terminate then Break;
     268    Job.Progress.Value := I;
     269    if Job.Terminate then Break;
    270270  until False;
    271271  //for I := 0 to HexData.Count - 1 do
    272272  //  Log(HexData[I]);
    273   if not JobProgressView.CurrentJob.Terminate then
     273  if not Job.Terminate then
    274274    HexFile.LoadFromStringList(HexData);
    275275end;
    276276
    277 procedure TDallasProgrammer.Verify;
     277procedure TDallasProgrammer.Verify(Job: TJob);
    278278var
    279279  Value: string;
     
    292292  end;
    293293  HexFile.SaveToStringList(HexData);
    294   JobProgressView.CurrentJob.Progress.Max := HexData.Count;
     294  Job.Progress.Max := HexData.Count;
    295295  for I := 0 to HexData.Count - 1 do begin
    296296    Request.Size := 0;
     
    311311    end;
    312312    CheckErrorCode(Value);
    313     JobProgressView.CurrentJob.Progress.Value := I;
    314     if JobProgressView.CurrentJob.Terminate then Break;
    315   end;
    316 end;
    317 
    318 procedure TDallasProgrammer.Write;
     313    Job.Progress.Value := I;
     314    if Job.Terminate then Break;
     315  end;
     316end;
     317
     318procedure TDallasProgrammer.Write(Job: TJob);
    319319var
    320320  Value: string;
     
    333333  end;
    334334  HexFile.SaveToStringList(HexData);
    335   JobProgressView.CurrentJob.Progress.Max := HexData.Count;
     335  Job.Progress.Max := HexData.Count;
    336336  for I := 0 to HexData.Count - 1 do begin
    337337    Request.Size := 0;
     
    352352    end;
    353353    CheckErrorCode(Value);
    354     JobProgressView.CurrentJob.Progress.Value := I;
    355     if JobProgressView.CurrentJob.Terminate then Break;
     354    Job.Progress.Value := I;
     355    if Job.Terminate then Break;
    356356  end;
    357357end;
  • ISPProgrammer/ISPprog/UISPprog.pas

    r363 r370  
    2626  public
    2727    constructor Create; override;
    28     procedure Write; override;
    29     procedure Read; override;
    30     procedure Verify; override;
     28    procedure Write(Job: TJob); override;
     29    procedure Read(Job: TJob); override;
     30    procedure Verify(Job: TJob); override;
    3131    procedure Erase; override;
    3232    procedure Reset; override;
     
    149149{ TISPProg }
    150150
    151 procedure TISPProg.Write;
     151procedure TISPProg.Write(Job: TJob);
    152152var
    153153  res: string;
     
    212212    maxadr:=maxadr or pagemask;         // round up to page size
    213213    radr:=minadr;
    214     JobProgressView.CurrentJob.Progress.Max := maxadr - minadr + 1;
     214    Job.Progress.Max := maxadr - minadr + 1;
    215215    while radr <= maxadr do begin
    216216      if (proctype = PROC_TYPE_AVR) and (flashsize > 1024*128) then
     
    233233      end;
    234234      radr := radr + pagesize;
    235       JobProgressView.CurrentJob.Progress.Value := radr - minadr;
    236       if JobProgressView.CurrentJob.Terminate then Break;
     235      Job.Progress.Value := radr - minadr;
     236      if Job.Terminate then Break;
    237237    end;
    238238    Log(SProgramOK);
     
    263263      end;
    264264      radr := radr + pagesize;
    265       JobProgressView.CurrentJob.Progress.Value := radr - minadr;
     265      Job.Progress.Value := radr - minadr;
    266266    end;
    267267    Log(SProgramOK);
     
    284284      end;
    285285    end;
    286     JobProgressView.CurrentJob.Progress.Value := radr - minadr;
     286    Job.Progress.Value := radr - minadr;
    287287  end;
    288288  LedOff;
     
    295295end;
    296296
    297 procedure TISPProg.Verify;
     297procedure TISPProg.Verify(Job: TJob);
    298298begin
    299299  inherited;
  • ISPProgrammer/PRESTO/UPresto.pas

    r363 r370  
    88
    99uses
    10   Classes, SysUtils, UISPProgrammer, URegistry, UPrestoDLL,
    11   UStreamHelper, Globals, Processors, Delays, UCPUType, Registry;
     10  Classes, SysUtils, UISPProgrammer, UPrestoDLL,
     11  UStreamHelper, Globals, Processors, Delays, UCPUType, Registry,
     12  UJobProgressView;
    1213
    1314type
     
    3334    procedure SaveToRegistry(Root: HKEY; Key: string); override;
    3435    function ReadIdentification: string; override;
    35     procedure Write; override;
    36     procedure Verify; override;
     36    procedure Write(Job: TJob); override;
     37    procedure Verify(Job: TJob); override;
    3738    procedure Erase; override;
    3839    procedure Reset; override;
     
    4647
    4748{$IFDEF Windows}
    48 
    49 uses
    50   UJobProgressView;
    51 
    52 const
    53   TempHexFile = 'Dump.hex';
    5449
    5550resourcestring
     
    279274end;
    280275
    281 procedure TPrestoProgrammer.Write;
     276procedure TPrestoProgrammer.Write(Job: TJob);
    282277var
    283278  Address, I, PageSize, MinAdr, MaxAdr: Integer;
     
    312307    // AT89S8253, AT89S2051/4051, AT89S51/52, AVRs with page programming
    313308    PageSize := Signatures[devicenr].fpagesize;
    314     JobProgressView.CurrentJob.Progress.Max := MaxAdr;
     309    Job.Progress.Max := MaxAdr;
    315310    WritePage.Size := PageSize;
    316311    ReadPage.Size := PageSize;
     
    361356        Inc(Address);
    362357      end;
    363       JobProgressView.CurrentJob.Progress.Value := Address;
    364       if JobProgressView.CurrentJob.Terminate then Break;
     358      Job.Progress.Value := Address;
     359      if Job.Terminate then Break;
    365360    end;
    366361    Log(SProgramOK);
     
    372367end;
    373368
    374 procedure TPrestoProgrammer.Verify;
    375 begin
    376   inherited Verify;
     369procedure TPrestoProgrammer.Verify(Job: TJob);
     370begin
     371  inherited;
    377372end;
    378373
     
    446441procedure TPrestoProgrammer.ISPWriteFlashPage(Address: Integer; Buffer: TStream);
    447442var
    448   pagesize, pagemask, raddr: integer;
     443  pagesize, pagemask: integer;
    449444  Data: TStreamHelper;
    450   ptr: ^byte;
    451445begin
    452446  try
     
    536530
    537531procedure TPrestoProgrammer.SetActive(AValue: Boolean);
    538 var
    539   Answer: Integer;
    540532begin
    541533  if Active = AValue then Exit;
  • ISPProgrammer/RFU/URFUProgrammer.pas

    r363 r370  
    66
    77uses
    8   Classes, SysUtils, Forms, UISPProgrammer, UCPUType, Process;
     8  Classes, SysUtils, Forms, UISPProgrammer, UCPUType, Process, UJobProgressView;
    99
    1010type
     
    1313
    1414  TRFUProgrammer = class(TISPProgrammer)
    15     procedure Write; override;
    16     procedure Verify; override;
     15    procedure Write(Job: TJob); override;
     16    procedure Verify(Job: TJob); override;
    1717    procedure Erase; override;
    1818    procedure Reset; override;
     
    2626{ TRFUProgrammer }
    2727
    28 procedure TRFUProgrammer.Write;
     28procedure TRFUProgrammer.Write(Job: TJob);
    2929begin
    30   inherited Write;
     30  inherited;
    3131  with TProcess.Create(nil) do
    3232  try
     
    4141end;
    4242
    43 procedure TRFUProgrammer.Verify;
     43procedure TRFUProgrammer.Verify(Job: TJob);
    4444begin
    45   inherited Verify;
     45  inherited;
    4646end;
    4747
  • ISPProgrammer/UISPProgrammer.pas

    r363 r370  
    77uses
    88  Classes, SysUtils, Registry, UIntelHexFile, UCommSerialPort,
    9   UCPUType;
     9  UCPUType, UJobProgressView;
    1010
    1111type
     
    3434    procedure LoadFromRegistry(Root: HKEY; Key: string); virtual;
    3535    procedure SaveToRegistry(Root: HKEY; Key: string); virtual;
    36     procedure Write; virtual;
    37     procedure Read; virtual;
    38     procedure Verify; virtual;
     36    procedure Write(Job: TJob); virtual;
     37    procedure Read(Job: TJob); virtual;
     38    procedure Verify(Job: TJob); virtual;
    3939    procedure Erase; virtual;
    4040    procedure Reset; virtual;
     
    8686end;
    8787
    88 procedure TISPProgrammer.Write;
     88procedure TISPProgrammer.Write(Job: TJob);
    8989begin
    9090  raise Exception.Create(SNotImplemented);
    9191end;
    9292
    93 procedure TISPProgrammer.Read;
     93procedure TISPProgrammer.Read(Job: TJob);
    9494begin
    9595  raise Exception.Create(SNotImplemented);
    9696end;
    9797
    98 procedure TISPProgrammer.Verify;
     98procedure TISPProgrammer.Verify(Job: TJob);
    9999begin
    100100  raise Exception.Create(SNotImplemented);
Note: See TracChangeset for help on using the changeset viewer.