Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
auke.klazema
HPIB
Commits
f23b9ca7
Commit
f23b9ca7
authored
Feb 16, 2018
by
auke.klazema
Browse files
Fixed pep8 lines issues and unneeded \
parent
92da2f8a
Changes
2
Show whitespace changes
Inline
Side-by-side
hpib.py
View file @
f23b9ca7
...
...
@@ -3,10 +3,9 @@ import time
import
re
import
platform
class
PROLOGIX_GPIB_USB
():
def
__init__
(
self
,
\
port
=
""
,
timeout
=
1
,
\
portFormat
=
"%d"
,
maxDeviceNum
=
9
,
verbose
=
False
,
\
def
__init__
(
self
,
port
=
""
,
timeout
=
1
,
portFormat
=
"%d"
,
maxDeviceNum
=
9
,
verbose
=
False
,
findDevices
=
False
):
if
port
==
""
:
if
platform
.
system
()
==
"Linux"
:
...
...
@@ -85,15 +84,12 @@ class PROLOGIX_GPIB_USB():
def
getDevices
(
self
):
return
self
.
_devices
class
GPIB_232_485CT_A
():
def
__init__
(
self
,
\
port
=
"/dev/ttyS0"
,
\
baudrate
=
9600
,
bytesize
=
serial
.
EIGHTBITS
,
\
parity
=
serial
.
PARITY_NONE
,
stopbits
=
serial
.
STOPBITS_ONE
,
\
interCharTimeout
=
None
,
pause
=
0
,
timeout
=
10
):
self
.
_serialPort
=
serial
.
Serial
(
port
,
\
baudrate
,
bytesize
,
\
parity
,
stopbits
,
\
def
__init__
(
self
,
port
=
"/dev/ttyS0"
,
baudrate
=
9600
,
bytesize
=
serial
.
EIGHTBITS
,
parity
=
serial
.
PARITY_NONE
,
stopbits
=
serial
.
STOPBITS_ONE
,
interCharTimeout
=
None
,
pause
=
0
,
timeout
=
10
):
self
.
_serialPort
=
serial
.
Serial
(
port
,
baudrate
,
bytesize
,
parity
,
stopbits
,
interCharTimeout
,
timeout
)
self
.
_serialPort
.
flushInput
()
self
.
_pause
=
pause
...
...
@@ -114,6 +110,7 @@ class GPIB_232_485CT_A():
self
.
_commandStr
=
"loc "
+
str
(
hpib_address
)
+
chr
(
13
)
self
.
_commandCount
=
self
.
_serialPort
.
write
(
self
.
_commandStr
)
class
hpib_device
():
def
__init__
(
self
,
hpib_address
,
port
,
keepLocal
=
False
,
pause
=
0
):
self
.
_hpib_address
=
hpib_address
...
...
test/test_hpib.py
View file @
f23b9ca7
...
...
@@ -98,5 +98,6 @@ class PrologixGpibUsbTest(unittest.TestCase):
with
self
.
assertRaises
(
ValueError
):
hpib
.
PROLOGIX_GPIB_USB
(
port
=
"device"
)
if
__name__
==
'__main__'
:
unittest
.
main
()
Write
Preview
Supports
Markdown
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