OpenZWave Library  1.6.953
SensorMultiLevelCCTypes.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // SensorMultiLevelCCTypes.h
4 //
5 // SensorMultiLevelCCTypes for SensorMultiLevel Command Class
6 //
7 // Copyright (c) 2019 Justin Hammond <justin@dynam.ac>
8 //
9 // SOFTWARE NOTICE AND LICENSE
10 //
11 // This file is part of OpenZWave.
12 //
13 // OpenZWave is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU Lesser General Public License as published
15 // by the Free Software Foundation, either version 3 of the License,
16 // or (at your option) any later version.
17 //
18 // OpenZWave is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU Lesser General Public License for more details.
22 //
23 // You should have received a copy of the GNU Lesser General Public License
24 // along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
25 //
26 //-----------------------------------------------------------------------------
27 
28 #ifndef SENSORMULTILEVELCCTYPES_H
29 #define SENSORMULTILEVELCCTYPES_H
30 
31 #include <cstdio>
32 #include <string>
33 #include <map>
34 #include "Defs.h"
35 #include "Driver.h"
37 
38 namespace OpenZWave
39 {
40  namespace Internal
41  {
42 
44  {
45  public:
47  {
48  public:
50  string name;
51  string unit;
52  };
53  typedef std::map<uint8, std::shared_ptr<SensorMultiLevelCCTypes::SensorMultiLevelScales> > SensorScales;
55  {
56  public:
58  string name;
60  };
61 
62  //-----------------------------------------------------------------------------
63  // Construction
64  //-----------------------------------------------------------------------------
65  private:
68  static void ReadXML();
69  public:
70  static SensorMultiLevelCCTypes* Get();
71  static bool Create();
72  string GetSensorName(uint32);
73  string GetSensorUnit(uint32, uint8);
76 
77  //-----------------------------------------------------------------------------
78  // Instance Functions
79  //-----------------------------------------------------------------------------
80  private:
81  static SensorMultiLevelCCTypes* m_instance;
82  static std::map<uint32, std::shared_ptr<SensorMultiLevelCCTypes::SensorMultiLevelTypes> > SensorTypes;
83  static uint32 m_revision;
84  };
85  } // namespace Internal
86 } // namespace OpenZWave
87 #endif // SENSORMULTILEVELCCTYPES_H
Definition: Bitfield.cpp:30
string name
Definition: SensorMultiLevelCCTypes.h:50
const SensorScales GetSensorScales(uint32)
Definition: SensorMultiLevelCCTypes.cpp:224
string unit
Definition: SensorMultiLevelCCTypes.h:51
string name
Definition: SensorMultiLevelCCTypes.h:58
Definition: SensorMultiLevelCCTypes.h:43
uint32 id
Definition: SensorMultiLevelCCTypes.h:57
unsigned int uint32
Definition: Defs.h:91
SensorScales allSensorScales
Definition: SensorMultiLevelCCTypes.h:59
static bool Create()
Definition: SensorMultiLevelCCTypes.cpp:235
std::map< uint8, std::shared_ptr< SensorMultiLevelCCTypes::SensorMultiLevelScales > > SensorScales
Definition: SensorMultiLevelCCTypes.h:53
string GetSensorUnit(uint32, uint8)
Definition: SensorMultiLevelCCTypes.cpp:189
static SensorMultiLevelCCTypes * Get()
Definition: SensorMultiLevelCCTypes.cpp:246
uint8 id
Definition: SensorMultiLevelCCTypes.h:49
string GetSensorName(uint32)
Definition: SensorMultiLevelCCTypes.cpp:179
string GetSensorUnitName(uint32, uint8)
Definition: SensorMultiLevelCCTypes.cpp:206
unsigned char uint8
Definition: Defs.h:85