Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tizayi committed Sep 28, 2023
1 parent 2021068 commit 6984eb2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
5 changes: 5 additions & 0 deletions src/calculations/qvalue.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { expect, test } from "vitest";

test("Test getting q from pixel position ", () => {
console.log("write some tests here");
});
2 changes: 1 addition & 1 deletion src/calculations/qvalue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ export const getPointForQ = (
);
return ray.getPointAtDistance(
1.0e3 *
(calculateDistanceFromQValue(qValue, cameralength, wavelength) ?? 0),
(calculateDistanceFromQValue(qValue, cameralength, wavelength) ?? 0),
);
};
15 changes: 7 additions & 8 deletions src/plot/centrePlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
SvgRect,
SvgLine,
} from "@h5web/lib";
// Need to find those damn types
// Need to find those damn h5lib types
import { Vector2, Vector3 } from "three";
import { useBeamstopStore } from "../data-entry/beamstopStore";
import { useDetectorStore } from "../data-entry/detectorStore";
Expand Down Expand Up @@ -132,19 +132,18 @@ export default function CentrePlot(): JSX.Element {
const requestedMax = getPointForQ(
resultStore.requestedRange.max * 1e9,
bealineConfig.angle ?? 0,
(bealineConfig.cameraLength ?? 0),
bealineConfig.cameraLength ?? 0,
(bealineConfig.wavelength ?? 0) * 1e-9,
ajustedBeamstop,
);
const requestedMin = getPointForQ(
resultStore.requestedRange.min * 1e9,
bealineConfig.angle ?? 0,
(bealineConfig.cameraLength ?? 0),
bealineConfig.cameraLength ?? 0,
(bealineConfig.wavelength ?? 0) * 1e-9,
ajustedBeamstop,
);


return (
<Box>
<Stack direction="column" spacing={2}>
Expand Down Expand Up @@ -177,14 +176,14 @@ export default function CentrePlot(): JSX.Element {
),
new Vector3(
(ajustedBeamstop.centre.x ?? 0) +
ajustedBeamstop.diameter / 2,
ajustedBeamstop.diameter / 2,
ajustedBeamstop.centre.y ?? 0,
),
new Vector3(
ajustedBeamstop.centre.x ?? 0,
(ajustedBeamstop.centre.y ?? 0) +
ajustedBeamstop.diameter / 2 +
(ajustedBeamstop.clearance ?? 0),
ajustedBeamstop.diameter / 2 +
(ajustedBeamstop.clearance ?? 0),
),
new Vector3(
ajustedCameraTube.centre.x ?? 0,
Expand All @@ -193,7 +192,7 @@ export default function CentrePlot(): JSX.Element {
new Vector3(
ajustedCameraTube.centre.x ?? 0,
(ajustedCameraTube.centre.y ?? 0) +
ajustedCameraTube.diameter / 2,
ajustedCameraTube.diameter / 2,
),
new Vector3(0, 0),
new Vector3(
Expand Down

0 comments on commit 6984eb2

Please sign in to comment.