Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
ptblab
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Daniele Nicolodi
ptblab
Commits
961face9
Commit
961face9
authored
1 year ago
by
Daniele Nicolodi
Browse files
Options
Downloads
Patches
Plain Diff
ls331: Minor modernizations
parent
e7b0ad55
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ls331.py
+10
-9
10 additions, 9 deletions
ls331.py
with
10 additions
and
9 deletions
ls331.py
+
10
−
9
View file @
961face9
...
...
@@ -8,7 +8,7 @@ import re
import
serial
import
time
from
ptblab
import
utils
,
datalogger
from
ptblab
import
datalogger
,
terminal
,
utils
class
Status
(
enum
.
IntFlag
):
...
...
@@ -53,15 +53,15 @@ def read_calibration_datafile(datafile):
"""
def
_parse_serial
(
x
):
return
re
.
sub
(
b
'
[^0-9]
'
,
b
''
,
x
)
return
re
.
sub
(
r
b
'
[^0-9]
'
,
b
''
,
x
)
fields
=
[
(
'
model
'
,
b
'
Sensor Model:\s+(.*)$
'
,
None
),
# CX-1050-SD-HT-1.4L
(
'
serial
'
,
b
'
Serial Number:\s+(.*)$
'
,
_parse_serial
),
# X165578
(
'
frmt
'
,
b
'
Data Format:\s+(\d)
'
,
None
),
# 4 (Log Ohms/Kelvin)
(
'
limit
'
,
b
'
SetPoint Limit:\s+(\d+\.\d+)\s+\(Kelvin\)$
'
,
None
),
# 325.0 (Kelvin)
(
'
sign
'
,
b
'
Temperature coefficient:\s+(\d)\s+\((Negative|Positive)\)$
'
,
None
),
# 1 (Negative)
(
'
npoints
'
,
b
'
Number of Breakpoints:\s+(\d+)$
'
,
int
),
# 149
(
'
model
'
,
r
b
'
Sensor Model:\s+(.*)$
'
,
None
),
# CX-1050-SD-HT-1.4L
(
'
serial
'
,
r
b
'
Serial Number:\s+(.*)$
'
,
_parse_serial
),
# X165578
(
'
frmt
'
,
r
b
'
Data Format:\s+(\d)
'
,
None
),
# 4 (Log Ohms/Kelvin)
(
'
limit
'
,
r
b
'
SetPoint Limit:\s+(\d+\.\d+)\s+\(Kelvin\)$
'
,
None
),
# 325.0 (Kelvin)
(
'
sign
'
,
r
b
'
Temperature coefficient:\s+(\d)\s+\((Negative|Positive)\)$
'
,
None
),
# 1 (Negative)
(
'
npoints
'
,
r
b
'
Number of Breakpoints:\s+(\d+)$
'
,
int
),
# 149
]
hdr
=
{}
...
...
@@ -85,7 +85,7 @@ def read_calibration_datafile(datafile):
# parse data
for
i
,
line
in
enumerate
(
lines
,
1
):
m
=
re
.
match
(
b
'
(\d+)\s+(\d*\.\d+(?:e\-?\d+)?)\s+(\d+\.\d+)$
'
,
line
.
strip
())
m
=
re
.
match
(
r
b
'
(\d+)\s+(\d*\.\d+(?:e\-?\d+)?)\s+(\d+\.\d+)$
'
,
line
.
strip
())
if
not
m
or
int
(
m
.
group
(
1
))
!=
i
:
raise
ValueError
(
line
)
data
.
append
((
float
(
m
.
group
(
2
)),
float
(
m
.
group
(
3
))))
...
...
@@ -185,6 +185,7 @@ def read(filename, device, fsampl, datadir, dataname):
instr
=
LS331
(
device
)
data
=
datalogger
.
open_data_file
(
datadir
,
dataname
,
filename
)
terminal
.
setup
()
for
t
in
utils
.
tick
(
fsampl
):
tempA
,
tempB
=
instr
.
get_temp
(
1
),
instr
.
get_temp
(
2
)
...
...
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