-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(api, robot-server): add per revision configs (#7109)
With the launch of the OT-2 refresh, we'll need to be able to express some config elements (specifically, currents) differently based on the hardware revision of the robot in question. This PR adds per-revision concepts to the robot configs area, specifically around the currents, which is a huge changeset. It also has a bunch of refactors that were waiting a long time, like - robot configs is a dataclass now - A lot had to deal with that - Removed the rest of the now-unused config elements. Closes #7093
- Loading branch information
Showing
17 changed files
with
465 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from dataclasses import dataclass | ||
from typing import Dict, Tuple | ||
from typing_extensions import TypedDict | ||
|
||
|
||
class AxisDict(TypedDict): | ||
X: float | ||
Y: float | ||
Z: float | ||
A: float | ||
B: float | ||
C: float | ||
|
||
|
||
class CurrentDictDefault(TypedDict): | ||
default: AxisDict | ||
|
||
|
||
CurrentDictModelEntries = TypedDict( | ||
'CurrentDictModelEntries', | ||
{'2.1': AxisDict, | ||
'A': AxisDict, | ||
'B': AxisDict, | ||
'C': AxisDict}, | ||
total=False) | ||
|
||
|
||
class CurrentDict(CurrentDictDefault, CurrentDictModelEntries): | ||
pass | ||
|
||
|
||
@dataclass | ||
class RobotConfig: | ||
name: str | ||
version: int | ||
gantry_steps_per_mm: Dict[str, float] | ||
acceleration: Dict[str, float] | ||
serial_speed: int | ||
default_pipette_configs: Dict[str, float] | ||
default_current: CurrentDict | ||
low_current: CurrentDict | ||
high_current: CurrentDict | ||
default_max_speed: AxisDict | ||
log_level: str | ||
z_retract_distance: float | ||
left_mount_offset: Tuple[float, float, float] |
Oops, something went wrong.