Commit bd7998f8 authored by Hafiz Emin Kosar's avatar Hafiz Emin Kosar
Browse files

- bugfixes in z- & laplace-transform demos

parent 1bdfc789
......@@ -126,6 +126,15 @@ class pzPlot():
self.selected_coords = p
def on_btn_release(event):
if event.inaxes != self.ax:
if self.ghost_hpoint is not None:
self.ghost_hpoint.remove()
self.ghost_hpoint_conj.remove()
self.ghost_hpoint = None
self.ghost_hpoint_conj = None
return
if self.filter != 'man': return
# press + no movement + release = click
if not self.move:
on_click(event)
......@@ -154,6 +163,9 @@ class pzPlot():
self.action = tmp_action
def on_motion(event):
if event.inaxes != self.ax: return
if self.filter != 'man': return
# if button is pressed
if event.button == 1:
# lock move
......
......@@ -123,6 +123,15 @@ class zPlot():
self.selected_coords = p
def on_btn_release(event):
if event.inaxes != self.ax:
if self.ghost_hpoint is not None:
self.ghost_hpoint.remove()
self.ghost_hpoint_conj.remove()
self.ghost_hpoint = None
self.ghost_hpoint_conj = None
return
if self.filter != 'man': return
# press + no movement + release = click
if not self.move:
on_click(event)
......@@ -151,6 +160,9 @@ class zPlot():
self.action = tmp_action
def on_motion(event):
if event.inaxes != self.ax: return
if self.filter != 'man': return
# if button is pressed
if event.button == 1:
# lock move
......@@ -504,10 +516,12 @@ class zPlot():
# update f-domain
if self.systemIsStable:
H_f = np.abs(rwth_transforms.iz_Hf(self.f, self.H0, poles, zeroes, poles_order, zeroes_order, True)).round(8)
rwth_plots.update_ylim(self.handles['axH'], H_f, 1.9, ymax=1e5)
else:
H_f = np.ones(self.f.shape) * -.5
H_f = np.empty(self.f.shape)
H_f[:] = np.nan
rwth_plots.update_ylim(self.handles['axH'], [-0.5, 0.5], 0.1)
self.stabilitytxt.set_visible(not self.systemIsStable)
self.handles['lineH'].set_ydata(H_f)
rwth_plots.update_ylim(self.handles['axH'], H_f, 1.9, ymax=1e5)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment