Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 2cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
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
FMC DEL 1ns 2cha
Commits
4dfb431b
Commit
4dfb431b
authored
Nov 03, 2016
by
Jan Pospisil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
floats in arguments
parent
8672b76f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
FFPG_CLI.py
sw/FFPG_CLI.py
+13
-8
No files found.
sw/FFPG_CLI.py
View file @
4dfb431b
...
...
@@ -2,7 +2,6 @@
# coding: utf8
# TODO:
# - floats in arguments
# - bunch assert (0-3563)
# - when no bunches are provided, stay in high/low according to polarity
# - fixed sub-bunch period, just check (warning) against "real" input frequency
...
...
@@ -16,7 +15,13 @@ def myInt(s):
return
int
(
s
)
except
:
return
None
def
myFloat
(
s
):
try
:
return
float
(
s
)
except
:
return
None
print
(
"FFPG command line interface"
)
print
(
""
)
...
...
@@ -31,9 +36,9 @@ if len(sys.argv) is not 4 and len(sys.argv) < 8:
print
" <fmcSlot (LUN)> - 0 | 1"
print
" <channel> - 1 | 2"
print
" <polarity> - 0 | 1"
print
" <pulseWidth> - positive number in [ns]"
print
" <pulseDelay> - non-negative number in [ns]"
print
" <triggerLatency> - non-negative number in [ns], or -1 (calibration disabled)"
print
" <pulseWidth> - positive
float
number in [ns]"
print
" <pulseDelay> - non-negative
float
number in [ns]"
print
" <triggerLatency> - non-negative
float
number in [ns], or -1 (calibration disabled)"
print
" <bunches> - space separated list of bunch numbers"
print
""
sys
.
exit
()
...
...
@@ -44,9 +49,9 @@ if sys.argv[3] == "stop":
polarity
=
"stop"
else
:
polarity
=
myInt
(
sys
.
argv
[
3
])
pulseWidth
=
my
In
t
(
sys
.
argv
[
4
])
pulseDelay
=
my
In
t
(
sys
.
argv
[
5
])
triggerLatency
=
my
In
t
(
sys
.
argv
[
6
])
pulseWidth
=
my
Floa
t
(
sys
.
argv
[
4
])
pulseDelay
=
my
Floa
t
(
sys
.
argv
[
5
])
triggerLatency
=
my
Floa
t
(
sys
.
argv
[
6
])
bunches
=
[]
for
i
in
range
(
7
,
len
(
sys
.
argv
)):
bunches
.
append
(
myInt
(
sys
.
argv
[
i
]))
...
...
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