File tree Expand file tree Collapse file tree 2 files changed +33
-6
lines changed Expand file tree Collapse file tree 2 files changed +33
-6
lines changed Original file line number Diff line number Diff line change 11import React from "react" ;
2- import { abortCurrentPlan } from "./blueapi" ;
2+ import { abortCurrentPlan , submitAndRunPlanImmediately } from "./blueapi" ;
33import {
44 Alert ,
55 Button ,
@@ -8,7 +8,37 @@ import {
88 Tooltip ,
99} from "@mui/material" ;
1010
11- export function RunPlanButton ( ) { }
11+ type PlanButtonProps = {
12+ btnLabel : string ;
13+ planName : string ;
14+ planParams ?: object ;
15+ title ?: string ;
16+ // btnColour?: string;
17+ // btnVariant?: string;
18+ } ;
19+
20+ export function RunPlanButton ( props : PlanButtonProps ) {
21+ const params = props . planParams ? props . planParams : { } ;
22+
23+ return (
24+ < div >
25+ < Tooltip title = { props . title ? props . title : "" } placement = "bottom" >
26+ < Button
27+ variant = "contained"
28+ color = "custom"
29+ onClick = { ( ) =>
30+ submitAndRunPlanImmediately ( {
31+ planName : props . planName ,
32+ planParams : params ,
33+ } )
34+ }
35+ >
36+ { props . btnLabel }
37+ </ Button >
38+ </ Tooltip >
39+ </ div >
40+ ) ;
41+ }
1242
1343export function AbortButton ( ) {
1444 const [ openMsg , setOpenMsg ] = React . useState < boolean > ( false ) ;
Original file line number Diff line number Diff line change @@ -13,10 +13,7 @@ import {
1313import { PvComponent } from "../pv/PvComponent" ;
1414import React from "react" ;
1515import { MapView , PumpProbeOptions } from "../components/CollectionComponents" ;
16- import {
17- abortCurrentPlan ,
18- submitAndRunPlanImmediately ,
19- } from "../blueapi/blueapi" ;
16+ import { submitAndRunPlanImmediately } from "../blueapi/blueapi" ;
2017import { chipTypes , MapTypes , pumpProbeMode } from "../components/params" ;
2118import { forceString } from "../pv/util" ;
2219import { AbortButton } from "../blueapi/BlueapiComponents" ;
You can’t perform that action at this time.
0 commit comments