Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
anselm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
vaclab
anselm
Commits
05595ccb
Commit
05595ccb
authored
Sep 27, 2018
by
wactbprot
Browse files
Options
Downloads
Patches
Plain Diff
+ test hardware
parent
dd952a1d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.rst
+2
-3
2 additions, 3 deletions
README.rst
anselm.py
+10
-4
10 additions, 4 deletions
anselm.py
anselm/config.json
+2
-1
2 additions, 1 deletion
anselm/config.json
se3_system_check.py
+139
-2
139 additions, 2 deletions
se3_system_check.py
with
153 additions
and
10 deletions
README.rst
+
2
−
3
View file @
05595ccb
...
...
@@ -37,8 +37,7 @@ install
> cd /path/to/anselm
> source bin/activate
> pip install -e .
>
> ./anselm.sh & ./srv.sh
check systems
=============
...
...
@@ -74,8 +73,8 @@ run
> python3 -m venv /path/to/anselm
> cd /path/to/anselm
> source bin/activate
> pip install -e .
>
> ./se3_system_check.sh
> ./anselm.sh & ./srv.sh
curl
...
...
This diff is collapsed.
Click to expand it.
anselm.py
+
10
−
4
View file @
05595ccb
...
...
@@ -38,6 +38,11 @@ class Anselm(System):
env_col
=
3
add_device_btn_col
=
4
std_line
=
1
year_line
=
1
env_line
=
1
add_device_btn_line
=
1
cal_id_col
=
2
fullscale_col
=
3
dut_branch_col
=
4
...
...
@@ -88,7 +93,7 @@ class Anselm(System):
self
.
win
.
closeEvent
=
self
.
closeEvent
self
.
grid
=
QGridLayout
(
self
.
win
)
self
.
add_widget_to_grid
(
self
.
make_std_combo
(),
self
.
current_gri
d_line
,
self
.
std_col
)
self
.
add_widget_to_grid
(
self
.
make_std_combo
(),
self
.
st
d_line
,
self
.
std_col
)
self
.
draw_grid
()
def
make_label_edit_pair
(
self
,
label_val
,
edit_val
,
line
):
...
...
@@ -383,13 +388,14 @@ class Anselm(System):
def
std_selected
(
self
,
combo
):
standard
=
combo
.
currentText
()
self
.
aset
(
'
standard
'
,
0
,
standard
)
self
.
add_widget_to_grid
(
self
.
make_year_combo
()
,
self
.
current_grid
_line
,
self
.
year_col
)
self
.
add_widget_to_grid
(
self
.
make_year_combo
()
,
self
.
year
_line
,
self
.
year_col
)
self
.
log
.
info
(
"
select standard {}
"
.
format
(
standard
))
def
env_selected
(
self
,
combo
):
env
=
combo
.
currentText
()
self
.
aset
(
'
enviroment
'
,
0
,
env
)
self
.
add_widget_to_grid
(
self
.
make_add_device_button
(),
self
.
current_grid_line
,
self
.
add_device_btn_col
)
self
.
add_widget_to_grid
(
self
.
make_add_device_button
(),
self
.
add_device_btn_line
,
self
.
add_device_btn_col
)
if
env
==
"
production
"
:
self
.
aset
(
'
save
'
,
0
,
"
yes
"
)
# ... chatbot to all on
...
...
@@ -401,7 +407,7 @@ class Anselm(System):
def
year_selected
(
self
,
combo
):
year
=
combo
.
currentText
()
self
.
aset
(
'
year
'
,
0
,
year
)
self
.
add_widget_to_grid
(
self
.
make_env_combo
(),
self
.
current_grid
_line
,
self
.
env_col
)
self
.
add_widget_to_grid
(
self
.
make_env_combo
(),
self
.
env
_line
,
self
.
env_col
)
self
.
log
.
info
(
"
select year {}
"
.
format
(
year
))
def
default_change
(
self
,
edit_widget
,
label_val
,
line
):
...
...
This diff is collapsed.
Click to expand it.
anselm/config.json
+
2
−
1
View file @
05595ccb
...
...
@@ -21,7 +21,8 @@
"host"
:
"localhost"
,
"port"
:
8001
,
"mpd_valves_id"
:
"mpd-se3-valves"
,
"mpd_servo_id"
:
"mpd-se3-servo"
"mpd_servo_id"
:
"mpd-se3-servo"
,
"mpd_state_id"
:
"mpd-se3-state"
},
"loglevel"
:
"DEBUG"
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
se3_system_check.py
+
139
−
2
View file @
05595ccb
...
...
@@ -3,6 +3,7 @@ import logging
import
requests
import
json
import
redis
import
sys
def
main
():
with
open
(
'
anselm/config.json
'
)
as
json_config_file
:
...
...
@@ -16,31 +17,138 @@ def main():
r
=
config
.
get
(
"
redis
"
)
rs
=
redis
.
StrictRedis
(
host
=
r
.
get
(
"
host
"
),
port
=
r
.
get
(
"
port
"
),
db
=
r
.
get
(
"
DB
"
),
decode_responses
=
True
)
# check redis
log
.
info
(
"
{:*<50}
"
.
format
(
"
check redis connection
"
))
res
=
rs
.
client_list
()
if
res
:
log
.
info
(
"
{:>50}
"
.
format
(
"
redis [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
redis [fail]
"
))
sys
.
exit
(
"
start redis
"
)
# check relay server
log
.
info
(
"
{:*<50}
"
.
format
(
"
check relayServer
"
))
data
=
{
'
Action
'
:
'
_version
'
}
req
=
requests
.
post
(
"
http://{}:{}
/_version
"
.
format
(
relay
.
get
(
"
host
"
),
relay
.
get
(
"
port
"
)),
data
=
json
.
dumps
(
data
))
req
=
requests
.
post
(
"
http://{}:{}
"
.
format
(
relay
.
get
(
"
host
"
),
relay
.
get
(
"
port
"
)),
data
=
json
.
dumps
(
data
))
res
=
req
.
json
()
if
'
Result
'
in
res
:
log
.
info
(
"
{:>50}
"
.
format
(
"
relayServer [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
relayServer [fail]
"
))
sys
.
exit
(
"
start relay server
"
)
# check p_fill modbus/CDGs
log
.
info
(
"
{:*<50}
"
.
format
(
"
check filling pressure CDGs
"
))
data
=
{
'
Action
'
:
'
MODBUS
'
,
"
Host
"
:
"
e75451
"
,
"
Address
"
:
0
,
"
Quantity
"
:
48
,
"
FunctionCode
"
:
"
ReadInputRegisters
"
,
"
OutMode
"
:
"
Buffer
"
,}
req
=
requests
.
post
(
"
http://{}:{}
"
.
format
(
relay
.
get
(
"
host
"
),
relay
.
get
(
"
port
"
)),
data
=
json
.
dumps
(
data
))
res
=
req
.
json
()
if
"
Result
"
in
res
and
"
data
"
in
res
[
'
Result
'
]
and
len
(
res
[
'
Result
'
][
'
data
'
])
==
96
:
log
.
info
(
"
{:>50}
"
.
format
(
"
filling pressure CDGs [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
filling pressure CDGs [fail]
"
))
sys
.
exit
(
"
Modbus e75451
"
)
# check add-vol-cdg/check standard modbus/CDGs
log
.
info
(
"
{:*<50}
"
.
format
(
"
check ad. vol. CDG
"
))
data
=
{
'
Action
'
:
'
MODBUS
'
,
"
Host
"
:
"
e75480
"
,
"
Address
"
:
0
,
"
Quantity
"
:
8
,
"
FunctionCode
"
:
"
ReadInputRegisters
"
,
"
OutMode
"
:
"
Buffer
"
,}
req
=
requests
.
post
(
"
http://{}:{}
"
.
format
(
relay
.
get
(
"
host
"
),
relay
.
get
(
"
port
"
)),
data
=
json
.
dumps
(
data
))
res
=
req
.
json
()
if
"
Result
"
in
res
and
"
data
"
in
res
[
'
Result
'
]
and
len
(
res
[
'
Result
'
][
'
data
'
])
==
16
:
log
.
info
(
"
{:>50}
"
.
format
(
"
ad. vol. CDG [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
ad. vol. CDG [fail]
"
))
sys
.
exit
(
"
Modbus e75451
"
)
# temperature keithley
log
.
info
(
"
{:*<50}
"
.
format
(
"
temperature keithley
"
))
data
=
{
'
Action
'
:
'
VXI11
'
,
"
Host
"
:
"
e75440
"
,
"
Device
"
:
"
inst0
"
,
"
Value
"
:
"
return_50()
\n
"
}
req
=
requests
.
post
(
"
http://{}:{}
"
.
format
(
relay
.
get
(
"
host
"
),
relay
.
get
(
"
port
"
)),
data
=
json
.
dumps
(
data
))
res
=
req
.
json
()
if
"
Result
"
in
res
and
len
(
res
[
'
Result
'
])
==
51
:
log
.
info
(
"
{:>50}
"
.
format
(
"
temperature keithley [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
temperature keithley [fail]
"
))
sys
.
exit
(
"
configure servos, use mpd-se3-servo
"
)
# check servos
# node 1
log
.
info
(
"
{:*<50}
"
.
format
(
"
check servo node 1 (cont. current)
"
))
data
=
{
'
Action
'
:
'
TCP
'
,
"
Host
"
:
"
e75443
"
,
"
Port
"
:
"
5301
"
,
"
Value
"
:
"
1GCC
\r
"
}
req
=
requests
.
post
(
"
http://{}:{}
"
.
format
(
relay
.
get
(
"
host
"
),
relay
.
get
(
"
port
"
)),
data
=
json
.
dumps
(
data
))
res
=
req
.
json
()
if
"
Result
"
in
res
and
float
(
res
[
'
Result
'
])
==
600
:
log
.
info
(
"
{:>50}
"
.
format
(
"
node 1 [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
node 1 [fail]
"
))
sys
.
exit
(
"
configure servos, use mpd-se3-servo
"
)
# node 2
log
.
info
(
"
{:*<50}
"
.
format
(
"
check servo node 2 (cont. current)
"
))
data
=
{
'
Action
'
:
'
TCP
'
,
"
Host
"
:
"
e75443
"
,
"
Port
"
:
"
5300
"
,
"
Value
"
:
"
2GCC
\r
"
}
req
=
requests
.
post
(
"
http://{}:{}
"
.
format
(
relay
.
get
(
"
host
"
),
relay
.
get
(
"
port
"
)),
data
=
json
.
dumps
(
data
))
res
=
req
.
json
()
if
"
Result
"
in
res
and
float
(
res
[
'
Result
'
])
==
600
:
log
.
info
(
"
{:>50}
"
.
format
(
"
node 2 [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
node 2 [fail]
"
))
sys
.
exit
(
"
configure servos, use mpd-se3-servo
"
)
# node 3
log
.
info
(
"
{:*<50}
"
.
format
(
"
check servo node 3 (cont. current)
"
))
data
=
{
'
Action
'
:
'
TCP
'
,
"
Host
"
:
"
e75443
"
,
"
Port
"
:
"
5301
"
,
"
Value
"
:
"
3GCC
\r
"
}
req
=
requests
.
post
(
"
http://{}:{}
"
.
format
(
relay
.
get
(
"
host
"
),
relay
.
get
(
"
port
"
)),
data
=
json
.
dumps
(
data
))
res
=
req
.
json
()
if
"
Result
"
in
res
and
float
(
res
[
'
Result
'
])
==
600
:
log
.
info
(
"
{:>50}
"
.
format
(
"
node 3 [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
node 3 [fail]
"
))
sys
.
exit
(
"
configure servos, use mpd-se3-servo
"
)
# node 4
log
.
info
(
"
{:*<50}
"
.
format
(
"
check servo node 4 (cont. current)
"
))
data
=
{
'
Action
'
:
'
TCP
'
,
"
Host
"
:
"
e75443
"
,
"
Port
"
:
"
5300
"
,
"
Value
"
:
"
4GCC
\r
"
}
req
=
requests
.
post
(
"
http://{}:{}
"
.
format
(
relay
.
get
(
"
host
"
),
relay
.
get
(
"
port
"
)),
data
=
json
.
dumps
(
data
))
res
=
req
.
json
()
if
"
Result
"
in
res
and
float
(
res
[
'
Result
'
])
==
600
:
log
.
info
(
"
{:>50}
"
.
format
(
"
node 4 [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
node 4 [fail]
"
))
sys
.
exit
(
"
configure servos, use mpd-se3-servo
"
)
# node 5
log
.
info
(
"
{:*<50}
"
.
format
(
"
check servo node 5 (cont. current)
"
))
data
=
{
'
Action
'
:
'
TCP
'
,
"
Host
"
:
"
e75443
"
,
"
Port
"
:
"
5301
"
,
"
Value
"
:
"
5GCC
\r
"
}
req
=
requests
.
post
(
"
http://{}:{}
"
.
format
(
relay
.
get
(
"
host
"
),
relay
.
get
(
"
port
"
)),
data
=
json
.
dumps
(
data
))
res
=
req
.
json
()
if
"
Result
"
in
res
and
float
(
res
[
'
Result
'
])
==
600
:
log
.
info
(
"
{:>50}
"
.
format
(
"
node 5 [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
node 5 [fail]
"
))
sys
.
exit
(
"
configure servos, use mpd-se3-servo
"
)
# node 6
log
.
info
(
"
{:*<50}
"
.
format
(
"
check servo node 6 (cont. current)
"
))
data
=
{
'
Action
'
:
'
TCP
'
,
"
Host
"
:
"
e75443
"
,
"
Port
"
:
"
5300
"
,
"
Value
"
:
"
6GCC
\r
"
}
req
=
requests
.
post
(
"
http://{}:{}
"
.
format
(
relay
.
get
(
"
host
"
),
relay
.
get
(
"
port
"
)),
data
=
json
.
dumps
(
data
))
res
=
req
.
json
()
if
"
Result
"
in
res
and
float
(
res
[
'
Result
'
])
==
600
:
log
.
info
(
"
{:>50}
"
.
format
(
"
node 6 [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
node 6 [fail]
"
))
sys
.
exit
(
"
configure servos, use mpd-se3-servo
"
)
# check vl_db_work
log
.
info
(
"
{:*<50}
"
.
format
(
"
check database
"
))
req
=
requests
.
get
(
"
http://{}:{}/{}
"
.
format
(
db
.
get
(
"
host
"
),
db
.
get
(
"
port
"
),
db
.
get
(
"
database
"
)))
res
=
req
.
json
()
if
'
db_name
'
in
res
:
log
.
info
(
"
{:>50}
"
.
format
(
"
database [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
database [fail]
"
))
sys
.
exit
(
"
start couchdb, ensure vl_db_work exists
"
)
# valves mpd
log
.
info
(
"
{:*<50}
"
.
format
(
"
check valves mpd
"
))
req
=
requests
.
get
(
"
http://{}:{}/{}/meta
"
.
format
(
ssmp
.
get
(
"
host
"
),
ssmp
.
get
(
"
port
"
),
ssmp
.
get
(
"
mpd_valves_id
"
)))
res
=
req
.
json
()
...
...
@@ -48,7 +156,9 @@ def main():
log
.
info
(
"
{:>50}
"
.
format
(
"
valves mp [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
valves mp [fail]
"
))
sys
.
exit
(
"
load mpd-se3-valves
"
)
# servo mpd
log
.
info
(
"
{:*<50}
"
.
format
(
"
check servo mpd
"
))
req
=
requests
.
get
(
"
http://{}:{}/{}/meta
"
.
format
(
ssmp
.
get
(
"
host
"
),
ssmp
.
get
(
"
port
"
),
ssmp
.
get
(
"
mpd_servo_id
"
)))
res
=
req
.
json
()
...
...
@@ -56,8 +166,35 @@ def main():
log
.
info
(
"
{:>50}
"
.
format
(
"
servo mp [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
servo mp [fail]
"
))
sys
.
exit
(
"
load mpd-se3-servo
"
)
# state mpd
log
.
info
(
"
{:*<50}
"
.
format
(
"
check state mpd
"
))
req
=
requests
.
get
(
"
http://{}:{}/{}/meta
"
.
format
(
ssmp
.
get
(
"
host
"
),
ssmp
.
get
(
"
port
"
),
ssmp
.
get
(
"
mpd_state_id
"
)))
res
=
req
.
json
()
if
'
id
'
in
res
:
log
.
info
(
"
{:>50}
"
.
format
(
"
state mp [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
state mp [fail]
"
))
sys
.
exit
(
"
load mpd-se3-state
"
)
# branches closed
log
.
info
(
"
{:*<50}
"
.
format
(
"
check all dut branch flanged blind
"
))
ok
=
input
(
"
all dut flanges closed? [y|n]:
"
)
if
ok
==
"
y
"
:
log
.
info
(
"
{:>50}
"
.
format
(
"
duts [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
duts [fail]
"
))
sys
.
exit
(
"
close dut branches
"
)
# gas supply
log
.
info
(
"
{:*<50}
"
.
format
(
"
check gas supply
"
))
ok
=
input
(
"
gas bottel open, pressure ok? [y|n]:
"
)
if
ok
==
"
y
"
:
log
.
info
(
"
{:>50}
"
.
format
(
"
gas supply [ok]
"
))
else
:
log
.
error
(
"
{:>50}
"
.
format
(
"
gas supply [fail]
"
))
sys
.
exit
(
"
ensure gas supply
"
)
if
__name__
==
'
__main__
'
:
main
()
\ No newline at end of file
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