Industrial: Fix compilation with Laz 2.0.8/FPC 3.0.4 - issue #39028.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8358 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-07-20 15:51:34 +00:00
parent 8ecd374dba
commit ec4052e4f0
4 changed files with 128 additions and 123 deletions

View File

@ -4,6 +4,9 @@
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="Properties_Demo"/>
<Scaled Value="True"/>
@ -14,9 +17,9 @@
</XPManifest>
</General>
<LazDoc Paths="..\docs"/>
<BuildModes>
<Item Name="Default" Default="True"/>
<Item Name="Debug">
<BuildModes Count="3">
<Item1 Name="Default" Default="True"/>
<Item2 Name="Debug">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
@ -56,8 +59,8 @@
</Options>
</Linking>
</CompilerOptions>
</Item>
<Item Name="Release">
</Item2>
<Item3 Name="Release">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
@ -88,7 +91,7 @@
</Options>
</Linking>
</CompilerOptions>
</Item>
</Item3>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
@ -97,26 +100,26 @@
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item>
<Item>
</Item1>
<Item2>
<PackageName Value="industrial"/>
</Item>
</Item2>
</RequiredPackages>
<Units>
<Unit>
<Units Count="2">
<Unit0>
<Filename Value="Properties_Demo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
</Unit0>
<Unit1>
<Filename Value="untMain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmMain"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit>
</Unit1>
</Units>
</ProjectOptions>
<CompilerOptions>
@ -142,16 +145,16 @@
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item>
<Item>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item>
<Item>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -4,7 +4,6 @@
unit industrial;
{$warn 5023 off : no warning about unused units}
interface
uses

View File

@ -50,7 +50,7 @@ type
public
constructor Create(ADisplay: TLCDDisplay);
destructor Destroy; override;
procedure Add(AChar: String; ADotRows: TDotRows);
procedure Add(AChar: String; const ADotRows: TDotRows);
procedure Assign(ASource: TPersistent); override;
procedure Clear;
procedure Delete(AChar: String);
@ -236,7 +236,7 @@ type
property OnChange: TNotifyEvent read FOnChange write FOnChange;
end;
function CopyDotRows(const ADotRows: TDotRows): TDotRows;
function CopyDotRows(const ADotRows: array of TDotRow): TDotRows;
implementation
@ -248,7 +248,7 @@ const
DEFAULT_DOT_ROW_COUNT = 7;
{ Create a "real" copy to avoid reference counter issues. }
function CopyDotRows(const ADotRows: TDotRows): TDotRows;
function CopyDotRows(const ADotRows: Array of TDotRow): TDotRows;
var
i: Integer;
begin
@ -276,7 +276,7 @@ begin
end;
{ Adds a new character dot matrix. }
procedure TCharDefs.Add(AChar: String; ADotRows: TDotRows);
procedure TCharDefs.Add(AChar: String; const ADotRows: TDotRows);
begin
if Length(ADotRows) <> FRowCount then
raise Exception.Create('Incorrect number of rows.');
@ -1038,100 +1038,101 @@ begin
ACharDefs.Clear;
if (AHorDots = DEFAULT_DOT_COL_COUNT) and (AVertDots = DEFAULT_DOT_ROW_COUNT) then
begin
ACharDefs.Add('!', [4, 4, 4, 4, 4, 0, 4]); // #33
ACharDefs.Add('"', [10, 10, 0, 0, 0, 0, 0]); // #34
ACharDefs.Add('#', [0, 10, 31, 10, 31, 10, 0]); // #35
ACharDefs.Add('$', [4, 15, 20, 14, 5, 30, 4]); // #36
ACharDefs.Add('%', [25, 26, 2, 4, 8, 11, 19]); // #37
ACharDefs.Add('&', [12, 18, 20, 8, 21, 18, 13]); // #38
ACharDefs.Add('''', [4, 4, 0, 0, 0, 0, 0]); // #39
ACharDefs.Add('(', [2, 4, 8, 8, 8, 4, 2]); // #40
ACharDefs.Add(')', [8, 4, 2, 2, 2, 4, 8]); // #41
ACharDefs.Add('*', [0, 4, 21, 14, 21, 4, 0]); // #42
ACharDefs.Add('+', [0, 4, 4, 31, 4, 4, 0]); // #43
ACharDefs.Add(',', [0, 0, 0, 0, 12, 4, 8]); // #44
ACharDefs.Add('-', [0, 0, 0, 14, 0, 0, 0]); // #45
ACharDefs.Add('.', [0, 0, 0, 0, 0, 12, 12]); // #46
ACharDefs.Add('/', [1, 1, 2, 4, 8, 16, 16]); // #47
ACharDefs.Add('0', [14, 17, 19, 21, 25, 17, 14]); // #48
ACharDefs.Add('1', [4, 12, 4, 4, 4, 4, 14]); // #49
ACharDefs.Add('2', [14, 17, 1, 2, 4, 8, 31]); // #50
ACharDefs.Add('3', [14, 17, 1, 6, 1, 17, 14]); // #51
ACharDefs.Add('4', [2, 6, 10, 18, 31, 2, 2]); // #52
ACharDefs.Add('5', [31, 16, 30, 1, 1, 17, 14]); // #53
ACharDefs.Add('6', [14, 17, 16, 30, 17, 17, 14]); // #54
ACharDefs.Add('7', [31, 1, 1, 2, 4, 4, 4]); // #55
ACharDefs.Add('8', [14, 17, 17, 14, 17, 17, 14]); // #56
ACharDefs.Add('9', [14, 17, 17, 15, 1, 17, 14]); // #57
ACharDefs.Add(':', [0, 12, 12, 0, 12, 12, 0]); // #58
ACharDefs.Add(';', [0, 12, 12, 0, 12, 4, 8]); // #59
ACharDefs.Add('<', [2, 4, 8, 16, 8, 4, 2]); // #60
ACharDefs.Add('=', [0, 0, 31, 0, 31, 0, 0]); // #61
ACharDefs.Add('>', [8, 4, 2, 1, 2, 4, 8]); // #62
ACharDefs.Add('?', [14, 17, 1, 2, 4, 0, 4]); // #63
ACharDefs.Add('@', [14, 17, 19, 21, 23, 16, 15]); // #64
ACharDefs.Add('A', [14, 17, 17, 31, 17, 17, 17]); // #65
ACharDefs.Add('B', [30, 17, 17, 30, 17, 17, 30]); // #66
ACharDefs.Add('C', [14, 17, 16, 16, 16, 17, 14]); // #67
ACharDefs.Add('D', [30, 17, 17, 17, 17, 17, 30]); // #68
ACharDefs.Add('E', [31, 16, 16, 30, 16, 16, 31]); // #69
ACharDefs.Add('F', [31, 16, 16, 30, 16, 16, 16]); // #70
ACharDefs.Add('G', [14, 17, 16, 19, 17, 17, 14]); // #71
ACharDefs.Add('H', [17, 17, 17, 31, 17, 17, 17]); // #72
ACharDefs.Add('I', [14, 4, 4, 4, 4, 4, 14]); // #73
ACharDefs.Add('J', [1, 1, 1, 1, 17, 17, 14]); // #74
ACharDefs.Add('K', [17, 18, 20, 24, 20, 18, 17]); // #75
ACharDefs.Add('L', [16, 16, 16, 16, 16, 16, 31]); // #76
ACharDefs.Add('M', [17, 27, 21, 21, 17, 17, 17]); // #77
ACharDefs.Add('N', [17, 25, 21, 19, 17, 17, 17]); // #78
ACharDefs.Add('O', [14, 17, 17, 17, 17, 17, 14]); // #79
ACharDefs.Add('P', [30, 17, 17, 30, 16, 16, 16]); // #80
ACharDefs.Add('Q', [14, 17, 17, 17, 17, 14, 1]); // #81
ACharDefs.Add('R', [30, 17, 17, 30, 17, 17, 17]); // #82
ACharDefs.Add('S', [14, 17, 16, 14, 1, 17, 14]); // #83
ACharDefs.Add('T', [31, 4, 4, 4, 4, 4, 4]); // #84
ACharDefs.Add('U', [17, 17, 17, 17, 17, 17, 14]); // #85
ACharDefs.Add('V', [17, 17, 17, 17, 17, 10, 4]); // #86
ACharDefs.Add('W', [17, 17, 17, 17, 21, 27, 17]); // #87
ACharDefs.Add('X', [17, 10, 4, 4, 4, 10, 17]); // #88
ACharDefs.Add('Y', [17, 17, 17, 10, 4, 4, 4]); // #89
ACharDefs.Add('Z', [31, 1, 2, 4, 8, 16, 31]); // #90
ACharDefs.Add('[', [12, 8, 8, 8, 8, 8, 12]); // #91
ACharDefs.Add('\', [0, 16, 8, 4, 2, 1, 0]); // #92
ACharDefs.Add(']', [6, 2, 2, 2, 2, 2, 6]); // #93
ACharDefs.Add('^', [4, 10, 17, 0, 0, 0, 0]); // #94
ACharDefs.Add('_', [0, 0, 0, 0, 0, 0, 31]); // #95
ACharDefs.Add('`', [6, 4, 2, 0, 0, 0, 0]); // #96
ACharDefs.Add('a', [0, 0, 14, 1, 15, 17, 15]); // #97
ACharDefs.Add('b', [16, 16, 30, 17, 17, 17, 30]); // #98
ACharDefs.Add('c', [0, 0, 15, 16, 16, 16, 15]); // #99
ACharDefs.Add('d', [1, 1, 15, 17, 17, 17, 15]); // #100
ACharDefs.Add('e', [0, 0, 14, 17, 31, 16, 14]); // #101
ACharDefs.Add('f', [3, 4, 31, 4, 4, 4, 4]); // #102
ACharDefs.Add('g', [0, 0, 15, 17, 15, 1, 14]); // #103
ACharDefs.Add('h', [16, 16, 22, 25, 17, 17, 17]);// #104
ACharDefs.Add('i', [4, 0, 12, 4, 4, 4, 14]); // #105
ACharDefs.Add('j', [2, 0, 6, 2, 2, 18, 12]); // #106
ACharDefs.Add('k', [16, 16, 18, 20, 24, 20, 18]);// #107
ACharDefs.Add('l', [12, 4, 4, 4, 4, 4, 14]); // #108
ACharDefs.Add('m', [0, 0, 26, 21, 21, 21, 21]); // #109
ACharDefs.Add('n', [0, 0, 22, 25, 17, 17, 17]); // #110
ACharDefs.Add('o', [0, 0, 14, 17, 17, 17, 14]); // #111
ACharDefs.Add('p', [0, 0, 30, 17, 30, 16, 16]); // #112
ACharDefs.Add('q', [0, 0, 15, 17, 15, 1, 1]); // #113
ACharDefs.Add('r', [0, 0, 11, 12, 8, 8, 8]); // #114
ACharDefs.Add('s', [0, 0, 14, 16, 14, 1, 30]); // #115
ACharDefs.Add('t', [4, 4, 31, 4, 4, 4, 3]); // #116
ACharDefs.Add('u', [0, 0, 17, 17, 17, 19, 13]); // #117
ACharDefs.Add('v', [0, 0, 17, 17, 17, 10, 4]); // #118
ACharDefs.Add('w', [0, 0, 17, 17, 21, 21, 10]); // #119
ACharDefs.Add('x', [0, 0, 17, 10, 4, 10, 17]); // #120
ACharDefs.Add('y', [0, 0, 17, 17, 15, 1, 14]); // #121
ACharDefs.Add('z', [0, 0, 31, 2, 4, 8, 31]); // #122
ACharDefs.Add('{', [3, 4, 4, 8, 4, 4, 3]); // #123
ACharDefs.Add('|', [4, 4, 4, 4, 4, 4, 4]); // #124
ACharDefs.Add('}', [24, 4, 4, 2, 4, 4, 24]); // #125
ACharDefs.Add('~', [8, 21, 2, 0, 0, 0, 0]); // #126
// Note: Passing the array via CopyDotRows is for compilation with FPC before v3.2
ACharDefs.Add('!', CopyDotRows([4, 4, 4, 4, 4, 0, 4])); // #33
ACharDefs.Add('"', CopyDotRows([10, 10, 0, 0, 0, 0, 0])); // #34
ACharDefs.Add('#', CopyDotRows([0, 10, 31, 10, 31, 10, 0])); // #35
ACharDefs.Add('$', CopyDotRows([4, 15, 20, 14, 5, 30, 4])); // #36
ACharDefs.Add('%', CopyDotRows([25, 26, 2, 4, 8, 11, 19])); // #37
ACharDefs.Add('&', CopyDotRows([12, 18, 20, 8, 21, 18, 13])); // #38
ACharDefs.Add('''',CopyDotRows([4, 4, 0, 0, 0, 0, 0])); // #39
ACharDefs.Add('(', CopyDotRows([2, 4, 8, 8, 8, 4, 2])); // #40
ACharDefs.Add(')', CopyDotRows([8, 4, 2, 2, 2, 4, 8])); // #41
ACharDefs.Add('*', CopyDotRows([0, 4, 21, 14, 21, 4, 0])); // #42
ACharDefs.Add('+', CopyDotRows([0, 4, 4, 31, 4, 4, 0])); // #43
ACharDefs.Add(',', CopyDotRows([0, 0, 0, 0, 12, 4, 8])); // #44
ACharDefs.Add('-', CopyDotRows([0, 0, 0, 14, 0, 0, 0])); // #45
ACharDefs.Add('.', CopyDotRows([0, 0, 0, 0, 0, 12, 12])); // #46
ACharDefs.Add('/', CopyDotRows([1, 1, 2, 4, 8, 16, 16])); // #47
ACharDefs.Add('0', CopyDotRows([14, 17, 19, 21, 25, 17, 14])); // #48
ACharDefs.Add('1', CopyDotRows([4, 12, 4, 4, 4, 4, 14])); // #49
ACharDefs.Add('2', CopyDotRows([14, 17, 1, 2, 4, 8, 31])); // #50
ACharDefs.Add('3', CopyDotRows([14, 17, 1, 6, 1, 17, 14])); // #51
ACharDefs.Add('4', CopyDotRows([2, 6, 10, 18, 31, 2, 2])); // #52
ACharDefs.Add('5', CopyDotRows([31, 16, 30, 1, 1, 17, 14])); // #53
ACharDefs.Add('6', CopyDotRows([14, 17, 16, 30, 17, 17, 14])); // #54
ACharDefs.Add('7', CopyDotRows([31, 1, 1, 2, 4, 4, 4])); // #55
ACharDefs.Add('8', CopyDotRows([14, 17, 17, 14, 17, 17, 14])); // #56
ACharDefs.Add('9', CopyDotRows([14, 17, 17, 15, 1, 17, 14])); // #57
ACharDefs.Add(':', CopyDotRows([0, 12, 12, 0, 12, 12, 0])); // #58
ACharDefs.Add(';', CopyDotRows([0, 12, 12, 0, 12, 4, 8])); // #59
ACharDefs.Add('<', CopyDotRows([2, 4, 8, 16, 8, 4, 2])); // #60
ACharDefs.Add('=', CopyDotRows([0, 0, 31, 0, 31, 0, 0])); // #61
ACharDefs.Add('>', CopyDotRows([8, 4, 2, 1, 2, 4, 8])); // #62
ACharDefs.Add('?', CopyDotRows([14, 17, 1, 2, 4, 0, 4])); // #63
ACharDefs.Add('@', CopyDotRows([14, 17, 19, 21, 23, 16, 15])); // #64
ACharDefs.Add('A', CopyDotRows([14, 17, 17, 31, 17, 17, 17])); // #65
ACharDefs.Add('B', CopyDotRows([30, 17, 17, 30, 17, 17, 30])); // #66
ACharDefs.Add('C', CopyDotRows([14, 17, 16, 16, 16, 17, 14])); // #67
ACharDefs.Add('D', CopyDotRows([30, 17, 17, 17, 17, 17, 30])); // #68
ACharDefs.Add('E', CopyDotRows([31, 16, 16, 30, 16, 16, 31])); // #69
ACharDefs.Add('F', CopyDotRows([31, 16, 16, 30, 16, 16, 16])); // #70
ACharDefs.Add('G', CopyDotRows([14, 17, 16, 19, 17, 17, 14])); // #71
ACharDefs.Add('H', CopyDotRows([17, 17, 17, 31, 17, 17, 17])); // #72
ACharDefs.Add('I', CopyDotRows([14, 4, 4, 4, 4, 4, 14])); // #73
ACharDefs.Add('J', CopyDotRows([1, 1, 1, 1, 17, 17, 14])); // #74
ACharDefs.Add('K', CopyDotRows([17, 18, 20, 24, 20, 18, 17])); // #75
ACharDefs.Add('L', CopyDotRows([16, 16, 16, 16, 16, 16, 31])); // #76
ACharDefs.Add('M', CopyDotRows([17, 27, 21, 21, 17, 17, 17])); // #77
ACharDefs.Add('N', CopyDotRows([17, 25, 21, 19, 17, 17, 17])); // #78
ACharDefs.Add('O', CopyDotRows([14, 17, 17, 17, 17, 17, 14])); // #79
ACharDefs.Add('P', CopyDotRows([30, 17, 17, 30, 16, 16, 16])); // #80
ACharDefs.Add('Q', CopyDotRows([14, 17, 17, 17, 17, 14, 1])); // #81
ACharDefs.Add('R', CopyDotRows([30, 17, 17, 30, 17, 17, 17])); // #82
ACharDefs.Add('S', CopyDotRows([14, 17, 16, 14, 1, 17, 14])); // #83
ACharDefs.Add('T', CopyDotRows([31, 4, 4, 4, 4, 4, 4])); // #84
ACharDefs.Add('U', CopyDotRows([17, 17, 17, 17, 17, 17, 14])); // #85
ACharDefs.Add('V', CopyDotRows([17, 17, 17, 17, 17, 10, 4])); // #86
ACharDefs.Add('W', CopyDotRows([17, 17, 17, 17, 21, 27, 17])); // #87
ACharDefs.Add('X', CopyDotRows([17, 10, 4, 4, 4, 10, 17])); // #88
ACharDefs.Add('Y', CopyDotRows([17, 17, 17, 10, 4, 4, 4])); // #89
ACharDefs.Add('Z', CopyDotRows([31, 1, 2, 4, 8, 16, 31])); // #90
ACharDefs.Add('[', CopyDotRows([12, 8, 8, 8, 8, 8, 12])); // #91
ACharDefs.Add('\', CopyDotRows([0, 16, 8, 4, 2, 1, 0])); // #92
ACharDefs.Add(']', CopyDotRows([6, 2, 2, 2, 2, 2, 6])); // #93
ACharDefs.Add('^', CopyDotRows([4, 10, 17, 0, 0, 0, 0])); // #94
ACharDefs.Add('_', CopyDotRows([0, 0, 0, 0, 0, 0, 31])); // #95
ACharDefs.Add('`', CopyDotRows([6, 4, 2, 0, 0, 0, 0])); // #96
ACharDefs.Add('a', CopyDotRows([0, 0, 14, 1, 15, 17, 15])); // #97
ACharDefs.Add('b', CopyDotRows([16, 16, 30, 17, 17, 17, 30])); // #98
ACharDefs.Add('c', CopyDotRows([0, 0, 15, 16, 16, 16, 15])); // #99
ACharDefs.Add('d', CopyDotRows([1, 1, 15, 17, 17, 17, 15])); // #100
ACharDefs.Add('e', CopyDotRows([0, 0, 14, 17, 31, 16, 14])); // #101
ACharDefs.Add('f', CopyDotRows([3, 4, 31, 4, 4, 4, 4])); // #102
ACharDefs.Add('g', CopyDotRows([0, 0, 15, 17, 15, 1, 14])); // #103
ACharDefs.Add('h', CopyDotRows([16, 16, 22, 25, 17, 17, 17]));// #104
ACharDefs.Add('i', CopyDotRows([4, 0, 12, 4, 4, 4, 14])); // #105
ACharDefs.Add('j', CopyDotRows([2, 0, 6, 2, 2, 18, 12])); // #106
ACharDefs.Add('k', CopyDotRows([16, 16, 18, 20, 24, 20, 18]));// #107
ACharDefs.Add('l', CopyDotRows([12, 4, 4, 4, 4, 4, 14])); // #108
ACharDefs.Add('m', CopyDotRows([0, 0, 26, 21, 21, 21, 21])); // #109
ACharDefs.Add('n', CopyDotRows([0, 0, 22, 25, 17, 17, 17])); // #110
ACharDefs.Add('o', CopyDotRows([0, 0, 14, 17, 17, 17, 14])); // #111
ACharDefs.Add('p', CopyDotRows([0, 0, 30, 17, 30, 16, 16])); // #112
ACharDefs.Add('q', CopyDotRows([0, 0, 15, 17, 15, 1, 1])); // #113
ACharDefs.Add('r', CopyDotRows([0, 0, 11, 12, 8, 8, 8])); // #114
ACharDefs.Add('s', CopyDotRows([0, 0, 14, 16, 14, 1, 30])); // #115
ACharDefs.Add('t', CopyDotRows([4, 4, 31, 4, 4, 4, 3])); // #116
ACharDefs.Add('u', CopyDotRows([0, 0, 17, 17, 17, 19, 13])); // #117
ACharDefs.Add('v', CopyDotRows([0, 0, 17, 17, 17, 10, 4])); // #118
ACharDefs.Add('w', CopyDotRows([0, 0, 17, 17, 21, 21, 10])); // #119
ACharDefs.Add('x', CopyDotRows([0, 0, 17, 10, 4, 10, 17])); // #120
ACharDefs.Add('y', CopyDotRows([0, 0, 17, 17, 15, 1, 14])); // #121
ACharDefs.Add('z', CopyDotRows([0, 0, 31, 2, 4, 8, 31])); // #122
ACharDefs.Add('{', CopyDotRows([3, 4, 4, 8, 4, 4, 3])); // #123
ACharDefs.Add('|', CopyDotRows([4, 4, 4, 4, 4, 4, 4])); // #124
ACharDefs.Add('}', CopyDotRows([24, 4, 4, 2, 4, 4, 24])); // #125
ACharDefs.Add('~', CopyDotRows([8, 21, 2, 0, 0, 0, 0])); // #126
end;
end;

View File

@ -15,7 +15,9 @@ unit Sensors;
interface
uses LCLIntf, LCLType, LResources, Classes, Controls, Graphics, Stdctrls, Extctrls;
uses
LCLIntf, LCLType, LResources, Classes,
Controls, Graphics, StdCtrls, Extctrls;
type
TStopLights = (slUNKNOWN, slRED, slYELLOW, slGREEN);