Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PyPCC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
PyPCC
Commits
07c8502a
Commit
07c8502a
authored
1 month ago
by
Corné Lukken
Browse files
Options
Downloads
Plain Diff
Merge branch '
L2SS-2374
' into 'master'
L2SS-2374
: Use more portable multiprocessing queue Closes
L2SS-2374
See merge request
!27
parents
703f235f
19e34ff1
No related branches found
No related tags found
1 merge request
!27
L2SS-2374: Use more portable multiprocessing queue
Pipeline
#125892
passed
1 month ago
Stage: run
Stage: image
Changes
1
Pipelines
13
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pypcc/opcuaserv/i2client.py
+12
-11
12 additions, 11 deletions
pypcc/opcuaserv/i2client.py
with
12 additions
and
11 deletions
pypcc/opcuaserv/i2client.py
+
12
−
11
View file @
07c8502a
#This is the OPC-UA side of the pipes to I2Cserver
#This is the OPC-UA side of the pipes to I2Cserver
from
multiprocessing
import
Queue
from
multiprocessing
import
Queue
,
Manager
from
pypcc.queuetypes
import
*
from
pypcc.queuetypes
import
*
class
i2client
():
class
i2client
():
def
__init__
(
self
,
name
=
'
RCU
'
):
def
__init__
(
self
,
name
=
'
RCU
'
):
self
.
Qin
=
Queue
()
self
.
mp_manager
=
Manager
()
self
.
Qout
=
Queue
()
self
.
Qin
=
self
.
mp_manager
.
Queue
()
self
.
name
=
name
;
self
.
Qout
=
self
.
mp_manager
.
Queue
()
self
.
name
=
name
def
GetInfo
(
self
):
def
GetInfo
(
self
):
return
self
.
Qin
,
self
.
Qout
,
self
.
name
return
self
.
Qin
,
self
.
Qout
,
self
.
name
def
stop
(
self
):
def
stop
(
self
):
self
.
Qout
.
put
(
None
)
;
self
.
Qout
.
put
(
None
)
self
.
Qin
.
put
(
None
)
;
self
.
Qin
.
put
(
None
)
# self.thread1.join();
# self.thread1.join();
# os.close(self.Output)
# os.close(self.Output)
# self.Input.close()
# self.Input.close()
def
restart
(
self
):
def
restart
(
self
):
self
.
stop
()
self
.
stop
()
self
.
Qin
=
Queue
()
self
.
Qin
=
self
.
mp_manager
.
Queue
()
self
.
Qout
=
Queue
()
self
.
Qout
=
self
.
mp_manager
.
Queue
()
def
readvar
(
self
,
id1
,
mask
=
[]):
def
readvar
(
self
,
id1
,
mask
=
[]):
Data
=
OPCUAset
(
id1
,
InstType
.
varRead
,[],
mask
.
copy
())
Data
=
OPCUAset
(
id1
,
InstType
.
varRead
,[],
mask
.
copy
())
self
.
Qout
.
put
(
Data
)
;
self
.
Qout
.
put
(
Data
)
def
setvar
(
self
,
id1
,
data
=
[],
mask
=
[]):
def
setvar
(
self
,
id1
,
data
=
[],
mask
=
[]):
Data
=
OPCUAset
(
id1
,
InstType
.
varSet
,
data
.
copy
(),
mask
.
copy
())
Data
=
OPCUAset
(
id1
,
InstType
.
varSet
,
data
.
copy
(),
mask
.
copy
())
self
.
Qout
.
put
(
Data
)
;
self
.
Qout
.
put
(
Data
)
def
QoutLength
(
self
):
def
QoutLength
(
self
):
return
self
.
Qout
.
qsize
()
return
self
.
Qout
.
qsize
()
...
@@ -40,7 +41,7 @@ class i2client():
...
@@ -40,7 +41,7 @@ class i2client():
self
.
Qout
.
put
(
Data
);
self
.
Qout
.
put
(
Data
);
def
data_waiting
(
self
):
def
data_waiting
(
self
):
return
(
self
.
Qin
.
qsize
()
>
0
)
;
return
(
self
.
Qin
.
qsize
()
>
0
)
def
readdata
(
self
):
def
readdata
(
self
):
message
=
self
.
Qin
.
get
()
message
=
self
.
Qin
.
get
()
...
...
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