Changeset - fe286d8bd071
[Not reviewed]
stream
0 2 0
Hasan Yavuz Ă–ZDERYA - 7 years ago 2018-06-23 12:10:54
hy@ozderya.net
handle some TODOs
2 files changed with 6 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/plotmanager.cpp
Show inline comments
 
@@ -470,25 +470,24 @@ void PlotManager::setYAxis(bool autoScal
 
    {
 
        plot->setYAxis(autoScaled, yAxisMin, yAxisMax);
 
    }
 
}
 

	
 
void PlotManager::setXAxis(bool asIndex, double xMin, double xMax)
 
{
 
    _xAxisAsIndex = asIndex;
 
    _xMin = xMin;
 
    _xMax = xMax;
 
    for (auto curve : curves)
 
    {
 
        // TODO: what happens when addCurve(QVector) is used?
 
        FrameBufferSeries* series = static_cast<FrameBufferSeries*>(curve->data());
 
        series->setXAxis(asIndex, xMin, xMax);
 
    }
 
    for (auto plot : plotWidgets)
 
    {
 
        if (asIndex)
 
        {
 
            plot->setXAxis(0, _numOfSamples);
 
        }
 
        else
 
        {
 
            plot->setXAxis(xMin, xMax);
src/stream.cpp
Show inline comments
 
@@ -39,26 +39,29 @@ Stream::Stream(unsigned nc, bool x, unsi
 
    }
 

	
 
    // create channels
 
    for (unsigned i = 0; i < nc; i++)
 
    {
 
        auto c = new StreamChannel(i, xData, new RingBuffer(ns), &_infoModel);
 
        channels.append(c);
 
    }
 
}
 

	
 
Stream::~Stream()
 
{
 
    // TODO: notify deletion
 
    // TODO: delete channels
 
    for (auto ch : channels)
 
    {
 
        delete ch;
 
    }
 
    delete xData;
 
}
 

	
 
bool Stream::hasX() const
 
{
 
    return _hasx;
 
}
 

	
 
unsigned Stream::numChannels() const
 
{
 
    return channels.length();
 
}
 

	
 
@@ -123,25 +126,25 @@ void Stream::setNumChannels(unsigned nc,
 
        }
 

	
 
        for (auto c : channels)
 
        {
 
            c->setX(xData);
 
        }
 
        _hasx = x;
 
    }
 

	
 
    if (nc != oldNum)
 
    {
 
        _infoModel.setNumOfChannels(nc);
 
        // TODO: how abut X change?
 
        // TODO: how about X change?
 
        emit numChannelsChanged(nc);
 
    }
 

	
 
    Sink::setNumChannels(nc, x);
 
}
 

	
 
void Stream::feedIn(const SamplePack& data)
 
{
 
    Q_ASSERT(data.numChannels() == numChannels() &&
 
             data.hasX() == hasX());
 

	
 
    if (_paused) return;
0 comments (0 inline, 0 general)