Ejemplo n.º 1
0
MixerCurve::MixerCurve(QWidget *parent) :
    QFrame(parent),
    m_mixerUI(new Ui::MixerCurve)
{
    m_mixerUI->setupUi(this);

    // setup some convienence pointers
    m_curve    = m_mixerUI->CurveWidget;
    m_settings = m_mixerUI->CurveSettings;


    m_mixerUI->SettingsGroup->hide();

    // create our spin delegate
    m_spinDelegate = new DoubleSpinDelegate();

    // set the default mixer type
    setMixerType(MixerCurve::MIXERCURVE_THROTTLE);

    // paint the ui
    UpdateCurveUI();

    // wire up our signals
    connect(m_mixerUI->CurveType, SIGNAL(currentIndexChanged(int)), this, SLOT(CurveTypeChanged()));
    connect(m_mixerUI->ResetCurve, SIGNAL(clicked()), this, SLOT(ResetCurve()));
    connect(m_mixerUI->PopupCurve, SIGNAL(clicked()), this, SLOT(PopupCurve()));
    connect(m_mixerUI->GenerateCurve, SIGNAL(clicked()), this, SLOT(GenerateCurve()));
    connect(m_curve, SIGNAL(curveUpdated()), this, SLOT(UpdateSettingsTable()));
    connect(m_settings, SIGNAL(cellChanged(int, int)), this, SLOT(SettingsTableChanged()));
    connect(m_mixerUI->CurveMin, SIGNAL(valueChanged(double)), this, SLOT(CurveMinChanged(double)));
    connect(m_mixerUI->CurveMax, SIGNAL(valueChanged(double)), this, SLOT(CurveMaxChanged(double)));
    connect(m_mixerUI->CurveStep, SIGNAL(valueChanged(double)), this, SLOT(GenerateCurve()));
}
Ejemplo n.º 2
0
void MixerCurve::ResetCurve()
{
    m_mixerUI->CurveMin->setValue(m_mixerUI->CurveMin->minimum());
    m_mixerUI->CurveMax->setValue(m_mixerUI->CurveMax->maximum());
    m_mixerUI->CurveType->setCurrentIndex(m_mixerUI->CurveType->findText("Linear"));

    initLinearCurve(MixerCurveWidget::NODE_NUMELEM, getCurveMax(), getCurveMin());

    UpdateSettingsTable();
}
Ejemplo n.º 3
0
MixerCurve::MixerCurve(QWidget *parent) :
    QFrame(parent),
    m_mixerUI(new Ui::MixerCurvePlot)
{
    m_mixerUI->setupUi(this);

    // setup some convienence pointers
    m_curve = m_mixerUI->CurveWidget;
    m_settings = m_mixerUI->CurveSettings;

    // by default mixcurve isn't used for curve2source
    m_mixerUI->CBCurve2Source->hide();

    m_mixerUI->SettingsGroup->hide();
    m_curve->showCommands(false);
    m_curve->showCommand("Reset", false);
    m_curve->showCommand("Popup", false);
    m_curve->showCommand("Commands", false);

    // create our spin delegate
    m_spinDelegate = new DoubleSpinDelegate();

    // set the default mixer type
    setMixerType(MixerCurve::MIXERCURVE_THROTTLE);

    // setup and turn off advanced mode
    CommandActivated();

    // paint the ui
    UpdateCurveUI();

    // wire up our signals

    connect(m_mixerUI->CurveType, SIGNAL(currentIndexChanged(int)), this, SLOT(CurveTypeChanged()));
    connect(m_mixerUI->ResetCurve, SIGNAL(clicked()), this, SLOT(ResetCurve()));
    connect(m_mixerUI->PopupCurve, SIGNAL(clicked()),this,SLOT(PopupCurve()));
    connect(m_mixerUI->GenerateCurve, SIGNAL(clicked()), this, SLOT(GenerateCurve()));
    connect(m_curve, SIGNAL(curveUpdated()), this, SLOT(UpdateSettingsTable()));
    connect(m_curve, SIGNAL(commandActivated(MixerNode*)),this, SLOT(CommandActivated(MixerNode*)));
    connect(m_settings, SIGNAL(cellChanged(int,int)), this, SLOT(SettingsTableChanged()));
    connect(m_mixerUI->CurveMin, SIGNAL(valueChanged(double)), this, SLOT(CurveMinChanged(double)));
    connect(m_mixerUI->CurveMax, SIGNAL(valueChanged(double)), this, SLOT(CurveMaxChanged(double)));
    connect(m_mixerUI->CurveStep, SIGNAL(valueChanged(double)), this, SLOT(GenerateCurve()));



}
Ejemplo n.º 4
0
void MixerCurve::setCurve(const QList<double> *points)
{
    m_curve->setCurve(points);
    UpdateSettingsTable();
}