Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fml40-reference-implementation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KWH40
fml40-reference-implementation
Commits
a8e5c86f
Commit
a8e5c86f
authored
4 years ago
by
GromeTT
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Added missing code snippet
parent
316b2fbf
No related branches found
No related tags found
3 merge requests
!8
Feature documentation
,
!6
Feature documentation alb
,
!5
Feature documentation alb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ml/thing.py
+15
-4
15 additions, 4 deletions
ml/thing.py
with
15 additions
and
4 deletions
ml/thing.py
+
15
−
4
View file @
a8e5c86f
...
...
@@ -650,6 +650,14 @@ def on_service_request(self, body_json):
"
Functionality %s is not one of the built-in functionalities in %s!
"
%
(
service_functionality
,
self
.
name
)
)
service_reply
.
fillServiceReply
(
senderUUID
=
self
.
thing_id
,
receiverUUID
=
body_json
.
get
(
"
sender
"
,
None
),
serviceType
=
body_json
.
get
(
"
serviceType
"
,
None
),
results
=
{
"
error
"
:
"
invalid functionalities (serviceType) {}
"
.
format
(
service_functionality
)},
replyingToUUID
=
body_json
.
get
(
"
identifier
"
,
None
),
msgUUID
=
"
s3i:{}
"
.
format
(
uuid
.
uuid4
())
)
else
:
# TODO: Call right functionality.
try
:
...
...
@@ -789,21 +797,24 @@ def to_dir_json(self):
if
self
.
features
.
get
(
"
ml40::Location
"
)
is
not
None
:
self
.
dir_json
[
"
attributes
"
][
"
location
"
]
=
{
"
longitude
"
:
self
.
features
.
get
(
"
ml40::Location
"
).
to_json
()[
"
longitude
"
],
"
latitude
"
:
self
.
features
.
get
(
"
ml40::Location
"
).
to_json
()[
"
latitude
"
]
,
"
latitude
"
:
self
.
features
.
get
(
"
ml40::Location
"
).
to_json
()[
"
latitude
"
]
}
self
.
dir_json
[
"
attributes
"
][
"
dataModel
"
]
=
"
fml40
"
self
.
dir_json
[
"
attributes
"
][
"
thingStructure
"
]
=
{
"
class
"
:
"
ml40::Thing
"
,
"
links
"
:
[]
,
"
links
"
:
[]
}
for
key
in
self
.
roles
.
keys
():
role_entry
=
{
"
association
"
:
"
roles
"
,
"
target
"
:
self
.
roles
[
key
].
to_json
()}
role_entry
=
{
"
association
"
:
"
roles
"
,
"
target
"
:
self
.
roles
[
key
].
to_json
()
}
self
.
dir_json
[
"
attributes
"
][
"
thingStructure
"
][
"
links
"
].
append
(
role_entry
)
for
key
in
self
.
features
.
keys
():
feature_target
=
{
"
class
"
:
self
.
features
[
key
].
to_json
()[
"
class
"
],
"
identifier
"
:
self
.
features
[
key
].
to_json
()[
"
identifier
"
]
,
"
identifier
"
:
self
.
features
[
key
].
to_json
()[
"
identifier
"
]
}
feature_entry
=
{
"
association
"
:
"
features
"
,
"
target
"
:
feature_target
}
# if the feature has targets, like ml40::Composite
...
...
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