Skip to content

Commit

Permalink
chore(merge): merge internal-release -> edge for 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
b-cooper authored and sfoster1 committed Apr 20, 2023
1 parent 0a63799 commit 699e9cc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions shared-data/js/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export const HEATERSHAKER_MODULE_V1: 'heaterShakerModuleV1' =
'heaterShakerModuleV1'

export const GRIPPER_V1: 'gripperV1' = 'gripperV1'
export const GRIPPER_V1_1: 'gripperV1.1' = 'gripperV1.1'
export const GRIPPER_MODELS = [GRIPPER_V1, GRIPPER_V1_1]

// pipette display categories
export const GEN3: 'GEN3' = 'GEN3'
Expand Down
10 changes: 8 additions & 2 deletions shared-data/js/gripper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import gripperV1 from '../gripper/definitions/1/gripperV1.json'
import gripperV1_1 from '../gripper/definitions/1/gripperV1.1.json'

import { GRIPPER_V1 } from './constants'
import { GRIPPER_V1, GRIPPER_V1_1 } from './constants'

import type { GripperModel, GripperDefinition } from './types'

Expand All @@ -10,8 +11,13 @@ export const getGripperDef = (
switch (gripperModel) {
case GRIPPER_V1:
return gripperV1 as GripperDefinition
case GRIPPER_V1_1:
return gripperV1_1 as GripperDefinition
default:
throw new Error(`Invalid gripper model ${gripperModel as string}`)
console.warn(
`Could not find a gripper with model ${gripperModel}, falling back to most recent definition: ${GRIPPER_V1_1}`
)
return gripperV1_1 as GripperDefinition
}
}

Expand Down
3 changes: 2 additions & 1 deletion shared-data/js/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
LEFT,
RIGHT,
GRIPPER_V1,
GRIPPER_V1_1,
} from './constants'
import type { INode } from 'svgson'
import type { RunTimeCommand } from '../protocol'
Expand Down Expand Up @@ -204,7 +205,7 @@ export type ModuleModel =
| ThermocyclerModuleModel
| HeaterShakerModuleModel

export type GripperModel = typeof GRIPPER_V1
export type GripperModel = typeof GRIPPER_V1 | typeof GRIPPER_V1_1

export type ModuleModelWithLegacy =
| ModuleModel
Expand Down

0 comments on commit 699e9cc

Please sign in to comment.