Changeset 4309

Show
Ignore:
Timestamp:
07/11/07 13:33:54 (6 years ago)
Author:
DrewCormier
Message:

removed unwanted timing support stuff

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • experimental/components/GraphPy/branches/0.6.1/GraphPy/GraphPy.py

    r4306 r4309  
    5151        self.inPort0_var = self.inPort0_servant._this() 
    5252 
    53         self.outPort0_servant = dataOut_timingStatus_i(self, "send_timing_report") 
    54         self.outPort0_var = self.outPort0_servant._this() 
    55         self.outPort0_active = False 
    56  
    5753        self.WorkModule_class_created = False 
    5854 
     
    6965        if str(id) == "GraphDataIn": 
    7066            return self.inPort0_var 
    71         if str(id) == "send_timing_report": 
    72             return self.outPort0_var 
    7367         
    7468        return None  #port not found in available ports list 
     
    112106        self.name = name 
    113107 
    114     # WARNING:  I and Q may have to be changed depending on what data you are receiving (e.g., bytesIn for realChar) 
    115108    def pushPacket(self, I, Q): 
    116109        self.parent.work_mod.AddData(I, Q) 
    117110 
    118  
    119 #------------------------------------------------------------------ 
    120 # dataOut_complexShort_i class definition 
    121 #------------------------------------------------------------------ 
    122 class dataOut_timingStatus_i(CF__POA.Port): 
    123     def __init__(self, parent, name): 
    124         self.parent = parent 
    125         self.outPorts = {} 
    126         self.name = name 
    127          
    128         self.data_buffer = [] 
    129         self.data_event = threading.Event() 
    130         self.data_buffer_lock = threading.Lock() 
    131          
    132         self.is_running = True 
    133         self.process_thread = threading.Thread(target = self.Process) 
    134         self.process_thread.start() 
    135  
    136     def connectPort(self, connection, connectionId): 
    137         port = connection._narrow(customInterfaces__POA.timingStatus) 
    138         self.outPorts[str(connectionId)] = port 
    139         self.parent.outPort0_active = True 
    140  
    141     def disconnectPort(self, connectionId): 
    142         self.outPorts.pop(str(connectionId)) 
    143         if len(self.outPorts)==0: 
    144             self.parent.outPort0_active = False 
    145  
    146     def releasePort(self): 
    147         # shut down the Process thread 
    148         self.is_running = False 
    149         self.data_event.set() 
    150  
    151     def send_data(self, I, Q): 
    152         self.data_buffer_lock.acquire() 
    153         self.data_buffer.insert(0, (I,Q)) 
    154         self.data_buffer_lock.release() 
    155         self.data_event.set() 
    156  
    157     def Process(self): 
    158         while self.is_running: 
    159             self.data_event.wait() 
    160             while len(self.data_buffer) > 0: 
    161                 self.data_buffer_lock.acquire() 
    162                 new_data = self.data_buffer.pop() 
    163                 self.data_buffer_lock.release() 
    164                  
    165                 for port in self.outPorts.values(): 
    166                     port.pushPacket(new_data[0], new_data[1]) 
    167                  
    168                 self.data_event.clear() 
    169111 
    170112