Fl_Gauge V0.0.6

Copyright 2004 Michael Pearce
Document Started: 3 August 2004
Last Updated: 6 August 2004

class Fl_Gauge



Class Hierarchy

Include Files

Description

This widget draws a round gauge dial that operates over 270 degrees.

Features Include:
   Min and Max values can be set
   Red-Line limit setable, displayed and can beep or call a callback function.
   All Colours changeable.
   Secondary value as text display, or can be used to show primary value.
   Odometer display value possible.

Methods

Fl_Gauge::Fl_Gauge(int x,int y,int w,int h,const char *label=0)

The constructor creates the plotting area using the position, size, and label.

Fl_Gauge::~Fl_Gauge(void);

The destructor - does nothing.

Fl_Color Fl_Gauge::dialcolor(void)
Fl_Gauge::dialcolor(Fl_Color C)

The first form returns the color of the dial.
The second form sets the color of the dial.

int Fl_Gauge::fontface(void) Fl_Gauge::fontface(int f)

The first form returns the font number used.
The second form sets the font used.
Uses the standard FL_FONT system.

int Fl_Gauge::fontsize(void)
Fl_Gauge::fontsize(int f)

The first form returns the font size used.
The second form sets the font size used.

Fl_Color Fl_Gauge:: framecolor(void)
Fl_Gauge::framecolor(Fl_Color C)

The first form returns the frame color.
The Second form sets the frame color.

Fl_Gauge::greenzonecb(void (*cb)(void *))


Sets the callback to use for the greenzone.

Fl_Color Fl_Gauge:: greenzonecolor(void)
Fl_Gauge::greenzonecolor(Fl_Color C)

The first form returns the Green Zone color.
The second form sets the Green Zone color.

double FL_Gauge::double greenzoneend(void) {return(GreenZoneEnd);}
Fl_Gauge::greenzoneend(double z) {GreenZoneEnd=z;}

The first form returns the currnet green zone end position.
The Second form sets the green zone end position.

int FL_Gauge::greenzonemode(void){return(GreenZoneMode);}
FL_Gauge::greenzonemode(int m){GreenZoneMode=m;}

The first form return the current green zone mode.
The Second form sets the green zone mode.
Options are:
FL_GAUGE_GZ_OFF - Turn greenzone OFF
FL_GAUGE_GZ_ON - Display the green zone
FL_GAUGE_GZ_BEEP - Display and Beep if OUT of zone
FL_GAUGE_GZ_CBIN - Display and use callback if IN zone
FL_GAUGE_GZ_CBOUT - Display and use callback if OUT of zone

double FL_Gauge:: greenzonestart(void){return (GreenZoneStart);}
FL_Gauge::void greenzonestart(double z) {GreenZoneStart=z;}

The first form returns the current green zone start position.
The Second form sets the green zone start position.

double Fl_Gauge::max(void)
Fl_Gauge::max(double m)

The first form returns the maximum displayable value.
The second form sets the maximum displayable value

double Fl_Gauge::min(void)
Fl_Gauge::min(double m)

The first form returns the minimum displayable value.
The second form sets the minimum displayable value

FL_Color Fl_Gauge::odocolor(void)
Fl_Gauge::odocolor(Fl_Color C)

The first for returns the odometer text color.
The second form sets the odometer text color.

Fl_Gauge::ododec(void)

Decrements the odometer by the odoinc size.

double Fl_Gauge::odometer(void)
Fl_Gauge::odometer(double o)

The first form returns the odometer value
The second form sets the odometer value

int Fl_Gauge::odomode(void)
Fl_Gauge::odomode(int o)

The first form returns the odometer mode.
The second form sets the odometer mode.
The options are:
FL_GAUGE_ODO_OFF - OFF
FL_GAUGE_ODO_ON - ON

int Fl_Gauge::odoplaces(int &r,int &c);

Sets or reads the odometer format code %0r.0clf
If r and c are zero then the current settings are returned.
returns 1 for values read or 0 for values set.

Fl_Gauge::odoinc(void)

Increments the odometer by the odoinc size.

double Fl_Gauge::odoincsize(void)
Fl_Gauge::odoincsize

The first form returns the odometer increment size.
The second form sets the odometer increment size.

int Fl_Gauge::places(int &,int &)

Sets or reads the dials text format code %0r.0clf
If r and c are zero then the current settings are returned.
returns 1 for values read or 0 for values set.

Fl_Color Fl_Gauge:: pointercolor(void)
Fl_Gauge::pointercolor(Fl_Color C)

The first form returns the pointer color.
The second form sets the pointer color.

Fl_Gauge::redlinecb(void (*cb)(void *))

Set the callback for the red line alert mode.

Fl_Color Fl_Gauge:: redlinecolor(void)
Fl_Gauge::redlinecolor(Fl_Color C)

The first form returns the Red-Line color.
The second form sets the Red-Line color.

int FL_Gauge:: redlinemode(void)
FL_Gauge::void redlinemode(int m)

The first form return the current red line mode.
The Second form sets the red line mode.
Options are:
FL_GAUGE_RL_OFF - Turn red line OFF
FL_GAUGE_RL_ON - Display the red line
FL_GAUGE_RL_BEEP - Display and Beep if OUT of zone
FL_GAUGE_RL_CBIN - Display and use callback if IN zone
FL_GAUGE_RL_CBOUT - Display and use callback if OUT of zone

double Fl_Gauge::redlinestart(void)
Fl_Gauge::redlinestart(double r)

The first form returns the starting position of the red-line range.
The second form sets the starting position of teh red-line range.

double Fl_Gauge::step(void)
Fl_Gauge::step(double s)

The first form returns the size of the major step markings
The second form sets the size of the major step markings

double Fl_Gauge::stepdiv(void)
Fl_Gauge::stepdiv(double s)

The first form returns the size of the minor step markings.
The second form sets the size of the minor step markings.

Fl_Color Fl_Gauge::textcolor(void)
Fl_Gauge::textcolor(Fl_Color C)

The first form returns the scales/text color.
The second form sets the scales/text color.

int Fl_Gauge::type(void)
void type(int t)

The first form returns the type of gauge drawn.
The second form sets the type of gauge drawn.
Possible values are:
FL_GAUGE_ROUND - Standard 270 degree round gauge
FL_GAUGE_SQUARE - 180 degree Square outline gauge*
FL_GAUGE_LINEAR - Linear (Vertical) gauge*
FL_GAUGE_DIGITAL - Digital segments gauge*
*These are not yet implimented but are possible future additions.

Fl_Color Fl_Gauge::v2color(void)
Fl_Gauge::v2color(Fl_Color C)

The first for returns the second values text color.
The second form sets the second values text color.

int Fl_Gauge::v2mode(void)
Fl_Gauge::v2mode(int v)

The first form returns the secondary value mode.
The second form sets the secondary value mode.
The options are:
FL_GAUGE_V2_NONE - Not Displayed
FL_GAUGE_V2_ON - Displayed as secondary value
FL_GAUGE_V2_V1 - Displayed as primary value
FL_GAUGE_V2_TRIP - Displayed and works like trip counter - linked to odometer.

int Fl_Gauge::v2places(int &,int &)

Sets or reads the secondary value format code %0r.0clf
If r and c are zero then the current settings are returned.
returns 1 for values read or 0 for values set.

double Fl_Gauge::value(void)
Fl_Gauge::value(double v)

The first form returns the current value of the gauge. The second form sets the value for the gauge.

double Fl_Gauge::value2(void)
Fl_Gauge::value2(double v)

The first form returns the secondary value.
The second for sets the secondary value.

const char* Fl_Gauge::version(void)

Returns the version string of the widget.



Future plans

Following are possible future additions - ideas and comments welcome.
  • Add values around dial.
  • Add other styles of dials - e.g. Square 90 Degree, Linear, Digital etc

    Known Problems

    STILL ALPHA - Will have missing features!!
    Please let me know of any bugs you may find.



    All content Copyright 2004 Michael Pearce All Rights Reserved.
    Email: mike AT kiwacan DOT co DOT nz
    Web: http://www.kiwacan.co.nz/fltk/fltk.html