From 8428ad5be1d49c8985a59b442823ceaa33005aa6 Mon Sep 17 00:00:00 2001
From: brynnchernosky <56202540+brynnchernosky@users.noreply.github.com>
Date: Fri, 17 Feb 2023 23:29:10 -0500
Subject: debugging datadoc not working

---
 src/client/views/nodes/PhysicsSimulationBox.tsx | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

(limited to 'src/client/views/nodes/PhysicsSimulationBox.tsx')

diff --git a/src/client/views/nodes/PhysicsSimulationBox.tsx b/src/client/views/nodes/PhysicsSimulationBox.tsx
index 25777ce18..f9baac431 100644
--- a/src/client/views/nodes/PhysicsSimulationBox.tsx
+++ b/src/client/views/nodes/PhysicsSimulationBox.tsx
@@ -278,12 +278,19 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
 
 
   componentDidMount() {
+    this.xMax = this.layoutDoc._width;
+    this.yMax = this.layoutDoc._height;
+    this.radius = 0.1*this.yMax
+
     // Add weight
-    if (this.dataDoc['simulationType'] == "Inclined Plane") {
+    if (this.dataDoc.simulationType == "Inclined Plane") {
+      console.log('add wedge on mount')
       this.addWedge()
-    } else if (this.dataDoc['simulationType'] == "Pendulum") {
+    } else if (this.dataDoc.simulationType == "Pendulum") {
+      console.log('add pendulum on mount')
       this.addPendulum()
-    } else if (this.dataDoc['simulationType'] == "Free Weight") {
+    } else if (this.dataDoc.simulationType == "Free Weight") {
+      console.log('add weight on mount')
       this.addWeight()
     }
 
@@ -353,13 +360,11 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
            <div>
               {this.dataDoc.simulationPaused && (
                <button onClick={() => {
-                console.log('start sim')
                 this.dataDoc.simulationPaused = false}
               } >START</button>
               )}
               {!this.dataDoc.simulationPaused && (
                <button onClick={() => {
-                console.log('pause sim')
                 this.dataDoc.simulationPaused = true}
               } >PAUSE</button>
               )}
@@ -372,17 +377,17 @@ export default class PhysicsSimulationBox extends ViewBoxAnnotatableComponent<Fi
                 if (!this.dataDoc.pendulum && !this.dataDoc.wedge) {
                   this.addWedge()
                   this.setToWedgeDefault()
-                  this.dataDoc['simulationType'] = "Inclined Plane"
+                  this.dataDoc.simulationType = "Inclined Plane"
                 }
                 else if (!this.dataDoc.pendulum && this.dataDoc.wedge) {
                   this.setToPendulumDefault()
                   this.addPendulum()
-                  this.dataDoc['simulationType'] = "Pendulum"
+                  this.dataDoc.simulationType = "Pendulum"
                 }
                 else {
                   this.addWeight()
                   this.setToWeightDefault()
-                  this.dataDoc['simulationType'] = "Free Weight"
+                  this.dataDoc.simulationType = "Free Weight"
                 }
               }} >TYPE</button>)}
               </div>
-- 
cgit v1.2.3-70-g09d2

