|
@@ -185,6 +185,8 @@ class InterfaceCore():
|
|
|
self.mv.delete(lname)
|
|
|
for i in self.refs[lname]:
|
|
|
canvas.delete(i)
|
|
|
+ del self.refs[lname]
|
|
|
+ self.drawn = set([e for e in self.drawn if e[4] != lname])
|
|
|
|
|
|
def clicked(self, event):
|
|
|
if self.find((event.x, event.y)):
|
|
@@ -210,7 +212,7 @@ class InterfaceCore():
|
|
|
print("Got unknown type: " + str(t))
|
|
|
self.mv.set_attribute(lname, attr, new_value)
|
|
|
|
|
|
- elif self.mode not in ["AdditionBlock", "NegatorBlock", "ConstantBlock", "MultiplyBlock", "ConstantBlock", "InverseBlock", "DelayBlock"]:
|
|
|
+ elif self.mode not in ["AdditionBlock", "NegatorBlock", "ConstantBlock", "MultiplyBlock", "ConstantBlock", "InverseBlock", "DelayBlock", "IntegratorBlock", "DerivatorBlock"]:
|
|
|
print("Cannot create something not guaranteed to be block type!")
|
|
|
else:
|
|
|
global name
|
|
@@ -296,8 +298,13 @@ def ic():
|
|
|
def delay():
|
|
|
core.set_mode("DelayBlock")
|
|
|
|
|
|
+def derivator():
|
|
|
+ core.set_mode("DerivatorBlock")
|
|
|
+
|
|
|
+def integrator():
|
|
|
+ core.set_mode("IntegratorBlock")
|
|
|
+
|
|
|
def delete(event):
|
|
|
- print("DELETE")
|
|
|
core.delete(event.x, event.y)
|
|
|
|
|
|
Button(root, text="+", command=addition).pack()
|
|
@@ -306,6 +313,8 @@ Button(root, text="*", command=multiply).pack()
|
|
|
Button(root, text="1/x", command=inverse).pack()
|
|
|
Button(root, text="Constant", command=constant).pack()
|
|
|
Button(root, text="Delay", command=delay).pack()
|
|
|
+Button(root, text="d/dx", command=derivator).pack()
|
|
|
+Button(root, text="integrator", command=integrator).pack()
|
|
|
|
|
|
Button(root, text="Link", command=link).pack()
|
|
|
Button(root, text="InitialCondition", command=ic).pack()
|