/*--------------------------------------------*/
void Calibrate_Class::calibrate()
{
  if(utils->noCVArray[potCalibrating] == true)
  {
    setNoCV(potCalibrating);
    nextPot();
    return;
  }
  
  utils->multiplexInCVs();  
  
  if(utils->cvInVals[potCalibrating] < 255)
  {
    if(cvDpotVals[potCalibrating] < 3) cvDpotVals[potCalibrating] = 0;
    else cvDpotVals[potCalibrating] -= 3;
    utils->writeCVDpot(potCalibrating, cvDpotVals[potCalibrating]);
    if(dpotVal == 0 || cvDpotVals[potCalibrating] == 0) nextPot(); 
  }
  else
  {
    nextPot();
  }
}
Beispiel #2
0
void PerfMon::drawGraph(QPainter *painter)
{
    painter->save();


    for(int i = 0;i<m_nChannelCount;i++)
    {
        // check to see if there's a need to draw specified data channel
        if(!m_visibleVec.at(i))
        {
            continue ;
        }

        // customize specified channel's graph color

        painter->setPen(QPen(m_clrVec.at(i)));

        QVector<qreal> dataVec = m_dataVec[i];


        QVector<QPointF> potVec;
        qreal startX = width();
        for(int j = 0;j < dataVec.count();j++)
        {
               qreal yValue = dataVec.at(j);
               qreal y = yValue*((qreal)height()/100);
               QPointF pot(startX,height()-y);

               //
               if(j<(dataVec.count()-1))
               {
                   qreal yNextValue=dataVec.at(j+1);
                   qreal yNext=yNextValue*((qreal)height()/100);
                   QPointF nextPot(startX-m_nIncrement,height()-yNext);
                   potVec.push_back(nextPot);
               }

               //

               startX-=m_nIncrement;

               //
               potVec.push_back(pot);
        }
        painter->drawLines(potVec);
    }

    painter->restore();
}