Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv TTL RS485 - Testing
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Conv TTL RS485 - Testing
Commits
8f0e37a5
Commit
8f0e37a5
authored
Nov 25, 2014
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw: Updated turning on and off of ELMA crate in pts.py
parent
c2a76b5d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
32 deletions
+4
-32
pts.py
pts/python/pts.py
+4
-32
No files found.
pts/python/pts.py
View file @
8f0e37a5
...
...
@@ -66,20 +66,6 @@ import re
# Import ptsdefine module to avoid wrong `make's
from
ptsdefine
import
*
##-------------------------------------------------------------------------------------------------
## Method to turn on the ELMA crate.
##-------------------------------------------------------------------------------------------------
## It calls the get-fan-speeds script to check if the crate is on.
##-------------------------------------------------------------------------------------------------
def
men_is_on
():
on
=
0
subprocess
.
call
(
"cd shell; ./get-fan-speeds"
,
shell
=
True
,
stdout
=
fnull
,
stderr
=
fnull
)
btxt
=
tuple
(
open
(
"log/fan-speeds"
,
"r"
))
for
i
in
range
(
1
,
len
(
btxt
)):
if
btxt
[
i
]
.
find
(
"INTEGER: 0"
)
==
-
1
:
on
=
on
+
1
return
on
##-------------------------------------------------------------------------------------------------
## Method to turn on the VME crate.
##-------------------------------------------------------------------------------------------------
...
...
@@ -87,15 +73,8 @@ def men_is_on():
## power to the VME backplane.
##-------------------------------------------------------------------------------------------------
def
men_on
():
tmo
=
1
while
men_is_on
()
==
0
:
print
"Try:
%
d Switching ON the VME Crate"
%
(
tmo
)
subprocess
.
call
(
"shell/men-on"
,
shell
=
True
,
stdout
=
fnull
,
stderr
=
fnull
)
tmo
=
tmo
+
1
if
tmo
>
10
:
print
"FATAL ERROR: VME Crate: Unable to switch ON"
sys
.
exit
(
1
)
time
.
sleep
(
1
)
print
(
"Switching on the ELMA crate"
)
subprocess
.
call
(
"shell/men-on"
,
shell
=
True
,
stdout
=
fnull
,
stderr
=
fnull
)
##-------------------------------------------------------------------------------------------------
## Method to turn off the VME crate.
...
...
@@ -104,15 +83,8 @@ def men_on():
## power to the VME backplane.
##-------------------------------------------------------------------------------------------------
def
men_off
():
tmo
=
1
while
men_is_on
()
!=
0
:
print
"Try:
%
d Switching OFF the VME Crate"
%
(
tmo
)
subprocess
.
call
(
"shell/men-off"
,
shell
=
True
,
stdout
=
fnull
,
stderr
=
fnull
)
tmo
=
tmo
+
1
if
tmo
>
10
:
print
"FATAL ERROR: VME Crate: Unable to switch OFF"
sys
.
exit
(
1
)
time
.
sleep
(
1
)
print
(
"Switching off the ELMA crate"
)
subprocess
.
call
(
"shell/men-off"
,
shell
=
True
,
stdout
=
fnull
,
stderr
=
fnull
)
##-------------------------------------------------------------------------------------------------
## Main "method" of PTS
...
...
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