Skip to content

Commit

Permalink
Added trajectory to the gui
Browse files Browse the repository at this point in the history
  • Loading branch information
estavitski committed Sep 20, 2016
1 parent d8e0b37 commit bfeb1ee
Show file tree
Hide file tree
Showing 2 changed files with 551 additions and 1 deletion.
35 changes: 35 additions & 0 deletions isstools/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
NavigationToolbar2QT as NavigationToolbar)
import pkg_resources

from isstools.trajectory.trajectory import trajectory

ui_path = pkg_resources.resource_filename('isstools', 'ui/XLive.ui')

# def my_plan(dets, some, other, param):
Expand All @@ -31,6 +33,8 @@ def __init__(self, plan_func, parent=None):
self.fig = fig = self.figure_content()
self.addCanvas(fig)
self.run_start.clicked.connect(self.test)
self.push_build_trajectory.clicked.connect(self.build_trajectory)
self.push_save_trajectory.clicked.connect(self.save_trajectory)

def addCanvas(self, fig):
self.canvas = FigureCanvas(fig)
Expand All @@ -55,6 +59,37 @@ def figure_content(self):
self.ax = ax1f1
return fig1

def build_trajectory(self):
E0 = int(self.edit_E0.text())

preedge_lo = int(self.edit_preedge_lo.text())
preedge_hi = int(self.edit_preedge_hi.text())
edge_lo = preedge_hi
edge_hi = int(self.edit_edge_hi.text())
postedge_lo = edge_hi
postedge_hi = int(self.edit_postedge_hi.text())

velocity_preedge = int (self.velocity_preedge.text())
velocity_edge = int(self.velocity_edge.text())
velocity_postedge = int(self.velocity_postedge.text())

preedge_stitch_lo = int(self.preedge_stitch_lo.text())
preedge_stitch_hi = int(self.preedge_stitch_hi.text())
edge_stitch_lo = int(self.edge_stitch_lo.text())
edge_stitch_hi = int(self.edge_stitch_hi.text())
postedge_stitch_lo = int(self.postedge_stitch_lo.text())
postedge_stitch_hi = int(self.postedge_stitch_hi.text())

padding_preedge = int(self.padding_preedge.text())
padding_postedge = int(self.padding_postedge.text())

traj=trajectory(edge_energy = E0, offsets = ([preedge_lo,preedge_hi,edge_hi,postedge_hi]),velocities = ([velocity_preedge, velocity_edge, velocity_postedge]),
stitching = ([preedge_stitch_lo, preedge_stitch_hi, edge_stitch_lo, edge_stitch_hi, postedge_stitch_lo, postedge_stitch_hi]),
servocycle = 16000, padding_lo = padding_preedge ,padding_hi=padding_postedge)

def save_trajectory(selfself):
pass

def test(self):
self.plan_func()

Expand Down
Loading

0 comments on commit bfeb1ee

Please sign in to comment.