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