LOG.config("The gate '" + getPojo().getName() + "' connects " + from + " to " + to);
}
@Override
protected void createCommands() {
Command a = new Command();
a.setName("Set " + getPojo().getName() + " openness to 50%");
a.setDescription("the " + getPojo().getName() + " changes its openness");
a.setReceiver("app.events.sensors.behavior.request.objects");
a.setProperty("object",
getPojo().getName());
a.setProperty("behavior", BEHAVIOR_OPENNESS);
a.setProperty("value", "50");
Command b = new Command();
b.setName("Increase " + getPojo().getName() + " openness");
b.setDescription("increases " + getPojo().getName() + " openness of one step");
b.setReceiver("app.events.sensors.behavior.request.objects");
b.setProperty("object",
getPojo().getName());
b.setProperty("behavior", BEHAVIOR_OPENNESS);
b.setProperty("value", "next");
Command c = new Command();
c.setName("Decrease " + getPojo().getName() + " openness");
c.setDescription("decreases " + getPojo().getName() + " openness of one step");
c.setReceiver("app.events.sensors.behavior.request.objects");
c.setProperty("object",
getPojo().getName());
c.setProperty("behavior", BEHAVIOR_OPENNESS);
c.setProperty("value", "previous");
Command d = new Command();
d.setName("Set its openness to 50%");
d.setDescription("set its openness to 50%");
d.setReceiver("app.events.sensors.behavior.request.objects");
d.setProperty("object", "@event.object.name");
d.setProperty("behavior", BEHAVIOR_OPENNESS);
d.setProperty("value", "50");
Command e = new Command();
e.setName("Increase its openness");
e.setDescription("increases its openness of one step");
e.setReceiver("app.events.sensors.behavior.request.objects");
e.setProperty("object", "@event.object.name");
e.setProperty("behavior", BEHAVIOR_OPENNESS);
e.setProperty("value", "next");
Command f = new Command();
f.setName("Decrease its openness");
f.setDescription("decreases its openness of one step");
f.setReceiver("app.events.sensors.behavior.request.objects");
f.setProperty("object", "@event.object.name");
f.setProperty("behavior", BEHAVIOR_OPENNESS);
f.setProperty("value", "previous");
Command g = new Command();
g.setName("Set its openness to the value in the event");
g.setDescription("set its openness to the value in the event");
g.setReceiver("app.events.sensors.behavior.request.objects");
g.setProperty("object", "@event.object.name");
g.setProperty("behavior", BEHAVIOR_OPENNESS);
g.setProperty("value", "@event.value");
Command h = new Command();
h.setName("Open " + getPojo().getName());
h.setDescription(getPojo().getSimpleType() + " opens");
h.setReceiver("app.events.sensors.behavior.request.objects");
h.setProperty("object",
getPojo().getName());
h.setProperty("behavior", BEHAVIOR_OPEN);
h.setProperty("value", "true");
Command i = new Command();
i.setName("Close " + getPojo().getName());
i.setDescription(getPojo().getSimpleType() + " closes");
i.setReceiver("app.events.sensors.behavior.request.objects");
i.setProperty("object",
getPojo().getName());
i.setProperty("behavior", BEHAVIOR_OPEN);
i.setProperty("value", "false");
Command l = new Command();
l.setName("Switch " + getPojo().getName() + " open state");
l.setDescription("closes/opens " + getPojo().getName());
l.setReceiver("app.events.sensors.behavior.request.objects");
l.setProperty("object",
getPojo().getName());
l.setProperty("behavior", BEHAVIOR_OPEN);
l.setProperty("value", "opposite");
Command m = new Command();
m.setName("Open this gate");
m.setDescription("this gate is opened");
m.setReceiver("app.events.sensors.behavior.request.objects");
m.setProperty("object", "@event.object.name");
m.setProperty("behavior", BEHAVIOR_OPEN);
m.setProperty("value", "true");
Command n = new Command();
n.setName("Close this gate");
n.setDescription("this gate is closed");
n.setReceiver("app.events.sensors.behavior.request.objects");
n.setProperty("object", "@event.object.name");
n.setProperty("behavior",BEHAVIOR_OPEN);
n.setProperty("value", "false");
Command o = new Command();
o.setName("Switch its open state");
o.setDescription("opens/closes the gate in the event");
o.setReceiver("app.events.sensors.behavior.request.objects");
o.setProperty("object", "@event.object.name");
o.setProperty("behavior", BEHAVIOR_OPEN);
o.setProperty("value", "opposite");
CommandPersistence.add(a);
CommandPersistence.add(b);
CommandPersistence.add(c);
CommandPersistence.add(d);