예제 #1
0
void ConstraintModel::setMaxDuration(const TimeValue& arg)
{
    if(m_maxDuration != arg)
    {
        m_maxDuration = arg;
        emit maxDurationChanged(arg);
        consistency.setWarning(m_defaultDuration > m_maxDuration && !m_maxDuration.isInfinite());
    }
}
void GenericTimeDataParams::setMaxDuration(qreal  maxDuration) {
    if ( (maxDuration > TIMEDATA_DEFAULT_MAX_TIME) || (maxDuration < 0) ) return;
    if (maxDuration!=m_maxDuration) {
        if (maxDuration < 0) {
            m_maxDuration=0;
        } else {
            m_maxDuration=maxDuration;
        }
        emit(maxDurationChanged(maxDuration));
    }
}
void RepeatedTimeData::connectSignals() {
    PartialTimeData::connectSignals();

    RepeatedTimeDataParams* _rtd=dynamic_cast<RepeatedTimeDataParams*>(getDataParameters());
    Q_ASSERT(_rtd);
    RepeatedTimeDataUI* _rtdUI=dynamic_cast<RepeatedTimeDataUI*>(this->getDelegate()->getUI());
    Q_ASSERT(_rtdUI);

    //Q_ASSERT(connect(_rtd,SIGNAL(blankTimeChanged(qreal)),this,SLOT(createData())));
    Q_ASSERT(connect(_rtd,SIGNAL(blankTimeChanged(qreal)),this,SLOT(updateBlankTime())));

    //Connect all the signal that can potentially change the number of repetitions
    Q_ASSERT(connect(_rtd ,SIGNAL(maxDurationChanged(qreal)),this,SLOT(updateRepetitions())));
    Q_ASSERT(connect(_rtd ,SIGNAL(t0Changed(qreal)),this,SLOT(updateRepetitions())));
    Q_ASSERT(connect(_rtd ,SIGNAL(durationChanged(qreal)),this,SLOT(updateRepetitions())));

    //if maxduration changed update the blank scale
    Q_ASSERT(connect(_rtd,SIGNAL(maxDurationChanged(qreal)),_rtdUI,SLOT(setBlankTimeScale(qreal))));

    //setting scale for UI
    _rtdUI->setBlankTimeScale(_rtd->maxDuration());
}
void TimePlotWidget::connectSignals() {
    TimePlotParams *_params=dynamic_cast< TimePlotParams*> (getDataParameters());
    Q_ASSERT(_params!=NULL);

    //Keep consitent duration and sample rate
    Q_ASSERT(connect(_params,SIGNAL(maxDurationChanged(qreal)),this,SLOT(setAllCurvesMaxDuration(qreal))));
    Q_ASSERT(connect(_params,SIGNAL(sampleRateChanged(qreal)),this,SLOT(setAllCurvesSampleRate(qreal))));

    //Signal arriving only from UI  (show/hide all)
    TimePlotWidgetUI *_ui=dynamic_cast< TimePlotWidgetUI*> (getControlWidget());
    Q_ASSERT(_ui!=NULL);
    Q_ASSERT(connect(_ui,SIGNAL(showAllCurvesToggled()),this,SLOT(showAllCurves())));
    Q_ASSERT(connect(_ui,SIGNAL(hideAllCurvesToggled()),this,SLOT(hideAllCurves())));
    Q_ASSERT(connect(this,SIGNAL(curveListChanged()),this,SLOT(recalcAndUpdatePlot())));
}