Merge branch 'feature_plugins' into feature_plugins_shader_gadgets

This commit is contained in:
Tristan Rowley
2020-02-16 19:43:46 +00:00

View File

@@ -47,8 +47,12 @@ class WJSendPlugin(ActionsPlugin, SequencePlugin, DisplayPlugin, ModulationRecei
def get_frame_data(self): def get_frame_data(self):
diff = self.last_record.copy() diff = self.last_record.copy()
#self.last_record = {} #self.last_record = {}
#print(">>> reporting frame data for rec\n\t%s" % diff)
return diff return diff
"""def clear_recorded_frame(self):
self.last_record = {}"""
def get_frame_diff(self, last_frame, current_frame): def get_frame_diff(self, last_frame, current_frame):
lf = last_frame.get(self.frame_key) lf = last_frame.get(self.frame_key)
cf = current_frame.get(self.frame_key) cf = current_frame.get(self.frame_key)
@@ -57,7 +61,7 @@ class WJSendPlugin(ActionsPlugin, SequencePlugin, DisplayPlugin, ModulationRecei
return {} return {}
if lf is None or not lf: if lf is None or not lf:
return { self.frame_key: cf.copy() } return cf.copy()
diff = {} diff = {}
for queue,message in cf.items(): for queue,message in cf.items():
@@ -67,6 +71,18 @@ class WJSendPlugin(ActionsPlugin, SequencePlugin, DisplayPlugin, ModulationRecei
#print (">>>>>> returning diff\n%s\n<<<<<" % diff) #print (">>>>>> returning diff\n%s\n<<<<<" % diff)
return diff return diff
def merge_data(self, data1, data2):
print (">>>merge_data passed\n\t%s\nand\n\t%s" % (data1,data2))
output = {}
if data1 is None:
output = data2.copy()
else:
output = data1.copy()
output.update(data2)
print("merge_data returning\n\t%s" % output)
print("<<<<<<")
return output
def recall_frame_data(self, data): def recall_frame_data(self, data):
if data is None: if data is None:
return return
@@ -166,12 +182,19 @@ class WJSendPlugin(ActionsPlugin, SequencePlugin, DisplayPlugin, ModulationRecei
last = {} last = {}
def send_buffered(self, queue, output, record = True): def send_buffered(self, queue, output, record = True):
# TODO: remove this crap when i'm sure the bug has been fixed
if output is not None and (type(output) is dict or 'WJSendPlugin' in output):
print ("\n\n\ncaught fucker?")
import traceback
traceback.print_stack()
quit()
if self.last.get(queue)!=output: if self.last.get(queue)!=output:
self.send_serial_string(output) self.send_serial_string(output)
self.last[queue] = output self.last[queue] = output
if record: if record:
print("### send_buffered is setting last_record[%s] to %s" % (queue,output)) print("### send_buffered is setting last_record[%s] to %s" % (queue,output))
self.last_record[queue] = output self.last_record[queue] = output
def send_append(self, command, value): def send_append(self, command, value):
# append value to the command as a hex value # append value to the command as a hex value