-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfluentDemo.p
56 lines (38 loc) · 1.65 KB
/
fluentDemo.p
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
/*------------------------------------------------------------------------
File : fluentDemo.p
Purpose :
Syntax :
Description :
Author(s) : lutzf
Created : Sat Sep 16 02:32:27 CEST 2023
Notes :
----------------------------------------------------------------------*/
/* *************************** Definitions ************************** */
BLOCK-LEVEL ON ERROR UNDO, THROW.
USING Consultingwerk.Demo.Decorator.* FROM PROPATH.
USING Consultingwerk.Demo.Fluent.FluentHouseBuilder FROM PROPATH.
DEFINE VARIABLE oHouse AS IHouse.
//basic house
oHouse = FluentHouseBuilder:Build()
:House.
oHouse = NEW BasicHouse().
DISPLAY "Basic House energy consumption:" oHouse:GetEndEnergyConsumption() SKIP.
//insulated house
oHouse = FluentHouseBuilder:Build()
:AddInsulation(TRUE)
:House.
DISPLAY "Insulated House energy consumption:" oHouse:GetEndEnergyConsumption() SKIP.
//insulated house with heat pump
oHouse = FluentHouseBuilder:Build()
:AddInsulation(TRUE)
:AddHeatPump(TRUE)
:House.
DISPLAY "After heat pump upgrade:" oHouse:GetEndEnergyConsumption() SKIP.
//insulated house with heat pump and solar
oHouse = FluentHouseBuilder:Build()
:AddInsulation(TRUE)
:AddSolar(TRUE)
:AddHeatPump(TRUE)
:House.
DISPLAY "After solar installation:" oHouse:GetEndEnergyConsumption() SKIP.
/* *************************** Main Block *************************** */