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)  

BtryMeter Class Reference

#include <btrymeter.h>

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

Classes

struct  acpi_batt
 

Public Member Functions

 BtryMeter (XOSView *parent)
 
 ~BtryMeter (void)
 
const char * name (void) const
 
void checkevent (void)
 
void checkResources (void)
 
 BtryMeter (XOSView *parent)
 
 ~BtryMeter (void)
 
const char * name (void) const
 
void checkevent (void)
 
void checkResources (void)
 
- Public Member Functions inherited from FieldMeter
 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 disableMeter (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)
 
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
 

Static Public Member Functions

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

Public Attributes

acpi_batt battery
 

Protected Member Functions

void getstats (void)
 
void getpwrinfo (void)
 
- Protected Member Functions inherited from FieldMeter
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 ()
 

Private Member Functions

bool getapminfo (void)
 
bool getacpi_or_sys_info (void)
 
bool acpi_battery_present (const std::string &filename)
 
bool acpi_parse_battery (const std::string &filename)
 
bool sys_battery_present (const std::string &filename)
 
bool sys_parse_battery (const std::string &filename)
 
void handle_apm_state (void)
 
void handle_acpi_state (void)
 

Static Private Member Functions

static bool has_acpi (void)
 
static bool has_apm (void)
 
static bool has_syspower (void)
 

Private Attributes

unsigned long leftcolor_
 
unsigned long usedcolor_
 
unsigned long chargecolor_
 
unsigned long fullcolor_
 
unsigned long lowcolor_
 
unsigned long critcolor_
 
unsigned long nonecolor_
 
unsigned int old_state_
 
bool use_apm
 
bool use_acpi
 
bool use_syspower
 
int apm_battery_state
 
int old_apm_battery_state
 
int acpi_charge_state
 
int old_acpi_charge_state
 
int acpi_sum_cap
 
int acpi_sum_remain
 
int acpi_sum_rate
 
int acpi_sum_alarm
 

Additional Inherited Members

- Protected Types inherited from FieldMeter
enum  UsedType {
  INVALID_0 , FLOAT , PERCENT , AUTOSCALE ,
  INVALID_TAIL
}
 
- Protected Attributes inherited from FieldMeter
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_
 

Detailed Description

Definition at line 17 of file btrymeter.h.

Constructor & Destructor Documentation

◆ BtryMeter() [1/2]

BtryMeter::BtryMeter ( XOSView parent)

Definition at line 15 of file btrymeter.cc.

References old_state_.

◆ ~BtryMeter() [1/2]

BtryMeter::~BtryMeter ( void  )

Definition at line 20 of file btrymeter.cc.

◆ BtryMeter() [2/2]

BtryMeter::BtryMeter ( XOSView parent)

◆ ~BtryMeter() [2/2]

BtryMeter::~BtryMeter ( void  )

Member Function Documentation

◆ acpi_battery_present()

bool BtryMeter::acpi_battery_present ( const std::string &  filename)
private

Definition at line 472 of file btrymeter.cc.

References XOSDEBUG.

Referenced by getacpi_or_sys_info().

◆ acpi_parse_battery()

◆ checkevent() [1/2]

void BtryMeter::checkevent ( void  )
virtual

Implements Meter.

Definition at line 41 of file btrymeter.cc.

References FieldMeter::drawfields(), and getstats().

◆ checkevent() [2/2]

void BtryMeter::checkevent ( void  )
virtual

Reimplemented from FieldMeter.

◆ checkResources() [1/2]

◆ checkResources() [2/2]

void BtryMeter::checkResources ( void  )
virtual

Reimplemented from FieldMeter.

◆ getacpi_or_sys_info()

◆ getapminfo()

bool BtryMeter::getapminfo ( void  )
private

◆ getpwrinfo()

void BtryMeter::getpwrinfo ( void  )
protected

◆ getstats()

◆ handle_acpi_state()

void BtryMeter::handle_acpi_state ( void  )
private

◆ handle_apm_state()

void BtryMeter::handle_apm_state ( void  )
private

◆ has_acpi()

bool BtryMeter::has_acpi ( void  )
staticprivate

Definition at line 85 of file btrymeter.cc.

References ACPIBATTERYDIR, and XOSDEBUG.

Referenced by has_source().

◆ has_apm()

bool BtryMeter::has_apm ( void  )
staticprivate

Definition at line 56 of file btrymeter.cc.

References APMFILENAME, and XOSDEBUG.

Referenced by has_source().

◆ has_source()

bool BtryMeter::has_source ( void  )
static

Definition at line 51 of file btrymeter.cc.

References has_acpi(), has_apm(), and has_syspower().

◆ has_syspower()

bool BtryMeter::has_syspower ( void  )
staticprivate

Definition at line 109 of file btrymeter.cc.

References SYSPOWERDIR.

Referenced by has_source().

◆ name() [1/2]

const char* BtryMeter::name ( void  ) const
inlinevirtual

Reimplemented from Meter.

Definition at line 22 of file btrymeter.h.

◆ name() [2/2]

const char* BtryMeter::name ( void  ) const
inlinevirtual

Reimplemented from Meter.

Definition at line 20 of file btrymeter.h.

◆ sys_battery_present()

bool BtryMeter::sys_battery_present ( const std::string &  filename)
private

Definition at line 592 of file btrymeter.cc.

References XOSDEBUG.

Referenced by getacpi_or_sys_info().

◆ sys_parse_battery()

Member Data Documentation

◆ acpi_charge_state

int BtryMeter::acpi_charge_state
private

Definition at line 65 of file btrymeter.h.

Referenced by getacpi_or_sys_info(), and handle_acpi_state().

◆ acpi_sum_alarm

int BtryMeter::acpi_sum_alarm
private

Definition at line 71 of file btrymeter.h.

Referenced by getacpi_or_sys_info().

◆ acpi_sum_cap

int BtryMeter::acpi_sum_cap
private

Definition at line 68 of file btrymeter.h.

Referenced by getacpi_or_sys_info().

◆ acpi_sum_rate

int BtryMeter::acpi_sum_rate
private

Definition at line 70 of file btrymeter.h.

Referenced by getacpi_or_sys_info().

◆ acpi_sum_remain

int BtryMeter::acpi_sum_remain
private

Definition at line 69 of file btrymeter.h.

Referenced by getacpi_or_sys_info().

◆ apm_battery_state

int BtryMeter::apm_battery_state
private

Definition at line 62 of file btrymeter.h.

Referenced by getapminfo(), and handle_apm_state().

◆ battery

acpi_batt BtryMeter::battery

Definition at line 35 of file btrymeter.h.

Referenced by acpi_parse_battery(), getacpi_or_sys_info(), and sys_parse_battery().

◆ chargecolor_

unsigned long BtryMeter::chargecolor_
private

Definition at line 30 of file btrymeter.h.

Referenced by checkResources(), and getstats().

◆ critcolor_

unsigned long BtryMeter::critcolor_
private

Definition at line 31 of file btrymeter.h.

Referenced by checkResources(), and getstats().

◆ fullcolor_

unsigned long BtryMeter::fullcolor_
private

Definition at line 30 of file btrymeter.h.

Referenced by checkResources(), and getstats().

◆ leftcolor_

unsigned long BtryMeter::leftcolor_
private

Definition at line 30 of file btrymeter.h.

Referenced by checkResources(), and getstats().

◆ lowcolor_

unsigned long BtryMeter::lowcolor_
private

Definition at line 31 of file btrymeter.h.

Referenced by checkResources(), and getstats().

◆ nonecolor_

unsigned long BtryMeter::nonecolor_
private

Definition at line 31 of file btrymeter.h.

Referenced by checkResources(), and getstats().

◆ old_acpi_charge_state

int BtryMeter::old_acpi_charge_state
private

Definition at line 66 of file btrymeter.h.

Referenced by getacpi_or_sys_info().

◆ old_apm_battery_state

int BtryMeter::old_apm_battery_state
private

Definition at line 63 of file btrymeter.h.

Referenced by getapminfo().

◆ old_state_

unsigned int BtryMeter::old_state_
private

Definition at line 32 of file btrymeter.h.

Referenced by BtryMeter(), and getstats().

◆ use_acpi

bool BtryMeter::use_acpi
private

Definition at line 47 of file btrymeter.h.

Referenced by getacpi_or_sys_info(), and getpwrinfo().

◆ use_apm

bool BtryMeter::use_apm
private

Definition at line 46 of file btrymeter.h.

Referenced by getpwrinfo().

◆ use_syspower

bool BtryMeter::use_syspower
private

Definition at line 48 of file btrymeter.h.

Referenced by getacpi_or_sys_info(), and getpwrinfo().

◆ usedcolor_

unsigned long BtryMeter::usedcolor_
private

Definition at line 30 of file btrymeter.h.

Referenced by checkResources().


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