Skip to content

Commit

Permalink
refactor(app): add more namespacing for command text utils
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhuff committed Oct 25, 2024
1 parent 819d98d commit 297f366
Show file tree
Hide file tree
Showing 29 changed files with 67 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import type {
RobotType,
LabwareDefinition2,
} from '@opentrons/shared-data'
import type { GetDirectTranslationCommandText } from './utils/getDirectTranslationCommandText'
import type {
TCProfileStepText,
TCProfileCycleText,
} from './utils/getTCRunExtendedProfileCommandText'
GetDirectTranslationCommandText,
} from './utils'
import type { CommandTextData } from '/app/local-resources/commands/types'

export interface UseCommandTextStringParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
AbsorbanceReaderReadRunTimeCommand,
RunTimeCommand,
} from '@opentrons/shared-data'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export type AbsorbanceCreateCommand =
| AbsorbanceReaderOpenLidRunTimeCommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CommentRunTimeCommand } from '@opentrons/shared-data/command'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export function getCommentCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getPipetteSpecsV2 } from '@opentrons/shared-data'

import type { ConfigureForVolumeRunTimeCommand } from '@opentrons/shared-data/command'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export function getConfigureForVolumeCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getPipetteSpecsV2 } from '@opentrons/shared-data'

import type { ConfigureNozzleLayoutRunTimeCommand } from '@opentrons/shared-data'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export function getConfigureNozzleLayoutCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CustomRunTimeCommand } from '@opentrons/shared-data/command'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export function getCustomCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DeprecatedDelayRunTimeCommand } from '@opentrons/shared-data/command'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export function getDelayCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RunTimeCommand } from '@opentrons/shared-data/command'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

const SIMPLE_TRANSLATION_KEY_BY_COMMAND_TYPE: {
[commandType in RunTimeCommand['commandType']]?: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { HeaterShakerSetAndWaitForShakeSpeedRunTimeCommand } from '@opentrons/shared-data/command'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export function getHSShakeSpeedCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import {
getLabwareName,
getLabwareDisplayLocation,
} from '/app/local-resources/labware'
import { getFinalLabwareLocation } from './getFinalLabwareLocation'
import { getFinalLabwareLocation } from '../getFinalLabwareLocation'

import type {
LiquidProbeRunTimeCommand,
RunTimeCommand,
TryLiquidProbeRunTimeCommand,
} from '@opentrons/shared-data'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

type LiquidProbeRunTimeCommands =
| LiquidProbeRunTimeCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
getPipetteSpecsV2,
} from '@opentrons/shared-data'

import { getPipetteNameOnMount } from './getPipetteNameOnMount'
import { getLiquidDisplayName } from './getLiquidDisplayName'
import { getPipetteNameOnMount } from '../getPipetteNameOnMount'
import { getLiquidDisplayName } from '../getLiquidDisplayName'

import { getLabwareName } from '/app/local-resources/labware'
import {
Expand All @@ -15,7 +15,7 @@ import {
} from '/app/local-resources/modules'

import type { LoadLabwareRunTimeCommand } from '@opentrons/shared-data'
import type { GetCommandText } from '..'
import type { GetCommandText } from '../..'

export const getLoadCommandText = ({
command,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { GRIPPER_WASTE_CHUTE_ADDRESSABLE_AREA } from '@opentrons/shared-data'

import { getFinalLabwareLocation } from './getFinalLabwareLocation'
import { getFinalLabwareLocation } from '../getFinalLabwareLocation'
import {
getLabwareName,
getLabwareDisplayLocation,
} from '/app/local-resources/labware'

import type { MoveLabwareRunTimeCommand } from '@opentrons/shared-data'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export function getMoveLabwareCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { MoveRelativeRunTimeCommand } from '@opentrons/shared-data/command'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export function getMoveRelativeCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getAddressableAreaDisplayName } from './getAddressableAreaDisplayName'
import { getAddressableAreaDisplayName } from '../getAddressableAreaDisplayName'

import type { MoveToAddressableAreaRunTimeCommand } from '@opentrons/shared-data/command'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export function getMoveToAddressableAreaCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getAddressableAreaDisplayName } from './getAddressableAreaDisplayName'
import { getAddressableAreaDisplayName } from '../getAddressableAreaDisplayName'

import type { MoveToAddressableAreaForDropTipRunTimeCommand } from '@opentrons/shared-data/command'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export function getMoveToAddressableAreaForDropTipCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { MoveToCoordinatesRunTimeCommand } from '@opentrons/shared-data/command'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export function getMoveToCoordinatesCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { MoveToSlotRunTimeCommand } from '@opentrons/shared-data/command'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export function getMoveToSlotCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import {
getLabwareDisplayLocation,
} from '/app/local-resources/labware'

import { getFinalLabwareLocation } from './getFinalLabwareLocation'
import { getFinalLabwareLocation } from '../getFinalLabwareLocation'

import type { MoveToWellRunTimeCommand } from '@opentrons/shared-data/command'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export function getMoveToWellCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getLabwareDefURI } from '@opentrons/shared-data'

import { getFinalLabwareLocation } from './getFinalLabwareLocation'
import { getWellRange } from './getWellRange'
import { getFinalLabwareLocation } from '../getFinalLabwareLocation'
import { getWellRange } from '../getWellRange'

import {
getLabwareDefinitionsFromCommands,
Expand All @@ -11,7 +11,7 @@ import {
} from '/app/local-resources/labware'

import type { PipetteName, RunTimeCommand } from '@opentrons/shared-data'
import type { GetCommandText } from '..'
import type { GetCommandText } from '../..'

export const getPipettingCommandText = ({
command,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getPipetteSpecsV2 } from '@opentrons/shared-data'

import type { PrepareToAspirateRunTimeCommand } from '@opentrons/shared-data/command'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export function getPrepareToAspirateCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RunTimeCommand } from '@opentrons/shared-data/command'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

type HandledCommands = Extract<RunTimeCommand, { commandType: 'setRailLights' }>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import type {
TCProfileCycle,
AtomicProfileStep,
} from '@opentrons/shared-data/command'
import type { GetTCRunExtendedProfileCommandTextResult } from '..'
import type { HandlesCommands } from './types'
import type { GetTCRunExtendedProfileCommandTextResult } from '../..'
import type { HandlesCommands } from '../types'

export interface TCProfileStepText {
kind: 'step'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { formatDurationLabeled } from '/app/transformations/commands'
import type { TCRunProfileRunTimeCommand } from '@opentrons/shared-data/command'
import type { GetTCRunProfileCommandTextResult } from '..'
import type { HandlesCommands } from './types'
import type { GetTCRunProfileCommandTextResult } from '../..'
import type { HandlesCommands } from '../types'

export function getTCRunProfileCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
HeaterShakerSetTargetTemperatureCreateCommand,
RunTimeCommand,
} from '@opentrons/shared-data'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export type TemperatureCreateCommand =
| TemperatureModuleSetTargetTemperatureCreateCommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { GetCommandText } from '..'
import type { GetCommandText } from '../..'

export function getUnknownCommandText({ command }: GetCommandText): string {
return JSON.stringify(command)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { WaitForDurationRunTimeCommand } from '@opentrons/shared-data/command'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export function getWaitForDurationCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { WaitForResumeRunTimeCommand } from '@opentrons/shared-data/command'
import type { HandlesCommands } from './types'
import type { HandlesCommands } from '../types'

export function getWaitForResumeCommandText({
command,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export * from './getLoadCommandText'
export * from './getTemperatureCommandText'
export * from './getTCRunProfileCommandText'
export * from './getTCRunExtendedProfileCommandText'
export * from './getHSShakeSpeedCommandText'
export * from './getMoveToSlotCommandText'
export * from './getMoveRelativeCommandText'
export * from './getMoveToCoordinatesCommandText'
export * from './getMoveToWellCommandText'
export * from './getMoveLabwareCommandText'
export * from './getConfigureForVolumeCommandText'
export * from './getConfigureNozzleLayoutCommandText'
export * from './getPrepareToAspirateCommandText'
export * from './getMoveToAddressableAreaCommandText'
export * from './getMoveToAddressableAreaForDropTipCommandText'
export * from './getDirectTranslationCommandText'
export * from './getWaitForDurationCommandText'
export * from './getWaitForResumeCommandText'
export * from './getDelayCommandText'
export * from './getCommentCommandText'
export * from './getCustomCommandText'
export * from './getUnknownCommandText'
export * from './getPipettingCommandText'
export * from './getLiquidProbeCommandText'
export * from './getRailLightsCommandText'
export * from './getAbsorbanceReaderCommandText'
Original file line number Diff line number Diff line change
@@ -1,26 +1,2 @@
export { getLoadCommandText } from './getLoadCommandText'
export { getTemperatureCommandText } from './getTemperatureCommandText'
export { getTCRunProfileCommandText } from './getTCRunProfileCommandText'
export { getTCRunExtendedProfileCommandText } from './getTCRunExtendedProfileCommandText'
export { getHSShakeSpeedCommandText } from './getHSShakeSpeedCommandText'
export { getMoveToSlotCommandText } from './getMoveToSlotCommandText'
export { getMoveRelativeCommandText } from './getMoveRelativeCommandText'
export { getMoveToCoordinatesCommandText } from './getMoveToCoordinatesCommandText'
export { getMoveToWellCommandText } from './getMoveToWellCommandText'
export { getMoveLabwareCommandText } from './getMoveLabwareCommandText'
export { getConfigureForVolumeCommandText } from './getConfigureForVolumeCommandText'
export { getConfigureNozzleLayoutCommandText } from './getConfigureNozzleLayoutCommandText'
export { getPrepareToAspirateCommandText } from './getPrepareToAspirateCommandText'
export { getMoveToAddressableAreaCommandText } from './getMoveToAddressableAreaCommandText'
export { getMoveToAddressableAreaForDropTipCommandText } from './getMoveToAddressabelAreaForDropTipCommandText'
export { getDirectTranslationCommandText } from './getDirectTranslationCommandText'
export { getWaitForDurationCommandText } from './getWaitForDurationCommandText'
export { getWaitForResumeCommandText } from './getWaitForResumeCommandText'
export { getDelayCommandText } from './getDelayCommandText'
export { getCommentCommandText } from './getCommentCommandText'
export { getCustomCommandText } from './getCustomCommandText'
export { getUnknownCommandText } from './getUnknownCommandText'
export { getPipettingCommandText } from './getPipettingCommandText'
export { getLiquidProbeCommandText } from './getLiquidProbeCommandText'
export { getRailLightsCommandText } from './getRailLightsCommandText'
export { getAbsorbanceReaderCommandText } from './getAbsorbanceReaderCommandText'
export * from './commandText'
export * from './types'

0 comments on commit 297f366

Please sign in to comment.