Skip to content

Commit 0da77fe

Browse files
author
brentru
committed
doxy gauge, text blocks
1 parent 103a464 commit 0da77fe

4 files changed

Lines changed: 81 additions & 8 deletions

File tree

src/blocks/GaugeBlock.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
*/
1515
#include "GaugeBlock.h"
1616

17+
/**************************************************************************/
18+
/*!
19+
@brief Creates a new Gauge Block on an Adafruit IO Dashboard.
20+
@param d
21+
Adafruit IO Dashboard name.
22+
@param f
23+
Adafruit IO Feed to display on the Gauge.
24+
*/
25+
/**************************************************************************/
1726
GaugeBlock::GaugeBlock(AdafruitIO_Dashboard *d, AdafruitIO_Feed *f)
1827
: AdafruitIO_Block(d, f) {
1928
min = 0;
@@ -24,6 +33,12 @@ GaugeBlock::GaugeBlock(AdafruitIO_Dashboard *d, AdafruitIO_Feed *f)
2433

2534
GaugeBlock::~GaugeBlock() {}
2635

36+
/**************************************************************************/
37+
/*!
38+
@brief Sets Gauge block properties.
39+
@return String containing properties of the Gauge block.
40+
*/
41+
/**************************************************************************/
2742
String GaugeBlock::properties() {
2843
int w = 0;
2944

src/blocks/GaugeBlock.h

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,73 @@
1717

1818
#include "AdafruitIO_Block.h"
1919

20+
21+
/**************************************************************************/
22+
/*!
23+
@brief Class for interacting with the Adafruit IO Dashboard
24+
Gauge Block.
25+
*/
26+
/**************************************************************************/
2027
class GaugeBlock : public AdafruitIO_Block {
2128

2229
public:
2330
GaugeBlock(AdafruitIO_Dashboard *d, AdafruitIO_Feed *f);
2431
~GaugeBlock();
2532

26-
int min;
27-
int max;
33+
int min; /*!< Min. value displayed on gauge. */
34+
int max; /*!< Max. value displayed on gauge. */
2835

29-
const char *ringWidth;
30-
const char *label;
36+
const char *ringWidth; /*!< Width of gauge's ring. */
37+
const char *label; /*!< Gauge text label. */
3138

32-
int width = 4;
33-
int height = 4;
39+
int width = 4; /*!< Dashboard block width. */
40+
int height = 4; /*!< Dashboard block height. */
3441

3542
String properties();
43+
44+
/******************************************/
45+
/*!
46+
@brief Returns block type
47+
@return Block type.
48+
*/
49+
/******************************************/
3650
const char *type() { return _visual_type; }
3751

3852
protected:
39-
const char *_visual_type = "gauge";
53+
const char *_visual_type = "gauge"; /*!< Block type. */
4054

55+
/******************************************/
56+
/*!
57+
@brief Returns width of block.
58+
@return Block width.
59+
*/
60+
/******************************************/
4161
int _width() { return width; }
62+
63+
/******************************************/
64+
/*!
65+
@brief Returns height of block.
66+
@return Block height.
67+
*/
68+
/******************************************/
4269
int _height() { return height; }
70+
71+
/******************************************/
72+
/*!
73+
@brief Returns block's row location
74+
on an Adafruit IO dashboard.
75+
@return Adafruit IO dashboard row.
76+
*/
77+
/******************************************/
4378
int _row() { return row; }
79+
80+
/******************************************/
81+
/*!
82+
@brief Returns block's column location
83+
on an Adafruit IO dashboard.
84+
@return Adafruit IO dashboard column
85+
*/
86+
/******************************************/
4487
int _column() { return column; }
4588
};
4689

src/blocks/TextBlock.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,28 @@
1414
*/
1515
#include "TextBlock.h"
1616

17+
/**************************************************************************/
18+
/*!
19+
@brief Creates a new Text Block on an Adafruit IO Dashboard.
20+
@param d
21+
Adafruit IO Dashboard name.
22+
@param f
23+
Adafruit IO Feed to display on the Text.
24+
*/
25+
/**************************************************************************/
1726
TextBlock::TextBlock(AdafruitIO_Dashboard *d, AdafruitIO_Feed *f)
1827
: AdafruitIO_Block(d, f) {
1928
fontSize = "small";
2029
}
2130

2231
TextBlock::~TextBlock() {}
2332

33+
/**************************************************************************/
34+
/*!
35+
@brief Sets Text block properties.
36+
@return String containing properties of the Text block.
37+
*/
38+
/**************************************************************************/
2439
String TextBlock::properties() {
2540
int s = 0;
2641

src/blocks/TextBlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class TextBlock : public AdafruitIO_Block {
2929
TextBlock(AdafruitIO_Dashboard *d, AdafruitIO_Feed *f);
3030
~TextBlock();
3131

32-
const char *fontSize;
32+
const char *fontSize; /*!< Dashboard block text font size. */
3333

3434
int width = 2; /*!< Dashboard block width. */
3535
int height = 1; /*!< Dashboard block height. */

0 commit comments

Comments
 (0)