1
1
import {
2
+ ABSORBANCE_READER_V1 ,
2
3
fixture96Plate ,
4
+ FLEX_STACKER_MODULE_V1 ,
3
5
getModuleDef ,
4
6
HEATERSHAKER_MODULE_V1 ,
5
7
MAGNETIC_BLOCK_V1 ,
@@ -27,8 +29,23 @@ const moduleModels: ModuleModel[] = [
27
29
MAGNETIC_MODULE_V2 ,
28
30
HEATERSHAKER_MODULE_V1 ,
29
31
MAGNETIC_BLOCK_V1 ,
32
+ ABSORBANCE_READER_V1 ,
33
+ FLEX_STACKER_MODULE_V1 ,
30
34
]
31
35
36
+ const moduleModelOptions = {
37
+ 'Temperature Module V2' : TEMPERATURE_MODULE_V2 ,
38
+ 'Temperature Module V1' : TEMPERATURE_MODULE_V1 ,
39
+ 'Thermocycler Module V1' : THERMOCYCLER_MODULE_V1 ,
40
+ 'Thermocycler Module V2' : THERMOCYCLER_MODULE_V2 ,
41
+ 'Magnetic Module V1' : MAGNETIC_MODULE_V1 ,
42
+ 'Magnetic Module V2' : MAGNETIC_MODULE_V2 ,
43
+ 'Heater-Shaker Module V1' : HEATERSHAKER_MODULE_V1 ,
44
+ 'Magnetic Block V1' : MAGNETIC_BLOCK_V1 ,
45
+ 'Absorbance Reader V1' : ABSORBANCE_READER_V1 ,
46
+ 'Flex Stacker Module V1' : FLEX_STACKER_MODULE_V1 ,
47
+ }
48
+
32
49
export default {
33
50
title : 'Library/Molecules/Simulation/Module' ,
34
51
} as Meta
@@ -39,53 +56,65 @@ const Template: Story<{
39
56
hasLabware : boolean
40
57
innerProps : { }
41
58
} > = args => {
59
+ // Add null check and default to first module model if undefined
60
+ const moduleModel = args . model || moduleModels [ 0 ]
61
+
42
62
return (
43
63
< RobotCoordinateSpace height = "100vh" width = "100vw" viewBox = "0 -50 200 320" >
44
64
< ModuleComponent
45
- def = { getModuleDef ( args . model ) }
65
+ def = { getModuleDef ( moduleModel ) }
46
66
x = { 0 }
47
67
y = { 0 }
48
68
innerProps = { args . innerProps }
49
69
orientation = { args . orientation }
70
+ targetSlotId = { null }
71
+ targetDeckId = { null }
50
72
>
51
73
{ args . hasLabware ? (
52
- < LabwareRender definition = { fixture96Plate as LabwareDefinition } />
74
+ < LabwareRender
75
+ definition = { fixture96Plate as LabwareDefinition }
76
+ positioningMode = "passThrough"
77
+ />
53
78
) : null }
54
79
</ ModuleComponent >
55
80
</ RobotCoordinateSpace >
56
81
)
57
82
}
83
+
58
84
export const Module = Template . bind ( { } )
85
+ Module . args = {
86
+ model : TEMPERATURE_MODULE_V2 ,
87
+ orientation : 'left' ,
88
+ hasLabware : false ,
89
+ innerProps : {
90
+ lidMotorState : 'open' ,
91
+ blockTargetTemp : 90 ,
92
+ targetTemperature : 4 ,
93
+ targetTemp : 40 ,
94
+ } ,
95
+ }
96
+
59
97
Module . argTypes = {
60
98
model : {
61
99
control : {
62
100
type : 'select' ,
63
- options : moduleModels ,
64
101
} ,
65
- defaultValue : moduleModels [ 0 ] ,
102
+ options : moduleModelOptions ,
66
103
} ,
67
104
orientation : {
68
105
control : {
69
106
type : 'select' ,
70
- options : [ 'left' , 'right' ] ,
71
107
} ,
72
- defaultValue : 'left' ,
108
+ options : [ 'left' , 'right' ] ,
73
109
} ,
74
110
hasLabware : {
75
111
control : {
76
112
type : 'boolean' ,
77
113
} ,
78
- defaultValue : false ,
79
114
} ,
80
115
innerProps : {
81
116
control : {
82
117
type : 'object' ,
83
118
} ,
84
- defaultValue : {
85
- lidMotorState : 'open' ,
86
- blockTargetTemp : 90 ,
87
- targetTemperature : 4 ,
88
- targetTemp : 40 ,
89
- } ,
90
119
} ,
91
120
}
0 commit comments