Skip to content

Commit

Permalink
move mappings from SimStatus into new file to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brauliorivas committed Jul 14, 2024
1 parent 92cc302 commit 1fcfeab
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion js/lib/getName.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mappings } from "../../data/particles.js";
import { mappings } from "../../mappings/particles.js";

export function getName(pdg) {
const particle = mappings[pdg];
Expand Down
12 changes: 1 addition & 11 deletions js/menu/filter/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { reconnect } from "./reconnect.js";
import { getVisible } from "../../events.js";
import { units } from "../../types/units.js";
import { copyObject } from "../../lib/copy.js";
import { SimStatusBitFieldDisplayValues } from "../../../mappings/sim-status.js";

const filterButton = document.getElementById("filter-button");
const openFilter = document.getElementById("open-filter");
Expand Down Expand Up @@ -60,17 +61,6 @@ let parametersRange = units.sort((a, b) =>

parametersRange = parametersRange.map((parameter) => new Range(parameter));

export const SimStatusBitFieldDisplayValues = {
23: "Overlay",
24: "Stopped",
25: "LeftDetector",
26: "DecayedInCalorimeter",
27: "DecayedInTracker",
28: "VertexIsNotEndpointOfParent",
29: "Backscatter",
30: "CreatedInSimulation",
};

const bits = new BitFieldBuilder(
"simulatorStatus",
"Simulation status",
Expand Down
2 changes: 1 addition & 1 deletion js/types/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { getName } from "../lib/getName.js";
import { linkTypes } from "./links.js";
import { parseCharge } from "../lib/parseCharge.js";
import { SimStatusBitFieldDisplayValues } from "../menu/filter/filter.js";
import { SimStatusBitFieldDisplayValues } from "../../mappings/sim-status.js";

const TOP_MARGIN = 40;

Expand Down
File renamed without changes.
10 changes: 10 additions & 0 deletions mappings/sim-status.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const SimStatusBitFieldDisplayValues = {
23: "Overlay",
24: "Stopped",
25: "LeftDetector",
26: "DecayedInCalorimeter",
27: "DecayedInTracker",
28: "VertexIsNotEndpointOfParent",
29: "Backscatter",
30: "CreatedInSimulation",
};

0 comments on commit 1fcfeab

Please sign in to comment.