Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/blueapi/visit.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RawValue } from "../pv/types";
import { forceString, ReadPvRawValue } from "../pv/util";
import { RawValue } from "pv/types";
import { forceString, ReadPvRawValue } from "pv/util";

/**
* Read the full visit path from the visit PV set by the beamline staff.
Expand Down
4 changes: 2 additions & 2 deletions src/components/Extruder/CollectionSetupEx.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Box, Grid2, Stack } from "@mui/material";
import React from "react";
import { ParameterInput } from "../ParameterInputs";
import {
LaserCheckButtons,
PumpProbeSelection,
PumpProbeSetup,
} from "./PumpProbeSelection";
import { AbortButton, RunPlanButton } from "../../blueapi/BlueapiComponents";
import { ParameterInput } from "components/ParameterInputs";
import { AbortButton, RunPlanButton } from "blueapi/BlueapiComponents";

/**Main collection input window for the extruderpanel. */
export function CollectionSetupEx() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Extruder/PumpProbeSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
Select,
Tooltip,
} from "@mui/material";
import { ParameterInput } from "../ParameterInputs";
import { RunPlanButton } from "blueapi/BlueapiComponents";
import { ParameterInput } from "components/ParameterInputs";
import React from "react";
import { RunPlanButton } from "../../blueapi/BlueapiComponents";

export function PumpProbeSelection({
pumpProbe,
Expand Down
6 changes: 3 additions & 3 deletions src/components/FixedTarget/CollectionSetupFt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
import React from "react";
import { PumpProbeOptions } from "./PumpProbeComponents";
import { MapView } from "./FixedTargetMapComponents";
import { chipTypes, MapTypes, pumpProbeMode } from "../params";
import { AbortButton, RunPlanButton } from "../../blueapi/BlueapiComponents";
import { ParameterInput } from "../ParameterInputs";
import { RunPlanButton, AbortButton } from "blueapi/BlueapiComponents";
import { ParameterInput } from "components/ParameterInputs";
import { pumpProbeMode, chipTypes, MapTypes } from "components/params";

type ParametersProps = {
subDir: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/FixedTarget/FixedTargetMapComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
ToggleButtonGroup,
Tooltip,
} from "@mui/material";
import { MapTypes } from "components/params";
import React from "react";
import { MapTypes } from "../params";

/**
* Create list of numbered ToggleButtons to add to a ToggleButtonGroup
Expand Down
2 changes: 1 addition & 1 deletion src/components/FixedTarget/PumpProbeComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
TextField,
Tooltip,
} from "@mui/material";
import { EavaRequest, calculateEAVA } from "components/params";
import React from "react";
import { calculateEAVA, EavaRequest } from "../params";

/**
* Opens a dilog showing the calculated laser delay to set for each EAVA setting, given the laser
Expand Down
12 changes: 6 additions & 6 deletions src/components/OavVideoStream.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Box } from "@mui/material";
import { PvComponent } from "../pv/PvComponent";
import { PvItem, PvDescription } from "../pv/types";
import React from "react";
import { useContainerDimensions } from "./OavVideoStreamHelper";
import { PvComponent } from "pv/PvComponent";
import { PvDescription, PvItem } from "pv/types";
import {
useParsedPvConnection,
parseNumericPv,
pvIntArrayToString,
useParsedPvConnection,
} from "../pv/util";
import React from "react";
import { useContainerDimensions } from "./OavVideoStreamHelper";
} from "pv/util";

/*
* A viewer which allows overlaying a crosshair (takes numbers which could be the values from a react useState hook)
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReadOnlyInputs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Grid2 } from "@mui/material";
import { RoPvBox } from "../pv/PvComponent";
import { RoPvBox } from "pv/PvComponent";

type RoPvAddress = {
visit: string;
Expand Down
6 changes: 3 additions & 3 deletions src/components/SelectionControl.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import { PvDescription } from "../pv/types";
import { submitAndRunPlanImmediately } from "../blueapi/blueapi";
import { PvDescription } from "pv/types";
import { submitAndRunPlanImmediately } from "blueapi/blueapi";
import { FormControl, InputLabel, MenuItem, Select } from "@mui/material";
import { forceString, useParsedPvConnection } from "../pv/util";
import { forceString, useParsedPvConnection } from "pv/util";

type SelectionProps = PvDescription & {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/SerialNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
type ImageColourSchemeSwitchType,
} from "@diamondlightsource/sci-react-ui";
import { Link } from "react-router-dom";
import i24ssx from "../assets/i24ssx.svg";
import i24ssx from "assets/i24ssx.svg";

const ssxLogo: ImageColourSchemeSwitchType = {
src: i24ssx,
Expand Down
2 changes: 1 addition & 1 deletion src/components/WorkerStatus.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Grid2, Stack, Typography } from "@mui/material";

import { processUseBlueApiCall, useBlueApiCall } from "../blueapi/blueapi";
import { processUseBlueApiCall, useBlueApiCall } from "blueapi/blueapi";
import { useState } from "react";

export function WorkerStatus() {
Expand Down
6 changes: 3 additions & 3 deletions src/routes/BeamlineI24.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Box, Tab, Tabs, useTheme } from "@mui/material";
import { BeamlineStatsTabPanel } from "../screens/BeamlineStats";
import { DetectorMotionTabPanel } from "../screens/DetectorMotion";
import { OavMover } from "../screens/OavMover";
import { BeamlineStatsTabPanel } from "screens/BeamlineStats";
import { DetectorMotionTabPanel } from "screens/DetectorMotion";
import { OavMover } from "screens/OavMover";
import React from "react";

interface TabPanelProps {
Expand Down
4 changes: 2 additions & 2 deletions src/routes/Extruder.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Typography, useTheme } from "@mui/material";
import { ReadOnlyInputs } from "../components/ReadOnlyInputs";
import { ParamsPanel } from "../screens/CollectionPanel";
import { ReadOnlyInputs } from "components/ReadOnlyInputs";
import { ParamsPanel } from "screens/CollectionPanel";

export function Extruder() {
const theme = useTheme();
Expand Down
4 changes: 2 additions & 2 deletions src/routes/FixedTarget.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Typography, useTheme } from "@mui/material";
import { ParamsPanel } from "../screens/CollectionPanel";
import { ReadOnlyInputs } from "../components/ReadOnlyInputs";
import { ParamsPanel } from "screens/CollectionPanel";
import { ReadOnlyInputs } from "components/ReadOnlyInputs";

export function FixedTarget() {
const theme = useTheme();
Expand Down
8 changes: 4 additions & 4 deletions src/screens/BeamlineStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {
Typography,
useTheme,
} from "@mui/material";
import { PvItem } from "../pv/types";
import { PvComponent } from "../pv/PvComponent";
import { forceString, parseNumericPv } from "../pv/util";
import { WorkerStatus } from "../components/WorkerStatus";
import { PvItem } from "pv/types";
import { PvComponent } from "pv/PvComponent";
import { forceString, parseNumericPv } from "pv/util";
import { WorkerStatus } from "components/WorkerStatus";

type StateBoxProps = {
children: React.ReactNode;
Expand Down
4 changes: 2 additions & 2 deletions src/screens/CollectionPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Typography } from "@mui/material";
import { CollectionSetupFt } from "../components/FixedTarget/CollectionSetupFt";
import { CollectionSetupEx } from "../components/Extruder/CollectionSetupEx";
import { CollectionSetupFt } from "components/FixedTarget/CollectionSetupFt";
import { CollectionSetupEx } from "components/Extruder/CollectionSetupEx";

type ExptType = {
expt: "extruder" | "fixed-target";
Expand Down
4 changes: 2 additions & 2 deletions src/screens/DetectorMotion.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Stack, Box, useTheme } from "@mui/material";
import { RoPvBox } from "../pv/PvComponent";
import { RunPlanButton } from "../blueapi/BlueapiComponents";
import { RoPvBox } from "pv/PvComponent";
import { RunPlanButton } from "blueapi/BlueapiComponents";

function DetectorState() {
const theme = useTheme();
Expand Down
18 changes: 9 additions & 9 deletions src/screens/OavMover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
useTheme,
Drawer,
} from "@mui/material";
import { OavVideoStream } from "../components/OavVideoStream";
import { OavVideoStream } from "components/OavVideoStream";
import {
ArrowBackRounded,
ArrowDownwardRounded,
Expand All @@ -24,14 +24,14 @@ import {
import { useState } from "react";

import React from "react";
import { submitAndRunPlanImmediately } from "../blueapi/blueapi";
import { CoordNumberInput } from "../components/CoordNumberInput";
import { PvDescription } from "../pv/types";
import { SelectionWithPlanRunner } from "../components/SelectionControl";
import { BacklightPositions, ZoomLevels } from "../pv/enumPvValues";
import oxfordChipDiagram from "../assets/Oxford Chip Diagram.excalidraw.svg";
import { RunPlanButton } from "../blueapi/BlueapiComponents";
import { parseInstrumentSession, readVisitFromPv } from "../blueapi/visit";
import { submitAndRunPlanImmediately } from "blueapi/blueapi";
import { CoordNumberInput } from "components/CoordNumberInput";
import { PvDescription } from "pv/types";
import { SelectionWithPlanRunner } from "components/SelectionControl";
import { BacklightPositions, ZoomLevels } from "pv/enumPvValues";
import oxfordChipDiagram from "assets/Oxford Chip Diagram.excalidraw.svg";
import { RunPlanButton } from "blueapi/BlueapiComponents";
import { parseInstrumentSession, readVisitFromPv } from "blueapi/visit";

const buttonStyle = {
color: "white",
Expand Down
5 changes: 5 additions & 0 deletions tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"module": "ESNext",
"skipLibCheck": true,

"baseUrl": "./",
"paths": {
"*": ["./src/*"]
},

/* Bundler mode */
"moduleResolution": "Bundler",
"allowImportingTsExtensions": true,
Expand Down
6 changes: 6 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import path from "path";

// https://vite.dev/config/
export default defineConfig({
Expand All @@ -10,5 +11,10 @@ export default defineConfig({
VITE_PVWS_SSL: "true",
},
},
resolve: {
alias: {
"": path.resolve(__dirname, "./src"),
},
},
base: "/mx-daq-ui/",
});
11 changes: 11 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
import path from "path";
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
environment: "jsdom",
},
resolve: {
alias: {
assets: path.resolve(__dirname, "./src/assets"),
blueapi: path.resolve(__dirname, "./src/blueapi"),
components: path.resolve(__dirname, "./src/components"),
pv: path.resolve(__dirname, "./src/pv"),
routes: path.resolve(__dirname, "./src/routes"),
screens: path.resolve(__dirname, "./src/screens"),
},
},
});