Skip to content

Commit

Permalink
some frontend changes to support the module
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau committed May 28, 2024
1 parent 32161d1 commit e6ba88c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api-client/src/modules/api-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ export interface HeaterShakerData {
errorDetails: string | null
status: HeaterShakerStatus
}
export interface AbsorbanceReaderData {
lidStatus: 'open' | 'closed' | 'unknown'
platePresence: 'present' | 'absent' | 'unknown'
sampleWavelength: number | null
status: AbsorbanceReaderStatus
}

export type TemperatureStatus =
| 'idle'
Expand Down Expand Up @@ -112,3 +118,5 @@ export type LatchStatus =
| 'idle_closed'
| 'idle_unknown'
| 'unknown'

export type AbsorbanceReaderStatus = 'idle' | 'measuring' | 'error'
10 changes: 10 additions & 0 deletions api-client/src/modules/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import type {
ThermocyclerModuleModel,
MagneticModuleModel,
HeaterShakerModuleModel,
AbsorbanceReaderModel,
TEMPERATURE_MODULE_TYPE,
MAGNETIC_MODULE_TYPE,
THERMOCYCLER_MODULE_TYPE,
HEATERSHAKER_MODULE_TYPE,
ABSORBANCE_READER_TYPE,
} from '@opentrons/shared-data'

import type * as ApiTypes from './api-types'
import { A } from 'vitest/dist/reporters-1evA5lom'

export * from './api-types'

Expand Down Expand Up @@ -44,11 +47,18 @@ export interface HeaterShakerModule extends CommonModuleInfo {
data: ApiTypes.HeaterShakerData
}

export interface AbsorbanceReaderModule extends CommonModuleInfo {
moduleType: typeof ABSORBANCE_READER_TYPE
moduleModel: AbsorbanceReaderModel
data: ApiTypes.AbsorbanceReaderData
}

export type AttachedModule =
| TemperatureModule
| MagneticModule
| ThermocyclerModule
| HeaterShakerModule
| AbsorbanceReaderModule

export interface ModulesMeta {
cursor: number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import {
import {
getCutoutDisplayName,
getFixtureDisplayName,
ABSORBANCE_READER_CUTOUTS,
ABSORBANCE_READER_V1,
ABSORBANCE_READER_V1_FIXTURE,
HEATER_SHAKER_CUTOUTS,
HEATERSHAKER_MODULE_V1,
HEATERSHAKER_MODULE_V1_FIXTURE,
Expand Down Expand Up @@ -234,6 +237,24 @@ export function AddFixtureModal({
...unconfiguredTemperatureModules,
]
}
if (
ABSORBANCE_READER_CUTOUTS.includes(cutoutId) &&
unconfiguredMods.some(m => m.moduleModel === ABSORBANCE_READER_V1)
) {
const unconfiguredAbsorbanceReaders = unconfiguredMods
.filter(mod => mod.moduleModel === ABSORBANCE_READER_V1)
.map(mod => [
{
cutoutId,
cutoutFixtureId: ABSORBANCE_READER_V1_FIXTURE,
opentronsModuleSerialNumber: mod.serialNumber,
},
])
availableOptions = [
...availableOptions,
...unconfiguredAbsorbanceReaders,
]
}
}
} else if (optionStage === 'wasteChuteOptions') {
availableOptions = WASTE_CHUTE_FIXTURES.map(fixture => [
Expand Down

0 comments on commit e6ba88c

Please sign in to comment.