Commit 8b3f80ac authored by Hafiz Emin Kosar's avatar Hafiz Emin Kosar
Browse files

- right click enabled for deletion of poles/zeros in Laplace GUI

parent b9ed9524
......@@ -37,7 +37,7 @@ class pzPlot():
mode = 'p'
mode_types = {'Polstelle': 'p', 'Nullstelle': 'z'}
action = 'add'
action_types = {'Hinzufügen': 'add', 'Löschen': 'del', 'Konvergenzbereich ändern': 'roc'}
action_types = {'Hinzufügen / Löschen': 'add', 'Konvergenzbereich ändern': 'roc'}
H = None
Hlog = None
......@@ -101,6 +101,11 @@ class pzPlot():
self.ax.set_title('Pol- /Nullstellen Diagramm', fontsize='12')
def onclick(event):
if not self.action == 'roc':
if event.button == 1: # Left click
self.action = 'add'
elif event.button == 2 or event.button == 3: # Middle or right click
self.action = 'del'
if event.inaxes != self.ax: return
if self.filter != 'man': return
p = event.xdata + 1j * event.ydata
......@@ -134,7 +139,7 @@ class pzPlot():
# Widgets
self.w_filter_type = interactive(self.update_filter,filtr=widgets.Dropdown(options=list(self.filter_types.keys()), value="Sprungfunktion", description='Filter'))
self.w_action_type = interactive(self.update_action,action=widgets.Dropdown(options=list(self.action_types.keys()),value="Hinzufügen", description='Modus', disabled=True))
self.w_action_type = interactive(self.update_action,action=widgets.Dropdown(options=list(self.action_types.keys()),value="Hinzufügen / Löschen", description='Modus', disabled=True))
self.w_point_type = interactive(self.update_mode,mode=widgets.Dropdown(options=list(self.mode_types.keys()), value="Polstelle", description='Typ', disabled=True))
self.w_amp_type = interactive(self.update_amp, H0=widgets.IntSlider(min=1,max=10,step=1,value=1), description="H0")
self.w_no_of_poles = interactive(self.update_no_of_poles, P=widgets.IntSlider(min=1,max=7,step=1,value=1), description="P")
......
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