aboutsummaryrefslogtreecommitdiff
path: root/operationscore
diff options
context:
space:
mode:
authorGravatar Thomas B Thompson <tbent@spice.(none)>2011-01-04 00:04:05 -0500
committerGravatar Thomas B Thompson <tbent@spice.(none)>2011-01-04 00:04:05 -0500
commit134de4472d3f2fa913944770595de9221dd27fdf (patch)
treecf83e29a1ef4931a15f9b30125fedbd8fba8caf9 /operationscore
parentf9aeaf10e3c9077504a78374640e79415734546b (diff)
worked on profiling, made a bunch of changes, huge speedup!
Diffstat (limited to 'operationscore')
-rw-r--r--operationscore/Input.py3
-rw-r--r--operationscore/Renderer.py4
-rw-r--r--operationscore/SmootCoreObject.py3
-rw-r--r--operationscore/ThreadedSmootCoreObject.py14
4 files changed, 19 insertions, 5 deletions
diff --git a/operationscore/Input.py b/operationscore/Input.py
index 62c4682..6b56cd5 100644
--- a/operationscore/Input.py
+++ b/operationscore/Input.py
@@ -1,5 +1,6 @@
import threading,time
from operationscore.SmootCoreObject import *
+from operationscore.ThreadedSmootCoreObject import ThreadedSmootCoreObject
#Abstract class for inputs. Inheriting classes should call "respond" to raise
#their event. Inheriting classes MUST define sensingLoop. Called at the
#interval specified in RefreshInterval while the input is active. For example, if you are writing
@@ -7,7 +8,7 @@ from operationscore.SmootCoreObject import *
#Inheriting classes MAY define inputInit. This is called before the loop
#begins.
import pdb
-class Input(SmootCoreObject):
+class Input(ThreadedSmootCoreObject):
#Event scope is a function pointer the function that will get called when
#an Parent is raised.
def __init__(self, argDict):
diff --git a/operationscore/Renderer.py b/operationscore/Renderer.py
index 8e31f8b..88da606 100644
--- a/operationscore/Renderer.py
+++ b/operationscore/Renderer.py
@@ -3,8 +3,8 @@
#Inheriting classes may define initRenderer which is called after the dictionary
#is pulled from config.
#TODO: multithreaded-rendering
-from operationscore.SmootCoreObject import *
-class Renderer(SmootCoreObject):
+from operationscore.ThreadedSmootCoreObject import *
+class Renderer(ThreadedSmootCoreObject):
def init(self):
self.initRenderer()
threading.Thread.__init__(self)
diff --git a/operationscore/SmootCoreObject.py b/operationscore/SmootCoreObject.py
index 9784aab..7e3c8bd 100644
--- a/operationscore/SmootCoreObject.py
+++ b/operationscore/SmootCoreObject.py
@@ -2,12 +2,11 @@ import pdb
import threading
import thread
import util.Config as configGetter
-class SmootCoreObject(threading.Thread):
+class SmootCoreObject(object):
def __init__(self, argDict, skipValidation = False):
self.argDict = argDict
self.validateArgs(self.className()+'.params')
self.lock = thread.allocate_lock()
- threading.Thread.__init__(self)
self.init() #call init of inheriting class
# self.__setitem__ = self.argDict.__setitem__
# self.__getitem__ = self.argDict.__getitem__
diff --git a/operationscore/ThreadedSmootCoreObject.py b/operationscore/ThreadedSmootCoreObject.py
new file mode 100644
index 0000000..90611bc
--- /dev/null
+++ b/operationscore/ThreadedSmootCoreObject.py
@@ -0,0 +1,14 @@
+import pdb
+import threading
+import thread
+import util.Config as configGetter
+from operationscore.SmootCoreObject import SmootCoreObject
+class ThreadedSmootCoreObject(SmootCoreObject, threading.Thread):
+ def __init__(self, argDict, skipValidation = False):
+ self.argDict = argDict
+ self.validateArgs(self.className()+'.params')
+ self.lock = thread.allocate_lock()
+ threading.Thread.__init__(self)
+ self.init() #call init of inheriting class
+ # self.__setitem__ = self.argDict.__setitem__
+ # self.__getitem__ = self.argDict.__getitem__