File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/env/artifact/environment/roomartifact Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 10
10
11
11
import cartago .OPERATION ;
12
12
import entity .actuator .ActuatorType ;
13
+ import entity .actuator .SwitchableActuator ;
13
14
import entity .room .RoomID ;
15
+ import infrastructure .wot .WotInvoker ;
14
16
15
17
import java .util .logging .Logger ;
16
18
19
21
* to the cooling part.
20
22
*/
21
23
public class Cooler extends AbstractActuatorInRoomArtifact implements SwitchableArtifact {
24
+ private SwitchableActuator actuator ;
25
+ private WotInvoker wotInvoker ;
22
26
/**
23
27
* Initialize the cooler artifact.
24
28
* @param roomId the room id where the cooler is placed.
25
29
*/
26
30
void init (final String roomId ) {
27
31
super .init (ActuatorType .COOLING , new RoomID (roomId ));
32
+ this .actuator = new SwitchableActuator (this .getActuatorID ());
33
+ this .wotInvoker = new WotInvoker ();
28
34
}
29
35
30
36
@ Override
31
37
@ OPERATION
32
38
public final void turnOn () {
33
39
Logger .getLogger (Cooler .class .toString ()).info ("[" + this .getRoomId () + "] " + this .getActuatorID ().getId () + " ON" );
40
+ this .actuator .turnOn (this .wotInvoker );
34
41
}
35
42
36
43
@ Override
37
44
@ OPERATION
38
45
public final void turnOff () {
39
46
Logger .getLogger (Cooler .class .toString ()).info ("[" + this .getRoomId () + "] " + this .getActuatorID ().getId () + " OFF" );
47
+ this .actuator .turnOff (this .wotInvoker );
40
48
}
41
49
}
You can’t perform that action at this time.
0 commit comments