@@ -291,7 +291,7 class USRPReader(ProcessingUnit): | |||||
291 | if not ippKm: |
|
291 | if not ippKm: | |
292 | raise ValueError, "[Reading] nSamples or ippKm should be defined" |
|
292 | raise ValueError, "[Reading] nSamples or ippKm should be defined" | |
293 |
|
293 | |||
294 | nSamples = ippKm / (1e6*0.15/self.__sample_rate) |
|
294 | nSamples = int(ippKm / (1e6*0.15/self.__sample_rate)) | |
295 |
|
295 | |||
296 | channelBoundList = [] |
|
296 | channelBoundList = [] | |
297 | channelNameListFiltered = [] |
|
297 | channelNameListFiltered = [] | |
@@ -317,7 +317,7 class USRPReader(ProcessingUnit): | |||||
317 | self.__channelNameList = channelNameListFiltered |
|
317 | self.__channelNameList = channelNameListFiltered | |
318 | self.__channelBoundList = channelBoundList |
|
318 | self.__channelBoundList = channelBoundList | |
319 | self.__nSamples = nSamples |
|
319 | self.__nSamples = nSamples | |
320 | self.__samples_to_read = buffer_size*nSamples |
|
320 | self.__samples_to_read = int(buffer_size*nSamples) | |
321 | self.__nChannels = len(self.__channelList) |
|
321 | self.__nChannels = len(self.__channelList) | |
322 |
|
322 | |||
323 | self.__startUTCSecond = startUTCSecond |
|
323 | self.__startUTCSecond = startUTCSecond | |
@@ -389,7 +389,7 class USRPReader(ProcessingUnit): | |||||
389 | self.__thisUnixSample += self.__samples_to_read |
|
389 | self.__thisUnixSample += self.__samples_to_read | |
390 |
|
390 | |||
391 | if self.__thisUnixSample + 2*self.__samples_to_read > self.__endUTCSecond*self.__sample_rate: |
|
391 | if self.__thisUnixSample + 2*self.__samples_to_read > self.__endUTCSecond*self.__sample_rate: | |
392 | print "[Reading] There are no more data into selected timerange" |
|
392 | print "[Reading] There are no more data into selected time-range" | |
393 |
|
393 | |||
394 | self.__reload() |
|
394 | self.__reload() | |
395 |
|
395 |
@@ -110,7 +110,9 class USRPReaderAPI(USRPReader, threading.Thread): | |||||
110 |
|
110 | |||
111 | if not self.isConfig: |
|
111 | if not self.isConfig: | |
112 | raise RuntimeError, 'setup() method has to be called before start()' |
|
112 | raise RuntimeError, 'setup() method has to be called before start()' | |
113 |
|
|
113 | ||
|
114 | print "Running ..." | |||
|
115 | ||||
114 | while True: |
|
116 | while True: | |
115 |
|
117 | |||
116 | if not self.__isBufferEmpty: |
|
118 | if not self.__isBufferEmpty: | |
@@ -131,5 +133,7 class USRPReaderAPI(USRPReader, threading.Thread): | |||||
131 | # print 'wait 1 second' |
|
133 | # print 'wait 1 second' | |
132 |
|
134 | |||
133 | # sleep(0.1) |
|
135 | # sleep(0.1) | |
134 |
|
136 | |||
|
137 | print "Closing thread" | |||
|
138 | ||||
135 | return No newline at end of file |
|
139 | return |
@@ -88,19 +88,19 class DynamicSerializer(Serializer): | |||||
88 | if not DEFAULT_SERIALIZER: |
|
88 | if not DEFAULT_SERIALIZER: | |
89 | raise ImportError, "Install a python serializer like cPickle or msgpack" |
|
89 | raise ImportError, "Install a python serializer like cPickle or msgpack" | |
90 |
|
90 | |||
91 | if not mode: |
|
91 | if not module: | |
92 | mode == DEFAULT_SERIALIZER |
|
92 | module == DEFAULT_SERIALIZER | |
93 |
|
93 | |||
94 | if mode == 'cPickle': |
|
94 | if module == 'cPickle': | |
95 | self.serializer = cPickleSerializer() |
|
95 | self.serializer = cPickleSerializer() | |
96 | # |
|
96 | # | |
97 | # if mode == 'jsonpickle': |
|
97 | # if module == 'jsonpickle': | |
98 | # self.serializer = jsonpickleSerializer() |
|
98 | # self.serializer = jsonpickleSerializer() | |
99 | # |
|
99 | # | |
100 | # if mode == 'yaml': |
|
100 | # if module == 'yaml': | |
101 | # self.serializer = yamlSerializer() |
|
101 | # self.serializer = yamlSerializer() | |
102 |
|
102 | |||
103 | if mode == 'msgpack': |
|
103 | if module == 'msgpack': | |
104 | self.serializer = msgpackSerializer() |
|
104 | self.serializer = msgpackSerializer() | |
105 |
|
105 | |||
106 |
|
106 |
General Comments 0
You need to be logged in to leave comments.
Login now