Skip to content
Snippets Groups Projects

Partly resolves "Implement state copy in AST"

Merged Manuel Krombholz requested to merge 30-implement-state-copy-in-ast into dev
All threads resolved!
Files
3
@@ -137,6 +137,9 @@ aspect ItemHandling {
//--- setStateFromBoolean ---
public abstract void Item.setStateFromBoolean(boolean value);
public void ColorItem.setStateFromBoolean(boolean value) {
if (getState()!=null && getState().getBrightness()!=0 && value) {
return;
}
setBrightness(value ? 100 : 0);
}
public void DateTimeItem.setStateFromBoolean(boolean value) {
@@ -389,6 +392,12 @@ aspect ItemHandling {
getRoot().addRule(createControllerRule(controllerItem,this));
}
public void Item.synchronizeWith(Item item) {
addControlledBy(item);
addControlling(item);
}
private Rule Item.createControllerRule(Item controllerItem, Item controlledItem) {
Rule rule = new Rule();
Loading