diff options
author | brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> | 2023-02-17 23:29:10 -0500 |
---|---|---|
committer | brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> | 2023-02-17 23:29:10 -0500 |
commit | 8428ad5be1d49c8985a59b442823ceaa33005aa6 (patch) | |
tree | 95bbd03b7e45ce20b94125caddd01408811bde0a /src/client/views/nodes/PhysicsSimulationBox.tsx | |
parent | 15c5985f0f52a4ceed3532c95106a7e9c493b080 (diff) |
debugging datadoc not working
Diffstat (limited to 'src/client/views/nodes/PhysicsSimulationBox.tsx')
-rw-r--r-- | src/client/views/nodes/PhysicsSimulationBox.tsx | 21 |
1 files changed, 13 insertions, 8 deletions
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> |