Skip to content

Commit d84f15d

Browse files
author
Tamoor Shahid
committed
Merge branch 'main' of github.com:DiamondLightSource/mx-daq-ui into organise_oavmover
2 parents 430d649 + 0824b5a commit d84f15d

21 files changed

+90
-61
lines changed

src/blueapi/visit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { RawValue } from "../pv/types";
2-
import { forceString, ReadPvRawValue } from "../pv/util";
1+
import { RawValue } from "pv/types";
2+
import { forceString, ReadPvRawValue } from "pv/util";
33

44
/**
55
* Read the full visit path from the visit PV set by the beamline staff.

src/components/Extruder/CollectionSetupEx.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { Box, Grid2, Stack } from "@mui/material";
22
import React from "react";
3-
import { ParameterInput } from "../ParameterInputs";
43
import {
54
LaserCheckButtons,
65
PumpProbeSelection,
76
PumpProbeSetup,
87
} from "./PumpProbeSelection";
9-
import { AbortButton, RunPlanButton } from "../../blueapi/BlueapiComponents";
8+
import { ParameterInput } from "components/ParameterInputs";
9+
import { AbortButton, RunPlanButton } from "blueapi/BlueapiComponents";
1010

1111
/**Main collection input window for the extruderpanel. */
1212
export function CollectionSetupEx() {

src/components/Extruder/PumpProbeSelection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import {
55
Select,
66
Tooltip,
77
} from "@mui/material";
8-
import { ParameterInput } from "../ParameterInputs";
8+
import { RunPlanButton } from "blueapi/BlueapiComponents";
9+
import { ParameterInput } from "components/ParameterInputs";
910
import React from "react";
10-
import { RunPlanButton } from "../../blueapi/BlueapiComponents";
1111

1212
export function PumpProbeSelection({
1313
pumpProbe,

src/components/FixedTarget/CollectionSetupFt.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import {
1111
import React from "react";
1212
import { PumpProbeOptions } from "./PumpProbeComponents";
1313
import { MapView } from "./FixedTargetMapComponents";
14-
import { chipTypes, MapTypes, pumpProbeMode } from "../params";
15-
import { AbortButton, RunPlanButton } from "../../blueapi/BlueapiComponents";
16-
import { ParameterInput } from "../ParameterInputs";
14+
import { RunPlanButton, AbortButton } from "blueapi/BlueapiComponents";
15+
import { ParameterInput } from "components/ParameterInputs";
16+
import { pumpProbeMode, chipTypes, MapTypes } from "components/params";
1717

1818
type ParametersProps = {
1919
subDir: string;

src/components/FixedTarget/FixedTargetMapComponents.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import {
1313
ToggleButtonGroup,
1414
Tooltip,
1515
} from "@mui/material";
16+
import { MapTypes } from "components/params";
1617
import React from "react";
17-
import { MapTypes } from "../params";
1818

1919
/**
2020
* Create list of numbered ToggleButtons to add to a ToggleButtonGroup

src/components/FixedTarget/PumpProbeComponents.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import {
1111
TextField,
1212
Tooltip,
1313
} from "@mui/material";
14+
import { EavaRequest, calculateEAVA } from "components/params";
1415
import React from "react";
15-
import { calculateEAVA, EavaRequest } from "../params";
1616

1717
/**
1818
* Opens a dilog showing the calculated laser delay to set for each EAVA setting, given the laser

src/components/OavVideoStream.tsx

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,13 @@
11
import { Box } from "@mui/material";
2-
import { PvComponent } from "../pv/PvComponent";
3-
import { PvItem, PvDescription } from "../pv/types";
2+
import React from "react";
3+
import { useContainerDimensions } from "./OavVideoStreamHelper";
4+
import { PvComponent } from "pv/PvComponent";
5+
import { PvDescription, PvItem } from "pv/types";
46
import {
7+
useParsedPvConnection,
58
parseNumericPv,
69
pvIntArrayToString,
7-
useParsedPvConnection,
8-
} from "../pv/util";
9-
import React from "react";
10-
11-
export const useContainerDimensions = (
12-
ref: React.MutableRefObject<HTMLHeadingElement | null>,
13-
) => {
14-
const [dimensions, setDimensions] = React.useState({ width: 0, height: 0 });
15-
React.useEffect(() => {
16-
const getDimensions = () => ({
17-
width: ref.current?.offsetWidth || 0,
18-
height: ref.current?.offsetWidth || 0,
19-
});
20-
const handleResize = () => {
21-
setDimensions(getDimensions());
22-
};
23-
if (ref.current) {
24-
setDimensions(getDimensions());
25-
}
26-
window.addEventListener("resize", handleResize);
27-
return () => {
28-
window.removeEventListener("resize", handleResize);
29-
};
30-
}, [ref]);
31-
32-
return dimensions;
33-
};
10+
} from "pv/util";
3411

3512
/*
3613
* A viewer which allows overlaying a crosshair (takes numbers which could be the values from a react useState hook)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { useState, useEffect } from "react";
2+
3+
export const useContainerDimensions = (
4+
ref: React.MutableRefObject<HTMLHeadingElement | null>,
5+
) => {
6+
const [dimensions, setDimensions] = useState({ width: 0, height: 0 });
7+
useEffect(() => {
8+
const getDimensions = () => ({
9+
width: ref.current?.offsetWidth || 0,
10+
height: ref.current?.offsetWidth || 0,
11+
});
12+
const handleResize = () => {
13+
setDimensions(getDimensions());
14+
};
15+
if (ref.current) {
16+
setDimensions(getDimensions());
17+
}
18+
window.addEventListener("resize", handleResize);
19+
return () => {
20+
window.removeEventListener("resize", handleResize);
21+
};
22+
}, [ref]);
23+
24+
return dimensions;
25+
};

src/components/ReadOnlyInputs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Grid2 } from "@mui/material";
2-
import { RoPvBox } from "../pv/PvComponent";
2+
import { RoPvBox } from "pv/PvComponent";
33

44
type RoPvAddress = {
55
visit: string;

src/components/SelectionControl.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from "react";
2-
import { PvDescription } from "../pv/types";
3-
import { submitAndRunPlanImmediately } from "../blueapi/blueapi";
2+
import { PvDescription } from "pv/types";
3+
import { submitAndRunPlanImmediately } from "blueapi/blueapi";
44
import { FormControl, InputLabel, MenuItem, Select } from "@mui/material";
5-
import { forceString, useParsedPvConnection } from "../pv/util";
5+
import { forceString, useParsedPvConnection } from "pv/util";
66

77
type SelectionProps = PvDescription & {
88
id: string;

0 commit comments

Comments
 (0)