int notify(int n, void *p) { changeUnits(); if(n&LH_NOTE_NET) { valCache+=net_.outRate(); valCount+=1; } if(n&LH_NOTE_SECOND) { if (valCount!=0) { lastVal = valCache/valCount; setMax( state()->net_max_out); addValue(lastVal); } valCache = 0; valCount = 0; } return LH_Graph::notify(n,p) | net_.notify(n,p) | LH_NOTE_SECOND; }
setConnection(); } DepthInternalWidget::~DepthInternalWidget() { delete ui; } void DepthInternalWidget::setConnection() { connect(ui->chboxDepth, SIGNAL(stateChanged(int)), this, SLOT(includeParameter(int))); connect(ui->chboxRate, SIGNAL(stateChanged(int)), this, SLOT(includeParameter(int))); connect(ui->chboxTension, SIGNAL(stateChanged(int)), this, SLOT(includeParameter(int))); connect(ui->cboxDepth, SIGNAL( currentIndexChanged(QString)), this, SLOT(changeUnits(QString))); connect(ui->cboxRate, SIGNAL( currentIndexChanged(QString)), this, SLOT(changeUnits(QString))); connect(ui->cboxTension, SIGNAL( currentIndexChanged(QString)), this, SLOT(changeUnits(QString))); connect(ui->pbtConnect, SIGNAL(toggled(bool)), this, SLOT(connectDepthMeter(bool))); connect(&timer, SIGNAL(timeout()), this, SLOT(onTime())); } void DepthInternalWidget::includeParameter(int state) { QCheckBox *chbox = (QCheckBox*)sender(); if (!chbox) return; bool flag; if (state == Qt::Checked) flag = true;