 
 (defn run [this settings cleanup?]
   (def last-acq this)
+  (def last-state (.state this))
     (reset! (.state this) {:stop false :pause false :finished false})
     (let [out-queue (LinkedBlockingQueue. 10)
           acq-thread (Thread. #(binding [state (.state this)]


;; globals

(def ^:dynamic state (atom {:stop false}))

(def attached-runnables (atom (vec nil)))


   burst-events))

(defn burst-cleanup []
  (println "burst-cleanup")
  (when (core isBufferOverflowed)
    (throw-exception "Circular buffer overflowed."))
  (core stopSequenceAcquisition)
