-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app): Plate reader in LPC and CommandText, filter out plate read…
- Loading branch information
Showing
18 changed files
with
206 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
app/src/molecules/Command/hooks/useCommandTextString/utils/getAbsorbanceReaderCommandText.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import type { | ||
AbsorbanceReaderOpenLidRunTimeCommand, | ||
AbsorbanceReaderCloseLidRunTimeCommand, | ||
AbsorbanceReaderInitializeRunTimeCommand, | ||
AbsorbanceReaderReadRunTimeCommand, | ||
RunTimeCommand, | ||
} from '@opentrons/shared-data' | ||
import type { HandlesCommands } from './types' | ||
|
||
export type AbsorbanceCreateCommand = | ||
| AbsorbanceReaderOpenLidRunTimeCommand | ||
| AbsorbanceReaderCloseLidRunTimeCommand | ||
| AbsorbanceReaderInitializeRunTimeCommand | ||
| AbsorbanceReaderReadRunTimeCommand | ||
|
||
const KEYS_BY_COMMAND_TYPE: { | ||
[commandType in AbsorbanceCreateCommand['commandType']]: string | ||
} = { | ||
'absorbanceReader/openLid': 'absorbance_reader_open_lid', | ||
'absorbanceReader/closeLid': 'absorbance_reader_close_lid', | ||
'absorbanceReader/initialize': 'absorbance_reader_initialize', | ||
'absorbanceReader/read': 'absorbance_reader_read', | ||
} | ||
|
||
type HandledCommands = Extract< | ||
RunTimeCommand, | ||
{ commandType: keyof typeof KEYS_BY_COMMAND_TYPE } | ||
> | ||
|
||
type GetAbsorbanceReaderCommandText = HandlesCommands<HandledCommands> | ||
|
||
export const getAbsorbanceReaderCommandText = ({ | ||
command, | ||
t, | ||
}: GetAbsorbanceReaderCommandText): string => { | ||
if (command.commandType === 'absorbanceReader/initialize') { | ||
const wavelengths = command.params.sampleWavelengths.join(' nm, ') + ` nm` | ||
const mode = | ||
command.params.measureMode === 'multi' ? t('multiple') : t('single') | ||
|
||
return `${t('absorbance_reader_initialize', { | ||
mode, | ||
wavelengths, | ||
})} ${ | ||
command.params.referenceWavelength != null | ||
? t('with_reference_of', { | ||
wavelength: command.params.referenceWavelength, | ||
}) | ||
: '' | ||
}` | ||
} | ||
return t(KEYS_BY_COMMAND_TYPE[command.commandType]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.