Changeset - d5f251708ffb
[Not reviewed]
default
0 1 0
Hasan Yavuz ÖZDERYA - 8 years ago 2018-03-30 10:38:21
hy@ozderya.net
fix undiscovered bug so far (afaik), which may cause significant problems when "skip sample" is clicked
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/binarystreamreader.cpp
Show inline comments
 
/*
 
  Copyright © 2017 Hasan Yavuz Özderya
 
  Copyright © 2018 Hasan Yavuz Özderya
 

	
 
  This file is part of serialplot.
 

	
 
  serialplot is free software: you can redistribute it and/or modify
 
  it under the terms of the GNU General Public License as published by
 
  the Free Software Foundation, either version 3 of the License, or
 
@@ -142,13 +142,13 @@ void BinaryStreamReader::onDataReady()
 

	
 
    // skip 1 sample (channel) if requested
 
    if (bytesAvailable >= (int) sampleSize && skipSampleRequested)
 
    {
 
        _device->read(sampleSize);
 
        skipSampleRequested = false;
 
        bytesAvailable--;
 
        bytesAvailable -= sampleSize;
 
    }
 

	
 
    if (bytesAvailable < packageSize) return;
 

	
 
    int numOfPackagesToRead =
 
        (bytesAvailable - (bytesAvailable % packageSize)) / packageSize;
0 comments (0 inline, 0 general)