Changeset 129


Ignore:
Timestamp:
Jan 17, 2011, 6:55:36 AM (14 years ago)
Author:
george
Message:
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • Common/UCommon.pas

    r123 r129  
    44
    55uses
    6   Windows, Classes, SysUtils, SpecializedList; //, ShFolder, ShellAPI;
     6  Windows, Classes, SysUtils, SpecializedList, StrUtils; //, ShFolder, ShellAPI;
    77
    88type
    99  TArrayOfByte = array of Byte;
    1010  TArrayOfString = array of string;
     11  TExceptionEvent = procedure(Sender: TObject; E: Exception) of object;
    1112
    1213  TUserNameFormat = (
     
    2223    unfDNSDomainName = 11);
    2324
     25var
     26  ExceptionHandler: TExceptionEvent;
    2427
    2528function IntToBin(Data: Cardinal; Count: Byte): string;
     
    3841procedure SetBit(var Variable: Word; Index: Byte; State: Boolean);
    3942function AddLeadingZeroes(const aNumber, Length : integer) : string;
     43function LastPos(const SubStr: String; const S: String): Integer;
    4044
    4145implementation
     
    6569end;*)
    6670
     71function LastPos(const SubStr: String; const S: String): Integer;
     72begin
     73  Result := Pos(ReverseString(SubStr), ReverseString(S));
     74  if (Result <> 0) then
     75    Result := ((Length(S) - Length(SubStr)) + 1) - Result + 1;
     76end;
     77
    6778function BCDToInt(Value: Byte): Byte;
    6879begin
  • CoolStreaming/Demo/BitStream/BitStreamTest.lpi

    r122 r129  
    4242      </Item2>
    4343    </RequiredPackages>
    44     <Units Count="5">
     44    <Units Count="6">
    4545      <Unit0>
    4646        <Filename Value="BitStreamTest.lpr"/>
    4747        <IsPartOfProject Value="True"/>
    4848        <UnitName Value="BitStreamTest"/>
    49         <EditorIndex Value="1"/>
     49        <EditorIndex Value="2"/>
    5050        <WindowIndex Value="0"/>
    5151        <TopLine Value="1"/>
     
    6464        <EditorIndex Value="0"/>
    6565        <WindowIndex Value="0"/>
    66         <TopLine Value="1"/>
    67         <CursorPos X="3" Y="18"/>
     66        <TopLine Value="132"/>
     67        <CursorPos X="1" Y="150"/>
    6868        <UsageCount Value="20"/>
    6969        <Loaded Value="True"/>
     
    8383        <Filename Value="E:\Programy\Lazarus\lcl\controls.pp"/>
    8484        <UnitName Value="Controls"/>
    85         <EditorIndex Value="2"/>
     85        <EditorIndex Value="3"/>
    8686        <WindowIndex Value="0"/>
    8787        <TopLine Value="1207"/>
     
    9898        <UsageCount Value="10"/>
    9999      </Unit4>
     100      <Unit5>
     101        <Filename Value="E:\Programy\Lazarus\fpc\2.4.3\source\rtl\objpas\sysutils\sysutilh.inc"/>
     102        <EditorIndex Value="1"/>
     103        <WindowIndex Value="0"/>
     104        <TopLine Value="84"/>
     105        <CursorPos X="79" Y="89"/>
     106        <UsageCount Value="10"/>
     107        <Loaded Value="True"/>
     108      </Unit5>
    100109    </Units>
    101     <JumpHistory Count="30" HistoryIndex="28">
     110    <JumpHistory Count="30" HistoryIndex="29">
    102111      <Position1>
    103112        <Filename Value="UMainForm.pas"/>
    104         <Caret Line="95" Column="1" TopLine="85"/>
     113        <Caret Line="99" Column="1" TopLine="85"/>
    105114      </Position1>
    106115      <Position2>
    107116        <Filename Value="UMainForm.pas"/>
    108         <Caret Line="98" Column="1" TopLine="85"/>
     117        <Caret Line="101" Column="1" TopLine="85"/>
    109118      </Position2>
    110119      <Position3>
    111120        <Filename Value="UMainForm.pas"/>
    112         <Caret Line="99" Column="1" TopLine="85"/>
     121        <Caret Line="94" Column="1" TopLine="85"/>
    113122      </Position3>
    114123      <Position4>
    115124        <Filename Value="UMainForm.pas"/>
    116         <Caret Line="92" Column="13" TopLine="85"/>
     125        <Caret Line="95" Column="1" TopLine="85"/>
    117126      </Position4>
    118127      <Position5>
    119128        <Filename Value="UMainForm.pas"/>
    120         <Caret Line="99" Column="1" TopLine="85"/>
     129        <Caret Line="98" Column="1" TopLine="85"/>
    121130      </Position5>
    122131      <Position6>
    123132        <Filename Value="UMainForm.pas"/>
    124         <Caret Line="101" Column="1" TopLine="85"/>
     133        <Caret Line="99" Column="1" TopLine="85"/>
    125134      </Position6>
    126135      <Position7>
    127136        <Filename Value="UMainForm.pas"/>
    128         <Caret Line="94" Column="1" TopLine="85"/>
     137        <Caret Line="101" Column="1" TopLine="85"/>
    129138      </Position7>
    130139      <Position8>
    131140        <Filename Value="UMainForm.pas"/>
    132         <Caret Line="95" Column="1" TopLine="85"/>
     141        <Caret Line="94" Column="1" TopLine="85"/>
    133142      </Position8>
    134143      <Position9>
    135144        <Filename Value="UMainForm.pas"/>
    136         <Caret Line="98" Column="1" TopLine="85"/>
     145        <Caret Line="95" Column="1" TopLine="85"/>
    137146      </Position9>
    138147      <Position10>
     
    142151      <Position11>
    143152        <Filename Value="UMainForm.pas"/>
    144         <Caret Line="101" Column="1" TopLine="85"/>
     153        <Caret Line="119" Column="27" TopLine="109"/>
    145154      </Position11>
    146155      <Position12>
    147156        <Filename Value="UMainForm.pas"/>
    148         <Caret Line="94" Column="1" TopLine="85"/>
     157        <Caret Line="99" Column="32" TopLine="78"/>
    149158      </Position12>
    150159      <Position13>
    151160        <Filename Value="UMainForm.pas"/>
    152         <Caret Line="95" Column="1" TopLine="85"/>
     161        <Caret Line="98" Column="29" TopLine="78"/>
    153162      </Position13>
    154163      <Position14>
    155164        <Filename Value="UMainForm.pas"/>
    156         <Caret Line="99" Column="1" TopLine="85"/>
     165        <Caret Line="102" Column="14" TopLine="78"/>
    157166      </Position14>
    158167      <Position15>
    159         <Filename Value="UMainForm.pas"/>
    160         <Caret Line="119" Column="27" TopLine="109"/>
     168        <Filename Value="BitStreamTest.lpr"/>
     169        <Caret Line="19" Column="1" TopLine="1"/>
    161170      </Position15>
    162171      <Position16>
    163172        <Filename Value="UMainForm.pas"/>
    164         <Caret Line="99" Column="32" TopLine="78"/>
     173        <Caret Line="101" Column="12" TopLine="85"/>
    165174      </Position16>
    166175      <Position17>
    167176        <Filename Value="UMainForm.pas"/>
    168         <Caret Line="98" Column="29" TopLine="78"/>
     177        <Caret Line="111" Column="49" TopLine="111"/>
    169178      </Position17>
    170179      <Position18>
    171180        <Filename Value="UMainForm.pas"/>
    172         <Caret Line="102" Column="14" TopLine="78"/>
     181        <Caret Line="24" Column="59" TopLine="23"/>
    173182      </Position18>
    174183      <Position19>
    175         <Filename Value="BitStreamTest.lpr"/>
    176         <Caret Line="19" Column="1" TopLine="1"/>
     184        <Filename Value="UMainForm.pas"/>
     185        <Caret Line="58" Column="21" TopLine="45"/>
    177186      </Position19>
    178187      <Position20>
    179188        <Filename Value="UMainForm.pas"/>
    180         <Caret Line="101" Column="12" TopLine="85"/>
     189        <Caret Line="72" Column="9" TopLine="59"/>
    181190      </Position20>
    182191      <Position21>
    183         <Filename Value="UMainForm.pas"/>
    184         <Caret Line="111" Column="49" TopLine="111"/>
     192        <Filename Value="BitStreamTest.lpr"/>
     193        <Caret Line="19" Column="1" TopLine="1"/>
    185194      </Position21>
    186195      <Position22>
    187         <Filename Value="UMainForm.pas"/>
    188         <Caret Line="24" Column="59" TopLine="23"/>
     196        <Filename Value="BitStreamTest.lpr"/>
     197        <Caret Line="18" Column="29" TopLine="1"/>
    189198      </Position22>
    190199      <Position23>
    191200        <Filename Value="UMainForm.pas"/>
    192         <Caret Line="58" Column="21" TopLine="45"/>
     201        <Caret Line="89" Column="23" TopLine="80"/>
    193202      </Position23>
    194203      <Position24>
    195204        <Filename Value="UMainForm.pas"/>
    196         <Caret Line="72" Column="9" TopLine="59"/>
     205        <Caret Line="15" Column="1" TopLine="3"/>
    197206      </Position24>
    198207      <Position25>
    199         <Filename Value="BitStreamTest.lpr"/>
    200         <Caret Line="19" Column="1" TopLine="1"/>
     208        <Filename Value="UMainForm.pas"/>
     209        <Caret Line="56" Column="11" TopLine="44"/>
    201210      </Position25>
    202211      <Position26>
    203         <Filename Value="BitStreamTest.lpr"/>
    204         <Caret Line="18" Column="29" TopLine="1"/>
     212        <Filename Value="UMainForm.pas"/>
     213        <Caret Line="76" Column="3" TopLine="69"/>
    205214      </Position26>
    206215      <Position27>
    207216        <Filename Value="UMainForm.pas"/>
    208         <Caret Line="89" Column="23" TopLine="80"/>
     217        <Caret Line="15" Column="7" TopLine="3"/>
    209218      </Position27>
    210219      <Position28>
    211220        <Filename Value="UMainForm.pas"/>
    212         <Caret Line="15" Column="1" TopLine="3"/>
     221        <Caret Line="11" Column="1" TopLine="1"/>
    213222      </Position28>
    214223      <Position29>
    215224        <Filename Value="UMainForm.pas"/>
    216         <Caret Line="56" Column="11" TopLine="44"/>
     225        <Caret Line="124" Column="53" TopLine="112"/>
    217226      </Position29>
    218227      <Position30>
    219228        <Filename Value="UMainForm.pas"/>
    220         <Caret Line="22" Column="15" TopLine="10"/>
     229        <Caret Line="143" Column="50" TopLine="131"/>
    221230      </Position30>
    222231    </JumpHistory>
  • CoolStreaming/Demo/BitStream/UMainForm.pas

    r122 r129  
    99  UBitStream;
    1010
    11 const
    12   Symbols: array[0..1] of Char = ('.', '#');
    13 
    1411type
    15   TByteArray = array of Byte;
    16 
     12  TArrayOfByte = array of Byte;
    1713
    1814  { TMainForm }
     
    2319  private
    2420    procedure PrintBitStream(Stream: TBitStream; StringList: TStrings);
    25     procedure PrintData(Data: TByteArray; Count: Integer; StringList: TStrings);
     21    procedure PrintData(Data: TArrayOfByte; Count: Integer; StringList: TStrings);
    2622    procedure PrintStream(Stream: TStream; StringList: TStrings);
    27     { private declarations }
    2823  public
    29     { public declarations }
    3024  end;
    3125
     
    4842  WindowState := wsMaximized;
    4943
    50   with Memo1, Lines do begin
    51   BitStream := TMemoryBitStream.Create;
    52   BitStream2 := TMemoryBitStream.Create;
    53   SetLength(Buffer, 4);
    54   Buffer[0] := $12;
    55   Buffer[1] := $34;
    56   Buffer[2] := $56;
    57   Buffer[3] := $78;
    58   Add('Source data:');
    59   PrintData(Buffer, Length(Buffer) * 8, Lines);
     44  with Memo1, Lines do try
     45    BeginUpdate;
     46    BitStream := TMemoryBitStream.Create;
     47    BitStream2 := TMemoryBitStream.Create;
     48    SetLength(Buffer, 4);
     49    Buffer[0] := $12;
     50    Buffer[1] := $34;
     51    Buffer[2] := $56;
     52    Buffer[3] := $78;
     53    Add('Source data:');
     54    PrintData(Buffer, Length(Buffer) * 8, Lines);
    6055
    61   BitStream.Write(Buffer[0], 28);
    62   Add('Write data to stream:');
    63   PrintBitStream(BitStream, Lines);
    64   // Write second bit array after first which lead to store data as shifted
    65   BitStream.Write(Buffer[0], 28);
    66   Add('Append shifted data to stream:');
    67   PrintBitStream(BitStream, Lines);
     56    BitStream.Write(Buffer[0], 28);
     57    Add('Write data to stream:');
     58    PrintBitStream(BitStream, Lines);
     59    // Write second bit array after first which lead to store data as shifted
     60    BitStream.Write(Buffer[0], 28);
     61    Add('Append shifted data to stream:');
     62    PrintBitStream(BitStream, Lines);
    6863
    69   // Read test of sub bit array
    70   BitStream.Position := 1;
    71   BitStream.Read(Buffer[0], 32);
    72   Add('Read bit data part:');
    73   PrintData(Buffer, Length(Buffer) * 8, Lines);
     64    // Read test of sub bit array
     65    BitStream.Position := 1;
     66    BitStream.Read(Buffer[0], 32);
     67    Add('Read bit data part:');
     68    PrintData(Buffer, Length(Buffer) * 8, Lines);
    7469
    75  (* // Test stream copy
    76   Add('Copy bit block to another stream:');
    77   for I := 0 to BitStream.Size do begin
    78     BitStream.Position := I;
    79     BitStream2.Size := 0;
    80     BitStream2.CopyFrom(BitStream, BitStream.Size);
    81     PrintBitStream(BitStream2, Lines);
    82   end;
    83   for I := 0 to BitStream.Size do begin
    84     BitStream.Position := 0;
    85     BitStream2.Size := 0;
    86     BitStream2.Position := I;
    87     BitStream2.CopyFrom(BitStream, BitStream.Size);
    88     PrintBitStream(BitStream2, Lines);
    89   end;  *)
    90 
    91   Add('Bit copy of substreams');
    92   SetLength(Buffer, 1000);
    93   for Y := 1 to BitStream.Size do begin
    94     Add('Size: ' + IntToStr(Y));
    95     for I := 0 to BitStream.Size - Y do begin
     70   (* // Test stream copy
     71    Add('Copy bit block to another stream:');
     72    for I := 0 to BitStream.Size do begin
    9673      BitStream.Position := I;
    9774      BitStream2.Size := 0;
    98       //BitStream2.CopyFrom(BitStream, Y);
    99       //PrintBitStream(BitStream2, Lines);
    100       SetLength(Buffer, 1000);
    101       C := BitStream.Read(Buffer[0], Y);
    102       SetLength(Buffer, C div 8 + 1);
    103       PrintData(Buffer, C, Lines);
     75      BitStream2.CopyFrom(BitStream, BitStream.Size);
     76      PrintBitStream(BitStream2, Lines);
    10477    end;
    105     Add('');
    106   end;
     78    for I := 0 to BitStream.Size do begin
     79      BitStream.Position := 0;
     80      BitStream2.Size := 0;
     81      BitStream2.Position := I;
     82      BitStream2.CopyFrom(BitStream, BitStream.Size);
     83      PrintBitStream(BitStream2, Lines);
     84    end;  *)
    10785
    108   BitStream.Destroy;
    109   BitStream2.Destroy;
     86    Add('Bit copy of substreams');
     87    SetLength(Buffer, 1000);
     88    for Y := 1 to BitStream.Size do begin
     89      Add('Size: ' + IntToStr(Y));
     90      for I := 0 to BitStream.Size - Y do begin
     91        BitStream.Position := I;
     92        BitStream2.Size := 0;
     93        //BitStream2.CopyFrom(BitStream, Y);
     94        //PrintBitStream(BitStream2, Lines);
     95        SetLength(Buffer, 1000);
     96        C := BitStream.Read(Buffer[0], Y);
     97        SetLength(Buffer, C div 8 + 1);
     98        PrintData(Buffer, C, Lines);
     99      end;
     100      Add('');
     101    end;
     102  finally
     103    BitStream.Free;
     104    BitStream2.Free;
     105    EndUpdate;
    110106  end;
    111107end;
    112108
    113 procedure TMainForm.PrintData(Data: TByteArray; Count: Integer; StringList: TStrings);
     109procedure TMainForm.PrintData(Data: TArrayOfByte; Count: Integer; StringList: TStrings);
    114110var
    115111  I: Integer;
     
    124120    for B := 0 to 7 do begin
    125121      if ((I * 8) + B) >= Count then Break;
    126       Line := Line + Symbols[(OneByte shr B) and 1];
     122      Line := Line + IntToStr((OneByte shr B) and 1);
    127123    end;
    128124  end;
     
    143139    Data := Stream.ReadByte;
    144140    for B := 0 to 7 do
    145       Line := Line + Symbols[(Data shr B) and 1];
     141      Line := Line + IntToStr((Data shr B) and 1);
    146142  end;
    147143  StringList.Add(Line);
     
    150146
    151147procedure TMainForm.PrintBitStream(Stream: TBitStream; StringList: TStrings);
    152 var
    153   I: Integer;
    154   Line: string;
    155148begin
    156   Stream.Position := 0;
    157   for I := 0 to Stream.Size - 1 do
    158     Line := Line + Symbols[Integer(Stream.ReadBit)];
    159   StringList.Add(Line);
    160   //StringList.Add('');
     149  StringList.Add(Stream.AsString);
    161150end;
    162151
  • Docking/CoolDocking/UCoolDockStyleTabs.pas

    r114 r129  
    147147    OnChange := TabControlChange;
    148148    PopupMenu := TCoolDockManager(Manager).PopupMenu;
    149     TTabControlNoteBookStrings(Tabs).NoteBook.OnMouseLeave := TabControlMouseLeave;
    150     TTabControlNoteBookStrings(Tabs).NoteBook.OnMouseDown := TabControlMouseDown;
    151     TTabControlNoteBookStrings(Tabs).NoteBook.OnMouseUp := TabControlMouseUp;
     149    //TTabControlNoteBookStrings(Tabs).NoteBook.OnMouseLeave := TabControlMouseLeave;
     150    //TTabControlNoteBookStrings(Tabs).NoteBook.OnMouseDown := TabControlMouseDown;
     151    //TTabControlNoteBookStrings(Tabs).NoteBook.OnMouseUp := TabControlMouseUp;
    152152    OnMouseUp := TabControlMouseUp;
    153153    Images := TabImageList;
  • ExceptionLogger/UExceptionForm.pas

    r40 r129  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   CustomLineInfo, Spin, ComCtrls, Contnrs, UStackTrace;
     9  CustomLineInfo, ComCtrls, UStackTrace;
    1010
    1111type
  • Generics/TemplateGenerics/Generic/GenericList.inc

    r114 r129  
    110110function TGList.Get(Index: TGListIndex): TGListItem;
    111111begin
     112  if (Index < 0) or (Index >= Count) then
     113    raise EListError.CreateFmt(SListIndexError, [Index]);
    112114  Result := FItems[Index];
    113115end;
     
    115117procedure TGList.Put(Index: TGListIndex; const AValue: TGListItem);
    116118begin
     119  if (Index < 0) or (Index >= Count) then
     120    raise EListError.CreateFmt(SListIndexError, [Index]);
    117121  FItems[Index] := AValue;
    118122end;
     
    175179  I := 0;
    176180  while I < Count do begin
    177     Items[I] := Source[I];
     181    FItems[I] := Source[I];
    178182    I := I + 1;
    179183  end;
     
    247251    raise EListError.CreateFmt(SListIndexError, [0])
    248252  else
    249     Result := Items[FCount - 1];
     253    Result := FItems[FCount - 1];
    250254end;
    251255
     
    255259    raise EListError.CreateFmt(SListIndexError, [0])
    256260  else
    257     Items[FCount - 1] := AValue;
     261    FItems[FCount - 1] := AValue;
    258262end;
    259263
     
    263267    raise EListError.CreateFmt(SListIndexError, [0])
    264268  else
    265     Result := Items[0];
     269    Result := FItems[0];
    266270end;
    267271
     
    271275    raise EListError.CreateFmt(SListIndexError, [0])
    272276  else
    273     Items[0] := AValue;
     277    FItems[0] := AValue;
    274278end;
    275279
     
    401405  I := 0;
    402406  while I < Count do begin
    403     Result := Result + Converter(Items[I]);
     407    Result := Result + Converter(FItems[I]);
    404408    if I < (Count - 1) then
    405409      Result := Result + Separator;
     
    469473  I := Start;
    470474  while I < Count do begin
    471     Items[I] := Value;
     475    FItems[I] := Value;
    472476    I := I + 1;
    473477  end;
  • Generics/TemplateGenerics/Specialized/SpecializedList.pas

    r112 r129  
    1919{$DEFINE TGListFromStringConverter := TListIntegerFromStringConverter}
    2020{$DEFINE TGListItemArray := TListIntegerItemArray}
     21{$DEFINE INTERFACE}
     22{$I 'GenericList.inc'}
     23
     24// TListBoolean<Integer, Boolean>
     25{$DEFINE TGListIndex := Integer}
     26{$DEFINE TGListItem := Boolean}
     27{$DEFINE TGList := TListBoolean}
     28{$DEFINE TGListSortCompare := TListBooleanSortCompare}
     29{$DEFINE TGListToStringConverter := TListBooleanToStringConverter}
     30{$DEFINE TGListFromStringConverter := TListBooleanFromStringConverter}
     31{$DEFINE TGListItemArray := TListBooleanItemArray}
    2132{$DEFINE INTERFACE}
    2233{$I 'GenericList.inc'}
     
    148159
    149160// TListSmallInt<Integer, SmallInt>
    150 {$DEFINE TGListIndex:=Integer}
    151 {$DEFINE TGListItem:=SmallInt}
    152 {$DEFINE TGList:=TListSmallInt}
    153 {$DEFINE TGListSortCompare:=TListSmallIntSortCompare}
    154 {$DEFINE TGListToStringConverter:=TListSmallIntToStringConverter}
    155 {$DEFINE TGListFromStringConverter:=TListSmallIntFromStringConverter}
     161{$DEFINE TGListIndex := Integer}
     162{$DEFINE TGListItem := SmallInt}
     163{$DEFINE TGList := TListSmallInt}
     164{$DEFINE TGListSortCompare := TListSmallIntSortCompare}
     165{$DEFINE TGListToStringConverter := TListSmallIntToStringConverter}
     166{$DEFINE TGListFromStringConverter := TListSmallIntFromStringConverter}
    156167{$DEFINE TGListItemArray := TListSmallIntItemArray}
     168{$DEFINE IMPLEMENTATION}
     169{$I 'GenericList.inc'}
     170
     171// TListBoolean<Integer, Boolean>
     172{$DEFINE TGListIndex := Integer}
     173{$DEFINE TGListItem := Boolean}
     174{$DEFINE TGList := TListBoolean}
     175{$DEFINE TGListSortCompare := TListBooleanSortCompare}
     176{$DEFINE TGListToStringConverter := TListBooleanToStringConverter}
     177{$DEFINE TGListFromStringConverter := TListBooleanFromStringConverter}
     178{$DEFINE TGListItemArray := TListBooleanItemArray}
    157179{$DEFINE IMPLEMENTATION}
    158180{$I 'GenericList.inc'}
  • PinConnection/UCommProtocol.pas

    r119 r129  
    77uses
    88  Classes, SysUtils, UVarBlockSerializer, syncobjs, UCommPin,
    9   UDebugLog, UStreamHelper, StopWatch, SpecializedList;
     9  UDebugLog, UStreamHelper, StopWatch, SpecializedList, UCommon;
    1010
    1111type
     
    6363
    6464  TRetransmitCheckThread = class(TThread)
    65   private
    6665  public
    6766    Parent: TCommProtocol;
     
    474473      except
    475474        on E: Exception do begin
    476           //MainForm.ExceptionLogger1.ThreadExceptionHandler(Self, E);
     475          if Assigned(ExceptionHandler) then ExceptionHandler(Self, E);
    477476        end;
    478477      end;
  • PinConnection/UCommSocket.pas

    r119 r129  
    66
    77uses
    8   Classes, SysUtils, blcksock, UCommPin;
     8  Classes, SysUtils, blcksock, UCommPin, UCommon;
    99
    1010type
     
    1616
    1717  TCommSocketReceiveThread = class(TThread)
     18  public
    1819    Parent: TCommSocket;
    1920    Stream: TMemoryStream;
     
    110111    except
    111112      on E: Exception do
    112         //MainForm.ExceptionLogger1.ThreadExceptionHandler(Self, E);
     113        if Assigned(ExceptionHandler) then ExceptionHandler(Self, E);
    113114    end;
    114115  until Terminated;
  • PinConnection/UCommThread.pas

    r119 r129  
    66
    77uses
    8   Classes, SysUtils, blcksock, UCommPin, SyncObjs, UStreamHelper;
     8  Classes, SysUtils, blcksock, UCommPin, SyncObjs, UStreamHelper, UCommon;
    99
    1010type
     
    1616
    1717  TCommThreadReceiveThread = class(TThread)
     18  public
    1819    Parent: TCommThread;
    1920    Stream: TMemoryStream;
     
    130131    except
    131132      on E: Exception do
    132         //MainForm.ExceptionLogger1.ThreadExceptionHandler(Self, E);
     133        if Assigned(ExceptionHandler) then ExceptionHandler(Self, E);
    133134    end;
    134135  until Terminated;
  • PinConnection/UPacketBurst.pas

    r119 r129  
    66
    77uses
    8   Classes, UCommPin, SyncObjs, UStreamHelper;
     8  Classes, UCommPin, SyncObjs, UStreamHelper, UCommon, SysUtils;
    99
    1010type
     
    103103  inherited;
    104104  try
     105  try
    105106    Stream := TStreamHelper.Create;
    106107    with PacketBurst do
     
    126127    Stream.Free;
    127128  end;
     129  except
     130    on E: Exception do
     131      if Assigned(ExceptionHandler) then ExceptionHandler(Self, E);
     132  end;
    128133end;
    129134
  • PinConnection/USerialPort.pas

    r119 r129  
    66
    77uses
    8   Classes, SysUtils, SynaSer, StdCtrls, Dialogs;
     8  Classes, SysUtils, SynaSer, StdCtrls, Dialogs, UCommon;
    99
    1010type
     
    2323
    2424  TSerialPortReceiveThread = class(TThread)
     25  public
    2526    Parent: TSerialPort;
    2627    procedure Execute; override;
     
    306307    except
    307308      on E: Exception do
    308         //MainForm.ExceptionLogger1.ThreadExceptionHandler(Self, E);
     309        if Assigned(ExceptionHandler) then ExceptionHandler(Self, E);
    309310    end;
    310311  until Terminated;
Note: See TracChangeset for help on using the changeset viewer.