Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
osie
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
osie
Commits
2916ee5a
Commit
2916ee5a
authored
Jul 28, 2023
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP.
parent
041b0055
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
bt5/erp5_opcua/SkinTemplateItem/portal_skins/erp5_opcua/ERP5Site_handleOPCUARequest.py
...em/portal_skins/erp5_opcua/ERP5Site_handleOPCUARequest.py
+11
-1
bt5/erp5_opcua/SkinTemplateItem/portal_skins/erp5_opcua/ERP5Site_handleOPCUARequest.xml
...m/portal_skins/erp5_opcua/ERP5Site_handleOPCUARequest.xml
+8
-0
No files found.
bt5/erp5_opcua/SkinTemplateItem/portal_skins/erp5_opcua/ERP5Site_handleOPCUARequest.py
View file @
2916ee5a
...
@@ -4,6 +4,15 @@ Simple script for OPCUA POC
...
@@ -4,6 +4,15 @@ Simple script for OPCUA POC
import
json
import
json
from
erp5.component.module.Log
import
log
from
erp5.component.module.Log
import
log
def
getPropertyId
(
node_id
):
# XXX: based on node_id guess property type, too! -i -> integer , s- string, etc,,
return
node_id
.
replace
(
";"
,
""
)
# XXX: get rid of Proxy roles on this script when proper authentication is used!!!
# XXX: what should be the OPCUA container?
default_opcua_document
=
context
.
opcua_document_module
[
"1"
]
try
:
try
:
data
=
context
.
REQUEST
.
data
data
=
context
.
REQUEST
.
data
except
AttributeError
:
except
AttributeError
:
...
@@ -14,5 +23,6 @@ else:
...
@@ -14,5 +23,6 @@ else:
# log only set requests for now
# log only set requests for now
node_id
=
data
[
'node'
]
node_id
=
data
[
'node'
]
node_value
=
data
[
'val'
]
node_value
=
data
[
'val'
]
log
(
"Set '%s' = '%s'"
%
(
node_id
,
node_value
))
log
(
"Set '%s' = '%s' to %s as %s"
%
(
node_id
,
node_value
,
default_opcua_document
,
getPropertyId
(
node_id
)))
log
(
data
)
# XXX: set to "ERP5 OPCUA Document" property
# XXX: set to "ERP5 OPCUA Document" property
bt5/erp5_opcua/SkinTemplateItem/portal_skins/erp5_opcua/ERP5Site_handleOPCUARequest.xml
View file @
2916ee5a
...
@@ -52,6 +52,14 @@
...
@@ -52,6 +52,14 @@
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
*args, **kwargs
</string>
</value>
<value>
<string>
*args, **kwargs
</string>
</value>
</item>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5Site_handleOPCUARequest
</string>
</value>
<value>
<string>
ERP5Site_handleOPCUARequest
</string>
</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