Changeset 399
- Timestamp:
- 06/23/12 06:56:49 (9 years ago)
- Location:
- trunk/Puzzlebox/Synapse
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Puzzlebox/Synapse/Session.py
r398 r399 7 7 8 8 __changelog__ = """\ 9 Last Update: 2012.0 5.079 Last Update: 2012.06.22 10 10 """ 11 11 … … 495 495 496 496 # NOTE: Move this to ThinkGear Server object 497 if 'rawEeg' in packet.keys(): 497 #if 'rawEeg' in packet.keys(): 498 #continue 499 500 501 if 'timestamp' in packet.keys() and len(packet.keys()) == 1: 502 if self.DEBUG: 503 print "WARN: Skipping empty packet:", 504 print packet 505 # skip empty packets 498 506 continue 499 507 500 508 501 if packet['timestamp'] not in csv.keys(): 509 timestamp = packet['timestamp'] 510 #(date, localtime) = self.parseTimeStamp(timestamp, \ 511 #truncate_time_zone=truncate_csv_timezone) 512 (date, localtime) = source.parseTimeStamp(timestamp, \ 513 truncate_time_zone=truncate_csv_timezone) 514 515 if timestamp not in csv.keys(): 502 516 503 517 #if 'blinkStrength' in packet.keys(): … … 506 520 507 521 508 timestamp = packet['timestamp'] 509 #(date, localtime) = self.parseTimeStamp(timestamp, \ 522 #timestamp = packet['timestamp'] 523 ##(date, localtime) = self.parseTimeStamp(timestamp, \ 524 ##truncate_time_zone=truncate_csv_timezone) 525 #(date, localtime) = source.parseTimeStamp(timestamp, \ 510 526 #truncate_time_zone=truncate_csv_timezone) 511 (date, localtime) = source.parseTimeStamp(timestamp, \512 truncate_time_zone=truncate_csv_timezone)513 527 514 528 csv[timestamp] = {} … … 517 531 518 532 519 520 521 522 csv[timestamp] = plugin.processPacketForExport(output=csv[timestamp], packet=packet)523 524 525 526 533 for plugin in parent.activePlugins: 534 if plugin.customDataHeaders != []: 535 try: 536 csv[timestamp] = plugin.processPacketForExport(packet=packet, output=csv[timestamp]) 537 except Exception, e: 538 if self.DEBUG: 539 print "ERROR: [Synapse:Session] Exception calling processPacketForExport on", 540 print plugin.name 527 541 528 542 529 543 for header in customDataHeaders: 530 531 #if header in packet.keys():532 #csv[timestamp][header] = packet[header]533 544 534 545 if 'custom' in packet.keys() and \ 535 546 header in packet['custom'].keys(): 547 548 timestamp = packet['timestamp'] 549 (date, localtime) = source.parseTimeStamp(timestamp, \ 550 truncate_time_zone=truncate_csv_timezone) 551 552 if timestamp not in csv.keys(): 553 csv[timestamp] = {} 554 csv[timestamp]['Date'] = date 555 csv[timestamp]['Time'] = localtime 556 if self.DEBUG: 557 print "WARN: Unmatched custom packet:", 558 print packet 559 536 560 csv[timestamp][header] = packet['custom'][header] 537 561 … … 596 620 597 621 622 try: 623 truncate_csv_timezone = target.configuration.EXPORT_CSV_TRUNCATE_TIMEZONE 624 except: 625 truncate_csv_timezone = False 626 627 598 628 if source.packets['rawEeg'] == []: 599 629 return(None) 600 630 601 631 602 headers = 'Date,Time,rawEeg' 632 headers = 'Date,Time,Raw EEG' 633 headers = headers + '\n' 603 634 604 635 csv = {} -
trunk/Puzzlebox/Synapse/ThinkGear/Server.py
r398 r399 509 509 510 510 for header in self.customDataHeaders: 511 output[header] = '' 511 if header not in output.keys(): 512 output[header] = '' 512 513 513 514 if 'eSense' in packet.keys():
Note: See TracChangeset
for help on using the changeset viewer.