Lumitronix_Iflex_Pro_Workshop
Library to interact with the iFlexPro
NeoSettings.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2 NeoSettings provides settings classes to describe settings
3 
4 Written by Michael C. Miller.
5 
6 I invest time and resources providing this open source code,
7 please support me by dontating (see https://github.com/Makuna)
8 
9 -------------------------------------------------------------------------
10 This file is part of the LUMITRONIX_iFlex_Workshop library.
11 
12 LumitronixIFlexBus is free software: you can redistribute it and/or modify
13 it under the terms of the GNU Lesser General Public License as
14 published by the Free Software Foundation, either version 3 of
15 the License, or (at your option) any later version.
16 
17 LumitronixIFlexBus is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU Lesser General Public License for more details.
21 
22 You should have received a copy of the GNU Lesser General Public
23 License along with LumitronixIFlex. If not, see
24 <http://www.gnu.org/licenses/>.
25 -------------------------------------------------------------------------*/
26 #pragma once
27 
29 {
30 };
31 
33 {
34 public:
35  NeoRgbCurrentSettings(uint16_t red, uint16_t green, uint16_t blue) :
37  GreenTenthMilliAmpere(green),
39  {
40  }
41 
42  // ------------------------------------------------------------------------
43  // operator [] - readonly
44  // access elements in order by index rather than member name
45  // ------------------------------------------------------------------------
46  uint16_t operator[](size_t idx) const
47  {
48  switch (idx)
49  {
50  case 0:
51  return RedTenthMilliAmpere;
52  case 1:
53  return GreenTenthMilliAmpere;
54  default:
55  return BlueTenthMilliAmpere;
56  }
57  }
58 
59  const uint16_t RedTenthMilliAmpere; // in 1/10th ma
60  const uint16_t GreenTenthMilliAmpere; // in 1/10th ma
61  const uint16_t BlueTenthMilliAmpere; // in 1/10th ma
62 };
63 
65 {
66 public:
67  NeoRgbwCurrentSettings(uint16_t red, uint16_t green, uint16_t blue, uint16_t white) :
69  GreenTenthMilliAmpere(green),
72  {
73  }
74 
75  // ------------------------------------------------------------------------
76  // operator [] - readonly
77  // access elements in order by index rather than member name
78  // ------------------------------------------------------------------------
79  uint16_t operator[](size_t idx) const
80  {
81  switch (idx)
82  {
83  case 0:
84  return RedTenthMilliAmpere;
85  case 1:
86  return GreenTenthMilliAmpere;
87  case 2:
88  return BlueTenthMilliAmpere;
89  default:
90  return WhiteTenthMilliAmpere;
91  }
92  }
93 
94  const uint16_t RedTenthMilliAmpere; // in 1/10th ma
95  const uint16_t GreenTenthMilliAmpere; // in 1/10th ma
96  const uint16_t BlueTenthMilliAmpere; // in 1/10th ma
97  const uint16_t WhiteTenthMilliAmpere; // in 1/10th ma
98 };
99 
101 {
102 public:
103  NeoRgbwwCurrentSettings(uint16_t red, uint16_t green, uint16_t blue, uint16_t warmWhite, uint16_t coolWhite) :
104  RedTenthMilliAmpere(red),
105  GreenTenthMilliAmpere(green),
106  BlueTenthMilliAmpere(blue),
107  WarmWhiteTenthMilliAmpere(warmWhite),
108  CoolWhiteTenthMilliAmpere(coolWhite)
109  {
110  }
111 
112  // ------------------------------------------------------------------------
113  // operator [] - readonly
114  // access elements in order by index rather than member name
115  // ------------------------------------------------------------------------
116  uint16_t operator[](size_t idx) const
117  {
118  switch (idx)
119  {
120  case 0:
121  return RedTenthMilliAmpere;
122  case 1:
123  return GreenTenthMilliAmpere;
124  case 2:
125  return BlueTenthMilliAmpere;
126  case 3:
128  default:
130  }
131  }
132 
133  const uint16_t RedTenthMilliAmpere; // in 1/10th ma
134  const uint16_t GreenTenthMilliAmpere; // in 1/10th ma
135  const uint16_t BlueTenthMilliAmpere; // in 1/10th ma
136  const uint16_t WarmWhiteTenthMilliAmpere; // in 1/10th ma
137  const uint16_t CoolWhiteTenthMilliAmpere; // in 1/10th ma
138 };
Definition: NeoSettings.h:29
Definition: NeoSettings.h:33
const uint16_t RedTenthMilliAmpere
Definition: NeoSettings.h:59
NeoRgbCurrentSettings(uint16_t red, uint16_t green, uint16_t blue)
Definition: NeoSettings.h:35
const uint16_t BlueTenthMilliAmpere
Definition: NeoSettings.h:61
const uint16_t GreenTenthMilliAmpere
Definition: NeoSettings.h:60
uint16_t operator[](size_t idx) const
Definition: NeoSettings.h:46
Definition: NeoSettings.h:65
const uint16_t RedTenthMilliAmpere
Definition: NeoSettings.h:94
const uint16_t GreenTenthMilliAmpere
Definition: NeoSettings.h:95
NeoRgbwCurrentSettings(uint16_t red, uint16_t green, uint16_t blue, uint16_t white)
Definition: NeoSettings.h:67
const uint16_t BlueTenthMilliAmpere
Definition: NeoSettings.h:96
const uint16_t WhiteTenthMilliAmpere
Definition: NeoSettings.h:97
uint16_t operator[](size_t idx) const
Definition: NeoSettings.h:79
Definition: NeoSettings.h:101
const uint16_t GreenTenthMilliAmpere
Definition: NeoSettings.h:134
const uint16_t BlueTenthMilliAmpere
Definition: NeoSettings.h:135
const uint16_t RedTenthMilliAmpere
Definition: NeoSettings.h:133
const uint16_t WarmWhiteTenthMilliAmpere
Definition: NeoSettings.h:136
uint16_t operator[](size_t idx) const
Definition: NeoSettings.h:116
const uint16_t CoolWhiteTenthMilliAmpere
Definition: NeoSettings.h:137
NeoRgbwwCurrentSettings(uint16_t red, uint16_t green, uint16_t blue, uint16_t warmWhite, uint16_t coolWhite)
Definition: NeoSettings.h:103