-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(api) Support changing current based on tip configuration #13660
Changes from 10 commits
9cd50a9
babbeb5
a45752d
f47b617
25120f9
8785edf
fa1f1f0
a509a0e
c53f48d
6eab794
decafda
bfab28d
dd06a8f
bbeb8f0
e54db9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,15 +200,18 @@ class NozzleConfigurationManager: | |
def __init__( | ||
self, | ||
nozzle_map: NozzleMap, | ||
current_scalar: float, | ||
pick_up_current_map: Dict[int, float], | ||
) -> None: | ||
self._physical_nozzle_map = nozzle_map | ||
self._current_nozzle_configuration = nozzle_map | ||
self._current_scalar: Final[float] = current_scalar | ||
self._pick_up_current_map: Final[Dict[int, float]] = pick_up_current_map | ||
|
||
@classmethod | ||
def build_from_nozzlemap( | ||
cls, nozzle_map: Dict[str, List[float]], current_scalar: float | ||
cls, | ||
nozzle_map: Dict[str, List[float]], | ||
default_pickup_current: float, | ||
pick_up_current_map: Optional[Dict[int, float]] = None, | ||
) -> "NozzleConfigurationManager": | ||
|
||
sorted_nozzlemap = list(nozzle_map.keys()) | ||
|
@@ -224,12 +227,23 @@ def build_from_nozzlemap( | |
back_left_nozzle=first_nozzle, | ||
front_right_nozzle=last_nozzle, | ||
) | ||
return cls(starting_nozzle_config, current_scalar) | ||
if pick_up_current_map: | ||
current_map = pick_up_current_map | ||
else: | ||
current_map = { | ||
num_tips + 1: default_pickup_current | ||
for num_tips in range(len(starting_nozzle_config.map_store)) | ||
} | ||
return cls(starting_nozzle_config, current_map) | ||
|
||
@property | ||
def starting_nozzle_offset(self) -> Point: | ||
return self._current_nozzle_configuration.starting_nozzle_offset | ||
|
||
@property | ||
def current_configuration(self) -> NozzleMap: | ||
return self._current_nozzle_configuration | ||
|
||
def update_nozzle_configuration( | ||
self, | ||
back_left_nozzle: str, | ||
|
@@ -256,13 +270,10 @@ def update_nozzle_configuration( | |
front_right_nozzle=front_right_nozzle, | ||
) | ||
|
||
def get_current_for_tip_configuration(self) -> float: | ||
# TODO While implementing this PR I realized that | ||
# the current scalar truly is inefficient for | ||
# encapsulating varying currents needed for | ||
# pick up tip so we'll need to follow this up | ||
# with a lookup table. | ||
return self._current_scalar | ||
def get_tip_configuration_current(self) -> float: | ||
return self._pick_up_current_map[ | ||
len(self._current_nozzle_configuration.map_store) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: i would love it if the nozzle configuration objects had like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure can do that |
||
] | ||
|
||
def critical_point_with_tip_length( | ||
self, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in what situations would we not have a
pick_up_current_map
? does it have to be= None
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single channels do not have a pick up current map.