Skip to content

Commit

Permalink
fix typo in plugin.py
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhrisca committed Feb 18, 2019
1 parent 2284218 commit 81bd985
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
23 changes: 12 additions & 11 deletions asammdf/recorder/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

import logging
from datetime import datetime
from threading import queue, Thread
from threading import Thread
from queue import Queue
from time import sleep

from abc import ABC
from abc import ABC, abstractmethod


logger = logging.getLogger("asammdf")
Expand All @@ -32,43 +33,43 @@ class PluginBase(ABC):
"""

def __init__(self, plugin):
self.queue = queue.Queue()
self.queue = Queue()
self.thread = None
self.running = False

@abstractmethod
def start(self):
""" setup acquisition and start receiving data by starting
the acquisition thread
"""
self.thread = Thread(target=self._acquire, args=())
self.thread.start()
self.running = True

@abstractmethod
def stop(self):
""" stop receiving data and stop acqusition thread
"""
self.running = False
while self.thread.is_alive():
sleep(0.005)

@abstractmethod
def _acquire(self):
""" setup acquisition and start receiving data by starting
the acquisition thread
"""
while True:

if self.running:
# get data from acquisition device and place it in the queue
self.queue.put((group_index, data_bytes))
else:
break


if __name__ == "__main__":
pass
2 changes: 1 addition & 1 deletion asammdf/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
""" asammdf version module """

__version__ = "5.0.0dev"
__version__ = "5.0.0.dev0"

0 comments on commit 81bd985

Please sign in to comment.