File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
src/env/artifact/environment Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2023. Smart Operating Block
3
+ *
4
+ * Use of this source code is governed by an MIT-style
5
+ * license that can be found in the LICENSE file or at
6
+ * https://opensource.org/licenses/MIT.
7
+ */
8
+
9
+ package artifact .environment ;
10
+
11
+ import cartago .Artifact ;
12
+ import cartago .OPERATION ;
13
+
14
+ import java .util .logging .Logger ;
15
+
16
+ /**
17
+ * CArtAgO artifact that is responsible for the communication with the hvac system of the operating block respect
18
+ * to the cooling part.
19
+ */
20
+ public class Cooler extends Artifact {
21
+ private String roomId ;
22
+
23
+ /**
24
+ * Initialize the cooler artifact.
25
+ * @param roomId the id of the room where the cooler is placed
26
+ */
27
+ void init (final String roomId ) {
28
+ this .roomId = roomId ;
29
+ }
30
+
31
+ /**
32
+ * Turn on the cooling system.
33
+ */
34
+ @ OPERATION
35
+ void turnOn () {
36
+ Logger .getLogger (Cooler .class .toString ()).info ("[" + this .roomId + "]" + " ON" );
37
+ }
38
+
39
+ /**
40
+ * Turn off the cooling system.
41
+ */
42
+ @ OPERATION
43
+ void turnOff () {
44
+ Logger .getLogger (Cooler .class .toString ()).info ("[" + this .roomId + "]" + " OFF" );
45
+ }
46
+ }
You can’t perform that action at this time.
0 commit comments