Skip to content

Commit

Permalink
add type key to base RTP types
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader committed Mar 14, 2024
1 parent c60bb40 commit 11ad47a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
18 changes: 17 additions & 1 deletion app/src/pages/Protocols/hooks/__tests__/hooks.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,47 +38,63 @@ const mockRTPData = [
displayName: 'Dry Run',
variableName: 'DRYRUN',
description: 'a dry run description',
type: 'boolean',
default: false,
},
{
displayName: 'Use Gripper',
variableName: 'USE_GRIPPER',
description: '',
type: 'boolean',
default: true,
},
{
displayName: 'Trash Tips',
variableName: 'TIP_TRASH',
description: 'throw tip in trash',
type: 'boolean',
default: true,
},
{
displayName: 'Deactivate Temperatures',
variableName: 'DEACTIVATE_TEMP',
description: 'deactivate temperature?',
type: 'boolean',
default: true,
},
{
displayName: 'Columns of Samples',
variableName: 'COLUMNS',
description: '',
suffix: 'mL',
type: 'int',
min: 1,
max: 14,
default: 4,
},
{
displayName: 'PCR Cycles',
variableName: 'PCRCYCLES',
variableName: 'PCR_CYCLES',
description: '',
type: 'int',
min: 1,
max: 10,
default: 6,
},
{
displayName: 'EtoH Volume',
variableName: 'ETOH_VOLUME',
description: '',
type: 'float',
min: 1.5,
max: 10.0,
default: 6.5,
},
{
displayName: 'Default Module Offsets',
variableName: 'DEFAULT_OFFSETS',
description: '',
type: 'str',
choices: [
{
displayName: 'no offsets',
Expand Down
18 changes: 17 additions & 1 deletion app/src/pages/Protocols/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,47 +205,63 @@ export const useRunTimeParameters = (
displayName: 'Dry Run',
variableName: 'DRYRUN',
description: 'a dry run description',
type: 'boolean',
default: false,
},
{
displayName: 'Use Gripper',
variableName: 'USE_GRIPPER',
description: '',
type: 'boolean',
default: true,
},
{
displayName: 'Trash Tips',
variableName: 'TIP_TRASH',
description: 'throw tip in trash',
type: 'boolean',
default: true,
},
{
displayName: 'Deactivate Temperatures',
variableName: 'DEACTIVATE_TEMP',
description: 'deactivate temperature?',
type: 'boolean',
default: true,
},
{
displayName: 'Columns of Samples',
variableName: 'COLUMNS',
description: '',
suffix: 'mL',
type: 'int',
min: 1,
max: 14,
default: 4,
},
{
displayName: 'PCR Cycles',
variableName: 'PCRCYCLES',
variableName: 'PCR_CYCLES',
description: '',
type: 'int',
min: 1,
max: 10,
default: 6,
},
{
displayName: 'EtoH Volume',
variableName: 'ETOH_VOLUME',
description: '',
type: 'float',
min: 1.5,
max: 10.0,
default: 6.5,
},
{
displayName: 'Default Module Offsets',
variableName: 'DEFAULT_OFFSETS',
description: '',
type: 'str',
choices: [
{
displayName: 'no offsets',
Expand Down
13 changes: 8 additions & 5 deletions shared-data/js/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -599,25 +599,28 @@ interface IntParameter {
default: number
}

interface EnumChoice {
interface Choice {
displayName: string
value: string
value: unknown
}

interface EnumParameter {
choices: EnumChoice[]
interface ChoiceParameter {
choices: Choice[]
default: string
}

interface BooleanParameter {
default: boolean
}

type RunTimeParameter = IntParameter | EnumParameter | BooleanParameter
type RunTimeParamterTypes = 'int' | 'float' | 'str' | 'boolean'

type RunTimeParameter = IntParameter | ChoiceParameter | BooleanParameter
interface BaseRunTimeParameters {
displayName: string
variableName: string
description: string
type: RunTimeParamterTypes
suffix?: string
}

Expand Down

0 comments on commit 11ad47a

Please sign in to comment.