-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariableunit.pas
More file actions
68 lines (55 loc) · 1.62 KB
/
variableunit.pas
File metadata and controls
68 lines (55 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
unit VariableUnit;
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils;
type
TVariable = class
protected
fname : string;
ftype : string;
fcomment : string;
public
constructor create(name:string;typeVar:string;commentField:string); virtual;
property nameVar:string read fname write fname;
property typeVar:string read ftype write ftype;
property comment:string read fcomment write fcomment;
end;
type TIOPlc = class(TVariable)
protected
fGPIO : string;
public
constructor create(name:string;typeVariable:string;gpio:string;commentField:string);
property gpio:string read fgpio write fGPIO;
end;
type TTimerVar = class (TVariable)
protected
fpreset : string;
fpresetON : string;
fpresetOFF : string;
public
constructor create(name:string;preset,presetON,presetOFF:string;typev:string);
property preset:string read fpreset write fpreset;
property presetON:string read fpresetON write fpresetON;
property presetOFF:string read fpresetOFF write fpresetOFF;
end;
implementation
constructor TVariable.create(name:string;typeVar:string;commentField:string);
begin
fname:=name;
ftype:=typeVar;
fcomment:=commentField;
end;
constructor TIOPlc.create(name:string;typeVariable:string;gpio:string;commentField:string);
begin
inherited create(name,typeVariable,commentField);
fgpio:=gpio;
end;
constructor TTimerVar.create(name:string;preset,presetON,presetOFF:string;typev:string);
begin
inherited create(name,typev,'');
fpreset:=preset;
fpresetON:=presetON;
fpresetOFF:=presetOFF;
end;
end.