Skip to content

Commit

Permalink
bump JSON version, minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan2423 committed Dec 21, 2023
1 parent d38d709 commit 2ea569f
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 51 deletions.
2 changes: 1 addition & 1 deletion src/ThreeEditor/Simulation/Detectors/DetectorManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class DetectorManager
{
/****************************Private****************************/
private readonly metadata = {
version: `0.11`,
version: `0.12`,
type: 'Manager',
generator: 'DetectorManager.toJSON'
} as {
Expand Down
2 changes: 1 addition & 1 deletion src/ThreeEditor/Simulation/Figures/FigureManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class FigureManager
{
/****************************Private****************************/
private readonly metadata = {
version: `0.11`, //update this to current YaptideEditor version when format changes
version: `0.12`, //update this to current YaptideEditor version when format changes
type: 'Manager',
generator: 'FigureManager.toJSON'
} satisfies Record<string, string | number>;
Expand Down
2 changes: 1 addition & 1 deletion src/ThreeEditor/Simulation/Materials/MaterialManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type Icru = number;
export class MaterialManager extends THREE.Object3D implements SimulationPropertiesType {
/****************************Private****************************/
private readonly metadata = {
version: `0.11`,
version: `0.12`,
type: 'Manager',
generator: 'MaterialManager.toJSON'
} as {
Expand Down
10 changes: 3 additions & 7 deletions src/ThreeEditor/Simulation/Scoring/ScoringManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SimulationSceneContainer } from '../Base/SimulationContainer';
import { SimulationElement, SimulationElementJSON } from '../Base/SimulationElement';
import { SimulationElementManager } from '../Base/SimulationManager';
import { CustomFilter, isCustomFilterJSON } from './CustomFilter';
import { isParticleFilterJSON,ParticleFilter } from './ParticleFilter';
import { isParticleFilterJSON, ParticleFilter } from './ParticleFilter';
import { FilterJSON, ScoringFilter } from './ScoringFilter';
import { ScoringOutput, ScoringOutputJSON as OutputJSON } from './ScoringOutput';
import { ScoringQuantity } from './ScoringQuantity';
Expand Down Expand Up @@ -64,7 +64,7 @@ export class ScoringManager
{
/****************************Private****************************/
private readonly metadata = {
version: `0.11`,
version: `0.12`,
type: 'Manager',
generator: 'ScoringManager.toJSON'
} as {
Expand Down Expand Up @@ -116,11 +116,7 @@ export class ScoringManager

getFilterOptions(): Record<string, string> {
const options = this.filters
.filter(filter => {
if (filter instanceof CustomFilter) return filter.rules.length;

return true;
})
.filter(filter => (filter instanceof CustomFilter ? filter.rules.length : true))
.reduce(
(acc, filter) => {
acc[filter.uuid] = `${filter.name} [${filter.id}]`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class SpecialComponentManager
{
/****************************Private****************************/
private readonly metadata = {
version: `0.11`,
version: `0.12`,
type: 'Manager',
generator: 'SpecialComponentManager.toJSON'
} as {
Expand Down
2 changes: 1 addition & 1 deletion src/ThreeEditor/Simulation/Zones/ZoneManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class ZoneManager
{
/****************************Private****************************/
private readonly metadata = {
version: `0.11`,
version: `0.12`,
type: 'Manager',
generator: 'ZoneManager.toJSON'
} as {
Expand Down
14 changes: 7 additions & 7 deletions src/ThreeEditor/examples/ex1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"input": {
"inputJson": {
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Editor",
"generator": "YaptideEditor.toJSON"
},
Expand Down Expand Up @@ -48,7 +48,7 @@
"name": "Figure Manager",
"type": "FigureManager",
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "FigureManager.toJSON"
},
Expand Down Expand Up @@ -93,7 +93,7 @@
"name": "Zones",
"type": "ZoneManager",
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "ZoneManager.toJSON"
},
Expand Down Expand Up @@ -160,7 +160,7 @@
"name": "DetectManager",
"type": "DetectorManager",
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "DetectorManager.toJSON"
},
Expand Down Expand Up @@ -248,7 +248,7 @@
"name": "Special Components",
"type": "SpecialComponentManager",
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "SpecialComponentManager.toJSON"
}
Expand Down Expand Up @@ -292,7 +292,7 @@
"1dd2e8f0-6684-42c2-ad35-7aa55358204e": 1
},
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "MaterialManager.toJSON"
}
Expand Down Expand Up @@ -582,7 +582,7 @@
}]
}],
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "ScoringManager.toJSON"
}
Expand Down
14 changes: 7 additions & 7 deletions src/ThreeEditor/examples/ex2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"input": {
"inputJson": {
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Editor",
"generator": "YaptideEditor.toJSON"
},
Expand Down Expand Up @@ -48,7 +48,7 @@
"name": "Figure Manager",
"type": "FigureManager",
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "FigureManager.toJSON"
},
Expand Down Expand Up @@ -140,7 +140,7 @@
"name": "Zones",
"type": "ZoneManager",
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "ZoneManager.toJSON"
},
Expand Down Expand Up @@ -268,7 +268,7 @@
"name": "DetectManager",
"type": "DetectorManager",
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "DetectorManager.toJSON"
},
Expand Down Expand Up @@ -299,7 +299,7 @@
"name": "Special Components",
"type": "SpecialComponentManager",
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "SpecialComponentManager.toJSON"
}
Expand Down Expand Up @@ -346,7 +346,7 @@
"334be148-f344-4156-a7c2-80c0c83bc9ea": 2
},
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "MaterialManager.toJSON"
}
Expand Down Expand Up @@ -431,7 +431,7 @@
}]
}],
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "ScoringManager.toJSON"
}
Expand Down
14 changes: 7 additions & 7 deletions src/ThreeEditor/examples/ex3.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"metadata": {
"generator": "DetectorManager.toJSON",
"type": "Manager",
"version": "0.11"
"version": "0.12"
},
"name": "DetectManager",
"type": "DetectorManager",
Expand Down Expand Up @@ -193,7 +193,7 @@
"metadata": {
"generator": "FigureManager.toJSON",
"type": "Manager",
"version": "0.11"
"version": "0.12"
},
"name": "Figure Manager",
"type": "FigureManager",
Expand Down Expand Up @@ -239,7 +239,7 @@
"metadata": {
"generator": "MaterialManager.toJSON",
"type": "Manager",
"version": "0.11"
"version": "0.12"
},
"name": "Material Manager",
"selectedMaterials": {
Expand All @@ -254,7 +254,7 @@
"metadata": {
"generator": "YaptideEditor.toJSON",
"type": "Editor",
"version": "0.11"
"version": "0.12"
},
"physic": {
"availableStoppingPowerFiles": {},
Expand Down Expand Up @@ -372,7 +372,7 @@
"metadata": {
"generator": "ScoringManager.toJSON",
"type": "Manager",
"version": "0.11"
"version": "0.12"
},
"name": "Outputs",
"outputs": [
Expand Down Expand Up @@ -564,7 +564,7 @@
"metadata": {
"generator": "SpecialComponentManager.toJSON",
"type": "Manager",
"version": "0.11"
"version": "0.12"
},
"name": "Special Components",
"type": "SpecialComponentManager",
Expand All @@ -574,7 +574,7 @@
"metadata": {
"generator": "ZoneManager.toJSON",
"type": "Manager",
"version": "0.11"
"version": "0.12"
},
"name": "Zones",
"type": "ZoneManager",
Expand Down
14 changes: 7 additions & 7 deletions src/ThreeEditor/examples/ex4.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"input": {
"inputJson": {
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Editor",
"generator": "YaptideEditor.toJSON"
},
Expand Down Expand Up @@ -48,7 +48,7 @@
"name": "Figure Manager",
"type": "FigureManager",
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "FigureManager.toJSON"
},
Expand Down Expand Up @@ -127,7 +127,7 @@
"name": "Zones",
"type": "ZoneManager",
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "ZoneManager.toJSON"
},
Expand Down Expand Up @@ -262,7 +262,7 @@
"name": "DetectManager",
"type": "DetectorManager",
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "DetectorManager.toJSON"
},
Expand Down Expand Up @@ -333,7 +333,7 @@
"name": "Special Components",
"type": "SpecialComponentManager",
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "SpecialComponentManager.toJSON"
}
Expand Down Expand Up @@ -385,7 +385,7 @@
"b588ae88-8aca-41c8-abb1-a0d9833d107e": 1
},
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "MaterialManager.toJSON"
}
Expand Down Expand Up @@ -553,7 +553,7 @@
}]
}],
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "ScoringManager.toJSON"
}
Expand Down
14 changes: 7 additions & 7 deletions src/ThreeEditor/examples/ex5.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"input": {
"inputJson": {
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Editor",
"generator": "YaptideEditor.toJSON"
},
Expand Down Expand Up @@ -48,7 +48,7 @@
"name": "Figure Manager",
"type": "FigureManager",
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "FigureManager.toJSON"
},
Expand Down Expand Up @@ -127,7 +127,7 @@
"name": "Zones",
"type": "ZoneManager",
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "ZoneManager.toJSON"
},
Expand Down Expand Up @@ -280,7 +280,7 @@
"name": "DetectManager",
"type": "DetectorManager",
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "DetectorManager.toJSON"
},
Expand Down Expand Up @@ -351,7 +351,7 @@
"name": "Special Components",
"type": "SpecialComponentManager",
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "SpecialComponentManager.toJSON"
}
Expand Down Expand Up @@ -400,7 +400,7 @@
"b588ae88-8aca-41c8-abb1-a0d9833d107e": 1
},
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "MaterialManager.toJSON"
}
Expand Down Expand Up @@ -568,7 +568,7 @@
}]
}],
"metadata": {
"version": "0.11",
"version": "0.12",
"type": "Manager",
"generator": "ScoringManager.toJSON"
}
Expand Down
Loading

0 comments on commit 2ea569f

Please sign in to comment.