File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ import {
2
+ FLEX_STACKER_MODULE_TYPE ,
3
+ TC_MODULE_LOCATION_OT2 ,
4
+ TC_MODULE_LOCATION_OT3 ,
5
+ THERMOCYCLER_MODULE_TYPE ,
6
+ } from '..'
7
+
8
+ import type { ModuleType } from '../types'
9
+
10
+ const getFlexStackerDisplayLocationFromSlotName = (
11
+ slotName : string
12
+ ) : string => {
13
+ return `${ slotName } +${ slotName [ 0 ] } 4`
14
+ }
15
+
16
+ /**
17
+ * Returns a string to represent a module's deck location, to be used in Deck Configuration and Protocol Setup.
18
+ * @param moduleType - The type of the module.
19
+ * @param slotName - The slot name where the module is located.
20
+ * @returns A string representing the module's deck label.
21
+ *
22
+ * For all labware loaded on/offdeck or on module, use `getLabwareDeckLabel` instead.
23
+ */
24
+ export function getModuleDeckLabel (
25
+ moduleType : ModuleType ,
26
+ slotName : string
27
+ ) : string {
28
+ switch ( moduleType ) {
29
+ case THERMOCYCLER_MODULE_TYPE :
30
+ if ( slotName === '7' ) {
31
+ // OT-2 thermocycler module slotName is always '7'
32
+ return TC_MODULE_LOCATION_OT2
33
+ } else {
34
+ return TC_MODULE_LOCATION_OT3
35
+ }
36
+ case FLEX_STACKER_MODULE_TYPE :
37
+ return getFlexStackerDisplayLocationFromSlotName ( slotName )
38
+ default :
39
+ return slotName
40
+ }
41
+ }
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ export * from './getLiquidsByIdForLabware'
60
60
export * from './getStackedItemsOnStartingDeck'
61
61
export * from './getStandardDeckViewLayerBlockList'
62
62
export * from './getWellFillFromLabwareId'
63
+ export * from './getModuleDeckLabel'
63
64
64
65
export const getLabwareDefIsStandard = ( def : LabwareDefinition ) : boolean =>
65
66
def ?. namespace === OPENTRONS_LABWARE_NAMESPACE
You can’t perform that action at this time.
0 commit comments