From c93e1dc281c831ab08cf0ce29420df845323b0be Mon Sep 17 00:00:00 2001
From: brynnchernosky <56202540+brynnchernosky@users.noreply.github.com>
Date: Mon, 1 May 2023 20:05:49 -0400
Subject: debugging

---
 .../nodes/PhysicsBox/PhysicsSimulationBox.tsx      | 86 +++++++++++++++-------
 1 file changed, 59 insertions(+), 27 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 671466261..56c61c4f1 100644
--- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx
+++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationBox.tsx
@@ -38,7 +38,13 @@ import tutorials from "./PhysicsSimulationTutorial.json";
 import Wall from "./PhysicsSimulationWall";
 import IWall from "./PhysicsSimulationWall";
 import Weight from "./PhysicsSimulationWeight";
-import IForce from "./PhysicsSimulationWeight";
+
+interface IForce {
+  description: string;
+  magnitude: number;
+  directionInDegrees: number;
+  component: boolean;
+}
 interface VectorTemplate {
   top: number;
   left: number;
@@ -833,7 +839,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
             <InputField
               label={<p>Gravity magnitude</p>}
               lowerBound={0}
-              changeValue={this.dataDoc.reviewGravityMagnitude}
+              dataDoc={this.dataDoc}
+              prop={'reviewGravityMagnitude'}
               step={0.1}
               unit={"N"}
               upperBound={50}
@@ -851,7 +858,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
             <InputField
               label={<p>Gravity angle</p>}
               lowerBound={0}
-              changeValue={this.dataDoc.reviewGravityAngle}
+              dataDoc={this.dataDoc}
+              prop={'reviewGravityAngle'}
               step={1}
               unit={"°"}
               upperBound={360}
@@ -870,7 +878,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
             <InputField
               label={<p>Normal force magnitude</p>}
               lowerBound={0}
-              changeValue={this.dataDoc.reviewNormalMagnitude}
+              dataDoc={this.dataDoc}
+              prop={'reviewNormalMagnitude'}
               step={0.1}
               unit={"N"}
               upperBound={50}
@@ -888,7 +897,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
             <InputField
               label={<p>Normal force angle</p>}
               lowerBound={0}
-              changeValue={this.dataDoc.reviewNormalAngle}
+              dataDoc={this.dataDoc}
+              prop={'reviewNormalAngle'}
               step={1}
               unit={"°"}
               upperBound={360}
@@ -907,7 +917,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
             <InputField
               label={<p>Static friction magnitude</p>}
               lowerBound={0}
-              changeValue={this.dataDoc.reviewStaticMagnitude}
+              dataDoc={this.dataDoc}
+              prop={'reviewStaticMagnitude'}
               step={0.1}
               unit={"N"}
               upperBound={50}
@@ -925,7 +936,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
             <InputField
               label={<p>Static friction angle</p>}
               lowerBound={0}
-              changeValue={this.dataDoc.reviewStaticAngle}
+              dataDoc={this.dataDoc}
+              prop={'reviewStaticAngle'}
               step={1}
               unit={"°"}
               upperBound={360}
@@ -948,7 +960,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                 </Box>
               }
               lowerBound={0}
-              changeValue={this.dataDoc.coefficientOfStaticFriction}
+              dataDoc={this.dataDoc}
+              prop={'coefficientOfStaticFriction'}
               step={0.1}
               unit={""}
               upperBound={1}
@@ -966,7 +979,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
             <InputField
               label={<Box>&theta;</Box>}
               lowerBound={0}
-              changeValue={this.dataDoc.qedgeAngle}
+              dataDoc={this.dataDoc}
+              prop={'wedgeAngle'}
               step={1}
               unit={"°"}
               upperBound={49}
@@ -1756,7 +1770,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                 <InputField
                   label={<Box>Speed</Box>}
                   lowerBound={1}
-                  changeValue={this.dataDoc.simulationSpeed} //TODO - deal with input field change value now that datadoc is being used!
+                  dataDoc={this.dataDoc}
+                  prop={'simulationSpeed'}
                   step={1}
                   unit={"x"}
                   upperBound={10}
@@ -1767,7 +1782,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                   <InputField
                     label={<Box>Gravity</Box>}
                     lowerBound={-30}
-                    changeValue={this.dataDoc.gravity}
+                    dataDoc={this.dataDoc}
+                    prop={'gravity'}
                     step={0.01}
                     unit={"m/s2"}
                     upperBound={0}
@@ -1782,7 +1798,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                   <InputField
                     label={<Box>Mass</Box>}
                     lowerBound={1}
-                    changeValue={this.dataDoc.mass}
+                    dataDoc={this.dataDoc}
+                    prop={'mass'}
                     step={0.1}
                     unit={"kg"}
                     upperBound={5}
@@ -1797,7 +1814,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                   <InputField
                     label={<Box>Red mass</Box>}
                     lowerBound={1}
-                    changeValue={this.dataDoc.mass}
+                    dataDoc={this.dataDoc}
+                    prop={'mass'}
                     step={0.1}
                     unit={"kg"}
                     upperBound={5}
@@ -1812,7 +1830,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                   <InputField
                     label={<Box>Blue mass</Box>}
                     lowerBound={1}
-                    changeValue={this.dataDoc.mass2}
+                    dataDoc={this.dataDoc}
+                    prop={'mass2'}
                     step={0.1}
                     unit={"kg"}
                     upperBound={5}
@@ -1827,7 +1846,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                   <InputField
                     label={<Box>Rod length</Box>}
                     lowerBound={100}
-                    changeValue={this.dataDoc.circularMotionRadius}
+                    dataDoc={this.dataDoc}
+                    prop={'circularMotionRadius'}
                     step={5}
                     unit={"kg"}
                     upperBound={250}
@@ -1847,7 +1867,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                     <Typography color="inherit">Spring stiffness</Typography>
                   }
                   lowerBound={0.1}
-                  changeValue={this.dataDoc.springConstant}
+                  dataDoc={this.dataDoc}
+                  prop={'springConstant'}
                   step={1}
                   unit={"N/m"}
                   upperBound={500}
@@ -1862,7 +1883,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                 <InputField
                   label={<Typography color="inherit">Rest length</Typography>}
                   lowerBound={10}
-                  changeValue={this.dataDoc.springRestLength}
+                  dataDoc={this.dataDoc}
+                  prop={'springRestLength'}
                   step={100}
                   unit={""}
                   upperBound={500}
@@ -1881,7 +1903,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                     </Typography>
                   }
                   lowerBound={-(this.dataDoc.springRestLength - 10)}
-                  changeValue={(val: number) => {}}
+                  dataDoc={this.dataDoc}
+                  prop={""}
                   step={10}
                   unit={""}
                   upperBound={this.dataDoc.springRestLength}
@@ -1902,7 +1925,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                 <InputField
                   label={<Box>&theta;</Box>}
                   lowerBound={0}
-                  changeValue={this.dataDoc.wedgeAngle}
+                  dataDoc={this.dataDoc}
+                  prop={'wedgeAngle'}
                   step={1}
                   unit={"°"}
                   upperBound={49}
@@ -1922,7 +1946,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                     </Box>
                   }
                   lowerBound={0}
-                  changeValue={this.dataDoc.coefficientOfStaticFriction}
+                  dataDoc={this.dataDoc}
+                  prop={'coefficientOfStaticFriction'}
                   step={0.1}
                   unit={""}
                   upperBound={1}
@@ -1944,7 +1969,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                     </Box>
                   }
                   lowerBound={0}
-                  changeValue={this.dataDoc.coefficientOfKineticFriction}
+                  dataDoc={this.dataDoc}
+                  prop={'coefficientOfKineticFriction'}
                   step={0.1}
                   unit={""}
                   upperBound={Number(this.dataDoc.coefficientOfStaticFriction)}
@@ -1981,7 +2007,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                 <InputField
                   label={<Box>Angle</Box>}
                   lowerBound={0}
-                  changeValue={this.dataDoc.pendulumAngle}
+                  dataDoc={this.dataDoc}
+                  prop={'pendulumAngle'}
                   step={1}
                   unit={"°"}
                   upperBound={59}
@@ -2071,7 +2098,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                 <InputField
                   label={<Box>Rod length</Box>}
                   lowerBound={0}
-                  changeValue={this.dataDoc.pendulumLength}
+                  dataDoc={this.dataDoc}
+                  prop={'pendulumLength'}
                   step={1}
                   unit={"m"}
                   upperBound={400}
@@ -2134,7 +2162,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                       >
                         <InputField
                           lowerBound={0}
-                          changeValue={this.dataDoc.positionXDisplay}
+                          dataDoc={this.dataDoc}
+                          prop={'positionXDisplay'}
                           step={1}
                           unit={"m"}
                           upperBound={this.xMax - 110}
@@ -2171,7 +2200,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                       >
                         <InputField
                           lowerBound={0}
-                          changeValue={this.dataDoc.positionYDisplay}
+                          dataDoc={this.dataDoc}
+                          prop={'positionYDisplay'}
                           step={1}
                           unit={"m"}
                           upperBound={this.yMax - 110}
@@ -2216,7 +2246,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                       >
                         <InputField
                           lowerBound={-50}
-                          changeValue={this.dataDoc.velocityXDisplay}
+                          dataDoc={this.dataDoc}
+                          prop={'velocityXDisplay'}
                           step={1}
                           unit={"m/s"}
                           upperBound={50}
@@ -2243,7 +2274,8 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                     >
                       <InputField
                         lowerBound={-50}
-                        changeValue={this.dataDoc.velocityYDisplay}
+                        dataDoc={this.dataDoc}
+                        prop={'velocityYDisplay'}
                         step={1}
                         unit={"m/s"}
                         upperBound={50}
-- 
cgit v1.2.3-70-g09d2

