Add multiple multisplines to Spline UI

Many of our autonomouses require us to stop in the middle. We have been
using separate multisplines to tell the robot to stop and then drive
backwards. If the Spline UI knows that these multiple multisplines
exist, we can ensure that each multispline starts where the last one ends.

You can press m to add a new multispline. This is a pretty big change
for the spline UI, and it touches pretty much every part.
Currently the multisplines are entirely separate from eachother,
but the next change adds constraints.

Signed-off-by: Nathan Leong <100028864@mvla.net>
Change-Id: Ic5eb0887d9fa6cde16a7f6b5e877a79078014614
diff --git a/frc971/control_loops/python/spline_graph.py b/frc971/control_loops/python/spline_graph.py
index 7bd6b45..fad635f 100755
--- a/frc971/control_loops/python/spline_graph.py
+++ b/frc971/control_loops/python/spline_graph.py
@@ -21,7 +21,7 @@
         self.connect(event, handler)
 
     def clear_clicked(self, button):
-        self.field.clear_graph()
+        self.field.clear()
 
     def output_json_clicked(self, button):
         self.field.export_json(self.file_name_box.get_text())
@@ -29,31 +29,36 @@
     def input_json_clicked(self, button):
         self.field.import_json(self.file_name_box.get_text())
         self.long_input.set_value(
-            self.field.points.getConstraint("LONGITUDINAL_ACCELERATION"))
+            self.field.active_multispline.getConstraint(
+                "LONGITUDINAL_ACCELERATION"))
         self.lat_input.set_value(
-            self.field.points.getConstraint("LATERAL_ACCELERATION"))
-        self.vol_input.set_value(self.field.points.getConstraint("VOLTAGE"))
+            self.field.active_multispline.getConstraint(
+                "LATERAL_ACCELERATION"))
+        self.vol_input.set_value(
+            self.field.active_multispline.getConstraint("VOLTAGE"))
 
     def undo_func(self, *args):
         self.field.undo()
 
     def long_changed(self, button):
         value = self.long_input.get_value()
-        self.field.points.setConstraint("LONGITUDINAL_ACCELERATION", value)
-        self.field.graph.schedule_recalculate(self.field.points)
+        self.field.active_multispline.setConstraint(
+            "LONGITUDINAL_ACCELERATION", value)
+        self.field.graph.schedule_recalculate(self.field.multisplines)
 
     def lat_changed(self, button):
         value = self.lat_input.get_value()
-        self.field.points.setConstraint("LATERAL_ACCELERATION", value)
-        self.field.graph.schedule_recalculate(self.field.points)
+        self.field.active_multispline.setConstraint("LATERAL_ACCELERATION",
+                                                    value)
+        self.field.graph.schedule_recalculate(self.field.multisplines)
 
     def vel_changed(self, button):
         value = self.vel_input.get_value()
 
     def vol_changed(self, button):
         value = self.vol_input.get_value()
-        self.field.points.setConstraint("VOLTAGE", value)
-        self.field.graph.schedule_recalculate(self.field.points)
+        self.field.active_multispline.setConstraint("VOLTAGE", value)
+        self.field.graph.schedule_recalculate(self.field.multisplines)
 
     def input_combobox_choice(self, combo):
         text = combo.get_active_text()
@@ -90,7 +95,8 @@
         self.long_label = Gtk.Label()
         self.long_label.set_text("Longitudinal Acceleration Restriction")
         self.long_input.set_value(
-            self.field.points.getConstraint("LONGITUDINAL_ACCELERATION"))
+            self.field.active_multispline.getConstraint(
+                "LONGITUDINAL_ACCELERATION"))
 
         self.lat_input = Gtk.SpinButton()
         self.lat_input.set_size_request(100, 20)
@@ -102,7 +108,8 @@
         self.lat_label = Gtk.Label()
         self.lat_label.set_text("Lateral Acceleration Restriction")
         self.lat_input.set_value(
-            self.field.points.getConstraint("LATERAL_ACCELERATION"))
+            self.field.active_multispline.getConstraint(
+                "LATERAL_ACCELERATION"))
 
         self.vel_input = Gtk.SpinButton()
         self.vel_input.set_size_request(100, 20)
@@ -125,7 +132,8 @@
         self.vol_input.connect("value-changed", self.vol_changed)
         self.vol_label = Gtk.Label()
         self.vol_label.set_text("Voltage Restriction")
-        self.vol_input.set_value(self.field.points.getConstraint("VOLTAGE"))
+        self.vol_input.set_value(
+            self.field.active_multispline.getConstraint("VOLTAGE"))
 
         self.output_json = Gtk.Button.new_with_label("Export")
         self.output_json.set_size_request(100, 40)