예제 #1
0
void plotter::keyPressEvent(QKeyEvent *event)
{
    switch (event->key()) {
    case Qt::Key_Plus:
        zoomIn();
        break;
    case Qt::Key_Minus:
        zoomOut();
        break;
    case Qt::Key_Left:
        zoomStack[curZoom].scroll(-1, 0);
        refreshPixmap();
        break;
    case Qt::Key_Right:
        zoomStack[curZoom].scroll(+1, 0);
        refreshPixmap();
        break;
    case Qt::Key_Down:
        zoomStack[curZoom].scroll(0, -1);
        refreshPixmap();
        break;
    case Qt::Key_Up:
        zoomStack[curZoom].scroll(0, +1);
        refreshPixmap();
        break;
    default:
        QWidget::keyPressEvent(event);
    }
}
예제 #2
0
void plotter::setPlotSettings(const PlotSettings &settings)
{
    zoomStack.clear();
    zoomStack.append(settings);
    curZoom = 0;
    refreshPixmap();
}
예제 #3
0
void Plotter::resizeEvent(QResizeEvent * /* event */)
{
    int x = width() - (zoomInButton->width() + zoomOutButton->width() + 10);
    zoomInButton->move(x, 5);
    zoomOutButton->move(x + zoomInButton->width() + 5, 5);
    refreshPixmap();
}
예제 #4
0
void plotter::zoomOut()
{
    if (curZoom > 0) {
        --curZoom;
        refreshPixmap();
   }
}
예제 #5
0
LayerItem::LayerItem(Qt::BrushStyle brushStyle, qreal heightRatio, qreal lengthRatio, QWidget *parent)
        : QWidget(parent), _brushStyle(brushStyle), _heightRatio(heightRatio), _lengthRatio(lengthRatio)
{
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
    setAttribute(Qt::WA_DeleteOnClose);
    refreshPixmap();
}
예제 #6
0
void plotter::zoomIn()
{
    if (curZoom < zoomStack.count() - 1) {
        ++curZoom;
        refreshPixmap();
    }
}
예제 #7
0
void
WaveformPlot::setMode(int _mode) {
    mode = _mode;
    delete waveForm;
    waveForm = new LinearSynthesis(mode);

    refreshPixmap();
}
예제 #8
0
파일: plotter.cpp 프로젝트: Qmax/PT6
void Plotter::updateZoom(QRect pRect,PlotSettings pSettings)
{
    setRubberBandRect(&pRect);
    m_ZoomSettings = new PlotSettings();
    m_ZoomSettings = &pSettings;
    m_moveFlag = true;
    refreshPixmap();
}
예제 #9
0
void Plotter::setBandData(int pID,QVector<QPointF> &data,double pBand)
{
    bandMap[pID] = data;
    m_objPlotData->m_nEnvelopBand = pBand;
   // qDebug() << "Band:"<<m_objPlotData->m_nEnvelopBand;
    generateCompareValues(pID);
    refreshPixmap();
}
예제 #10
0
파일: plotter.cpp 프로젝트: TiKunze/mne-cpp
void plotter::setPlotSettings(const PlotSettings &settings)
{
    zoomStack.clear();
    zoomStack.append(settings);
    curZoom = 0;
    zoomInButton->hide();
    zoomOutButton->hide();
    refreshPixmap();
}
예제 #11
0
void Plotter::clearBand(int pID)
{
    if(bandMap.contains(pID))
    {
    	bandMap.remove(pID);
    	refreshPixmap();
    }

}
예제 #12
0
파일: plotter.cpp 프로젝트: TiKunze/mne-cpp
void plotter::zoomIn()
{
    if(curZoom < zoomStack.count() - 1){
        ++curZoom;
        zoomInButton->setEnabled(curZoom < zoomStack.count() - 1);
        zoomOutButton->setEnabled(true);
        zoomOutButton->show();
        refreshPixmap();
    }
}
예제 #13
0
파일: plotter.cpp 프로젝트: TiKunze/mne-cpp
void plotter::zoomOut()
{
    if(curZoom > 0){
        --curZoom;
        zoomOutButton->setEnabled(curZoom > 0);
        zoomInButton->setEnabled(true);
        zoomInButton->show();
        refreshPixmap();
    }
}
예제 #14
0
파일: plotter.cpp 프로젝트: Qmax/PT6
void Plotter::wheelEvent(QWheelEvent *event)
{
    int numDegrees = event->delta() /8;
    int numTicks = numDegrees / 15;
    if(event->orientation() == Qt::Horizontal)
        zoomStack[curZoom].scroll(numTicks,0);
    else
        zoomStack[curZoom].scroll(0,numTicks);
   refreshPixmap();
}
예제 #15
0
파일: plotter.cpp 프로젝트: Qmax/PT6
void Plotter::clearCurve(int pID)
{
    //for(int l_nIndex=0;l_nIndex< curveMap.count();l_nIndex++) 496213
    //    curveMap.remove(l_nIndex);
    if(curveMap.contains(pID))
    {
        curveMap.remove(pID);
        refreshPixmap();
    }
}
예제 #16
0
void Plotter::clearCurve(int pID)
{
    //for(int l_nIndex=0;l_nIndex< curveMap.count();l_nIndex++) 496213
    //    curveMap.remove(l_nIndex);
	m_bClearTrace = true;
	m_nClearID = pID;
	//qDebug()<<"Clear Curve Trace Index:" << m_nClearID;
    if(curveMap.contains(pID))
    {
        curveMap.remove(pID);
        refreshPixmap();
    }
}
예제 #17
0
파일: graph.cpp 프로젝트: jiick/Amp
void Graph::curveMapper()
{
    static int i = 0;

    pointStorage_0.append(QPoint(axsTime_0, axsValue_0));
    pointStorage_1.append(QPoint(axsTime_1, axsValue_1));

    axsTime_0++;
    axsTime_1++;
    axsValue_0 += 2;
    axsValue_1 += 1;

    i++;

    refreshPixmap();
}
예제 #18
0
void Plotter::wheelEvent(QWheelEvent *event)
{
    //the distance the wheel was rotated in eighths of a degree
    int numDegrees = event->delta() / 8;
    int numTicks = numDegrees / 15;

    if (event->orientation() == Qt::Horizontal)
    {
        zoomStack[curZoom].scroll(numTicks, 0);
    }
    else
    {
        zoomStack[curZoom].scroll(0, numTicks);
    }
    refreshPixmap();
}
예제 #19
0
파일: graph.cpp 프로젝트: jiick/Amp
Graph::Graph(QWidget *parent)
    : QWidget(parent), axsTime_0(0), axsTime_1(0), axsValue_0(0), axsValue_1(0)
{
    setBackgroundRole(QPalette::Dark);
    setAutoFillBackground(true);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    setFocusPolicy(Qt::StrongFocus);

    rubberBandIsShown = false;

    refreshPixmap();

    timer = new QTimer();
    connect(timer, SIGNAL(timeout()), this, SLOT(curveMapper()));

    //QTimer::singleShot(5000, this, SLOT(startCount()));
}
예제 #20
0
void Plotter::setCurveData(int pID,const QVector<QPointF> & pData)
{
   // qDebug() << "CurveID"<<pID;
//    loopMap.clear();
//    if(m_nLoopDrive){
//        //loopMap = pData;
//        //refreshlGrid();
//        }
//    else
//    {
//        curveMap[pID] = pData;
//        refreshPixmap();
//    }
    curveMap[pID] = pData;
    refreshPixmap();//added for VI grap hide in multiple traces.

}
예제 #21
0
파일: fftplot.cpp 프로젝트: vsr83/miniSynth
void
FFTPlot::fftUpdate(fftw_complex *out, unsigned int size, unsigned int ind_dataset) {
    Q_ASSERT(ind_dataset < numPlots);

    if (fftSizes[ind_dataset] != size) {
        if (fftSizes[ind_dataset] > 0) {
            delete [] fftAmpls[ind_dataset];
        }
        fftSizes[ind_dataset] = size;
        fftAmpls[ind_dataset] = new qreal[size];
    }
    qreal *fftAmpl = fftAmpls[ind_dataset];
    for (unsigned int ind=0; ind < fftSizes[ind_dataset]; ind++) {
        qreal re = out[ind][0], im = out[ind][1];

        fftAmpl[ind] = 0.5*qSqrt(re*re + im*im)/fftSizes[ind_dataset];
        if (fftAmpl[ind] == 0) {
            fftAmpl[ind] = minampl;
        }
    }
    refreshPixmap();
}
예제 #22
0
파일: fftplot.cpp 프로젝트: vsr83/miniSynth
void
FFTPlot::fftUpdate(std::complex<qreal> *out, unsigned int size, unsigned int ind_dataset) {
    Q_ASSERT(ind_dataset < numPlots);

//    qDebug() << ind_dataset << size;

    if (fftSizes[ind_dataset] != size) {
        if (fftSizes[ind_dataset] > 0) {
            delete [] fftAmpls[ind_dataset];
        }
        fftSizes[ind_dataset] = size;
        fftAmpls[ind_dataset] = new qreal[size];
    }
    qreal *fftAmpl = fftAmpls[ind_dataset];
    for (unsigned int ind=0; ind < fftSizes[ind_dataset]; ind++) {
        qreal re = out[ind].real(), im = out[ind].imag();

        fftAmpl[ind] = 0.5*qSqrt(re*re + im*im)/fftSizes[ind_dataset];
        if (fftAmpl[ind] == 0) {
            fftAmpl[ind] = minampl;
        }
    }
    refreshPixmap();
}
예제 #23
0
void plotter::clearCurve(int id)
{
    curveMap.remove(id);
    refreshPixmap();
}
예제 #24
0
void plotter::resizeEvent(QResizeEvent * /* event */)
{
    refreshPixmap();
}
예제 #25
0
void plotter::setCurveData(int id, const QVector<QPointF> &data)
{
    curveMap[id] = data;
    refreshPixmap();
}
예제 #26
0
파일: plotter.cpp 프로젝트: Qmax/PT6
void Plotter::setCurveData(int pID,const QVector<QPointF> & pData)
{
    curveMap[pID] = pData;
    refreshPixmap();
}
예제 #27
0
void
WaveformPlot::resizeEvent(QResizeEvent *event) {
    refreshPixmap();
    Q_UNUSED(event);
}
예제 #28
0
파일: plotter.cpp 프로젝트: Qmax/PT6
void Plotter::resizeEvent(QResizeEvent *event)
{
    //Q_UNUSED(event);
    refreshPixmap();
}
예제 #29
0
void
WaveformPlot::setTimbre(QVector<int> &amplitudes, QVector<int> &phases) {
    waveForm->setTimbre(amplitudes, phases);
    refreshPixmap();
}
예제 #30
0
파일: plotter.cpp 프로젝트: Qmax/PT6
void Plotter::keyPressEvent(QKeyEvent *event)
{
    switch(event->key())
    {
    case Qt::Key_Right:
        if(rubberBandRect.x() < this->width()-(rubberBandRect.width()-10))
        {
        rubberBandRect.setLeft(rubberBandRect.x() + 10);
        rubberBandRect.setWidth(rubberBandRect.width()+10);
        updateRubberBandRegion();
        }
        break;
    case Qt::Key_Left:
        if(rubberBandRect.x() > 10){
        rubberBandRect.setLeft(rubberBandRect.x() - 10);
        rubberBandRect.setWidth(rubberBandRect.width()-10);
        updateRubberBandRegion();

    }
        break;
    case Qt::Key_Down:
        if(rubberBandRect.y() < this->height()-rubberBandRect.height()){
        rubberBandRect.setTop(rubberBandRect.y() + 10);
        rubberBandRect.setHeight(rubberBandRect.height()+10);
        updateRubberBandRegion();

    }
        break;
    case Qt::Key_Up:
        if(rubberBandRect.y() >0){
        rubberBandRect.setTop(rubberBandRect.y() - 10);
        rubberBandRect.setHeight(rubberBandRect.height()-10);
        updateRubberBandRegion();

    }
        break;
     default: QWidget::keyPressEvent(event);
    }
    QRect rect = rubberBandRect.normalized();
    if(rect.width() < 4 || rect.height() < 4 )
    {
        return;
    }
    rect.translate(-Margin,-Margin);
    PlotSettings prevSettings = zoomStack[curZoom];
    PlotSettings settings;
    settings.m_nOffset = prevSettings.m_nOffset;
    double dx = prevSettings.spanX() / (width()-2*Margin);
    double dy = prevSettings.spanY() / (height()-2*Margin);
    settings.minX = prevSettings.minX + dx * rect.left();
    settings.maxX = prevSettings.minX + dx * rect.right();
    settings.minY = prevSettings.maxY - dy * rect.bottom();
    settings.maxY = prevSettings.maxY - dy * rect.top();
    settings.adjust();
    PlotSettings *pTemp = new PlotSettings();
    pTemp = &settings;
    zoomStack.resize(curZoom + 1);
    zoomStack.append(settings);
    refreshPixmap();
    emit moveWindow(rubberBandRect,settings);
}