Skip to content

Commit

Permalink
Completed the demo application.
Browse files Browse the repository at this point in the history
  • Loading branch information
pragmaticlinuxblog committed Apr 3, 2022
1 parent dc73929 commit d6a16d2
Show file tree
Hide file tree
Showing 3 changed files with 326 additions and 53 deletions.
24 changes: 15 additions & 9 deletions demo/SocketCanDemo.lpr
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,23 @@
//---------------------------------------------------------------------------------------
// L I C E N S E
//---------------------------------------------------------------------------------------
// This library is free software; you can redistribute it and/or modify it under the
// terms of the GNU Library General Public License as published by the Free Software
// Foundation; either version 2 of the License, or (at your option) any later version.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// This library is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
// PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// You should have received a copy of the GNU Library General Public License along with
// this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street,
// Fifth Floor, Boston, MA 02110-1301 USA
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
//***************************************************************************************
{$IFDEF FPC}
Expand Down
153 changes: 140 additions & 13 deletions demo/mainunit.lfm
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
object MainForm: TMainForm
Left = 1062
Left = 845
Height = 416
Top = 327
Width = 477
Top = 345
Width = 619
ActiveControl = BtnTransmit
Caption = 'SocketCanDemo'
ClientHeight = 416
ClientWidth = 477
ClientWidth = 619
OnCreate = FormCreate
OnDestroy = FormDestroy
LCLVersion = '2.0.12.0'
object GbxConnection: TGroupBox
Left = 0
Height = 80
Top = 0
Width = 477
Width = 619
Align = alTop
Caption = 'Connection'
ClientHeight = 62
ClientWidth = 475
ClientWidth = 617
TabOrder = 0
object CbbDevices: TComboBox
Left = 16
Expand All @@ -42,37 +42,164 @@ object MainForm: TMainForm
Left = 0
Height = 80
Top = 80
Width = 477
Width = 619
Align = alTop
Caption = 'Transmission'
ClientHeight = 62
ClientWidth = 475
ClientWidth = 617
TabOrder = 1
object BtnTransmit: TButton
Left = 16
Left = 504
Height = 28
Top = 16
Width = 96
Caption = 'Transmit'
OnClick = BtnTransmitClick
TabOrder = 10
end
object LblId: TLabel
Left = 16
Height = 17
Top = 20
Width = 12
Caption = 'Id'
ParentColor = False
end
object EdtId: TEdit
Left = 40
Height = 29
Top = 16
Width = 40
MaxLength = 3
TabOrder = 0
Text = '23E'
end
object CbbLen: TComboBox
Left = 128
Height = 27
Top = 16
Width = 48
ItemHeight = 0
ItemIndex = 8
Items.Strings = (
'0'
'1'
'2'
'3'
'4'
'5'
'6'
'7'
'8'
)
Style = csDropDownList
TabOrder = 1
Text = '8'
end
object LblLen: TLabel
Left = 96
Height = 17
Top = 20
Width = 22
Caption = 'Len'
ParentColor = False
end
object LblData: TLabel
Left = 192
Height = 17
Top = 20
Width = 28
Caption = 'Data'
ParentColor = False
end
object EdtData0: TEdit
Left = 232
Height = 29
Top = 16
Width = 32
MaxLength = 2
TabOrder = 2
Text = 'AA'
end
object EdtData1: TEdit
Left = 264
Height = 29
Top = 16
Width = 32
MaxLength = 2
TabOrder = 3
Text = '55'
end
object EdtData2: TEdit
Left = 296
Height = 29
Top = 16
Width = 32
MaxLength = 2
TabOrder = 4
Text = '00'
end
object EdtData3: TEdit
Left = 328
Height = 29
Top = 16
Width = 32
MaxLength = 2
TabOrder = 5
Text = 'FF'
end
object EdtData4: TEdit
Left = 360
Height = 29
Top = 16
Width = 32
MaxLength = 2
TabOrder = 6
Text = '01'
end
object EdtData5: TEdit
Left = 392
Height = 29
Top = 16
Width = 32
MaxLength = 2
TabOrder = 7
Text = '02'
end
object EdtData6: TEdit
Left = 424
Height = 29
Top = 16
Width = 32
MaxLength = 2
TabOrder = 8
Text = '03'
end
object EdtData7: TEdit
Left = 456
Height = 29
Top = 16
Width = 32
MaxLength = 2
TabOrder = 9
Text = '04'
end
end
object GbxLog: TGroupBox
Left = 0
Height = 256
Top = 160
Width = 477
Width = 619
Align = alClient
Caption = 'Log'
ClientHeight = 238
ClientWidth = 475
ClientWidth = 617
TabOrder = 2
object MmoLog: TMemo
Left = 0
Height = 238
Top = 0
Width = 475
Width = 617
Align = alClient
Font.Height = -13
Font.Name = 'Monospace'
Expand Down
Loading

0 comments on commit d6a16d2

Please sign in to comment.