Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
eraser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenLicht
eraser
Commits
12e187c8
Commit
12e187c8
authored
4 years ago
by
Manuel Krombholz
Browse files
Options
Downloads
Patches
Plain Diff
Added synchronizeWith
parent
3b52bd53
No related branches found
No related tags found
2 merge requests
!19
dev to master
,
!8
Partly resolves "Implement state copy in AST"
Pipeline
#8771
failed
4 years ago
Stage: build
Stage: test
Stage: report
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
eraser-base/src/main/jastadd/Item.jrag
+9
-1
9 additions, 1 deletion
eraser-base/src/main/jastadd/Item.jrag
feedbackloop.execute/src/test/java/de/tudresden/inf/st/eraser/feedbackloop/execute/ExecuteImplTest.java
+6
-6
6 additions, 6 deletions
...n/inf/st/eraser/feedbackloop/execute/ExecuteImplTest.java
with
15 additions
and
7 deletions
eraser-base/src/main/jastadd/Item.jrag
+
9
−
1
View file @
12e187c8
...
...
@@ -137,8 +137,10 @@ aspect ItemHandling {
//--- setStateFromBoolean ---
public abstract void Item.setStateFromBoolean(boolean value);
public void ColorItem.setStateFromBoolean(boolean value) {
if (getState().getBrightness()==0) {
setBrightness(value ? 100 : 0);
}
}
public void DateTimeItem.setStateFromBoolean(boolean value) {
// there is no good way here
logger.warn("Ignoring boolean update using {} for {}", value, this);
...
...
@@ -389,6 +391,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();
...
...
This diff is collapsed.
Click to expand it.
feedbackloop.execute/src/test/java/de/tudresden/inf/st/eraser/feedbackloop/execute/ExecuteImplTest.java
+
6
−
6
View file @
12e187c8
...
...
@@ -31,7 +31,7 @@ public class ExecuteImplTest {
lamp
.
enableSendState
();
TestUtils
.
getDefaultGroup
(
model
).
addItem
(
lamp
);
numberItem
.
addControlling
(
lamp
);
numberItem
.
synchronizeWith
(
lamp
);
Execute
execute
=
new
ExecuteImpl
();
execute
.
setKnowledgeBase
(
model
.
getRoot
());
...
...
@@ -62,7 +62,7 @@ public class ExecuteImplTest {
lamp
.
enableSendState
();
TestUtils
.
getDefaultGroup
(
model
).
addItem
(
lamp
);
button
.
addControlling
(
lamp
);
button
.
synchronizeWith
(
lamp
);
Execute
execute
=
new
ExecuteImpl
();
execute
.
setKnowledgeBase
(
model
.
getRoot
());
...
...
@@ -103,10 +103,10 @@ public class ExecuteImplTest {
lamp
.
enableSendState
();
TestUtils
.
getDefaultGroup
(
model
).
addItem
(
lamp
);
lamp
.
addControlledBy
(
numberItem
);
lamp
.
addControlledBy
(
stringItem
);
lamp
.
addControlledBy
(
booleanItem
);
lamp
.
addControlledBy
(
colorItem
);
lamp
.
synchronizeWith
(
numberItem
);
lamp
.
synchronizeWith
(
stringItem
);
lamp
.
synchronizeWith
(
booleanItem
);
lamp
.
synchronizeWith
(
colorItem
);
Execute
execute
=
new
ExecuteImpl
();
execute
.
setKnowledgeBase
(
model
.
getRoot
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment