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)  

FieldMeter Class Reference

#include <fieldmeter.h>

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

Public Member Functions

 FieldMeter (XOSView *parent, int numfields, const char *title="", const char *legend="", int docaptions=0, int dolegends=0, int dousedlegends=0)
 
virtual ~FieldMeter (void)
 
virtual void drawfields (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 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 drawlegend (void)
 
void drawused (int mandatory)
 
bool checkX (int x, int width) const
 
void setNumFields (int n)
 
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_
 
- 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 15 of file fieldmeter.h.

Member Enumeration Documentation

◆ UsedType

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

Definition at line 37 of file fieldmeter.h.

Constructor & Destructor Documentation

◆ FieldMeter()

FieldMeter::FieldMeter ( XOSView parent,
int  numfields,
const char *  title = "",
const char *  legend = "",
int  docaptions = 0,
int  dolegends = 0,
int  dousedlegends = 0 
)

◆ ~FieldMeter()

FieldMeter::~FieldMeter ( void  )
virtual

Definition at line 47 of file fieldmeter.cc.

References colors_, fields_, lastvals_, and lastx_.

Member Function Documentation

◆ checkevent()

◆ checkResources()

◆ checkX()

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

Definition at line 283 of file fieldmeter.cc.

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

Referenced by FieldMeterDecay::drawfields().

◆ disableMeter()

void FieldMeter::disableMeter ( void  )

◆ docaptions()

void FieldMeter::docaptions ( int  val)
inline

Definition at line 25 of file fieldmeter.h.

References Meter::docaptions_.

◆ dolegends()

void FieldMeter::dolegends ( int  val)
inline

Definition at line 26 of file fieldmeter.h.

References Meter::dolegends_.

◆ dousedlegends()

void FieldMeter::dousedlegends ( int  val)
inline

Definition at line 27 of file fieldmeter.h.

References Meter::dousedlegends_.

◆ draw()

◆ drawfields()

◆ drawlegend()

◆ drawused()

◆ IntervalTimeInMicrosecs()

double FieldMeter::IntervalTimeInMicrosecs ( )
inlineprotected

Definition at line 67 of file fieldmeter.h.

References _timer, and Timer::report_usecs().

Referenced by DiskMeter::update_info(), and DiskMeter::updateinfo().

◆ IntervalTimeInSecs()

double FieldMeter::IntervalTimeInSecs ( )
inlineprotected

◆ IntervalTimerStart()

◆ IntervalTimerStop()

void FieldMeter::IntervalTimerStop ( )
inlineprotected

◆ reset()

void FieldMeter::reset ( void  )

Definition at line 103 of file fieldmeter.cc.

References lastvals_, lastx_, and numfields_.

◆ setfieldcolor() [1/2]

◆ setfieldcolor() [2/2]

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

Definition at line 112 of file fieldmeter.cc.

References colors_.

◆ setNumFields()

void FieldMeter::setNumFields ( int  n)
protected

Definition at line 263 of file fieldmeter.cc.

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

Referenced by disableMeter(), and FieldMeter().

◆ setUsed()

◆ SetUsedFormat()

Member Data Documentation

◆ _timer

Timer FieldMeter::_timer
private

◆ colors_

◆ fields_

◆ lastused_

double FieldMeter::lastused_
protected

Definition at line 41 of file fieldmeter.h.

Referenced by drawused(), and FieldMeter().

◆ lastvals_

int* FieldMeter::lastvals_
protected

◆ lastx_

int * FieldMeter::lastx_
protected

◆ metric_

bool FieldMeter::metric_
protected

◆ numfields_

int FieldMeter::numfields_
protected

◆ numWarnings_

int FieldMeter::numWarnings_
protected

Definition at line 47 of file fieldmeter.h.

Referenced by drawfields(), and FieldMeter().

◆ print_

UsedType FieldMeter::print_
protected

Definition at line 45 of file fieldmeter.h.

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

◆ printedZeroTotalMesg_

int FieldMeter::printedZeroTotalMesg_
protected

Definition at line 46 of file fieldmeter.h.

Referenced by FieldMeter(), and setUsed().

◆ total_

◆ used_

double FieldMeter::used_
protected

Definition at line 41 of file fieldmeter.h.

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

◆ usedcolor_

unsigned long FieldMeter::usedcolor_
protected

Definition at line 44 of file fieldmeter.h.

Referenced by checkResources(), and drawused().

◆ usedoffset_

int FieldMeter::usedoffset_
protected

Definition at line 49 of file fieldmeter.h.

Referenced by drawused(), and FieldMeter().


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