Skip to content
GitLab
Explore
Sign in
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
PyPCC
Commits
7880951f
Commit
7880951f
authored
4 years ago
by
Paulus Kruger
Browse files
Options
Downloads
Patches
Plain Diff
32 rcus
parent
8defea92
No related branches found
No related tags found
1 merge request
!8
Pypcc2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
HWconf.py
+1
-1
1 addition, 1 deletion
HWconf.py
RCU.py
+2
-2
2 additions, 2 deletions
RCU.py
Vars.py
+1
-1
1 addition, 1 deletion
Vars.py
pypcc2.py
+3
-3
3 additions, 3 deletions
pypcc2.py
with
7 additions
and
7 deletions
HWconf.py
+
1
−
1
View file @
7880951f
...
@@ -3,7 +3,7 @@ from enum import Enum
...
@@ -3,7 +3,7 @@ from enum import Enum
#Mid plane address
#Mid plane address
MPaddr
=
namedtuple
(
"
MPaddr
"
,
"
nI2C I2C nSwitch Switch
"
);
MPaddr
=
namedtuple
(
"
MPaddr
"
,
"
nI2C I2C nSwitch Switch
"
);
RCU_MPaddr
=
MPaddr
(
1
,[
1
],
4
,[
1
,
2
,
3
,
4
])
RCU_MPaddr
=
MPaddr
(
1
,[
1
],
32
,[
1
,
2
,
3
,
4
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
])
CLK_MPaddr
=
MPaddr
(
1
,[
1
],
1
,[
7
])
CLK_MPaddr
=
MPaddr
(
1
,[
1
],
1
,[
7
])
DevReg
=
namedtuple
(
"
DevReg
"
,
"
Addr Register_R Register_W store
"
);
DevReg
=
namedtuple
(
"
DevReg
"
,
"
Addr Register_R Register_W store
"
);
...
...
This diff is collapsed.
Click to expand it.
RCU.py
+
2
−
2
View file @
7880951f
...
@@ -50,7 +50,7 @@ class RCU1():
...
@@ -50,7 +50,7 @@ class RCU1():
RCU0
=-
1
;
RCU0
=-
1
;
for
RCUi
in
range
(
self
.
N
):
for
RCUi
in
range
(
self
.
N
):
if
(
Mask
[
RCUi
]):
if
(
Mask
[
RCUi
]):
mask
+
=
1
<<
Vars
.
RCU_MPaddr
.
Switch
[
RCUi
]
mask
|
=
1
<<
Vars
.
RCU_MPaddr
.
Switch
[
RCUi
]
if
RCU0
<
0
:
RCU0
=
RCUi
;
if
RCU0
<
0
:
RCU0
=
RCUi
;
if
RCU0
<
0
:
return
;
#Mask all zero
if
RCU0
<
0
:
return
;
#Mask all zero
self
.
SWcallback
(
mask
)
self
.
SWcallback
(
mask
)
...
@@ -113,7 +113,7 @@ class RCU1():
...
@@ -113,7 +113,7 @@ class RCU1():
def
GetVarValueAll
(
self
,
V1
,
value1
):
def
GetVarValueAll
(
self
,
V1
,
value1
):
mask
=
0
;
mask
=
0
;
for
RCUi
in
range
(
self
.
N
):
for
RCUi
in
range
(
self
.
N
):
mask
+
=
1
<<
V1
.
Vars
[
0
].
MPaddr
.
Switch
[
RCUi
]
mask
|
=
1
<<
V1
.
Vars
[
0
].
MPaddr
.
Switch
[
RCUi
]
Step
=
V1
.
nVars
Step
=
V1
.
nVars
if
V1
.
Vars
[
0
].
type
==
Vars
.
DevType
.
I2C
:
if
V1
.
Vars
[
0
].
type
==
Vars
.
DevType
.
I2C
:
for
Vari
in
range
(
Step
):
for
Vari
in
range
(
Step
):
...
...
This diff is collapsed.
Click to expand it.
Vars.py
+
1
−
1
View file @
7880951f
...
@@ -148,7 +148,7 @@ RCU_on=Instrs("RCU_on",12,[
...
@@ -148,7 +148,7 @@ RCU_on=Instrs("RCU_on",12,[
RCU_off
=
Instrs
(
"
RCU_off
"
,
1
,[
RCU_off
=
Instrs
(
"
RCU_off
"
,
1
,[
# Instr(DevType.Var,RCU_mask,4,[1,1,1,1]),
# Instr(DevType.Var,RCU_mask,4,[1,1,1,1]),
Instr
(
DevType
.
Var
,
RCU_pwrd
,
4
,[
0
,
0
,
0
,
0
]),
Instr
(
DevType
.
Var
,
RCU_pwrd
,
32
,[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
]),
# Instr(DevType.Var,RCU_mask,4,[0,0,0,0])
# Instr(DevType.Var,RCU_mask,4,[0,0,0,0])
])
])
...
...
This diff is collapsed.
Click to expand it.
pypcc2.py
+
3
−
3
View file @
7880951f
...
@@ -42,7 +42,7 @@ logging.info("OPC-UA Server started")
...
@@ -42,7 +42,7 @@ logging.info("OPC-UA Server started")
SW1
=
I2Cswitch1
.
I2Cswitch1
(
I2C
.
I2C1server
)
SW1
=
I2Cswitch1
.
I2Cswitch1
(
I2C
.
I2C1server
)
RCU
=
RCU
.
RCU1
(
4
,
I2C
.
I2C1server
,
SW1
.
SetChannel
)
RCU
=
RCU
.
RCU1
(
32
,
I2C
.
I2C1server
,
SW1
.
SetChannel
)
#Vars.RCU_mask.OPCW.get_data_value().Value.Value=[1,1,0,0]
#Vars.RCU_mask.OPCW.get_data_value().Value.Value=[1,1,0,0]
#Vars.Ant_mask.OPCW.get_data_value().Value.Value=[1,1,0,0,0,0,0,0,0,0,1,0]
#Vars.Ant_mask.OPCW.get_data_value().Value.Value=[1,1,0,0,0,0,0,0,0,0,1,0]
...
@@ -93,9 +93,9 @@ def TimerThread(Q1,RCU):
...
@@ -93,9 +93,9 @@ def TimerThread(Q1,RCU):
if
Q1
.
qsize
()
>
3
:
continue
;
if
Q1
.
qsize
()
>
3
:
continue
;
cnt
=
0
;
cnt
=
0
;
logging
.
debug
(
str
((
"
I2C bytes=
"
,
I2C
.
I2Ccounter
,
"
Qlength=
"
,
Q1
.
qsize
())))
logging
.
debug
(
str
((
"
I2C bytes=
"
,
I2C
.
I2Ccounter
,
"
Qlength=
"
,
Q1
.
qsize
())))
Inst1
=
Vars
.
Instr
(
Vars
.
DevType
.
VarUpdate
,
Vars
.
RCU_temp
,
4
,[
0
]
*
4
)
Inst1
=
Vars
.
Instr
(
Vars
.
DevType
.
VarUpdate
,
Vars
.
RCU_temp
,
32
,[
0
]
*
32
)
Q1
.
put
(
Inst1
)
Q1
.
put
(
Inst1
)
Inst1
=
Vars
.
Instr
(
Vars
.
DevType
.
VarUpdate
,
Vars
.
RCU_ADC_lock
,
12
,[
0
]
*
12
)
Inst1
=
Vars
.
Instr
(
Vars
.
DevType
.
VarUpdate
,
Vars
.
RCU_ADC_lock
,
96
,[
0
]
*
96
)
Q1
.
put
(
Inst1
)
Q1
.
put
(
Inst1
)
logging
.
info
(
"
End Timer thread
"
)
logging
.
info
(
"
End Timer thread
"
)
...
...
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