xosview  1.23
About: xosview is an X Windows based system monitor (cpu, memory, swap and network usage; interrupt and serial activities; load average).
  Fossies Dox: xosview-1.23.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

BitFieldMeter Class Reference

#include <bitfieldmeter.h>

Inheritance diagram for BitFieldMeter:
[legend]
Collaboration diagram for BitFieldMeter:
[legend]

Public Member Functions

 BitFieldMeter (XOSView *parent, int numBits=1, int numfields=1, const char *title="", const char *bitlegend="", const char *fieldlegend="", int docaptions=0, int dolegends=0, int dousedlegends=0)
 
virtual ~BitFieldMeter (void)
 
virtual void drawfields (int mandatory=0)
 
void drawBits (int mandatory=0)
 
void setfieldcolor (int field, const char *color)
 
void setfieldcolor (int field, unsigned long color)
 
void docaptions (int val)
 
void dolegends (int val)
 
void dousedlegends (int val)
 
void reset (void)
 
void setUsed (double val, double total)
 
void setBits (int startbit, unsigned char values)
 
void draw (void)
 
void checkevent (void)
 
void disableMeter (void)
 
virtual void checkResources (void)
 
- Public Member Functions inherited from Meter
 Meter (XOSView *parent, const char *title="", const char *legend="", int docaptions=0, int dolegends=0, int dousedlegends=0)
 
virtual ~Meter (void)
 
virtual const char * name (void) const
 
void resize (int x, int y, int width, int height)
 
void title (const char *title)
 
const char * title (void)
 
void legend (const char *legend)
 
const char * legend (void)
 
void docaptions (int val)
 
void dolegends (int val)
 
void dousedlegends (int val)
 
int requestevent (void)
 
int getX () const
 
int getY () const
 
int getWidth () const
 
int getHeight () const
 

Protected Types

enum  UsedType {
  INVALID_0 , FLOAT , PERCENT , AUTOSCALE ,
  INVALID_TAIL
}
 

Protected Member Functions

void SetUsedFormat (const char *const str)
 
void drawfieldlegend (void)
 
void drawused (int mandatory)
 
bool checkX (int x, int width) const
 
void setNumFields (int n)
 
void setNumBits (int n)
 
void setfieldlegend (const char *fieldlegend)
 
void IntervalTimerStart ()
 
void IntervalTimerStop ()
 
double IntervalTimeInMicrosecs ()
 
double IntervalTimeInSecs ()
 
- Protected Member Functions inherited from Meter
double samplesPerSecond ()
 
double secondsPerSample ()
 

Protected Attributes

int numfields_
 
double * fields_
 
double total_
 
double used_
 
double lastused_
 
int * lastvals_
 
int * lastx_
 
unsigned long * colors_
 
unsigned long usedcolor_
 
UsedType print_
 
int printedZeroTotalMesg_
 
int numWarnings_
 
bool metric_
 
int usedoffset_
 
unsigned long onColor_
 
unsigned long offColor_
 
char * bits_
 
char * lastbits_
 
int numbits_
 
char * fieldLegend_
 
- Protected Attributes inherited from Meter
XOSViewparent_
 
int x_
 
int y_
 
int width_
 
int height_
 
int docaptions_
 
int dolegends_
 
int dousedlegends_
 
int priority_
 
int counter_
 
char * title_
 
char * legend_
 
unsigned long textcolor_
 

Private Attributes

Timer _timer
 

Additional Inherited Members

- Static Public Member Functions inherited from Meter
static double scaleValue (double value, char *scale, bool metric)
 

Detailed Description

Definition at line 16 of file bitfieldmeter.h.

Member Enumeration Documentation

◆ UsedType

enum BitFieldMeter::UsedType
protected
Enumerator
INVALID_0 
FLOAT 
PERCENT 
AUTOSCALE 
INVALID_TAIL 

Definition at line 44 of file bitfieldmeter.h.

Constructor & Destructor Documentation

◆ BitFieldMeter()

BitFieldMeter::BitFieldMeter ( XOSView parent,
int  numBits = 1,
int  numfields = 1,
const char *  title = "",
const char *  bitlegend = "",
const char *  fieldlegend = "",
int  docaptions = 0,
int  dolegends = 0,
int  dousedlegends = 0 
)

◆ ~BitFieldMeter()

BitFieldMeter::~BitFieldMeter ( void  )
virtual

Definition at line 55 of file bitfieldmeter.cc.

References bits_, colors_, fields_, lastbits_, lastvals_, and lastx_.

Member Function Documentation

◆ checkevent()

void BitFieldMeter::checkevent ( void  )
virtual

Implements Meter.

Reimplemented in RAIDMeter.

Definition at line 311 of file bitfieldmeter.cc.

References drawBits(), and drawfields().

Referenced by RAIDMeter::checkevent().

◆ checkResources()

void BitFieldMeter::checkResources ( void  )
virtual

Reimplemented from Meter.

Reimplemented in RAIDMeter.

Definition at line 64 of file bitfieldmeter.cc.

References XWin::allocColor(), Meter::checkResources(), XWin::getResource(), Meter::parent_, and usedcolor_.

Referenced by RAIDMeter::checkResources().

◆ checkX()

bool BitFieldMeter::checkX ( int  x,
int  width 
) const
protected

Definition at line 344 of file bitfieldmeter.cc.

References fields_, Meter::name(), numfields_, total_, Meter::width_, and Meter::x_.

◆ disableMeter()

void BitFieldMeter::disableMeter ( void  )

◆ docaptions()

void BitFieldMeter::docaptions ( int  val)
inline

Definition at line 29 of file bitfieldmeter.h.

References Meter::docaptions_.

◆ dolegends()

void BitFieldMeter::dolegends ( int  val)
inline

Definition at line 30 of file bitfieldmeter.h.

References Meter::dolegends_.

◆ dousedlegends()

void BitFieldMeter::dousedlegends ( int  val)
inline

Definition at line 31 of file bitfieldmeter.h.

References Meter::dousedlegends_.

◆ draw()

◆ drawBits()

void BitFieldMeter::drawBits ( int  mandatory = 0)

◆ drawfieldlegend()

void BitFieldMeter::drawfieldlegend ( void  )
protected

◆ drawfields()

◆ drawused()

◆ IntervalTimeInMicrosecs()

double BitFieldMeter::IntervalTimeInMicrosecs ( )
inlineprotected

Definition at line 81 of file bitfieldmeter.h.

References _timer, and Timer::report_usecs().

◆ IntervalTimeInSecs()

double BitFieldMeter::IntervalTimeInSecs ( )
inlineprotected

Definition at line 82 of file bitfieldmeter.h.

References _timer, and Timer::report_usecs().

◆ IntervalTimerStart()

void BitFieldMeter::IntervalTimerStart ( )
inlineprotected

Definition at line 76 of file bitfieldmeter.h.

References _timer, and Timer::start().

◆ IntervalTimerStop()

void BitFieldMeter::IntervalTimerStop ( )
inlineprotected

Definition at line 77 of file bitfieldmeter.h.

References _timer, and Timer::stop().

◆ reset()

void BitFieldMeter::reset ( void  )

Definition at line 125 of file bitfieldmeter.cc.

References lastvals_, lastx_, and numfields_.

◆ setBits()

void BitFieldMeter::setBits ( int  startbit,
unsigned char  values 
)

Definition at line 316 of file bitfieldmeter.cc.

References bits_.

◆ setfieldcolor() [1/2]

void BitFieldMeter::setfieldcolor ( int  field,
const char *  color 
)

◆ setfieldcolor() [2/2]

void BitFieldMeter::setfieldcolor ( int  field,
unsigned long  color 
)

Definition at line 134 of file bitfieldmeter.cc.

References colors_.

◆ setfieldlegend()

void BitFieldMeter::setfieldlegend ( const char *  fieldlegend)
protected

Definition at line 363 of file bitfieldmeter.cc.

References fieldLegend_.

Referenced by BitFieldMeter(), disableMeter(), and RAIDMeter::RAIDMeter().

◆ setNumBits()

void BitFieldMeter::setNumBits ( int  n)
protected

Definition at line 70 of file bitfieldmeter.cc.

References bits_, lastbits_, and numbits_.

Referenced by BitFieldMeter(), disableMeter(), and RAIDMeter::RAIDMeter().

◆ setNumFields()

void BitFieldMeter::setNumFields ( int  n)
protected

Definition at line 324 of file bitfieldmeter.cc.

References colors_, fields_, lastvals_, lastx_, numfields_, and total_.

Referenced by BitFieldMeter(), and disableMeter().

◆ setUsed()

void BitFieldMeter::setUsed ( double  val,
double  total 
)

Definition at line 98 of file bitfieldmeter.cc.

References AUTOSCALE, FLOAT, Meter::name(), PERCENT, print_, printedZeroTotalMesg_, and used_.

Referenced by RAIDMeter::checkevent().

◆ SetUsedFormat()

void BitFieldMeter::SetUsedFormat ( const char *const  str)
protected

Definition at line 82 of file bitfieldmeter.cc.

References AUTOSCALE, FLOAT, PERCENT, and print_.

Referenced by RAIDMeter::checkResources().

Member Data Documentation

◆ _timer

Timer BitFieldMeter::_timer
private

◆ bits_

char* BitFieldMeter::bits_
protected

◆ colors_

unsigned long* BitFieldMeter::colors_
protected

◆ fieldLegend_

char* BitFieldMeter::fieldLegend_
protected

Definition at line 69 of file bitfieldmeter.h.

Referenced by BitFieldMeter(), drawfieldlegend(), and setfieldlegend().

◆ fields_

double* BitFieldMeter::fields_
protected

◆ lastbits_

char * BitFieldMeter::lastbits_
protected

Definition at line 59 of file bitfieldmeter.h.

Referenced by BitFieldMeter(), drawBits(), setNumBits(), and ~BitFieldMeter().

◆ lastused_

double BitFieldMeter::lastused_
protected

Definition at line 48 of file bitfieldmeter.h.

Referenced by BitFieldMeter(), and drawused().

◆ lastvals_

int* BitFieldMeter::lastvals_
protected

Definition at line 49 of file bitfieldmeter.h.

Referenced by BitFieldMeter(), drawfields(), reset(), setNumFields(), and ~BitFieldMeter().

◆ lastx_

int * BitFieldMeter::lastx_
protected

Definition at line 49 of file bitfieldmeter.h.

Referenced by BitFieldMeter(), drawfields(), reset(), setNumFields(), and ~BitFieldMeter().

◆ metric_

bool BitFieldMeter::metric_
protected

Definition at line 55 of file bitfieldmeter.h.

Referenced by BitFieldMeter(), drawfields(), and drawused().

◆ numbits_

int BitFieldMeter::numbits_
protected

Definition at line 60 of file bitfieldmeter.h.

Referenced by drawBits(), and setNumBits().

◆ numfields_

int BitFieldMeter::numfields_
protected

Definition at line 46 of file bitfieldmeter.h.

Referenced by checkX(), drawfieldlegend(), drawfields(), reset(), and setNumFields().

◆ numWarnings_

int BitFieldMeter::numWarnings_
protected

Definition at line 54 of file bitfieldmeter.h.

Referenced by BitFieldMeter(), and drawfields().

◆ offColor_

unsigned long BitFieldMeter::offColor_
protected

Definition at line 58 of file bitfieldmeter.h.

Referenced by RAIDMeter::checkResources(), disableMeter(), and drawBits().

◆ onColor_

unsigned long BitFieldMeter::onColor_
protected

Definition at line 58 of file bitfieldmeter.h.

Referenced by RAIDMeter::checkResources(), disableMeter(), draw(), and drawBits().

◆ print_

UsedType BitFieldMeter::print_
protected

Definition at line 52 of file bitfieldmeter.h.

Referenced by BitFieldMeter(), drawused(), setUsed(), and SetUsedFormat().

◆ printedZeroTotalMesg_

int BitFieldMeter::printedZeroTotalMesg_
protected

Definition at line 53 of file bitfieldmeter.h.

Referenced by BitFieldMeter(), and setUsed().

◆ total_

double BitFieldMeter::total_
protected

◆ used_

double BitFieldMeter::used_
protected

Definition at line 48 of file bitfieldmeter.h.

Referenced by BitFieldMeter(), drawused(), and setUsed().

◆ usedcolor_

unsigned long BitFieldMeter::usedcolor_
protected

Definition at line 51 of file bitfieldmeter.h.

Referenced by checkResources(), and drawused().

◆ usedoffset_

int BitFieldMeter::usedoffset_
protected

Definition at line 56 of file bitfieldmeter.h.

Referenced by BitFieldMeter(), and drawused().


The documentation for this class was generated from the following files: