Skip to content

Commit 5ea635c

Browse files
author
brentru
committed
doxy _block, colorblock, chartblock, imageblock
1 parent 0332f85 commit 5ea635c

5 files changed

Lines changed: 114 additions & 18 deletions

File tree

src/blocks/AdafruitIO_Block.cpp

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
1-
//
2-
// Adafruit invests time and resources providing this open source code.
3-
// Please support Adafruit and open source hardware by purchasing
4-
// products from Adafruit!
5-
//
6-
// Copyright (c) 2015-2016 Adafruit Industries
7-
// Authors: Tony DiCola, Todd Treece
8-
// Licensed under the MIT license.
9-
//
10-
// All text above must be included in any redistribution.
11-
//
1+
/*!
2+
* @file AdafruitIO_Block.cpp
3+
*
4+
* This is part of the Adafruit IO library for the Arduino platform.
5+
*
6+
* Adafruit invests time and resources providing this open source code,
7+
* please support Adafruit and open-source hardware by purchasing
8+
* products from Adafruit!
9+
*
10+
* Written by Tony DiCola, Todd Treece for Adafruit Industries
11+
*
12+
* BSD license, all text here must be included in any redistribution.
13+
*
14+
*/
1215
#include "AdafruitIO_Block.h"
1316
#include "AdafruitIO.h"
1417
#include "AdafruitIO_Dashboard.h"
1518

19+
/**************************************************************************/
20+
/*!
21+
@brief Creates a new Block on an Adafruit IO Dashboard.
22+
@param d
23+
Adafruit IO Dashboard name.
24+
@param f
25+
Adafruit IO Feed to display on the block.
26+
*/
27+
/**************************************************************************/
1628
AdafruitIO_Block::AdafruitIO_Block(AdafruitIO_Dashboard *d,
1729
AdafruitIO_Feed *f) {
1830
_dashboard = d;
@@ -21,11 +33,24 @@ AdafruitIO_Block::AdafruitIO_Block(AdafruitIO_Dashboard *d,
2133

2234
AdafruitIO_Block::~AdafruitIO_Block() {}
2335

36+
/**************************************************************************/
37+
/*!
38+
@brief Sets block properties.
39+
@return String containing block's properties.
40+
*/
41+
/**************************************************************************/
2442
String AdafruitIO_Block::properties() {
2543
String props = "{}";
2644
return props;
2745
}
2846

47+
/**************************************************************************/
48+
/*!
49+
@brief Sets block dimensions, provided block size (width, height)
50+
and block location on dashboard (row, column).
51+
@return String containing block's dimensions.
52+
*/
53+
/**************************************************************************/
2954
String AdafruitIO_Block::dimensions() {
3055
String dim = "\",\"size_x\":\"";
3156
dim += _width();
@@ -45,8 +70,20 @@ String AdafruitIO_Block::dimensions() {
4570
return dim;
4671
}
4772

73+
/**************************************************************************/
74+
/*!
75+
@brief Returns type of Adafruit IO Block.
76+
@return Block type
77+
*/
78+
/**************************************************************************/
4879
const char *AdafruitIO_Block::type() { return _visual_type; }
4980

81+
/**************************************************************************/
82+
/*!
83+
@brief Creates a new block on an Adafruit IO dashboard.
84+
@return True if successful, False otherwise.
85+
*/
86+
/**************************************************************************/
5087
bool AdafruitIO_Block::save() {
5188
HttpClient *http = _dashboard->io()->_http;
5289

src/blocks/AdafruitIO_Block.h

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,22 @@
2121
class AdafruitIO_Dashboard;
2222
class AdafruitIO_Feed;
2323

24+
/**************************************************************************/
25+
/*!
26+
@brief Class for interacting with and creating Adafruit IO Dashboard
27+
blocks.
28+
*/
29+
/**************************************************************************/
2430
class AdafruitIO_Block {
2531

2632
public:
2733
AdafruitIO_Block(AdafruitIO_Dashboard *d, AdafruitIO_Feed *f);
2834
~AdafruitIO_Block();
2935

30-
int width = 2;
31-
int height = 2;
32-
int row = 0;
33-
int column = 0;
36+
int width = 2; /*!< Dashboard block width. */
37+
int height = 2; /*!< Dashboard block height. */
38+
int row = 0; /*!< Row location of block on dashboard. */
39+
int column = 0; /*!< Column location of block on dashboard. */
3440

3541
virtual String properties();
3642
String dimensions();
@@ -40,14 +46,43 @@ class AdafruitIO_Block {
4046
bool save();
4147

4248
protected:
43-
AdafruitIO_Dashboard *_dashboard;
44-
AdafruitIO_Feed *_feed;
49+
AdafruitIO_Dashboard *_dashboard; /*!< Instance of an Adafruit IO Dashboard. */
50+
AdafruitIO_Feed *_feed; /*!< Instance of an Adafruit IO Feed. */
4551

46-
const char *_visual_type;
52+
const char *_visual_type; /*!< Block type. */
4753

54+
/******************************************/
55+
/*!
56+
@brief Returns width of block.
57+
@return Block width.
58+
*/
59+
/******************************************/
4860
virtual int _width() { return width; }
61+
62+
/******************************************/
63+
/*!
64+
@brief Returns height of block.
65+
@return Block height.
66+
*/
67+
/******************************************/
4968
virtual int _height() { return height; }
69+
70+
/******************************************/
71+
/*!
72+
@brief Returns block's row location
73+
on an Adafruit IO dashboard.
74+
@return Adafruit IO dashboard row.
75+
*/
76+
/******************************************/
5077
virtual int _row() { return row; }
78+
79+
/******************************************/
80+
/*!
81+
@brief Returns block's column location
82+
on an Adafruit IO dashboard.
83+
@return Adafruit IO dashboard column
84+
*/
85+
/******************************************/
5186
virtual int _column() { return column; }
5287
};
5388

src/blocks/ChartBlock.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ class ChartBlock : public AdafruitIO_Block {
2929
ChartBlock(AdafruitIO_Dashboard *d, AdafruitIO_Feed *f);
3030
~ChartBlock();
3131

32+
/******************************************/
33+
/*!
34+
@brief Returns block type
35+
@return Block type.
36+
*/
37+
/******************************************/
3238
const char *type() { return _visual_type; }
3339

3440
int historyHours; /*!< Amount of hours to store the chart's history for. */

src/blocks/ColorBlock.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@
2626
class ColorBlock : public AdafruitIO_Block {
2727

2828
public:
29+
/**************************************************************************/
30+
/*!
31+
@brief Creates a new color block on an Adafruit IO Dashboard.
32+
@param d
33+
Adafruit IO Dashboard name.
34+
@param f
35+
Adafruit IO Feed to display on the block.
36+
*/
37+
/**************************************************************************/
2938
ColorBlock(AdafruitIO_Dashboard *d, AdafruitIO_Feed *f)
3039
: AdafruitIO_Block(d, f) {}
3140
~ColorBlock() {}

src/blocks/ImageBlock.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@
2626
class ImageBlock : public AdafruitIO_Block {
2727

2828
public:
29+
/**************************************************************************/
30+
/*!
31+
@brief Creates a new Image Block on an Adafruit IO Dashboard.
32+
@param d
33+
Adafruit IO Dashboard name.
34+
@param f
35+
Adafruit IO Feed to display on the image block.
36+
*/
37+
/**************************************************************************/
2938
ImageBlock(AdafruitIO_Dashboard *d, AdafruitIO_Feed *f)
3039
: AdafruitIO_Block(d, f) {}
3140
~ImageBlock() {}

0 commit comments

Comments
 (0)