-
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(shared-data, app): add configureNozzleLayout command type in run log #13961
Changes from 4 commits
c7031de
3e87825
88b077f
a4f65e9
f2253eb
5c77e4f
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { | ||
getPipetteNameSpecs, | ||
PipetteName, | ||
RunTimeCommand, | ||
} from '@opentrons/shared-data' | ||
|
||
/** | ||
* @param pipetteName name of pipette being used | ||
* @param commands list of commands to search within | ||
* @param wellName the target well for pickup tip | ||
* @returns WellRange string of wells pipette will pickup tips from | ||
*/ | ||
export function getWellRange( | ||
pipetteId: string, | ||
pipetteName: PipetteName, | ||
commands: RunTimeCommand[], | ||
wellName: string | ||
): string { | ||
const pipetteChannels = getPipetteNameSpecs(pipetteName)?.channels ?? 1 | ||
let usedChannels = pipetteChannels | ||
if (pipetteChannels === 96) { | ||
for (const c of commands.reverse()) { | ||
if ( | ||
c.commandType === 'configureNozzleLayout' && | ||
c.params?.pipetteId === pipetteId | ||
) { | ||
// TODO(sb, 11/9/23): add support for quadrant and row configurations when needed | ||
if (c.params.configuration_params.style === 'SINGLE') { | ||
usedChannels = 1 | ||
} else if (c.params.configuration_params.style === 'COLUMN') { | ||
usedChannels = 8 | ||
} | ||
break | ||
} | ||
} | ||
} | ||
if (usedChannels === 96) { | ||
return 'A1 - H12' | ||
} else if (usedChannels === 8) { | ||
const column = wellName.substr(1) | ||
return `A${column} - H${column}` | ||
} | ||
return wellName | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,13 +71,26 @@ export interface LoadFixtureRunTimeCommand | |
result?: LoadLabwareResult | ||
} | ||
|
||
export interface ConfigureNozzleLayoutCreateCommand | ||
extends CommonCommandCreateInfo { | ||
commandType: 'configureNozzleLayout' | ||
params: ConfigureNozzleLayoutParams | ||
} | ||
|
||
export interface ConfigureNozzleLayoutRunTimeCommand | ||
extends CommonCommandRunTimeInfo, | ||
ConfigureNozzleLayoutCreateCommand { | ||
result?: {} | ||
} | ||
|
||
export type SetupRunTimeCommand = | ||
| LoadPipetteRunTimeCommand | ||
| LoadLabwareRunTimeCommand | ||
| LoadFixtureRunTimeCommand | ||
| LoadModuleRunTimeCommand | ||
| LoadLiquidRunTimeCommand | ||
| MoveLabwareRunTimeCommand | ||
| ConfigureNozzleLayoutRunTimeCommand | ||
smb2268 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
export type SetupCreateCommand = | ||
| LoadPipetteCreateCommand | ||
|
@@ -86,6 +99,7 @@ export type SetupCreateCommand = | |
| LoadModuleCreateCommand | ||
| LoadLiquidCreateCommand | ||
| MoveLabwareCreateCommand | ||
| ConfigureNozzleLayoutCreateCommand | ||
|
||
export type LabwareLocation = | ||
| 'offDeck' | ||
|
@@ -161,3 +175,26 @@ interface LoadFixtureParams { | |
loadName: FixtureLoadName | ||
fixtureId?: string | ||
} | ||
|
||
const COLUMN = 'COLUMN' | ||
const SINGLE = 'SINGLE' | ||
const ROW = 'ROW' | ||
const QUADRANT = 'QUADRANT' | ||
const EMPTY = 'EMPTY' | ||
|
||
export type NozzleConfigurationStyle = | ||
| typeof COLUMN | ||
| typeof SINGLE | ||
| typeof ROW | ||
| typeof QUADRANT | ||
| typeof EMPTY | ||
|
||
interface NozzleConfigurationParams { | ||
primary_nozzle: string | ||
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. we probably want both 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. I think this would have to be a BE change, wouldn't it? |
||
style: NozzleConfigurationStyle | ||
} | ||
|
||
interface ConfigureNozzleLayoutParams { | ||
pipetteId: string | ||
configuration_params: NozzleConfigurationParams | ||
} | ||
Comment on lines
+197
to
+200
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. Oh wait i didn't realize a 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. I'm pretty sure it's necessary based on this https://github.com/Opentrons/opentrons/blob/edge/api/src/opentrons/protocol_engine/commands/configure_nozzle_layout.py#L33 - @sanni-t can you confirm whether the types I have here are correct? 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. Yep, |
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.
maybe add a TODO here to remind us to add a result type?
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.
I was looking at the analysis output and the result was just an empty object - @sanni-t is that correct?
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.
Yes, that's correct. The result is an empty object.