@@ -30,7 +30,11 @@ import { PvDescription } from "../pv/types";
3030import { SelectionWithPlanRunner } from "../components/SelectionControl" ;
3131import { BacklightPositions , ZoomLevels } from "../pv/enumPvValues" ;
3232import oxfordChipDiagram from "../assets/Oxford Chip Diagram.excalidraw.svg" ;
33- import { RunPlanButton } from "../blueapi/BlueapiComponents" ;
33+ import {
34+ parseInstrumentSession ,
35+ readVisitFromPv ,
36+ RunPlanButton ,
37+ } from "../blueapi/BlueapiComponents" ;
3438
3539const buttonStyle = {
3640 color : "white" ,
@@ -391,6 +395,9 @@ export function OavMover() {
391395 const [ pixelsPerMicron , setPixelsPerMicron ] = useState < number > ( 1.25 ) ;
392396 const theme = useTheme ( ) ;
393397 const bgColor = theme . palette . background . paper ;
398+
399+ const fullVisit = readVisitFromPv ( ) ;
400+
394401 return (
395402 < div >
396403 < Grid2 container spacing = { 2 } columns = { 12 } >
@@ -412,11 +419,15 @@ export function OavMover() {
412419 "Not submitting plan while disconnected from PVs!"
413420 ) ;
414421 } else {
422+ // This is an example but not useful for actual production use.
415423 submitAndRunPlanImmediately ( {
416424 planName : "gui_gonio_move_on_click" ,
417- planParams : {
418- position_px : [ x_int , y_int ] ,
419- } ,
425+ planParams : { position_px : [ x_int , y_int ] } ,
426+ instrumentSession : parseInstrumentSession ( fullVisit ) ,
427+ } ) . catch ( ( error ) => {
428+ console . log (
429+ `Failed to run plan gui_gonio_move_on_click, see console and logs for full error. Reason: ${ error } `
430+ ) ;
420431 } ) ;
421432 }
422433 } }
0 commit comments