Changeset 414


Ignore:
Timestamp:
Aug 17, 2012, 9:53:11 AM (12 years ago)
Author:
chronos
Message:
  • Fixed: Use parent TCommNode Active property instead custom in PinConnection package.
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • Generics/TemplateGenerics/Generic/GenericList.inc

    r405 r414  
    8686    property Items[Index: TGListIndex]: TGListItem read Get write Put; default;
    8787    property Last: TGListItem read GetLast write SetLast;
     88    property OnUpdate: TNotifyEvent read FOnUpdate write FOnUpdate;
    8889  end;
    8990 
  • ISPProgrammer/PRESTO/UPresto.pas

    r370 r414  
    402402constructor TPrestoProgrammer.Create;
    403403begin
    404   inherited Create;
     404  inherited;
    405405  Capabilities := [ipcErase, ipcWrite, ipcReset];
    406406  Presto := TPresto.Create;
     
    414414destructor TPrestoProgrammer.Destroy;
    415415begin
    416   Presto.Free;
    417   inherited Destroy;
     416  FreeAndNil(Presto);
     417  inherited;
    418418end;
    419419
  • ISPProgrammer/UISPProgrammer.pas

    r413 r414  
    138138begin
    139139  Active := False;
    140   ExtPin.Free;
    141   HexFile.Free;
     140  FreeAndNil(ExtPin);
     141  FreeAndNil(HexFile);
    142142  inherited Destroy;
    143143end;
  • PinConnection/UCommConcentrator.pas

    r413 r414  
    4040    property Pins: TPinList read FPins write FPins;
    4141    property Main: TCommPin read FMain write FMain;
    42     property Active: Boolean read FActive write FActive;
    4342  end;
    4443
     
    122121destructor TCommConcentrator.Destroy;
    123122begin
    124   FActive := False;
    125   FPins.Free;
    126   FMain.Free;
     123  Active := False;
     124  FreeAndNil(FPins);
     125  FreeAndNil(FMain);
    127126  inherited Destroy;
    128127end;
  • PinConnection/UCommDelay.pas

    r413 r414  
    3535  TCommDelay = class(TCommNode)
    3636  private
    37     FActive: Boolean;
    3837    FDelay: TDateTime;
    3938    PacketQueue1: TListObject; // TListObject<TDelayedPacket>
     
    4342    procedure ReceiveData1(Sender: TCommPin; AStream: TListByte);
    4443    procedure ReceiveData2(Sender: TCommPin; AStream: TListByte);
    45     procedure SetActive(AValue: Boolean);
     44  protected
     45    procedure SetActive(const AValue: Boolean); override;
    4646  public
    4747    Lock1: TCriticalSection;
     
    5252    destructor Destroy; override;
    5353    property Delay: TDateTime read FDelay write FDelay;
    54     property Active: Boolean read FActive write SetActive;
    5554  end;
    5655
     
    141140end;
    142141
    143 procedure TCommDelay.SetActive(AValue: Boolean);
     142procedure TCommDelay.SetActive(const AValue: Boolean);
    144143begin
    145144  if FActive = AValue then Exit;
     
    167166    FreeAndNil(Thread2);
    168167  end;
     168  inherited;
    169169end;
    170170
  • PinConnection/UCommHub.pas

    r413 r414  
    2525  TCommHub = class(TCommNode)
    2626  private
    27     FActive: Boolean;
    2827    FPins: TPinList;
    2928    procedure Receive(Sender: TCommPin; Stream: TListByte);
     
    3332    destructor Destroy; override;
    3433    property Pins: TPinList read FPins write FPins;
    35     property Active: Boolean read FActive write FActive;
    3634  end;
    3735
     
    103101begin
    104102  Active := False;
    105   FPins.Free;
    106   inherited Destroy;
     103  FreeAndNil(FPins);
     104  inherited;
    107105end;
    108106
  • PinConnection/UCommMark.pas

    r413 r414  
    1414  TCommMark = class(TCommNode)
    1515  private
    16     FActive: Boolean;
    1716    FMarkIndex: Integer;
    1817    FFrameData: TListByte;
     
    2120    procedure FrameDataReceive(Sender: TCommPin; Stream: TListByte);
    2221    procedure FrameSetStatus(Sender: TCommPin; Status: Integer);
    23     procedure SetActive(AValue: Boolean);
     22  protected
     23    procedure SetActive(const AValue: Boolean); override;
    2424  public
    2525    PinRaw: TCommPin;
     
    2929    constructor Create(AOwner: TComponent); override;
    3030    destructor Destroy; override;
    31     property Active: Boolean read FActive write SetActive;
    3231  end;
    3332
     
    7574end;
    7675
    77 procedure TCommMark.SetActive(AValue: Boolean);
     76procedure TCommMark.SetActive(const AValue: Boolean);
    7877begin
    7978  if FActive = AValue then Exit;
    8079  FActive := AValue;
    8180  if FActive then Reset;
     81  inherited;
    8282end;
    8383
  • PinConnection/UCommPin.pas

    r413 r414  
    5858  TCommNode = class(TComponent)
    5959  private
     60  protected
    6061    FActive: Boolean;
    61   protected
    62     procedure SetActive(AValue: Boolean); virtual;
     62    procedure SetActive(const AValue: Boolean); virtual;
    6363  public
    6464    property Active: Boolean read FActive write SetActive;
     
    7070{ TCommNode }
    7171
    72 procedure TCommNode.SetActive(AValue: Boolean);
     72procedure TCommNode.SetActive(const AValue: Boolean);
    7373begin
    7474  if FActive = AValue then Exit;
  • PinConnection/UCommSerialPort.pas

    r413 r414  
    1919    procedure ReceiveData(Stream: TListByte);
    2020  protected
    21     procedure SetActive(AValue: Boolean); override;
     21    procedure SetActive(const AValue: Boolean); override;
    2222  public
    2323    SerialPort: TSerialPort;
     
    3939end;
    4040
    41 procedure TCommSerialPort.SetActive(AValue: Boolean);
     41procedure TCommSerialPort.SetActive(const AValue: Boolean);
    4242begin
    43   inherited SetActive(AValue);
     43  inherited;
    4444  SerialPort.Active := AValue;
    4545end;
  • PinConnection/UCommTelnet.pas

    r413 r414  
    419419destructor TCommTelnet.Destroy;
    420420begin
    421   FCommandData.Free;
    422   Options.Free;
    423   TelnetPin.Free;
    424   RawPin.Free;
    425   FResponses.Free;
     421  FreeAndNil(FCommandData);
     422  FreeAndNil(Options);
     423  FreeAndNil(TelnetPin);
     424  FreeAndNil(RawPin);
     425  FreeAndNil(FResponses);
    426426  inherited Destroy;
    427427end;
  • PinConnection/UCommThread.pas

    r413 r414  
    3030  TCommThread = class(TCommNode)
    3131  private
    32     FActive: Boolean;
    3332    FOnReceiveData: TReceiveDataEvent;
    3433    FReceiveThread: TCommThreadReceiveThread;
     
    4241    procedure ExtReceiveData(Sender: TCommPin; Stream: TListByte);
    4342    procedure ExtSetStatus(Sender: TCommPin; AStatus: Integer);
    44     procedure SetActive(const AValue: Boolean);
     43  protected
     44    procedure SetActive(const AValue: Boolean); override;
    4545  public
    4646    Ext: TCommPin;
    4747    Pin: TCommPin;
    48     property Active: Boolean read FActive write SetActive;
    4948    constructor Create(AOwner: TComponent); override;
    5049    destructor Destroy; override;
     
    101100    FreeAndNil(FReceiveThread);
    102101  end;
     102  inherited;
    103103end;
    104104
  • PinConnection/UPacketBurst.pas

    r413 r414  
    2121  TPacketBurst = class(TCommNode)
    2222  private
    23     FActive: Boolean;
    2423    SendThreadEvent: TEvent;
    2524    SendThread: TPacketBurstSendThread;
     
    2928    procedure PacketSingleReceive(Sender: TCommPin; Stream: TListByte);
    3029    procedure PacketBurstReceive(Sender: TCommPin; Stream: TListByte);
    31     procedure SetActive(const AValue: Boolean);
     30  protected
     31    procedure SetActive(const AValue: Boolean); override;
    3232  public
    3333    SendPeriod: Integer;
     
    3737    destructor Destroy; override;
    3838    constructor Create(AOwner: TComponent); override;
    39     property Active: Boolean read FActive write SetActive;
    4039  end;
    4140
     
    101100    FreeAndNil(SendThread);
    102101  end;
     102  inherited;
    103103end;
    104104
Note: See TracChangeset for help on using the changeset viewer.