Class: Pocolog::StreamAligner
- Inherits:
-
Object
- Object
- Pocolog::StreamAligner
- Defined in:
- lib/pocolog/stream_aligner.rb
Defined Under Namespace
Classes: IndexEntry
Instance Attribute Summary collapse
-
#base_time ⇒ Object
readonly
Returns the value of attribute base_time.
-
#full_index ⇒ Array<IndexEntry>
readonly
The full aligned index.
-
#global_pos_first_sample ⇒ Object
readonly
A per-stream mapping from the stream index to the global position of the last of this stream's samples.
-
#global_pos_last_sample ⇒ Object
readonly
A per-stream mapping from the stream index to the global position of the first of this stream's samples.
-
#interval_lg ⇒ (Time,Time)
readonly
The time of the first and last samples in the stream, in logical time.
-
#sample_index ⇒ Object
readonly
The index of the current sample.
-
#size ⇒ Integer
readonly
Returns the number of samples one can get out of this stream aligner.
-
#streams ⇒ Object
readonly
Returns the value of attribute streams.
-
#use_rt ⇒ Object
readonly
Returns the value of attribute use_rt.
-
#use_sample_time ⇒ Object
readonly
Returns the value of attribute use_sample_time.
Instance Method Summary collapse
-
#add_streams(*streams) ⇒ Object
Add new streams to the alignment.
- #advance ⇒ (Integer,Time)
-
#count_samples ⇒ Object
Provided for backward compatibility only.
-
#each(do_rewind = true) {|stream_idx, time, sample| ... } ⇒ Object
Enumerate all samples in this stream.
-
#empty? ⇒ Boolean
Whether there are no samples in the aligner.
-
#eof? ⇒ Boolean
Tests whether reading the next sample will return something.
-
#export_to_file(file, start_index = 0, end_index = size, &block) ⇒ Object
exports all streams to a new log file if no start and end index is given all data are exported otherwise the data are truncated according to the given global indexes.
-
#find_first_stream_sample_after(position_global, stream) ⇒ Object
Returns the stream-local index of the first sample strictly after the sample at the given global position.
-
#find_first_stream_sample_at_or_after(position_global, stream) ⇒ Object
Returns the stream-local index of the first sample that is either at or just after the given global position.
-
#first_sample_pos(stream) ⇒ nil, Integer
Returns the global sample position of the first sample of the given stream.
-
#initialize(use_rt = false, *streams) ⇒ StreamAligner
constructor
A new instance of StreamAligner.
-
#last_sample_pos(stream) ⇒ nil, Integer
Returns the global sample position of the last sample of the given stream.
-
#next ⇒ (Time,Time,(Integer,Typelib::Type))?
Defined for compatibility with DataStream#next.
- #pretty_print(pp) ⇒ Object
-
#previous ⇒ (Time,Time,(Integer,Typelib::Type))?
Defined for compatibility with DataStream#previous.
-
#raw_each(do_rewind = true) {|stream_idx, time, sample| ... } ⇒ Object
Enumerate all samples in this stream.
-
#remove_streams(*streams) ⇒ Object
Remove the given streams in the stream aligner.
-
#rewind ⇒ Object
Rewinds the stream aligner to the position before the first sample.
-
#sample_info(stream_idx) ⇒ (DataStream,Integer)?
Returns the information necessary to read a stream's sample later.
-
#seek(pos, read_data = true) ⇒ Object
Seek at the given position or time.
-
#seek_to_index_entry(entry, read_data = true) ⇒ Object
private
This is a private helper for #seek_to_time and #seek_to_pos.
-
#seek_to_pos(pos, read_data = true) ⇒ (Integer,Time[,Typelib::Type])
Seeks to the sample whose global position is pos.
-
#seek_to_time(time, read_data = true) ⇒ (Integer,Time[,Typelib::Type])
Seek to the first sample after the given time.
-
#single_data(index, sample = nil) ⇒ Object?
Returns the current data sample for the given stream index note stream index is the index of the data stream, not the search index !.
-
#single_raw_data(index, sample = nil) ⇒ Typelib::Type
Returns the current raw data sample for the given stream index note stream index is the index of the data stream, not the search index !.
-
#step ⇒ (Integer,Time,Typelib::Type)
Advances one step in the joint stream, and returns the index of the updated stream as well as the time and the data sample.
-
#step_back ⇒ (Integer,Time,Typelib::Type)
Decrements one step in the joint stream, an returns the index of the updated stream, its time as well as the sample data.
-
#stream_by_index(stream_idx) ⇒ DataStream
Return the stream object at the given stream index.
-
#stream_index_for_name(name) ⇒ Integer?
Returns the stream index of the stream with this name.
-
#stream_index_for_stream(stream) ⇒ Object
Returns the stream index for the given stream.
-
#stream_index_for_type(type) ⇒ Integer?
Returns the stream index of the stream whose type has this name.
-
#time ⇒ Time
Returns the time of the last played back sample.
- #time_interval ⇒ Object
-
#update_interval_lg ⇒ Object
private
Update #interval_lg based on the information currently in #full_index.
Constructor Details
#initialize(use_rt = false, *streams) ⇒ StreamAligner
Returns a new instance of StreamAligner
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/pocolog/stream_aligner.rb', line 61 def initialize(use_rt = false, *streams) @use_sample_time = use_rt == :use_sample_time @use_rt = use_rt @global_pos_first_sample = Array.new @global_pos_last_sample = Array.new @size = 0 @interval_lg = Array.new @base_time = nil @stream_state = Array.new @streams = Array.new @sample_index = -1 add_streams(*streams) end |
Instance Attribute Details
#base_time ⇒ Object (readonly)
Returns the value of attribute base_time
6 7 8 |
# File 'lib/pocolog/stream_aligner.rb', line 6 def base_time @base_time end |
#full_index ⇒ Array<IndexEntry> (readonly)
The full aligned index
This is a mapping from a global position in the aligned stream to information about the sample at that stream
49 50 51 |
# File 'lib/pocolog/stream_aligner.rb', line 49 def full_index @full_index end |
#global_pos_first_sample ⇒ Object (readonly)
A per-stream mapping from the stream index to the global position of the last of this stream's samples
35 36 37 |
# File 'lib/pocolog/stream_aligner.rb', line 35 def global_pos_first_sample @global_pos_first_sample end |
#global_pos_last_sample ⇒ Object (readonly)
A per-stream mapping from the stream index to the global position of the first of this stream's samples
41 42 43 |
# File 'lib/pocolog/stream_aligner.rb', line 41 def global_pos_last_sample @global_pos_last_sample end |
#interval_lg ⇒ (Time,Time) (readonly)
The time of the first and last samples in the stream, in logical time
54 55 56 |
# File 'lib/pocolog/stream_aligner.rb', line 54 def interval_lg @interval_lg end |
#sample_index ⇒ Object (readonly)
The index of the current sample
29 30 31 |
# File 'lib/pocolog/stream_aligner.rb', line 29 def sample_index @sample_index end |
#size ⇒ Integer (readonly)
Returns the number of samples one can get out of this stream aligner
This is the sum of samples available on each of the underlying streams
21 22 23 |
# File 'lib/pocolog/stream_aligner.rb', line 21 def size @size end |
#streams ⇒ Object (readonly)
Returns the value of attribute streams
8 9 10 |
# File 'lib/pocolog/stream_aligner.rb', line 8 def streams @streams end |
#use_rt ⇒ Object (readonly)
Returns the value of attribute use_rt
3 4 5 |
# File 'lib/pocolog/stream_aligner.rb', line 3 def use_rt @use_rt end |
#use_sample_time ⇒ Object (readonly)
Returns the value of attribute use_sample_time
4 5 6 |
# File 'lib/pocolog/stream_aligner.rb', line 4 def use_sample_time @use_sample_time end |
Instance Method Details
#add_streams(*streams) ⇒ Object
Add new streams to the alignment
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/pocolog/stream_aligner.rb', line 105 def add_streams(*streams) return if streams.empty? if sample_index != -1 if eof? eof = true current_entry = full_index[-1] else current_entry = full_index[sample_index] end end streams_size = streams.inject(0) { |s, stream| s + stream.size } size = (@size += streams_size) Pocolog.info "adding #{streams.size} streams with #{streams_size} samples" tic = Time.now if !base_time @base_time = streams.map { |s| s.stream_index.base_time }.compact.min end sort_index = Array.new all_streams = (@streams + streams) if base_time all_streams.each_with_index do |stream, i| stream.stream_index.base_time = base_time for entry in stream.stream_index.index_map sort_index << entry[1] * size + i end end end Pocolog.info "concatenated indexes in #{"%.2f" % [Time.now - tic]} seconds" tic = Time.now sort_index.sort! @global_pos_first_sample = Array.new @global_pos_last_sample = Array.new current_positions = Array.new(all_streams.size, 0) @full_index = Array.new(size) position_global = 0 for sort_code in sort_index time = sort_code / size stream_index = sort_code % size position_in_stream = current_positions[stream_index] current_positions[stream_index] = position_in_stream + 1 entry = IndexEntry.new(time, stream_index, position_in_stream, position_global) global_pos_first_sample[entry.stream_number] ||= position_global global_pos_last_sample[entry.stream_number] = position_global @full_index[position_global] = entry position_global += 1 end @streams = all_streams update_interval_lg Pocolog.info "built full index in #{"%.2f" % [Time.now - tic]} seconds" if current_entry @sample_index = @full_index. index do |e| e.stream_number == current_entry.stream_number && e.position_in_stream == current_entry.position_in_stream end if eof step end end end |
#advance ⇒ (Integer,Time)
401 402 403 404 405 406 407 408 |
# File 'lib/pocolog/stream_aligner.rb', line 401 def advance if eof? @sample_index = size return end seek_to_pos(@sample_index + 1, false) end |
#count_samples ⇒ Object
Provided for backward compatibility only
11 12 13 14 |
# File 'lib/pocolog/stream_aligner.rb', line 11 def count_samples Pocolog.warn "StreamAligner#count_samples is deprecated. Use #size instead" size end |
#each(do_rewind = true) {|stream_idx, time, sample| ... } ⇒ Object
Enumerate all samples in this stream
670 671 672 673 674 675 676 |
# File 'lib/pocolog/stream_aligner.rb', line 670 def each(do_rewind = true) return enum_for(__method__, do_rewind) unless block_given? raw_each(do_rewind) do |index, time, raw_sample| yield(index, time, Typelib.to_ruby(raw_sample)) end end |
#empty? ⇒ Boolean
Whether there are no samples in the aligner
24 25 26 |
# File 'lib/pocolog/stream_aligner.rb', line 24 def empty? size == 0 end |
#eof? ⇒ Boolean
90 91 92 |
# File 'lib/pocolog/stream_aligner.rb', line 90 def eof? sample_index >= size - 1 end |
#export_to_file(file, start_index = 0, end_index = size, &block) ⇒ Object
exports all streams to a new log file if no start and end index is given all data are exported otherwise the data are truncated according to the given global indexes
the block is called for each sample to update a custom progress bar if the block returns 1 the export is canceled
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 |
# File 'lib/pocolog/stream_aligner.rb', line 466 def export_to_file(file,start_index=0,end_index=size,&block) output = Pocolog::Logfiles.create(file) streams.each do |s| stream_start_index = first_sample_pos(s) stream_end_index = last_sample_pos(s) + 1 # Ignore the stream if it is empty next if !stream_start_index # Ignore the stream if there are no samples intersecting with # the required interval next if start_index >= stream_end_index || end_index <= stream_start_index stream_start_index = [start_index, stream_start_index].max stream_end_index = [end_index, stream_end_index].min first_stream_pos = find_first_stream_sample_at_or_after( stream_start_index, s) last_stream_pos = find_first_stream_sample_at_or_after( stream_end_index, s) next if first_stream_pos == last_stream_pos index = 0 number_of_samples = stream_end_index-stream_start_index+1 stream_output = output.create_stream(s.name, s.type) result = s.copy_to(first_stream_pos,last_stream_pos,stream_output) do |i| if block index +=1 block.call(index,number_of_samples) end end break if !result end output.close end |
#find_first_stream_sample_after(position_global, stream) ⇒ Object
Returns the stream-local index of the first sample strictly after the sample at the given global position
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 |
# File 'lib/pocolog/stream_aligner.rb', line 523 def find_first_stream_sample_after(position_global, stream) if !(entry = full_index[position_global]) return stream.size end stream_number = stream_index_for_stream(stream) # First things first, if entry is a sample of stream, we just have # to go forward by one if entry.stream_number == stream_number return entry.position_in_stream + 1 end # Otherwise, we need to search in the stream time = entry.time search_pos = stream.stream_index.sample_number_by_internal_time(time) if search_pos == stream.size return search_pos end # If the sample we found has the same time than the entry at # position_global, We now have to figure out whether it is before or # after position global # # We do a linear search in all samples that have the same time than # the reference time. This basically assumes that you don't have a # million samples with the same time. I believe it fair. search_time = stream.stream_index.internal_time_by_sample_number(search_pos) if search_time != time return search_pos end while entry && entry.time == time if entry.stream_number == stream_number return entry.position_in_stream end entry = @full_index[position_global += 1] end return search_pos + 1 end |
#find_first_stream_sample_at_or_after(position_global, stream) ⇒ Object
Returns the stream-local index of the first sample that is either at or just after the given global position
505 506 507 508 509 510 511 512 513 514 515 516 |
# File 'lib/pocolog/stream_aligner.rb', line 505 def find_first_stream_sample_at_or_after(position_global, stream) if !(entry = full_index[position_global]) return stream.size end stream_number = stream_index_for_stream(stream) if entry.stream_number == stream_number return entry.position_in_stream end find_first_stream_sample_after(position_global, stream) end |
#first_sample_pos(stream) ⇒ nil, Integer
Returns the global sample position of the first sample of the given stream
577 578 579 580 581 582 |
# File 'lib/pocolog/stream_aligner.rb', line 577 def first_sample_pos(stream) if stream.kind_of?(DataStream) stream = validate_stream_index_from_stream(stream) end @global_pos_first_sample[stream] end |
#last_sample_pos(stream) ⇒ nil, Integer
Returns the global sample position of the last sample of the given stream
589 590 591 592 593 594 |
# File 'lib/pocolog/stream_aligner.rb', line 589 def last_sample_pos(stream) if stream.kind_of?(DataStream) stream = validate_stream_index_from_stream(stream) end @global_pos_last_sample[stream] end |
#next ⇒ (Time,Time,(Integer,Typelib::Type))?
Defined for compatibility with DataStream#next
Goes one sample further and returns the sample's logical and real times as well as the stream index and the sample data
429 430 431 432 433 434 |
# File 'lib/pocolog/stream_aligner.rb', line 429 def next stream_index, time, data = step if stream_index return time, time, [stream_index, data] end end |
#pretty_print(pp) ⇒ Object
449 450 451 452 453 454 455 456 457 458 |
# File 'lib/pocolog/stream_aligner.rb', line 449 def pretty_print(pp) pp.text "Stream aligner with #{streams.size} streams and #{size} samples" pp.nest(2) do pp.breakable pp.seplist(streams.each_with_index) do |s, i| pp.text "[#{i}] " s.pretty_print(pp) end end end |
#previous ⇒ (Time,Time,(Integer,Typelib::Type))?
Defined for compatibility with DataStream#previous
Goes back one sample and returns the sample's logical and real times as well as the stream index and the sample data
442 443 444 445 446 447 |
# File 'lib/pocolog/stream_aligner.rb', line 442 def previous stream_index, time, data = step_back if stream_index return time, time, [stream_index, data] end end |
#raw_each(do_rewind = true) {|stream_idx, time, sample| ... } ⇒ Object
Enumerate all samples in this stream
654 655 656 657 658 659 660 661 |
# File 'lib/pocolog/stream_aligner.rb', line 654 def raw_each(do_rewind = true) return enum_for(__method__, do_rewind) unless block_given? rewind if do_rewind while (stream_idx, time = advance) yield(stream_idx, time, single_raw_data(stream_idx)) end end |
#remove_streams(*streams) ⇒ Object
Remove the given streams in the stream aligner
The index-to-stream mapping changes after this. Refer to #streams to map indexes to streams
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/pocolog/stream_aligner.rb', line 181 def remove_streams(*streams) # First, build a map of the current stream indexes to the new # stream indexes stream_indexes = Array.new for_removal = Array.new streams.each do |s| s_index = stream_index_for_stream(s) stream_indexes << s_index for_removal[s_index] = true end index_map = Array.new new_index = 0 self.streams.size.times do |stream_index| if for_removal[stream_index] index_map[stream_index] = nil else index_map[stream_index] = new_index new_index += 1 end end if eof? eof = true elsif sample_index != -1 current_entry = full_index[sample_index] changed_sample = for_removal[current_entry.stream_number] end # Then, transform the index accordingly @global_pos_first_sample = Array.new @global_pos_last_sample = Array.new global_position = 0 @full_index = full_index.find_all do |entry| if current_entry && (current_entry == entry) @sample_index = global_position current_entry = nil # speedup comparison for the rest of the filtering end if new_index = index_map[entry.stream_number] global_pos_first_sample[new_index] ||= global_position global_pos_last_sample[new_index] = global_position entry.position_global = global_position entry.stream_number = new_index global_position += 1 end end @stream_state.clear if @full_index.empty? @sample_index = -1 elsif eof @sample_index = size elsif @sample_index != -1 sample_info = seek_to_pos(@sample_index, false) end # Remove the streams, and update the global attributes stream_indexes.reverse.each do |i| s = @streams.delete_at(i) @size -= s.size end update_interval_lg if sample_info && changed_sample && (sample_index != full_index.size) return *sample_info, single_data(sample_info[0]) end end |
#rewind ⇒ Object
97 98 99 100 |
# File 'lib/pocolog/stream_aligner.rb', line 97 def rewind @sample_index = -1 nil end |
#sample_info(stream_idx) ⇒ (DataStream,Integer)?
Returns the information necessary to read a stream's sample later
612 613 614 615 616 |
# File 'lib/pocolog/stream_aligner.rb', line 612 def sample_info(stream_idx) if state = @stream_state[stream_idx] return streams[stream_idx], state.position_in_stream end end |
#seek(pos, read_data = true) ⇒ Object #seek(time, read_data = true) ⇒ Object
Seek at the given position or time
271 272 273 274 275 276 277 |
# File 'lib/pocolog/stream_aligner.rb', line 271 def seek(pos, read_data = true) if pos.kind_of?(Time) seek_to_time(pos, read_data) else seek_to_pos(pos, read_data) end end |
#seek_to_index_entry(entry, read_data = true) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This is a private helper for #seek_to_time and #seek_to_pos. It seeks the stream aligner to the given global sample
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
# File 'lib/pocolog/stream_aligner.rb', line 320 def seek_to_index_entry(entry, read_data = true) if !entry @sample_index = size return end @sample_index = entry.position_global stream_idx = entry.stream_number @stream_state[stream_idx] = entry if read_data return stream_idx, time, single_data(stream_idx) else return stream_idx, time end end |
#seek_to_pos(pos, read_data = true) ⇒ (Integer,Time[,Typelib::Type])
Seeks to the sample whose global position is pos
303 304 305 306 307 308 309 310 311 |
# File 'lib/pocolog/stream_aligner.rb', line 303 def seek_to_pos(pos, read_data = true) if empty? raise RangeError, "empty stream" elsif pos < 0 || pos > size raise RangeError, "#{pos} is out of bounds [0..#{size}]." end seek_to_index_entry(@full_index[pos], read_data) end |
#seek_to_time(time, read_data = true) ⇒ (Integer,Time[,Typelib::Type])
Seek to the first sample after the given time
285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/pocolog/stream_aligner.rb', line 285 def seek_to_time(time, read_data = true) if empty? raise RangeError, "#{time} is out of bounds, the stream is empty" elsif time < interval_lg[0] || time > interval_lg[1] raise RangeError, "#{time} is out of bounds valid interval #{interval_lg[0]} to #{interval_lg[1]}" end target_time = StreamIndex.time_to_internal(time, base_time) entry = @full_index.bsearch { |e| e.time >= target_time } seek_to_index_entry(entry, read_data) end |
#single_data(index, sample = nil) ⇒ Object?
Returns the current data sample for the given stream index note stream index is the index of the data stream, not the search index !
626 627 628 629 630 |
# File 'lib/pocolog/stream_aligner.rb', line 626 def single_data(index, sample = nil) if (raw = single_raw_data(index, sample)) return Typelib.to_ruby(raw) end end |
#single_raw_data(index, sample = nil) ⇒ Typelib::Type
Returns the current raw data sample for the given stream index note stream index is the index of the data stream, not the search index !
640 641 642 643 644 645 |
# File 'lib/pocolog/stream_aligner.rb', line 640 def single_raw_data(index, sample = nil) stream, position = sample_info(index) if stream stream.read_one_raw_data_sample(position) end end |
#step ⇒ (Integer,Time,Typelib::Type)
Advances one step in the joint stream, and returns the index of the updated stream as well as the time and the data sample
The associated data sample can also be retrieved by single_data(stream_idx)
385 386 387 388 389 390 |
# File 'lib/pocolog/stream_aligner.rb', line 385 def step stream_idx, time = advance if stream_idx return stream_idx, time, single_data(stream_idx) end end |
#step_back ⇒ (Integer,Time,Typelib::Type)
Decrements one step in the joint stream, an returns the index of the updated stream, its time as well as the sample data
414 415 416 417 418 419 420 421 |
# File 'lib/pocolog/stream_aligner.rb', line 414 def step_back if @sample_index == 0 @sample_index = -1 return nil end seek_to_pos(sample_index - 1) end |
#stream_by_index(stream_idx) ⇒ DataStream
Return the stream object at the given stream index
340 341 342 |
# File 'lib/pocolog/stream_aligner.rb', line 340 def stream_by_index(stream_idx) @streams[stream_idx] end |
#stream_index_for_name(name) ⇒ Integer?
Returns the stream index of the stream with this name
353 354 355 |
# File 'lib/pocolog/stream_aligner.rb', line 353 def stream_index_for_name(name) streams.index { |s| s.name == name } end |
#stream_index_for_stream(stream) ⇒ Object
Returns the stream index for the given stream
345 346 347 |
# File 'lib/pocolog/stream_aligner.rb', line 345 def stream_index_for_stream(stream) streams.index(stream) end |
#stream_index_for_type(type) ⇒ Integer?
Returns the stream index of the stream whose type has this name
362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
# File 'lib/pocolog/stream_aligner.rb', line 362 def stream_index_for_type(type) if type.respond_to?(:name) type = type.name end match_i = streams.index { |s| s.type.name == type } if match_i rmatch_i = streams.rindex { |s| s.type.name == type } if match_i != rmatch_i raise ArgumentError, "There exists more than one stream with type #{type}" end match_i end end |
#time ⇒ Time
Returns the time of the last played back sample
80 81 82 83 84 |
# File 'lib/pocolog/stream_aligner.rb', line 80 def time if (sample_index != -1) && (entry = full_index[sample_index]) StreamIndex.time_from_internal(entry.time, base_time) end end |
#time_interval ⇒ Object
56 57 58 59 |
# File 'lib/pocolog/stream_aligner.rb', line 56 def time_interval Pocolog.warn_deprecated "StreamAligner#time_interval is deprecated in favor of #interval_lg" interval_lg end |
#update_interval_lg ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Update #interval_lg based on the information currently in #full_index
254 255 256 257 258 259 260 261 262 263 |
# File 'lib/pocolog/stream_aligner.rb', line 254 def update_interval_lg if full_index.empty? @interval_lg = [] else @interval_lg = [ StreamIndex.time_from_internal(full_index.first.time, base_time), StreamIndex.time_from_internal(full_index.last.time, base_time) ] end end |