void arduinoGrapher::drawProbes(){ ofSetLineWidth(1); ofSetHexColor(white); float pos1x, pos2x, pos1y, pos2y; int pos1yVal, pos2yVal; if (probes.size()>0){ drawProbe(probes[0], pos1x, pos1y, pos1yVal); } if (probes.size()>1){ drawProbe(probes[1], pos2x, pos2y, pos2yVal); ofSetHexColor(white); ofLine(pos1x, graphY-45, pos2x, graphY-45); float middle = (pos1x+pos2x)/2; verdana.drawString(ofToString((float)(abs(probes[0].timestamp-probes[1].timestamp))/1000000), middle, graphY-50); if (showValueDifference){ if (pos1y>0&&pos2y>0){ ofLine(graphX+graphW+25, pos1y, graphX+graphW+25, pos2y); float middleY = (pos1y+pos2y)/2; verdana.drawString(ofToString((float)abs(pos1yVal-pos2yVal)), graphX+graphW+27, middleY+6); } } } }
void ScopeViewBase::drawProbeMap( QPainter & p, QMap< int, T * > & map ) { typedef typename QMap<int, T*>::iterator TheIterator; const TheIterator end = map.end(); for ( TheIterator it = map.begin(); it != end; ++it ) { T * probe = it.data(); if ( probe->isEmpty() ) return; drawMidLine( p, probe ); // Set the pen colour according to the colour the user has selected for the probe p.setPen( probe->color() ); drawProbe( p, probe ); } }