Skip to content

v0.0.9-Unstable

Pre-release
Pre-release
Compare
Choose a tag to compare
@juanmf juanmf released this 18 Jan 21:36

Full Changelog: v0.0.6-MVP...v0.0.9-Unstable

This release adds:

  • Improvements to BlockingQueueWorker. Better encapsulation of Queue, WorkChain (to sequence jobs in a dynamic navigation scenario, where stacking jobs would interrupt ongoing jobs.)
"""
creates a double-linked list of jobs, starts the 1st when the pipe is set. BlockingQueueWorker's 
consumer will add the chain links to the jobQueue in order as it finishes jobs.
"""
class SomeWorkerClass(BlockingQueueWorker):
...
  def doSomeChainedWork(self):
    self.workChain([your handler fn param list], block=False)
      .then([your handler fn next param list])
      .startChain())

and job concept (to prevent erratic additions to __jobQueue and adds Futures to track job times.)

  • Adds EventDispatched, an implementation of mediator pattern. That enables your app to decouple from events happening at the Motor Driver level. You still need to pass in a callable but that callable can fire events that will be handled by your app. En ecense you add extension points using events to hook your app to, instead of adding the logic directly inside the passed callable. EventDispatcher itself is a BlockingQueueWorker so it has it's own thread to dispatch published events to registered handlers.
  • Simplified client code by adding signedSteps() method to Drivers, so that the driver itself can decide if it's clockwise or counter clockwise (negative steps number is counter clockwise steps).
  • Improved README and docstrings, still more updates missing to catch up with new features.
  • Huge win (90-100x) in performance and sorting of log messages (from print()). multiple thread printing caused a mess in STDOUT, tprint() proxies (not literally) print and stores messages in a map. flush_streams() dumps logs to STDOUT cleaning the in-memory map, each thread's output will be in it's own chunk of output, prefixed by timestamp in microseconds (running RPI must get 10x faster than RPI 4B to start causing timestamp collisions, i.e. two immediate logs are apart by ~10uS).
  • added at exit handlers to ensure tprint dumps the map to STDOUT when your app ends or crashes. Usage: import stepper_motors_juanmf1.atexit_handlers.

This is ready for anyone to test, and could be just the same as next stable, but I didn't have the time to thoroughly test it. As my focus was to add need features from a client perspective and have it work for me.

Main areas still pending test:

  • micro-stepping modes (always used full step mode)
  • How well threads are scheduled with multiple motors running.