Changeset - 0e27c36ff949
[Not reviewed]
Hasan Yavuz Ă–ZDERYA - 9 years ago 2017-04-01 08:49:22
hy@ozderya.net
fix symbols
3 files changed with 14 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/plot.cpp
Show inline comments
 
@@ -38,6 +38,7 @@ Plot::Plot(QWidget* parent) :
 
{
 
    isAutoScaled = true;
 
    symbolSize = 0;
 
    numOfSamples = 1;
 

	
 
    QObject::connect(&zoomer, &Zoomer::unzoomed, this, &Plot::unzoomed);
 

	
 
@@ -250,7 +251,10 @@ void Plot::onXScaleChanged()
 
    auto sw = axisWidget(QwtPlot::xBottom);
 
    auto paintDist = sw->scaleDraw()->scaleMap().pDist();
 
    auto scaleDist = sw->scaleDraw()->scaleMap().sDist();
 
    int symDisPx = round(paintDist / scaleDist);
 
    auto fullScaleDist = zoomer.zoomBase().width();
 
    auto zoomRate = fullScaleDist / scaleDist;
 
    float samplesInView = numOfSamples / zoomRate;
 
    int symDisPx = round(paintDist / samplesInView);
 

	
 
    if (symDisPx < SYMBOL_SHOW_AT_WIDTH)
 
    {
 
@@ -294,6 +298,11 @@ void Plot::resizeEvent(QResizeEvent * ev
 

	
 
void Plot::onNumOfSamplesChanged(unsigned value)
 
{
 
    numOfSamples = value;
 
    onXScaleChanged();
 

	
 
    // TODO: what to do with this?
 

	
 
    // auto currentBase = zoomer.zoomBase();
 
    // currentBase.setWidth(value);
 
    // zoomer.setZoomBase(currentBase);
src/plot.h
Show inline comments
 
@@ -72,6 +72,7 @@ private:
 
    bool isAutoScaled;
 
    double yMin, yMax;
 
    double _xMin, _xMax;
 
    unsigned numOfSamples;
 
    int symbolSize;
 
    Zoomer zoomer;
 
    ScaleZoomer sZoomer;
src/plotmanager.cpp
Show inline comments
 
@@ -462,12 +462,10 @@ void PlotManager::flashSnapshotOverlay()
 
void PlotManager::onNumOfSamplesChanged(unsigned value)
 
{
 
    _numOfSamples = value;
 
    if (_xAxisAsIndex)
 
    for (auto plot : plotWidgets)
 
    {
 
        for (auto plot : plotWidgets)
 
        {
 
            plot->setXAxis(0, value);
 
        }
 
        plot->onNumOfSamplesChanged(value);
 
        if (_xAxisAsIndex) plot->setXAxis(0, value);
 
    }
 
}
 

	
0 comments (0 inline, 0 general)