diff --git a/src/pages/MonitoringPage/Components.tsx b/src/pages/MonitoringPage/Components.tsx index 5dc05f6..1e21eb1 100644 --- a/src/pages/MonitoringPage/Components.tsx +++ b/src/pages/MonitoringPage/Components.tsx @@ -103,9 +103,17 @@ export const DirectSpeechInput: React.FC = () => { }; // --- interface for goals/triggers/norms/conditional norms --- +type StatusItem = { + id?: string | number; + achieved?: boolean; + description?: string; + label?: string; + norm?: string; +}; + interface StatusListProps { title: string; - items: any[]; + items: StatusItem[]; type: 'goal' | 'trigger' | 'norm'| 'cond_norm'; } diff --git a/src/pages/MonitoringPage/MonitoringPage.module.css b/src/pages/MonitoringPage/MonitoringPage.module.css index 451b229..1d76c46 100644 --- a/src/pages/MonitoringPage/MonitoringPage.module.css +++ b/src/pages/MonitoringPage/MonitoringPage.module.css @@ -53,12 +53,16 @@ font-weight: bold; } -.pause{ +.pausePlayInactive{ + background-color: gray; +} + +.pausePlayActive{ background-color: green; } .next { - background-color: #ccc; + background-color: lightgray; } .restartPhase{ diff --git a/src/pages/MonitoringPage/MonitoringPage.tsx b/src/pages/MonitoringPage/MonitoringPage.tsx index 1ffee92..e6dbd25 100644 --- a/src/pages/MonitoringPage/MonitoringPage.tsx +++ b/src/pages/MonitoringPage/MonitoringPage.tsx @@ -2,7 +2,7 @@ import React from 'react'; import styles from './MonitoringPage.module.css'; import useProgramStore from "../../utils/programStore.ts"; import { GestureControls, SpeechPresets, DirectSpeechInput, StatusList } from './Components'; -import { nextPhase, resetExperiment, resetPhase } from ".//MonitoringPageAPI.ts" +import { nextPhase, pauseExperiment, playExperiment, resetExperiment, resetPhase } from ".//MonitoringPageAPI.ts" type Goal = { id?: string | number; description?: string; achieved?: boolean }; type Trigger = { id?: string | number; label?: string ; achieved?: boolean }; @@ -17,9 +17,10 @@ const MonitoringPage: React.FC = () => { // Can be used to block actions until feedback from CB. const [loading, setLoading] = React.useState(false); + const [isPlaying, setIsPlaying] = React.useState(false); const phaseIds = getPhaseIds(); - const [phaseIndex, setPhaseIndex] = React.useState(0); + const [phaseIndex, _] = React.useState(0); if (phaseIds.length === 0) { return

No program loaded.

; @@ -37,6 +38,12 @@ const MonitoringPage: React.FC = () => { try { setLoading(true); switch (button) { + case "pause": + await pauseExperiment(); + break; + case "play": + await playExperiment(); + break; case "nextPhase": await nextPhase(); break; @@ -73,7 +80,27 @@ const MonitoringPage: React.FC = () => {

Experiment Controls

- + {/*Pause button*/} + + + {/*Play button*/} + + + {/*Next button*/} + + {/*Restart Phase button*/} + + {/*Restart Experiment button*/}