Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added text boxes to edit the initial conditions in the GUI. #333

Merged
merged 6 commits into from
Mar 9, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
The description for the initial condition boxes now displays the init…
…ial time value instead of t.
  • Loading branch information
moorepants committed Mar 9, 2016
commit 0764a5ef8cb4a6b95803ab34de91b79ef46f3a4e
16 changes: 7 additions & 9 deletions pydy/viz/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from pkg_resources import parse_version
import numpy as np
from sympy import latex
from sympy.physics.mechanics import ReferenceFrame, Point
from sympy.physics.mechanics import ReferenceFrame, Point, dynamicsymbols

# local
from .camera import PerspectiveCamera
Expand Down Expand Up @@ -695,23 +695,21 @@ def _fill_constants_widgets(self):

text_widget = widgets.FloatText(value=init_val,
description=desc)
# NOTE : These widgets overlap each other in the HBox and this
# width setting (the default) keeps them from overlapping.
text_widget.width = 'auto'

self._constants_text_widgets[sym] = text_widget

def _fill_initial_conditions_widgets(self):

for sym, val in self._system.initial_conditions.items():
for sym in self._system.coordinates + self._system.speeds:

desc = latex(sym, mode='inline')
val = self._system.initial_conditions[sym]

sym_0 = sym.xreplace({dynamicsymbols._t: self._system.times[0]})

desc = latex(sym_0, mode='inline')

text_widget = widgets.FloatText(value=val,
description=desc)
# NOTE : These widgets overlap each other in the HBox and this
# width setting (the default) keeps them from overlapping.
text_widget.width = 'auto'

self._initial_conditions_text_widgets[sym] = text_widget

Expand Down