   [[] (atom {:running false :stop false})])
 
 (defn -run [this settings acq-eng]
+  (def latest-acq this)
   (load-mm)
   (create-device-agents)
 	(let [out-queue (GentleLinkedBlockingQueue.)


(defn acq-sleep [interval-ms]
  (let [target-time (+ (@state :last-wake-time) interval-ms)
        sleep-time (- target-time (clock-ms))]
    (log-cmd (@state :last-wake-time))
    (when (pos? sleep-time)
      (interruptible-sleep sleep-time)
      (swap! state assoc :last-wake-time target-time))))

(declare device-agents)


  
(defn execute [event-fns]
  (doseq [event-fn event-fns :while (not (:stop @state))]
    (event-fn)
    (await-resume)
    ))

(defn cleanup []
  (do-when #(.update %) (:display @state))
