plotter/gpib_plotter_mockup.py

changeset 40
1bbea188a7e5
parent 39
8becd52c2171
child 41
9a453b2479c5
--- a/plotter/gpib_plotter_mockup.py	Mon Feb 04 19:49:48 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-import glob
-import os
-import time
-import random
-
-class GPIBplotter:#(GPIB):
-    """
-    A mockup thet will find in a directory some HPGL files and feed them randomly
-    """
-    def __init__(self, device="/dev/ttyUSB0", baudrate=115200, timeout=0.1,
-                 address=5):
-        self._timeout = timeout
-        self.filenames = glob.glob('examples/*.plt')
-        self._next = random.randint(10,50)
-        self._num = 0
-
-    def plotStarted(self):
-        pass
-        
-    def load_plot(self, wait_timeout=0):
-        if wait_timeout:
-            time.sleep(wait_timeout)
-        self._num += 1
-        if self._num > self._next:
-            ret = open(random.choice(self.filenames)).read()
-            if len(ret)>0:
-                self.plotStarted()
-                self._num = 0
-                self._next = random.randint(10,100)
-                time.sleep(random.randint(1,3))
-                return ret
-            return None
-        return None
-    
-        

mercurial