Skip to content

Commit

Permalink
Fix 372 upload cal curve timeout issue (#390)
Browse files Browse the repository at this point in the history
* add 65ms wait time b/w uploading cal points and use logging statements

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* move logging statement for checking all points to _check_curve()

* add logging.debug() to assertion errors

* add successful upload statement

* add excitement to successful upload statement

* remove logging statements

* Remove blank line

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Brian Koopman <[email protected]>
  • Loading branch information
3 people authored Jun 28, 2023
1 parent 6c44eb1 commit 5899c24
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions socs/Lakeshore/Lakeshore372.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import socket
import sys
import time

import numpy as np

Expand Down Expand Up @@ -1318,6 +1319,7 @@ def set_curve(self, _file):
for point in values:
print("uploading %s" % point)
self._set_data_point(point[0], point[1], point[2])
time.sleep(0.065)

# refresh curve attributes
self.get_header()
Expand Down Expand Up @@ -1347,9 +1349,8 @@ def _check_curve(self, _file):
point = values[j - 1]
units = float(resp[0])
temperature = float(resp[1])
assert units == float(point[1]), "Point number %s not uploaded" % point[0]
assert temperature == float(point[2]), "Point number %s not uploaded" % point[0]
print("Successfully uploaded %s, %s" % (units, temperature))
assert units == float(point[1]), "Point number %s not uploaded. Reuploading points." % point[0]
assert temperature == float(point[2]), "Point number %s not uploaded. Reuploading points." % point[0]
# if AssertionError, tell 372 to re-upload points
except AssertionError:
if units != float(point[1]):
Expand Down

0 comments on commit 5899c24

Please sign in to comment.