Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:11.4
xosview
xosview-1.8.3-double.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xosview-1.8.3-double.patch of Package xosview
--- fieldmeter.cc +++ fieldmeter.cc 2006-07-26 17:34:35.000000000 +0200 @@ -25,7 +25,61 @@ CVSID("$Id$"); CVSID_DOT_H(FIELDMETER_H_CVSID); -FieldMeter::FieldMeter( XOSView *parent, int numfields, const char *title, + +template FieldMeter<float>::FieldMeter(XOSView *, int, const char *, const char *, int, int, int); +template FieldMeter<float>::~FieldMeter(void); +template void FieldMeter<float>::drawfields(int); +template void FieldMeter<float>::setfieldcolor(int, const char *); +template void FieldMeter<float>::setfieldcolor(int, unsigned long); +template void FieldMeter<float>::docaptions(int); +template void FieldMeter<float>::dolegends(int); +template void FieldMeter<float>::dousedlegends(int); +template void FieldMeter<float>::reset(void); +template void FieldMeter<float>::used_obsolete(int); +template void FieldMeter<float>::absolute_obsolete(float); +template void FieldMeter<float>::setUsed(float, float); +template void FieldMeter<float>::draw(void); +template void FieldMeter<float>::checkevent(void); +template void FieldMeter<float>::disableMeter(void); +template void FieldMeter<float>::checkResources(void); +template void FieldMeter<float>::SetUsedFormat(const char * const); +template void FieldMeter<float>::drawlegend(void); +template void FieldMeter<float>::drawused(int manditory); +template bool FieldMeter<float>::checkX(int, int) const; +template void FieldMeter<float>::setNumFields(int); +template void FieldMeter<float>::IntervalTimerStart(); +template void FieldMeter<float>::IntervalTimerStop(); +template double FieldMeter<float>::IntervalTimeInMicrosecs(); +template double FieldMeter<float>::IntervalTimeInSecs(); + +template FieldMeter<double>::FieldMeter(XOSView *, int, const char *, const char *, int, int, int); +template FieldMeter<double>::~FieldMeter(void); +template void FieldMeter<double>::drawfields(int); +template void FieldMeter<double>::setfieldcolor(int, const char *); +template void FieldMeter<double>::setfieldcolor(int, unsigned long); +template void FieldMeter<double>::docaptions(int); +template void FieldMeter<double>::dolegends(int); +template void FieldMeter<double>::dousedlegends(int); +template void FieldMeter<double>::reset(void); +template void FieldMeter<double>::used_obsolete(int); +template void FieldMeter<double>::absolute_obsolete(double); +template void FieldMeter<double>::setUsed(double, double); +template void FieldMeter<double>::draw(void); +template void FieldMeter<double>::checkevent(void); +template void FieldMeter<double>::disableMeter(void); +template void FieldMeter<double>::checkResources(void); +template void FieldMeter<double>::SetUsedFormat(const char * const); +template void FieldMeter<double>::drawlegend(void); +template void FieldMeter<double>::drawused(int manditory); +template bool FieldMeter<double>::checkX(int, int) const; +template void FieldMeter<double>::setNumFields(int); +template void FieldMeter<double>::IntervalTimerStart(); +template void FieldMeter<double>::IntervalTimerStop(); +template double FieldMeter<double>::IntervalTimeInMicrosecs(); +template double FieldMeter<double>::IntervalTimeInSecs(); + +template<typename F> +FieldMeter<F>::FieldMeter( XOSView *parent, int numfields, const char *title, const char *legend, int docaptions, int dolegends, int dousedlegends ) : Meter(parent, title, legend, docaptions, dolegends, dousedlegends){ @@ -43,8 +97,8 @@ FieldMeter::FieldMeter( XOSView *parent, setNumFields(numfields); } -void -FieldMeter::disableMeter ( ) +template<typename F> void +FieldMeter<F>::disableMeter ( ) { setNumFields(1); setfieldcolor (0, "gray"); @@ -55,20 +109,22 @@ FieldMeter::disableMeter ( ) } -FieldMeter::~FieldMeter( void ){ +template<typename F> +FieldMeter<F>::~FieldMeter( void ){ delete[] fields_; delete[] colors_; delete[] lastvals_; delete[] lastx_; } -void FieldMeter::checkResources( void ){ +template<typename F> void +FieldMeter<F>::checkResources( void ){ Meter::checkResources(); usedcolor_ = parent_->allocColor( parent_->getResource( "usedLabelColor") ); } - -void FieldMeter::SetUsedFormat ( const char * const fmt ) { +template<typename F> void +FieldMeter<F>::SetUsedFormat ( const char * const fmt ) { /* Do case-insensitive compares. */ if (!strncasecmp (fmt, "percent", 8)) print_ = PERCENT; @@ -85,7 +141,8 @@ void FieldMeter::SetUsedFormat ( const c } } -void FieldMeter::setUsed (float val, float total) +template<typename F> void +FieldMeter<F>::setUsed (F val, F total) { if (print_ == FLOAT) used_ = val; @@ -113,20 +170,24 @@ void FieldMeter::setUsed (float val, flo } } -void FieldMeter::reset( void ){ +template<typename F> void +FieldMeter<F>::reset( void ){ for ( int i = 0 ; i < numfields_ ; i++ ) lastvals_[i] = lastx_[i] = -1; } -void FieldMeter::setfieldcolor( int field, const char *color ){ +template<typename F> void +FieldMeter<F>::setfieldcolor( int field, const char *color ){ colors_[field] = parent_->allocColor( color ); } -void FieldMeter::setfieldcolor( int field, unsigned long color ) { +template<typename F> void +FieldMeter<F>::setfieldcolor( int field, unsigned long color ) { colors_[field] = color; } -void FieldMeter::draw( void ){ +template<typename F> void +FieldMeter<F>::draw( void ){ /* Draw the outline for the fieldmeter. */ parent_->setForeground( parent_->foreground() ); parent_->drawRectangle( x_ - 1, y_ - 1, width_ + 2, height_ + 2 ); @@ -147,7 +208,8 @@ void FieldMeter::draw( void ){ drawfields( 1 ); } -void FieldMeter::drawlegend( void ){ +template<typename F> void +FieldMeter<F>::drawlegend( void ){ char *tmp1, *tmp2, buff[100]; int n, x = x_; @@ -174,7 +236,8 @@ void FieldMeter::drawlegend( void ){ parent_->setStippleN(0); /* Restore default all-bits stipple. */ } -void FieldMeter::drawused( int manditory ){ +template<typename F> void +FieldMeter<F>::drawused( int manditory ){ if ( !manditory ) if ( (lastused_ == used_) ) return; @@ -190,7 +253,7 @@ void FieldMeter::drawused( int manditory } else if (print_ == AUTOSCALE){ char scale; - float scaled_used; + F scaled_used; /* Unfortunately, we have to do our comparisons by 1000s (otherwise * a value of 1020, which is smaller than 1K, could end up * being printed as 1020, which is wider than what can fit) */ @@ -245,7 +308,8 @@ void FieldMeter::drawused( int manditory lastused_ = used_; } -void FieldMeter::drawfields( int manditory ){ +template<typename F> void +FieldMeter<F>::drawfields( int manditory ){ int twidth, x = x_; if ( total_ == 0 ) @@ -265,7 +329,7 @@ void FieldMeter::drawfields( int mandito "will not be displayed.\n", name()); } - twidth = (int) ((width_ * (float) fields_[i]) / total_); + twidth = (int) ((width_ * (F) fields_[i]) / total_); // twidth = (int)((fields_[i] * width_) / total_); if ( (i == numfields_ - 1) && ((x + twidth) != (x_ + width_)) ) twidth = width_ + x_ - x; @@ -287,17 +351,19 @@ void FieldMeter::drawfields( int mandito //parent_->flush(); } -void FieldMeter::checkevent( void ){ +template<typename F> void +FieldMeter<F>::checkevent( void ){ drawfields(); } -void FieldMeter::setNumFields(int n){ +template<typename F> void +FieldMeter<F>::setNumFields(int n){ numfields_ = n; delete[] fields_; delete[] colors_; delete[] lastvals_; delete[] lastx_; - fields_ = new float[numfields_]; + fields_ = new F[numfields_]; colors_ = new unsigned long[numfields_]; lastvals_ = new int[numfields_]; lastx_ = new int[numfields_]; @@ -311,7 +377,8 @@ void FieldMeter::setNumFields(int n){ } } -bool FieldMeter::checkX(int x, int width) const { +template<typename F> bool +FieldMeter<F>::checkX(int x, int width) const { if ((x < x_) || (x + width < x_) || (x > x_ + width_) || (x + width > x_ + width_)){ std::cerr << "FieldMeter::checkX() : bad horiz values for meter : " --- fieldmeter.h +++ fieldmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -14,6 +14,7 @@ #include "meter.h" #include "timer.h" +template<typename F> class FieldMeter : public Meter { public: FieldMeter( XOSView *parent, int numfields, @@ -30,9 +31,9 @@ public: void reset( void ); /* These next two are deprecated -- use setUsed instead. bgrayson */ void used_obsolete( int val ) { print_ = PERCENT; used_ = val; } - void absolute_obsolete( float val ) { print_ = FLOAT; used_ = val; } + void absolute_obsolete( F val ) { print_ = FLOAT; used_ = val; } - void setUsed (float val, float total); + void setUsed (F val, F total); void draw( void ); void checkevent( void ); void disableMeter ( void ); @@ -43,8 +44,8 @@ protected: enum UsedType { INVALID_0, FLOAT, PERCENT, AUTOSCALE, INVALID_TAIL }; int numfields_; - float *fields_; - float total_, used_, lastused_; + F *fields_; + F total_, used_, lastused_; int *lastvals_, *lastx_; unsigned long *colors_; unsigned long usedcolor_; --- fieldmeterdecay.cc +++ fieldmeterdecay.cc 2006-07-26 17:36:14.000000000 +0200 @@ -45,15 +45,24 @@ CVSID("$Id$"); CVSID_DOT_H(FIELDMETERDECAY_H_CVSID); -FieldMeterDecay::FieldMeterDecay( XOSView *parent, +template FieldMeterDecay<float>::FieldMeterDecay(XOSView *, int, const char *, const char *, int, int, int); +template FieldMeterDecay<float>::~FieldMeterDecay(void); +template void FieldMeterDecay<float>::drawfields(int); + +template FieldMeterDecay<double>::FieldMeterDecay(XOSView *, int, const char *, const char *, int, int, int); +template FieldMeterDecay<double>::~FieldMeterDecay(void); +template void FieldMeterDecay<double>::drawfields(int); + +template<typename F> +FieldMeterDecay<F>::FieldMeterDecay( XOSView *parent, int numfields, const char *title, const char *legend, int docaptions, int dolegends, int dousedlegends ) -: FieldMeter (parent, numfields, title, legend, docaptions, dolegends, +: FieldMeter<F> (parent, numfields, title, legend, docaptions, dolegends, dousedlegends) { - decay_ = new float[numfields]; - lastDecayval_ = new float[numfields]; + decay_ = new F[numfields]; + lastDecayval_ = new F[numfields]; for (int decayCtr = 0; decayCtr < numfields; decayCtr++) { decay_[decayCtr] = 0.0; lastDecayval_[decayCtr] = 0.0; @@ -63,27 +72,29 @@ FieldMeterDecay::FieldMeterDecay( XOSVie dodecay_ = 1; } -FieldMeterDecay::~FieldMeterDecay( void ){ +template<typename F> +FieldMeterDecay<F>::~FieldMeterDecay( void ){ delete[] decay_; delete[] lastDecayval_; } -void FieldMeterDecay::drawfields( int manditory ){ - int twidth, x = x_; +template<typename F> +void FieldMeterDecay<F>::drawfields( int manditory ){ + int twidth, x = this->x_; if (!dodecay_) { // If this meter shouldn't be done as a decaying splitmeter, // call the ordinary fieldmeter code. - FieldMeter::drawfields (manditory); + FieldMeter<F>::drawfields (manditory); return; } - if ( total_ == 0.0 ) + if ( this->total_ == 0.0 ) return; - int halfheight = height_ / 2; - int decaytwidth, decayx = x_; + int halfheight = this->height_ / 2; + int decaytwidth, decayx = this->x_; // This code is supposed to make the average display look just like // the ordinary display for the first drawfields, but it doesn't seem @@ -92,9 +103,9 @@ void FieldMeterDecay::drawfields( int ma if (firsttime_) { firsttime_ = 0; - for (int i = 0; i < numfields_; i++) + for (int i = 0; i < this->numfields_; i++) { - decay_[i] = 1.0*fields_[i]/total_; + decay_[i] = 1.0*this->fields_[i]/this->total_; } } @@ -117,58 +128,58 @@ void FieldMeterDecay::drawfields( int ma * then turn to ints. I think this will solve a whole bunch of * our problems with rounding that before we tackled at a whole * lot of places. BCG */ - for ( int i = 0 ; i < numfields_ ; i++ ){ + for ( int i = 0 ; i < this->numfields_ ; i++ ){ - decay_[i] = ALPHA*decay_[i] + (1-ALPHA)*(fields_[i]*1.0/total_); + decay_[i] = ALPHA*decay_[i] + (1-ALPHA)*(this->fields_[i]*1.0/this->total_); // We want to round the widths, rather than truncate. - twidth = (int) (0.5 + (width_ * (float) fields_[i]) / total_); - decaytwidth = (int) (0.5 + width_ * decay_[i]); + twidth = (int) (0.5 + (this->width_ * (F) this->fields_[i]) / this->total_); + decaytwidth = (int) (0.5 + this->width_ * decay_[i]); if (decaytwidth < 0.0) { - std::cerr << "Error: FieldMeterDecay " << name() << ": decaytwidth of "; - std::cerr << decaytwidth << ", width of " << width_ << ", decay_[" << i; + std::cerr << "Error: FieldMeterDecay " << this->name() << ": decaytwidth of "; + std::cerr << decaytwidth << ", width of " << this->width_ << ", decay_[" << i; std::cerr << "] of " << decay_[i] << std::endl; } // However, due to rounding, we may have gone one // pixel too far by the time we get to the later fields... - if (x + twidth > x_ + width_) - twidth = width_ + x_ - x; - if (decayx + decaytwidth > x_ + width_) - decaytwidth = width_ + x_ - decayx; + if (x + twidth > this->x_ + this->width_) + twidth = this->width_ + this->x_ - x; + if (decayx + decaytwidth > this->x_ + this->width_) + decaytwidth = this->width_ + this->x_ - decayx; // Also, due to rounding error, the last field may not go far // enough... - if ( (i == numfields_ - 1) && ((x + twidth) != (x_ + width_)) ) - twidth = width_ + x_ - x; - if ( (i == numfields_ - 1) && ((decayx + decaytwidth) != (x_ + width_))) - decaytwidth = width_ + x_ - decayx; + if ( (i == this->numfields_ - 1) && ((x + twidth) != (this->x_ + this->width_)) ) + twidth = this->width_ + this->x_ - x; + if ( (i == this->numfields_ - 1) && ((decayx + decaytwidth) != (this->x_ + this->width_))) + decaytwidth = this->width_ + this->x_ - decayx; - parent_->setForeground( colors_[i] ); - parent_->setStippleN(i%4); + this->parent_->setForeground( this->colors_[i] ); + this->parent_->setStippleN(i%4); // drawFilledRectangle() adds one to its width and height. // Let's correct for that here. - if ( manditory || (twidth != lastvals_[i]) || (x != lastx_[i]) ){ - if (!checkX(x, twidth)) + if ( manditory || (twidth != this->lastvals_[i]) || (x != this->lastx_[i]) ){ + if (!this->checkX(x, twidth)) std::cerr <<__FILE__ << ":" << __LINE__ <<std::endl; - parent_->drawFilledRectangle( x, y_, twidth, halfheight ); + this->parent_->drawFilledRectangle( x, this->y_, twidth, halfheight ); } if ( manditory || (decay_[i] != lastDecayval_[i]) ){ - if (!checkX(decayx, decaytwidth)) + if (!this->checkX(decayx, decaytwidth)) std::cerr <<__FILE__ << ":" << __LINE__ <<std::endl; - parent_->drawFilledRectangle( decayx, y_+halfheight+1, - decaytwidth, height_ - halfheight-1); + this->parent_->drawFilledRectangle( decayx, this->y_+halfheight+1, + decaytwidth, this->height_ - halfheight-1); } - lastvals_[i] = twidth; - lastx_[i] = x; + this->lastvals_[i] = twidth; + this->lastx_[i] = x; lastDecayval_[i] = decay_[i]; - parent_->setStippleN(0); /* Restore all-bits stipple. */ - if ( dousedlegends_ ) - drawused( manditory ); + this->parent_->setStippleN(0); /* Restore all-bits stipple. */ + if ( this->dousedlegends_ ) + this->drawused( manditory ); x += twidth; decayx += decaytwidth; --- fieldmeterdecay.h +++ fieldmeterdecay.h 2006-07-26 17:13:10.000000000 +0200 @@ -21,7 +21,8 @@ #include "meter.h" #include "fieldmeter.h" -class FieldMeterDecay : public FieldMeter { +template<typename F> +class FieldMeterDecay : public FieldMeter<F> { public: FieldMeterDecay( XOSView *parent, int numfields, const char *title = "", const char *legend = "", @@ -33,8 +34,8 @@ public: protected: int dodecay_; int firsttime_; // Used to set up decaying fields right the first time. - float *decay_; - float *lastDecayval_; + F *decay_; + F *lastDecayval_; private: }; --- fieldmetergraph.cc +++ fieldmetergraph.cc 2006-07-26 17:45:06.000000000 +0200 @@ -38,11 +38,26 @@ CVSID("$Id$"); CVSID_DOT_H(FIELDMETERGRAPH_H_CVSID); -FieldMeterGraph::FieldMeterGraph( XOSView *parent, +template FieldMeterGraph<float>::FieldMeterGraph(XOSView *, int, const char *, const char *, int, int, int); +template FieldMeterGraph<float>::~FieldMeterGraph(void); +template void FieldMeterGraph<float>::drawfields(int); +template void FieldMeterGraph<float>::drawBar(int); +template void FieldMeterGraph<float>::checkResources(void); +template void FieldMeterGraph<float>::setNumCols(int); + +template FieldMeterGraph<double>::FieldMeterGraph(XOSView *, int, const char *, const char *, int, int, int); +template FieldMeterGraph<double>::~FieldMeterGraph(void); +template void FieldMeterGraph<double>::drawfields(int); +template void FieldMeterGraph<double>::drawBar(int); +template void FieldMeterGraph<double>::checkResources(void); +template void FieldMeterGraph<double>::setNumCols(int); + +template<typename F> +FieldMeterGraph<F>::FieldMeterGraph( XOSView *parent, int numfields, const char *title, const char *legend, int docaptions, int dolegends, int dousedlegends ) -: FieldMeterDecay (parent, numfields, title, legend, docaptions, +: FieldMeterDecay<F> (parent, numfields, title, legend, docaptions, dolegends, dousedlegends) { @@ -56,12 +71,14 @@ FieldMeterGraph::FieldMeterGraph( XOSVie } -FieldMeterGraph::~FieldMeterGraph( void ) +template<typename F> +FieldMeterGraph<F>::~FieldMeterGraph( void ) { delete [] heightfield_; } -void FieldMeterGraph::drawfields( int manditory ) +template<typename F> +void FieldMeterGraph<F>::drawfields( int manditory ) { int i,j; @@ -69,11 +86,11 @@ void FieldMeterGraph::drawfields( int ma { // Call FieldMeterDecay code if this meter should not be // drawn as a graph - FieldMeterDecay::drawfields( manditory ); + FieldMeterDecay<F>::drawfields( manditory ); return; } - if( total_ <= 0.0 ) + if( this->total_ <= 0.0 ) return; // allocate memory for height field graph storage @@ -81,18 +98,18 @@ void FieldMeterGraph::drawfields( int ma // numfields_ and graphNumCols_ are defined in the constructor if( heightfield_ == NULL ) { - if( numfields_ > 0 && graphNumCols_ > 0 ) + if( this->numfields_ > 0 && graphNumCols_ > 0 ) { - heightfield_ = new float [numfields_*graphNumCols_]; + heightfield_ = new F [this->numfields_*graphNumCols_]; for( i = 0; i < graphNumCols_; i++ ) { - for( j = 0; j < numfields_; j++ ) + for( j = 0; j < this->numfields_; j++ ) { - if( j < numfields_-1 ) - heightfield_[i*numfields_+j] = 0.0; + if( j < this->numfields_-1 ) + heightfield_[i*this->numfields_+j] = 0.0; else - heightfield_[i*numfields_+j] = 1.0; + heightfield_[i*this->numfields_+j] = 1.0; } } } @@ -103,54 +120,54 @@ void FieldMeterGraph::drawfields( int ma { for( i = 0; i < graphNumCols_-1; i++ ) { - for( j = 0; j < numfields_; j++ ) + for( j = 0; j < this->numfields_; j++ ) { - heightfield_[i*numfields_+j] = heightfield_[(i+1)*numfields_+j]; + heightfield_[i*this->numfields_+j] = heightfield_[(i+1)*this->numfields_+j]; } } graphpos_ = graphNumCols_ - 1; } // get current values to be plotted - for( i = 0; i < numfields_; i++ ) + for( i = 0; i < this->numfields_; i++ ) { - float a = fields_[i] / total_; + F a = this->fields_[i] / this->total_; if( a <= 0.0 ) a = 0.0; if( a >= 1.0 ) a = 1.0; - heightfield_[graphpos_*numfields_+i] = a; + heightfield_[graphpos_*this->numfields_+i] = a; } /* For the first time, we need to draw everything, so * skip the optimized copyArea case. Also, if we are * not fully visible, then the copy-area won't work * properly. */ - if( !firstTimeDrawn_ && parent_->hasBeenExposedAtLeastOnce() && !parent_->isExposed() && parent_->isFullyVisible() ) + if( !firstTimeDrawn_ && this->parent_->hasBeenExposedAtLeastOnce() && !this->parent_->isExposed() && this->parent_->isFullyVisible() ) { // scroll area - int col_width = width_/graphNumCols_; + int col_width = this->width_/graphNumCols_; if( col_width < 1 ) { col_width = 1; } - int sx = x_ + col_width; - int swidth = width_ - col_width; - int sheight = height_ + 1; - if( sx > x_ && swidth > 0 && sheight > 0 ) - parent_->copyArea( sx, y_, swidth, sheight, x_, y_ ); + int sx = this->x_ + col_width; + int swidth = this->width_ - col_width; + int sheight = this->height_ + 1; + if( sx > this->x_ && swidth > 0 && sheight > 0 ) + this->parent_->copyArea( sx, this->y_, swidth, sheight, this->x_, this->y_ ); drawBar( graphNumCols_ - 1 ); } else { if (firstTimeDrawn_ && - parent_->isAtLeastPartiallyVisible() && - parent_->hasBeenExposedAtLeastOnce()) { + this->parent_->isAtLeastPartiallyVisible() && + this->parent_->hasBeenExposedAtLeastOnce()) { XOSDEBUG("True exposure! %d\n", firstTimeDrawn_); firstTimeDrawn_ = 0; } else XOSDEBUG("Full draw: isAtLeastPart %d, hasBeenExposed %d\n", - parent_->isAtLeastPartiallyVisible(), - parent_->hasBeenExposedAtLeastOnce()); + this->parent_->isAtLeastPartiallyVisible(), + this->parent_->hasBeenExposedAtLeastOnce()); // need to draw entire graph on expose event for( i = 0; i < graphNumCols_; i++ ) { drawBar( i ); @@ -158,49 +175,53 @@ void FieldMeterGraph::drawfields( int ma } graphpos_++; - parent_->setStippleN(0); // Restore all-bits stipple. - if ( dousedlegends_ ) + this->parent_->setStippleN(0); // Restore all-bits stipple. + if ( this->dousedlegends_ ) { - drawused( manditory ); + this->drawused( manditory ); } } -void FieldMeterGraph::drawBar( int i ) + +template<typename F> +void FieldMeterGraph<F>::drawBar( int i ) { int j; - int y = y_ + height_; - int x = x_ + i*width_/graphNumCols_; - int barwidth = (x_ + (i+1)*width_/graphNumCols_)-x; + int y = this->y_ + this->height_; + int x = this->x_ + i*this->width_/graphNumCols_; + int barwidth = (this->x_ + (i+1)*this->width_/graphNumCols_)-x; if( barwidth>0 ) { int barheight; - for( j = 0 ; j < numfields_; j++ ) + for( j = 0 ; j < this->numfields_; j++ ) { /* Round up, by adding 0.5 before * converting to an int. */ - barheight = (int)((heightfield_[i*numfields_+j]*height_)+0.5); + barheight = (int)((heightfield_[i*this->numfields_+j]*this->height_)+0.5); - parent_->setForeground( colors_[j] ); - parent_->setStippleN(j%4); + this->parent_->setForeground( this->colors_[j] ); + this->parent_->setStippleN(j%4); - if( barheight > (y-y_) ) - barheight = (y-y_); + if( barheight > (y-this->y_) ) + barheight = (y-this->y_); // hack to ensure last field always reaches top of graph area - if( j == numfields_-1 ) - barheight = (y-y_); + if( j == this->numfields_-1 ) + barheight = (y-this->y_); y -= barheight; if( barheight>0 ) - parent_->drawFilledRectangle( x, y, barwidth, barheight ); + this->parent_->drawFilledRectangle( x, y, barwidth, barheight ); } } } -void FieldMeterGraph::checkResources( void ) + +template<typename F> +void FieldMeterGraph<F>::checkResources( void ) { - FieldMeterDecay::checkResources(); + FieldMeterDecay<F>::checkResources(); - const char *ptr = parent_->getResource( "graphNumCols" ); + const char *ptr = this->parent_->getResource( "graphNumCols" ); if( ptr ) { int i; @@ -213,7 +234,9 @@ void FieldMeterGraph::checkResources( vo } } } -void FieldMeterGraph::setNumCols( int n ) + +template<typename F> +void FieldMeterGraph<F>::setNumCols( int n ) { graphNumCols_ = n; graphpos_ = graphNumCols_-1; --- fieldmetergraph.h +++ fieldmetergraph.h 2006-07-26 17:46:37.000000000 +0200 @@ -17,7 +17,8 @@ #include "meter.h" #include "fieldmeterdecay.h" -class FieldMeterGraph : public FieldMeterDecay { +template<typename F> +class FieldMeterGraph : public FieldMeterDecay<F> { public: FieldMeterGraph( XOSView *parent, int numfields, const char *title = "", const char *legend = "", @@ -38,7 +39,7 @@ protected: /* There's some sort of corruption going on -- we can't have * variables after the heightfield_ below, otherwise they get * corrupted??? */ - float *heightfield_; + F *heightfield_; private: void drawBar( int i ); }; --- bsd/btrymeter.cc +++ bsd/btrymeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -28,14 +28,14 @@ static const char APMFILENAME[] = "/dev/apm"; BtryMeter::BtryMeter( XOSView *parent ) - : FieldMeter( parent, 2, "BAT", "% LEFT/% USED", 1, 1 ){ + : FieldMeter<float>( parent, 2, "BAT", "% LEFT/% USED", 1, 1 ){ } BtryMeter::~BtryMeter( void ){ } void BtryMeter::checkResources( void ){ - FieldMeter::checkResources(); + FieldMeter<float>::checkResources(); setfieldcolor( 0, parent_->getResource( "batteryUsedColor" ) ); setfieldcolor( 1, parent_->getResource( "batteryLeftColor" ) ); --- bsd/btrymeter.h +++ bsd/btrymeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -15,7 +15,7 @@ #include "fieldmeter.h" -class BtryMeter : public FieldMeter { +class BtryMeter : public FieldMeter<float> { public: BtryMeter( XOSView *parent ); ~BtryMeter( void ); --- bsd/cpumeter.cc +++ bsd/cpumeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -35,10 +35,10 @@ CVSID_DOT_H(CPUMETER_H_CVSID); CPUMeter::CPUMeter( XOSView *parent ) #if defined(XOSVIEW_FREEBSD) || defined(XOSVIEW_BSDI) || \ (defined(XOSVIEW_NETBSD) && (__NetBSD_Version__ >= 104260000)) -: FieldMeterGraph( parent, 5, "CPU", "USR/NICE/SYS/INT/FREE" ){ +: FieldMeterGraph<float>( parent, 5, "CPU", "USR/NICE/SYS/INT/FREE" ){ #define FREE_INDEX 4 #else -: FieldMeterGraph( parent, 4, "CPU", "USR/NICE/SYS/FREE" ){ +: FieldMeterGraph<float>( parent, 4, "CPU", "USR/NICE/SYS/FREE" ){ #define FREE_INDEX 3 #endif for ( int i = 0 ; i < 2 ; i++ ) @@ -55,7 +55,7 @@ CPUMeter::~CPUMeter( void ){ } void CPUMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); setfieldcolor( 0, parent_->getResource("cpuUserColor") ); setfieldcolor( 1, parent_->getResource("cpuNiceColor") ); --- bsd/cpumeter.h +++ bsd/cpumeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -21,7 +21,7 @@ #include "fieldmetergraph.h" -class CPUMeter : public FieldMeterGraph { +class CPUMeter : public FieldMeterGraph<float> { public: CPUMeter( XOSView *parent ); ~CPUMeter( void ); --- bsd/diskmeter.cc +++ bsd/diskmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -21,7 +21,7 @@ CVSID("$Id$"); CVSID_DOT_H(DISKMETER_H_CVSID); DiskMeter::DiskMeter( XOSView *parent, float max ) -: FieldMeterGraph( parent, 2, "DISK", "XFER/IDLE" ){ +: FieldMeterGraph<float>( parent, 2, "DISK", "XFER/IDLE" ){ // The setting of the priority will be done in checkResources(). BCG dodecay_ = 0; @@ -74,7 +74,7 @@ DiskMeter::~DiskMeter( void ){ } void DiskMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); if (kernelHasStats_) { setfieldcolor( 0, parent_->getResource("diskUsedColor") ); --- bsd/diskmeter.h +++ bsd/diskmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -20,7 +20,7 @@ #include "fieldmetergraph.h" #include <sys/types.h> // For u_int64_t -class DiskMeter : public FieldMeterGraph { +class DiskMeter : public FieldMeterGraph<float> { public: DiskMeter( XOSView *parent, float max ); ~DiskMeter( void ); --- bsd/intratemeter.cc +++ bsd/intratemeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -19,7 +19,7 @@ CVSID("$Id$"); CVSID_DOT_H(IRQRATEMETER_H_CVSID); IrqRateMeter::IrqRateMeter( XOSView *parent ) - : FieldMeterGraph( parent, 2, "IRQs", "IRQs per sec/IDLE", 1, 1, 0 ){ + : FieldMeterGraph<float>( parent, 2, "IRQs", "IRQs per sec/IDLE", 1, 1, 0 ){ kernelHasStats_ = BSDIntrInit(); if (!kernelHasStats_) { @@ -36,7 +36,7 @@ IrqRateMeter::~IrqRateMeter( void ){ } void IrqRateMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); if (kernelHasStats_) { oncol_ = parent_->allocColor(parent_->getResource("irqrateUsedColor")); idlecol_ = parent_->allocColor(parent_->getResource("irqrateIdleColor")); --- bsd/intratemeter.h +++ bsd/intratemeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -17,7 +17,7 @@ #include "fieldmetergraph.h" #include "kernel.h" -class IrqRateMeter : public FieldMeterGraph { +class IrqRateMeter : public FieldMeterGraph<float> { public: IrqRateMeter( XOSView *parent ); ~IrqRateMeter( void ); --- bsd/loadmeter.cc +++ bsd/loadmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -24,14 +24,14 @@ CVSID("$Id$"); CVSID_DOT_H(LOADMETER_H_CVSID); LoadMeter::LoadMeter( XOSView *parent ) - : FieldMeterGraph( parent, 2, "LOAD", "PROCS per MIN/IDLE", 1, 1, 0 ){ + : FieldMeterGraph<float>( parent, 2, "LOAD", "PROCS per MIN/IDLE", 1, 1, 0 ){ } LoadMeter::~LoadMeter( void ){ } void LoadMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); procloadcol_ = parent_->allocColor(parent_->getResource( "loadProcColor" )); warnloadcol_ = parent_->allocColor(parent_->getResource( "loadWarnColor" )); --- bsd/loadmeter.h +++ bsd/loadmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -22,7 +22,7 @@ #include "fieldmetergraph.h" -class LoadMeter : public FieldMeterGraph { +class LoadMeter : public FieldMeterGraph<float> { public: LoadMeter( XOSView *parent ); ~LoadMeter( void ); --- bsd/memmeter.cc +++ bsd/memmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -34,12 +34,12 @@ CVSID_DOT_H(MEMMETER_H_CVSID); MemMeter::MemMeter( XOSView *parent ) #ifdef XOSVIEW_FREEBSD -: FieldMeterGraph( parent, 5, "MEM", "ACT/INACT/WRD/CA/FRE" ) { +: FieldMeterGraph<double>( parent, 5, "MEM", "ACT/INACT/WRD/CA/FRE" ) { #define FREE_INDEX 4 #else // Once we figure out how to get the buffers field for NetBSD, // change the next line. -: FieldMeterGraph( parent, 4, "MEM", "ACT/INACT/WIRE/FREE" ){ +: FieldMeterGraph<double>( parent, 4, "MEM", "ACT/INACT/WIRE/FREE" ){ #define FREE_INDEX 3 #endif BSDPageInit(); @@ -48,7 +48,7 @@ MemMeter::MemMeter( XOSView *parent ) MemMeter::~MemMeter( void ){ } void MemMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<double>::checkResources(); // The Active and Inactive colors are new. setfieldcolor( 0, parent_->getResource("memActiveColor") ); --- bsd/memmeter.h +++ bsd/memmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -21,7 +21,7 @@ #include "fieldmetergraph.h" -class MemMeter : public FieldMeterGraph { +class MemMeter : public FieldMeterGraph<double> { public: MemMeter( XOSView *parent ); ~MemMeter( void ); --- bsd/netmeter.cc +++ bsd/netmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -26,7 +26,7 @@ CVSID_DOT_H2(TIMER_H_CVSID); CVSID_DOT_H3(TIMEVAL_H_CVSID); NetMeter::NetMeter( XOSView *parent, float max ) - : FieldMeterGraph( parent, 3, "NET", "IN/OUT/IDLE" ){ + : FieldMeterGraph<float>( parent, 3, "NET", "IN/OUT/IDLE" ){ kernelHasStats_ = BSDNetInit(); if (!kernelHasStats_) { warnx( @@ -46,7 +46,7 @@ NetMeter::~NetMeter( void ){ } void NetMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); if (kernelHasStats_) { setfieldcolor( 0, parent_->getResource("netInColor") ); --- bsd/netmeter.h +++ bsd/netmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -24,7 +24,7 @@ class Host; -class NetMeter : public FieldMeterGraph { +class NetMeter : public FieldMeterGraph<float> { public: NetMeter(XOSView *parent, float max); ~NetMeter( void ); --- bsd/pagemeter.cc +++ bsd/pagemeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -24,7 +24,7 @@ CVSID("$Id$"); CVSID_DOT_H(PAGEMETER_H_CVSID); PageMeter::PageMeter( XOSView *parent, double total ) -: FieldMeterGraph( parent, 3, "PAGE", "IN/OUT/IDLE" ){ +: FieldMeterGraph<float>( parent, 3, "PAGE", "IN/OUT/IDLE" ){ total_ = total; BSDPageInit(); #ifdef UVM @@ -37,7 +37,7 @@ PageMeter::PageMeter( XOSView *parent, d PageMeter::~PageMeter( void ){ } void PageMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); // The Active and Inactive colors are new. setfieldcolor( 0, parent_->getResource("pageInColor") ); --- bsd/pagemeter.h +++ bsd/pagemeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -34,7 +34,7 @@ #include <sys/vmmeter.h> #endif -class PageMeter : public FieldMeterGraph { +class PageMeter : public FieldMeterGraph<float> { public: PageMeter( XOSView *parent, double total ); ~PageMeter( void ); --- bsd/swapmeter.cc +++ bsd/swapmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -29,7 +29,7 @@ CVSID_DOT_H(SWAPMETER_H_CVSID); static int doSwap = 1; SwapMeter::SwapMeter( XOSView *parent ) -: FieldMeterGraph( parent, 2, "SWAP", "USED/FREE" ){ +: FieldMeterGraph<float>( parent, 2, "SWAP", "USED/FREE" ){ #ifdef HAVE_SWAPCTL useSwapCtl = 0; #endif @@ -60,7 +60,7 @@ SwapMeter::~SwapMeter( void ){ } void SwapMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); setfieldcolor( 0, parent_->getResource("swapUsedColor") ); setfieldcolor( 1, parent_->getResource("swapFreeColor") ); --- bsd/swapmeter.h +++ bsd/swapmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -19,7 +19,7 @@ #include "fieldmetergraph.h" -class SwapMeter : public FieldMeterGraph { +class SwapMeter : public FieldMeterGraph<float> { public: SwapMeter( XOSView *parent ); ~SwapMeter( void ); --- hpux/cpumeter.cc +++ hpux/cpumeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -12,7 +12,7 @@ #include <stdlib.h> CPUMeter::CPUMeter( XOSView *parent ) -: FieldMeterGraph( parent, 5, "CPU", "USR/NICE/SYS/INT/FREE" ){ +: FieldMeterGraph<float>( parent, 5, "CPU", "USR/NICE/SYS/INT/FREE" ){ for ( int i = 0 ; i < 2 ; i++ ) for ( int j = 0 ; j < 5 ; j++ ) cputime_[i][j] = 0; @@ -23,7 +23,7 @@ CPUMeter::~CPUMeter( void ){ } void CPUMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); setfieldcolor( 0, parent_->getResource( "cpuUserColor" ) ); setfieldcolor( 1, parent_->getResource( "cpuNiceColor" ) ); --- hpux/cpumeter.h +++ hpux/cpumeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -11,7 +11,7 @@ #include "fieldmetergraph.h" -class CPUMeter : public FieldMeterGraph { +class CPUMeter : public FieldMeterGraph<float> { public: CPUMeter( XOSView *parent ); ~CPUMeter( void ); --- irix65/cpumeter.cc +++ irix65/cpumeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -11,7 +11,7 @@ #include <strstream.h> CPUMeter::CPUMeter(XOSView *parent, int cpuid) - : FieldMeterGraph(parent, USED_CPU_STATES, toUpper(cpuStr(cpuid)), + : FieldMeterGraph<float>(parent, USED_CPU_STATES, toUpper(cpuStr(cpuid)), "USER/SYS/INTR/WAIT/IDLE") { for (int i = 0 ; i < 2 ; i++) @@ -33,7 +33,7 @@ CPUMeter::~CPUMeter(void) void CPUMeter::checkResources(void) { - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); setfieldcolor(0, parent_->getResource("cpuUserColor")); setfieldcolor(1, parent_->getResource("cpuSystemColor")); --- irix65/cpumeter.h +++ irix65/cpumeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -13,7 +13,7 @@ #define USED_CPU_STATES (CPU_STATES-1) // SXBRK + IDLE merged -class CPUMeter : public FieldMeterGraph { +class CPUMeter : public FieldMeterGraph<float> { public: CPUMeter(XOSView *parent, const int cpuid = 0); ~CPUMeter(void); --- irix65/diskmeter.cc +++ irix65/diskmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -10,7 +10,7 @@ #include <stdlib.h> -DiskMeter::DiskMeter( XOSView *parent, float max ) : FieldMeterGraph( +DiskMeter::DiskMeter( XOSView *parent, float max ) : FieldMeterGraph<float>( parent, 3, "DISK", "READ/WRITE/IDLE") { maxspeed_ = max; @@ -23,7 +23,7 @@ DiskMeter::~DiskMeter( void ) void DiskMeter::checkResources( void ) { - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); setfieldcolor( 0, parent_->getResource("diskReadColor") ); setfieldcolor( 1, parent_->getResource("diskWriteColor") ); --- irix65/diskmeter.h +++ irix65/diskmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -8,7 +8,7 @@ #include "fieldmetergraph.h" -class DiskMeter : public FieldMeterGraph +class DiskMeter : public FieldMeterGraph<float> { public: DiskMeter( XOSView *parent, float max ); --- irix65/gfxmeter.cc +++ irix65/gfxmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -16,7 +16,7 @@ using namespace std; // GfxMeter display swapbuffers per second. max is base rate for one gfx pipe. GfxMeter::GfxMeter(XOSView *parent, int max) - : FieldMeterGraph(parent, 2, "GFX","SWAPBUF/S", 1, 1, 0 ) + : FieldMeterGraph<float>(parent, 2, "GFX","SWAPBUF/S", 1, 1, 0 ) { lastalarmstate = -1; total_ = 0; @@ -50,7 +50,7 @@ int GfxMeter::nPipes(void) void GfxMeter::checkResources(void) { - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); swapgfxcol_ = parent_->allocColor(parent_->getResource( "gfxSwapColor" )); warngfxcol_ = parent_->allocColor(parent_->getResource( "gfxWarnColor" )); --- irix65/gfxmeter.h +++ irix65/gfxmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -10,7 +10,7 @@ #include <rpcsvc/rstat.h> -class GfxMeter : public FieldMeterGraph +class GfxMeter : public FieldMeterGraph<float> { public: GfxMeter(XOSView *parent, int max); --- irix65/loadmeter.cc +++ irix65/loadmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -22,7 +22,7 @@ using namespace std; LoadMeter::LoadMeter(XOSView *parent) - : FieldMeterGraph( parent, 2, "LOAD", "PROCS/MIN", 1, 1, 0 ) + : FieldMeterGraph<float>( parent, 2, "LOAD", "PROCS/MIN", 1, 1, 0 ) { lastalarmstate = -1; total_ = 2.0; @@ -40,7 +40,7 @@ LoadMeter::~LoadMeter(void) void LoadMeter::checkResources(void) { - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); procloadcol_ = parent_->allocColor(parent_->getResource( "loadProcColor" )); warnloadcol_ = parent_->allocColor(parent_->getResource( "loadWarnColor" )); --- irix65/loadmeter.h +++ irix65/loadmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -8,7 +8,7 @@ #include "fieldmetergraph.h" #include <rpcsvc/rstat.h> -class LoadMeter : public FieldMeterGraph { +class LoadMeter : public FieldMeterGraph<float> { public: LoadMeter(XOSView *parent); ~LoadMeter(void); --- irix65/memmeter.cc +++ irix65/memmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -9,7 +9,7 @@ #include <invent.h> MemMeter::MemMeter(XOSView *parent) - : FieldMeterGraph(parent, 4, "MEM","KERNEL/FS/USER/FREE") + : FieldMeterGraph<double>(parent, 4, "MEM","KERNEL/FS/USER/FREE") { inventory_t *inv; _pageSize = getpagesize(); @@ -33,7 +33,7 @@ MemMeter::MemMeter(XOSView *parent) void MemMeter::checkResources(void) { - FieldMeterGraph::checkResources(); + FieldMeterGraph<double>::checkResources(); setfieldcolor(0, parent_->getResource("memKernelColor")); setfieldcolor(1, parent_->getResource("memCacheColor")); --- irix65/memmeter.h +++ irix65/memmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -10,7 +10,7 @@ #include <sys/sysmp.h> #include <sys/sysinfo.h> /* for SAGET and MINFO structures */ -class MemMeter : public FieldMeterGraph { +class MemMeter : public FieldMeterGraph<double> { public: MemMeter(XOSView *parent); ~MemMeter(void); --- linux/btrymeter.cc +++ linux/btrymeter.cc 2006-07-26 17:29:02.000000000 +0200 @@ -29,7 +29,7 @@ static const char APMFILENAME[] = "/proc static const char ACPIBATTERYDIR[] = "/proc/acpi/battery"; BtryMeter::BtryMeter( XOSView *parent ) - : FieldMeter( parent, 2, "BTRY", "AVAIL/USED", 1, 1, 0 ){ + : FieldMeter<float>( parent, 2, "BTRY", "AVAIL/USED", 1, 1, 0 ){ // find out ONCE whether to use ACPI or APM use_acpi = use_apm = false; @@ -100,7 +100,7 @@ bool BtryMeter::has_acpi( void ){ void BtryMeter::checkResources( void ){ - FieldMeter::checkResources(); + FieldMeter<float>::checkResources(); setfieldcolor( 0, parent_->getResource( "batteryLeftColor" ) ); setfieldcolor( 1, parent_->getResource( "batteryUsedColor" ) ); --- linux/btrymeter.h +++ linux/btrymeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -14,7 +14,7 @@ #include <string> -class BtryMeter : public FieldMeter { +class BtryMeter : public FieldMeter<float> { public: BtryMeter( XOSView *parent ); ~BtryMeter( void ); --- linux/cpumeter.cc +++ linux/cpumeter.cc 2006-07-26 17:29:50.000000000 +0200 @@ -19,7 +19,7 @@ static const char STATFILENAME[] = "/pro #define MAX_PROCSTAT_LENGTH BUFFER_SIZE CPUMeter::CPUMeter(XOSView *parent, const char *cpuID) -: FieldMeterGraph( parent, 7, toUpper(cpuID), "US/NI/SY/ID/WA/HI/SI" ) { +: FieldMeterGraph<float>( parent, 7, toUpper(cpuID), "US/NI/SY/ID/WA/HI/SI" ) { _lineNum = findLine(cpuID); for ( int i = 0 ; i < 2 ; i++ ) for ( int j = 0 ; j < 7 ; j++ ) @@ -32,7 +32,7 @@ CPUMeter::~CPUMeter( void ){ } void CPUMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); setfieldcolor( 0, parent_->getResource( "cpuUserColor" ) ); setfieldcolor( 1, parent_->getResource( "cpuNiceColor" ) ); --- linux/cpumeter.h +++ linux/cpumeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -11,7 +11,7 @@ #include "fieldmetergraph.h" -class CPUMeter : public FieldMeterGraph { +class CPUMeter : public FieldMeterGraph<float> { public: CPUMeter(XOSView *parent, const char *cpuID = "cpu"); ~CPUMeter(void); --- linux/diskmeter.cc +++ linux/diskmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -19,7 +19,7 @@ #define MAX_PROCSTAT_LENGTH BUFFER_SIZE -DiskMeter::DiskMeter( XOSView *parent, float max ) : FieldMeterGraph( +DiskMeter::DiskMeter( XOSView *parent, float max ) : FieldMeterGraph<float>( parent, 3, "DISK", "READ/WRITE/IDLE"), _vmstat(false), _statFileName("/proc/stat") { @@ -61,7 +61,7 @@ DiskMeter::~DiskMeter( void ) void DiskMeter::checkResources( void ) { - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); setfieldcolor( 0, parent_->getResource("diskReadColor") ); setfieldcolor( 1, parent_->getResource("diskWriteColor") ); --- linux/diskmeter.h +++ linux/diskmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -9,7 +9,7 @@ #include "fieldmetergraph.h" -class DiskMeter : public FieldMeterGraph +class DiskMeter : public FieldMeterGraph<float> { public: DiskMeter( XOSView *parent, float max ); --- linux/lmstemp.cc +++ linux/lmstemp.cc 2006-07-26 17:13:10.000000000 +0200 @@ -23,7 +23,7 @@ static const char PROC_SENSORS[] = "/pro LmsTemp::LmsTemp( XOSView *parent, const char *filename, const char *label, const char *caption) - : FieldMeter( parent, 3, label, caption, 1, 1, 0 ){ + : FieldMeter<float>( parent, 3, label, caption, 1, 1, 0 ){ if(!checksensors(filename)) { std::cerr <<"Can not find file : " <<PROC_SENSORS <<"/*/" << filename << std::endl; @@ -96,7 +96,7 @@ int LmsTemp::checksensors(const char* f } void LmsTemp::checkResources( void ){ - FieldMeter::checkResources(); + FieldMeter<float>::checkResources(); setfieldcolor( 0, parent_->getResource( "lmstempActColor" ) ); setfieldcolor( 1, parent_->getResource( "lmstempIdleColor") ); --- linux/lmstemp.h +++ linux/lmstemp.h 2006-07-26 17:13:10.000000000 +0200 @@ -15,7 +15,7 @@ #include "fieldmeter.h" -class LmsTemp : public FieldMeter { +class LmsTemp : public FieldMeter<float> { public: LmsTemp( XOSView *parent, const char * filename, const char *label, const char * caption); --- linux/loadmeter.cc +++ linux/loadmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -19,7 +19,7 @@ static const char SPEEDFILENAME[] = "/pr LoadMeter::LoadMeter( XOSView *parent ) - : FieldMeterGraph( parent, 2, "LOAD", "PROCS/MIN", 1, 1, 0 ){ + : FieldMeterGraph<float>( parent, 2, "LOAD", "PROCS/MIN", 1, 1, 0 ){ lastalarmstate = -1; total_ = 2.0; old_cpu_speed_= cur_cpu_speed_=0; @@ -31,7 +31,7 @@ LoadMeter::~LoadMeter( void ){ } void LoadMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); procloadcol_ = parent_->allocColor(parent_->getResource( "loadProcColor" )); warnloadcol_ = parent_->allocColor(parent_->getResource( "loadWarnColor" )); --- linux/loadmeter.h +++ linux/loadmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -15,7 +15,7 @@ #include "fieldmetergraph.h" -class LoadMeter : public FieldMeterGraph { +class LoadMeter : public FieldMeterGraph<float> { public: LoadMeter( XOSView *parent ); ~LoadMeter( void ); --- linux/memmeter.cc +++ linux/memmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -15,7 +15,7 @@ static const char MEMFILENAME[] = "/proc static const char MEMSTATFNAME[] = "/proc/memstat"; MemMeter::MemMeter( XOSView *parent ) -: FieldMeterGraph( parent, 4, "MEM", "USED+SHAR/BUFF/CACHE/FREE" ){ +: FieldMeterGraph<double>( parent, 4, "MEM", "USED+SHAR/BUFF/CACHE/FREE" ){ _shAdj = -1; // Check and see if the memstat module has been loaded @@ -37,7 +37,7 @@ MemMeter::~MemMeter( void ){ } void MemMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<double>::checkResources(); setfieldcolor( 0, parent_->getResource( "memUsedColor" ) ); if (_shAdj == 0) @@ -80,7 +80,7 @@ void MemMeter::getmeminfo( void ){ } if (total_) - FieldMeterDecay::setUsed (total_ - fields_[4 + _shAdj], total_); + FieldMeterDecay<double>::setUsed (total_ - fields_[4 + _shAdj], total_); } MemMeter::LineInfo *MemMeter::findLines(LineInfo *tmplate, int len, --- linux/memmeter.h +++ linux/memmeter.h 2006-07-26 17:30:32.000000000 +0200 @@ -11,7 +11,7 @@ #include "fieldmetergraph.h" -class MemMeter : public FieldMeterGraph { +class MemMeter : public FieldMeterGraph<double> { public: MemMeter( XOSView *parent ); ~MemMeter( void ); @@ -28,7 +28,7 @@ private: class LineInfo { public: - LineInfo(const char *id, float *val) + LineInfo(const char *id, double *val) { _line = -1; _id = id; _val = val; _idlen = strlen(_id); } LineInfo(void) {}; @@ -43,7 +43,7 @@ private: int _line; const char *_id; int _idlen; - float *_val; + double *_val; }; LineInfo *_MIlineInfos; --- linux/netmeter.cc +++ linux/netmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -48,7 +48,7 @@ #include <string> NetMeter::NetMeter( XOSView *parent, float max ) - : FieldMeterGraph( parent, 3, "NET", "IN/OUT/IDLE" ){ + : FieldMeterGraph<float>( parent, 3, "NET", "IN/OUT/IDLE" ){ _timer.start(); maxpackets_ = max; _lastBytesIn = _lastBytesOut = 0; @@ -107,7 +107,7 @@ void NetMeter::checkOSVersion(void) } void NetMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); setfieldcolor( 0, parent_->getResource( "netInColor" ) ); setfieldcolor( 1, parent_->getResource( "netOutColor" ) ); --- linux/netmeter.h +++ linux/netmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -14,7 +14,7 @@ class Host; -class NetMeter : public FieldMeterGraph { +class NetMeter : public FieldMeterGraph<float> { public: NetMeter(XOSView *parent, float max); ~NetMeter( void ); --- linux/nfsmeter.cc +++ linux/nfsmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -37,7 +37,7 @@ NFSMeter::NFSMeter(XOSView *parent, const char *name, int nfields, char *fields, const char *statfile) - : FieldMeterGraph( parent, nfields, name, fields ){ + : FieldMeterGraph<float>( parent, nfields, name, fields ){ _statfile = statfile; _statname = name; } @@ -46,7 +46,7 @@ NFSMeter::~NFSMeter( void ){ } void NFSMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); } NFSDStats::NFSDStats(XOSView *parent) --- linux/nfsmeter.h +++ linux/nfsmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -13,7 +13,7 @@ class Host; -class NFSMeter : public FieldMeterGraph { +class NFSMeter : public FieldMeterGraph<float> { public: NFSMeter( XOSView *parent, --- linux/pagemeter.cc +++ linux/pagemeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -18,7 +18,7 @@ PageMeter::PageMeter( XOSView *parent, float max ) - : FieldMeterGraph( parent, 3, "PAGE", "IN/OUT/IDLE" ), + : FieldMeterGraph<float>( parent, 3, "PAGE", "IN/OUT/IDLE" ), _vmstat(false), _statFileName("/proc/stat"){ for ( int i = 0 ; i < 2 ; i++ ) for ( int j = 0 ; j < 2 ; j++ ) @@ -40,7 +40,7 @@ PageMeter::~PageMeter( void ){ } void PageMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); setfieldcolor( 0, parent_->getResource( "pageInColor" ) ); setfieldcolor( 1, parent_->getResource( "pageOutColor" ) ); --- linux/pagemeter.h +++ linux/pagemeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -11,7 +11,7 @@ #include "fieldmetergraph.h" -class PageMeter : public FieldMeterGraph { +class PageMeter : public FieldMeterGraph<float> { public: PageMeter( XOSView *parent, float max ); ~PageMeter( void ); --- linux/swapmeter.cc +++ linux/swapmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -27,7 +27,7 @@ static const char MEMFILENAME[] = "/proc SwapMeter::SwapMeter( XOSView *parent ) -: FieldMeterGraph( parent, 2, "SWAP", "USED/FREE" ){ +: FieldMeterGraph<float>( parent, 2, "SWAP", "USED/FREE" ){ } @@ -35,7 +35,7 @@ SwapMeter::~SwapMeter( void ){ } void SwapMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); setfieldcolor( 0, parent_->getResource( "swapUsedColor" ) ); setfieldcolor( 1, parent_->getResource( "swapFreeColor" ) ); --- linux/swapmeter.h +++ linux/swapmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -13,7 +13,7 @@ #include "fieldmetergraph.h" -class SwapMeter : public FieldMeterGraph { +class SwapMeter : public FieldMeterGraph<float> { public: SwapMeter( XOSView *parent ); ~SwapMeter( void ); --- sunos5/cpumeter.cc +++ sunos5/cpumeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -11,7 +11,7 @@ #include <sstream> CPUMeter::CPUMeter(XOSView *parent, kstat_ctl_t *_kc, int cpuid) - : FieldMeterGraph(parent, CPU_STATES, toUpper(cpuStr(cpuid)), + : FieldMeterGraph<float>(parent, CPU_STATES, toUpper(cpuStr(cpuid)), "USER/SYS/WAIT/IDLE") { kc = _kc; @@ -36,7 +36,7 @@ CPUMeter::~CPUMeter(void) void CPUMeter::checkResources(void) { - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); setfieldcolor(0, parent_->getResource("cpuUserColor")); setfieldcolor(1, parent_->getResource("cpuSystemColor")); --- sunos5/cpumeter.h +++ sunos5/cpumeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -10,7 +10,7 @@ #include <kstat.h> #include <sys/sysinfo.h> -class CPUMeter : public FieldMeterGraph { +class CPUMeter : public FieldMeterGraph<float> { public: CPUMeter(XOSView *parent, kstat_ctl_t *kcp, int cpuid = 0); ~CPUMeter(void); --- sunos5/diskmeter.cc +++ sunos5/diskmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -12,7 +12,7 @@ DiskMeter::DiskMeter( XOSView *parent, kstat_ctl_t *_kc, float max ) - : FieldMeterGraph( parent, 3, "DISK", "READ/WRITE/IDLE") + : FieldMeterGraph<float>( parent, 3, "DISK", "READ/WRITE/IDLE") { kc = _kc; read_prev_ = 0; @@ -37,7 +37,7 @@ DiskMeter::~DiskMeter( void ) void DiskMeter::checkResources( void ) { - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); setfieldcolor( 0, parent_->getResource("diskReadColor") ); setfieldcolor( 1, parent_->getResource("diskWriteColor") ); --- sunos5/diskmeter.h +++ sunos5/diskmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -11,7 +11,7 @@ #include <kstat.h> #define NPARTS 100 -class DiskMeter : public FieldMeterGraph +class DiskMeter : public FieldMeterGraph<float> { public: DiskMeter( XOSView *parent, kstat_ctl_t *_kc, float max ); --- sunos5/loadmeter.cc +++ sunos5/loadmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -11,7 +11,7 @@ using std::cerr; LoadMeter::LoadMeter(XOSView *parent, kstat_ctl_t *_kc) - : FieldMeterGraph(parent, 2, "LOAD", "PROCS/MIN", 1, 1, 0) + : FieldMeterGraph<float>(parent, 2, "LOAD", "PROCS/MIN", 1, 1, 0) { kc = _kc; ksp = kstat_lookup(kc, "unix", 0, "system_misc"); @@ -27,7 +27,7 @@ LoadMeter::~LoadMeter(void) void LoadMeter::checkResources(void) { - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); warnloadcol_ = parent_->allocColor( parent_->getResource("loadWarnColor" )); --- sunos5/loadmeter.h +++ sunos5/loadmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -8,7 +8,7 @@ #include "fieldmetergraph.h" #include <kstat.h> -class LoadMeter : public FieldMeterGraph { +class LoadMeter : public FieldMeterGraph<float> { public: LoadMeter(XOSView *parent, kstat_ctl_t *kcp); ~LoadMeter(void); --- sunos5/memmeter.cc +++ sunos5/memmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -8,7 +8,7 @@ #include <stdlib.h> MemMeter::MemMeter(XOSView *parent, kstat_ctl_t *_kc) - : FieldMeterGraph(parent, 2, "MEM", "USED/FREE") + : FieldMeterGraph<double>(parent, 2, "MEM", "USED/FREE") { kc = _kc; @@ -24,7 +24,7 @@ MemMeter::MemMeter(XOSView *parent, ksta void MemMeter::checkResources(void) { - FieldMeterGraph::checkResources(); + FieldMeterGraph<double>::checkResources(); setfieldcolor(0, parent_->getResource("memUsedColor")); setfieldcolor(1, parent_->getResource("memFreeColor")); --- sunos5/memmeter.h +++ sunos5/memmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -8,7 +8,7 @@ #include "fieldmetergraph.h" #include <kstat.h> -class MemMeter : public FieldMeterGraph { +class MemMeter : public FieldMeterGraph<double> { public: MemMeter(XOSView *parent, kstat_ctl_t *kcp); ~MemMeter(void); --- sunos5/netmeter.cc +++ sunos5/netmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -11,7 +11,7 @@ #include <stdlib.h> NetMeter::NetMeter( XOSView *parent, kstat_ctl_t *_kc, float max ) - : FieldMeterGraph( parent, 3, "NET", "IN/OUT/IDLE" ){ + : FieldMeterGraph<float>( parent, 3, "NET", "IN/OUT/IDLE" ){ kc = _kc; maxpackets_ = max; nnet=0; @@ -50,7 +50,7 @@ NetMeter::~NetMeter( void ){ } void NetMeter::checkResources( void ){ - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); setfieldcolor( 0, parent_->getResource("netInColor") ); setfieldcolor( 1, parent_->getResource("netOutColor") ); --- sunos5/netmeter.h +++ sunos5/netmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -16,7 +16,7 @@ class Host; -class NetMeter : public FieldMeterGraph { +class NetMeter : public FieldMeterGraph<float> { public: NetMeter(XOSView *parent, kstat_ctl_t *_kc, float max); ~NetMeter( void ); --- sunos5/pagemeter.cc +++ sunos5/pagemeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -9,7 +9,7 @@ #include <sys/sysinfo.h> PageMeter::PageMeter(XOSView *parent, kstat_ctl_t *_kc, float max) - : FieldMeterGraph( parent, 3, "PAGE", "IN/OUT/IDLE") + : FieldMeterGraph<float>( parent, 3, "PAGE", "IN/OUT/IDLE") { kc = _kc; @@ -35,7 +35,7 @@ PageMeter::~PageMeter(void) void PageMeter::checkResources(void) { - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); setfieldcolor(0, parent_->getResource("pageInColor")); setfieldcolor(1, parent_->getResource("pageOutColor")); --- sunos5/pagemeter.h +++ sunos5/pagemeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -8,7 +8,7 @@ #include "fieldmetergraph.h" #include <kstat.h> -class PageMeter : public FieldMeterGraph { +class PageMeter : public FieldMeterGraph<float> { public: PageMeter(XOSView *parent, kstat_ctl_t *kcp, float max); ~PageMeter(void); --- sunos5/swapmeter.cc +++ sunos5/swapmeter.cc 2006-07-26 17:13:10.000000000 +0200 @@ -12,7 +12,7 @@ static size_t Pagesize; SwapMeter::SwapMeter(XOSView *parent, kstat_ctl_t *_kc) - : FieldMeterGraph(parent, 3, "SWAP", "USED/RSVD/FREE") + : FieldMeterGraph<float>(parent, 3, "SWAP", "USED/RSVD/FREE") { if (!Pagesize) Pagesize = sysconf(_SC_PAGESIZE); @@ -24,7 +24,7 @@ SwapMeter::~SwapMeter(void) void SwapMeter::checkResources(void) { - FieldMeterGraph::checkResources(); + FieldMeterGraph<float>::checkResources(); setfieldcolor(0, parent_->getResource("swapUsedColor")); setfieldcolor(1, parent_->getResource("swapReservedColor")); --- sunos5/swapmeter.h +++ sunos5/swapmeter.h 2006-07-26 17:13:10.000000000 +0200 @@ -8,7 +8,7 @@ #include "fieldmetergraph.h" #include <kstat.h> -class SwapMeter : public FieldMeterGraph { +class SwapMeter : public FieldMeterGraph<float> { public: SwapMeter(XOSView *parent, kstat_ctl_t *kcp); ~SwapMeter(void);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor