Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TULIP-CPS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NUI
TULIP-CPS
Commits
a91b8acb
Commit
a91b8acb
authored
Jul 18, 2017
by
Nico Mack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added ExecutorScope Annotation
parent
6a5a0730
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
3 deletions
+83
-3
CPS/src/lu/list/itis/dkd/tui/bootstrapping/VariableBootstrapper.java
...list/itis/dkd/tui/bootstrapping/VariableBootstrapper.java
+7
-0
CPS/src/lu/list/itis/dkd/tui/cps/system/executor/JavascriptExecutor.java
.../itis/dkd/tui/cps/system/executor/JavascriptExecutor.java
+3
-0
CPS/src/lu/list/itis/dkd/tui/cps/utility/ExecutorScope.java
CPS/src/lu/list/itis/dkd/tui/cps/utility/ExecutorScope.java
+31
-0
CPS/src/lu/list/itis/dkd/tui/cps/variable/SpatialVariable.java
...rc/lu/list/itis/dkd/tui/cps/variable/SpatialVariable.java
+39
-0
CPS/src/lu/list/itis/dkd/tui/widget/ValueWidget.java
CPS/src/lu/list/itis/dkd/tui/widget/ValueWidget.java
+3
-3
No files found.
CPS/src/lu/list/itis/dkd/tui/bootstrapping/VariableBootstrapper.java
View file @
a91b8acb
...
...
@@ -15,6 +15,7 @@ package lu.list.itis.dkd.tui.bootstrapping;
import
lu.list.itis.dkd.tui.cps.utility.Externalization
;
import
lu.list.itis.dkd.tui.cps.variable.BooleanVariable
;
import
lu.list.itis.dkd.tui.cps.variable.TextVariable
;
import
lu.list.itis.dkd.tui.cps.variable.Variable
;
import
lu.list.itis.dkd.tui.cps.variable.tangible.TangibleNumericalVariable
;
import
lu.list.itis.dkd.tui.exception.BuildException
;
...
...
@@ -55,6 +56,12 @@ public class VariableBootstrapper {
variable
=
booleanVariable
;
break
;
case
Externalization
.
TEXT_TYPE
:
String
textValue
=
BootstrappingUtils
.
getContentAsString
(
variableNode
,
Externalization
.
INITIAL_ATTRIBUTE
,
BootstrappingUtils
.
OPTIONAL
,
Externalization
.
EMPTY_STRING
,
context
);
TextVariable
textVariable
=
new
TextVariable
(
name
,
textValue
);
variable
=
textVariable
;
break
;
default
:
throw
new
BuildException
(
"Don't know how to build a Variable of type "
+
type
);
//$NON-NLS-1$
}
...
...
CPS/src/lu/list/itis/dkd/tui/cps/system/executor/JavascriptExecutor.java
View file @
a91b8acb
...
...
@@ -31,6 +31,9 @@ public class JavascriptExecutor extends Executor {
@Override
public
void
set
(
Variable
<?>
variable
)
{
// TODO Rely on ExecutorScope annotations to generalize setting of multi-value variables
engine
.
put
(
variable
.
getName
(),
variable
.
getValue
());
if
(
LOGGER
.
isInfoEnabled
())
{
LOGGER
.
info
(
"Parameter {} = {}"
,
variable
.
getName
(),
variable
.
getValue
());
//$NON-NLS-1$
...
...
CPS/src/lu/list/itis/dkd/tui/cps/utility/ExecutorScope.java
0 → 100644
View file @
a91b8acb
/**
* Copyright Luxembourg Institute of Science and Technology, 2017. All rights reserved. If you wish
* to use this code for any purpose, please contact the author(s).
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package
lu.list.itis.dkd.tui.cps.utility
;
import
static
java
.
lang
.
annotation
.
ElementType
.
METHOD
;
import
static
java
.
lang
.
annotation
.
RetentionPolicy
.
RUNTIME
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.Target
;
@Retention
(
RUNTIME
)
@Target
(
METHOD
)
/**
* @author mack
* @since [major].[minor]
* @version [major].[minor].[micro]
*/
public
@interface
ExecutorScope
{
String
identifier
()
default
""
;
}
CPS/src/lu/list/itis/dkd/tui/cps/variable/SpatialVariable.java
View file @
a91b8acb
...
...
@@ -14,6 +14,7 @@
package
lu.list.itis.dkd.tui.cps.variable
;
import
lu.list.itis.dkd.dbc.annotation.Nullable
;
import
lu.list.itis.dkd.tui.cps.utility.ExecutorScope
;
import
lu.list.itis.dkd.tui.cps.utility.Externalization
;
import
lu.list.itis.dkd.tui.utility.Point
;
...
...
@@ -133,5 +134,43 @@ public class SpatialVariable extends Variable<Point> {
return
converted
;
}
@ExecutorScope
(
identifier
=
"x"
)
public
double
getX
()
{
return
(
this
.
value
!=
null
)
?
this
.
value
.
getX
()
:
0
;
}
@ExecutorScope
(
identifier
=
"x"
)
public
void
setX
(
double
value
)
{
if
(
this
.
value
==
null
)
{
this
.
value
=
new
Point
();
}
this
.
value
.
x
=
(
float
)
value
;
}
@ExecutorScope
(
identifier
=
"y"
)
public
double
getY
()
{
return
(
this
.
value
!=
null
)
?
this
.
value
.
getY
()
:
0
;
}
@ExecutorScope
(
identifier
=
"y"
)
public
void
setY
(
double
value
)
{
if
(
this
.
value
==
null
)
{
this
.
value
=
new
Point
();
}
this
.
value
.
y
=
(
float
)
value
;
}
@ExecutorScope
(
identifier
=
"a"
)
public
double
getA
()
{
return
(
this
.
value
!=
null
)
?
this
.
value
.
getAngle
()
:
0
;
}
@ExecutorScope
(
identifier
=
"a"
)
public
void
setAngle
(
double
value
)
{
if
(
this
.
value
==
null
)
{
this
.
value
=
new
Point
();
}
this
.
value
.
setAngle
((
float
)
value
);
}
}
CPS/src/lu/list/itis/dkd/tui/widget/ValueWidget.java
View file @
a91b8acb
...
...
@@ -32,7 +32,7 @@ import lu.list.itis.dkd.tui.utility.Point;
import
lu.list.itis.dkd.tui.widget.builder.BaseValueWidgetBuilder
;
import
lu.list.itis.dkd.tui.widget.corona.ConditionalCorona
;
import
lu.list.itis.dkd.tui.widget.corona.Corona
;
import
lu.list.itis.dkd.tui.widget.tether.
Data
Feed
;
import
lu.list.itis.dkd.tui.widget.tether.
Information
Feed
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -125,8 +125,8 @@ public class ValueWidget extends TetherableWidget implements InformationProvider
@SuppressWarnings
(
"unchecked"
)
protected
void
updateTethers
(
Double
value
)
{
@SuppressWarnings
(
"rawtypes"
)
List
<
DataFeed
>
dataFeeds
=
this
.
getTethers
(
Data
Feed
.
class
);
for
(
Data
Feed
<
Double
>
tether
:
dataFeeds
)
{
List
<
InformationFeed
>
dataFeeds
=
this
.
getTethers
(
Information
Feed
.
class
);
for
(
Information
Feed
<
Double
>
tether
:
dataFeeds
)
{
tether
.
setInformation
(
value
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment