From 617d008889a6b9640bc9cf8a87d24a5ed24cb660 Mon Sep 17 00:00:00 2001 From: brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> Date: Tue, 2 May 2023 20:39:02 -0400 Subject: debug --- .../nodes/PhysicsBox/PhysicsSimulationBox.tsx | 102 ++++++++++----------- 1 file changed, 47 insertions(+), 55 deletions(-) (limited to 'src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx') diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx b/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx index 5335fc1ec..3cb34d5b9 100644 --- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx +++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx @@ -33,10 +33,9 @@ import { import Typography from "@mui/material/Typography"; import "./PhysicsSimulationBox.scss"; import InputField from "./PhysicsSimulationInputField"; -// import questions from "./PhysicsSimulationQuestions.json"; -// import tutorials from "./PhysicsSimulationTutorial.json"; +import questions from "./PhysicsSimulationQuestions.json"; +import tutorials from "./PhysicsSimulationTutorial.json"; import Wall from "./PhysicsSimulationWall"; -import IWall from "./PhysicsSimulationWall"; import Weight from "./PhysicsSimulationWeight"; interface IWallProps { @@ -211,7 +210,7 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent { - if (this.dataDoc.simulationType != "Circular Motion") { + setupSimulation = (simulationType: string, mode: string) => { + this.dataDoc.simulationPaused = true; + if (simulationType != "Circular Motion") { this.dataDoc.startVelX = 0; this.dataDoc.setStartVelY = 0; this.dataDoc.velocityXDisplay = (0); this.dataDoc.velocityYDisplay = (0); } - if (this.dataDoc.mode == "Freeform") { + if (mode == "Freeform") { this.dataDoc.showForceMagnitudes = (true); - if (this.dataDoc.simulationType == "One Weight") { + if (simulationType == "One Weight") { this.dataDoc.showComponentForces = false; this.dataDoc.startPosY = (this.yMin + this.radius); this.dataDoc.startPosX = ((this.xMax + this.xMin) / 2 - this.radius); @@ -252,7 +252,7 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent )} -
-
- -
-
)} +
+ +