| OpenZWave Library 1.6.0

Loading...
Searching...
No Matches
ValueSchedule.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2//
3// ValueSchedule.h
4//
5// A one day schedule for the Climate Control Schedule command class
6//
7// Copyright (c) 2010 Mal Lansell <openzwave@lansell.org>
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 _ValueSchedule_H
29#define _ValueSchedule_H
30
31#include <string>
32#include "Defs.h"
33#include "value_classes/Value.h"
34
35 class TiXmlElement;
36
37 namespace OpenZWave
38{
39 class Msg;
40 class Node;
41
45 class ValueSchedule: public Value
46 {
47 public:
48 ValueSchedule( uint32 const _homeId, uint8 const _nodeId, ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _index, string const& _label, string const& _units, bool const _readOnly, bool const _writeOnly, uint8 const _pollIntensity );
49 ValueSchedule();
50 virtual ~ValueSchedule(){}
51
52 bool SetSwitchPoint( uint8 const _hours, uint8 const _minutes, int8 const _setback );
53 bool RemoveSwitchPoint( uint8 const _idx );
54 void ClearSwitchPoints(){ m_numSwitchPoints = 0; }
55 bool GetSwitchPoint( uint8 const _idx, uint8* o_hours, uint8* o_minutes, int8* o_setback )const;
56 bool FindSwitchPoint( uint8 const _hours, uint8 const _minutes, uint8* o_idx )const;
57 uint8 GetNumSwitchPoints()const{ return m_numSwitchPoints; }
58
59 bool Set();
60 void OnValueRefreshed();
61
62 virtual string const GetAsString() const;
63
64 // From Value
65 virtual void ReadXML( uint32 const _homeId, uint8 const _nodeId, uint8 const _commandClassId, TiXmlElement const* _valueElement );
66 virtual void WriteXML( TiXmlElement* _valueElement );
67
68 private:
69 struct SwitchPoint
70 {
71 uint8 m_hours;
72 uint8 m_minutes;
73 int8 m_setback;
74 };
75
76 SwitchPoint m_switchPoints[9];
77 uint8 m_numSwitchPoints;
78 };
79
80} // namespace OpenZWave
81
82#endif
Defs.h
uint16
unsigned short uint16
Definition Defs.h:92
uint32
unsigned int uint32
Definition Defs.h:95
int8
signed char int8
Definition Defs.h:88
uint8
unsigned char uint8
Definition Defs.h:89
Value.h
OpenZWave::ValueID::ValueGenre
ValueGenre
Definition ValueID.h:81
OpenZWave::ValueSchedule
Schedule sent to/received from a node.
Definition ValueSchedule.h:46
OpenZWave::ValueSchedule::~ValueSchedule
virtual ~ValueSchedule()
Definition ValueSchedule.h:50
OpenZWave::ValueSchedule::ReadXML
virtual void ReadXML(uint32 const _homeId, uint8 const _nodeId, uint8 const _commandClassId, TiXmlElement const *_valueElement)
Definition ValueSchedule.cpp:79
OpenZWave::ValueSchedule::FindSwitchPoint
bool FindSwitchPoint(uint8 const _hours, uint8 const _minutes, uint8 *o_idx) const
Definition ValueSchedule.cpp:325
OpenZWave::ValueSchedule::ClearSwitchPoints
void ClearSwitchPoints()
Definition ValueSchedule.h:54
OpenZWave::ValueSchedule::RemoveSwitchPoint
bool RemoveSwitchPoint(uint8 const _idx)
Definition ValueSchedule.cpp:262
OpenZWave::ValueSchedule::WriteXML
virtual void WriteXML(TiXmlElement *_valueElement)
Definition ValueSchedule.cpp:130
OpenZWave::ValueSchedule::GetNumSwitchPoints
uint8 GetNumSwitchPoints() const
Definition ValueSchedule.h:57
OpenZWave::ValueSchedule::SetSwitchPoint
bool SetSwitchPoint(uint8 const _hours, uint8 const _minutes, int8 const _setback)
Definition ValueSchedule.cpp:201
OpenZWave::ValueSchedule::OnValueRefreshed
void OnValueRefreshed()
Definition ValueSchedule.cpp:178
OpenZWave::ValueSchedule::Set
bool Set()
Definition ValueSchedule.cpp:165
OpenZWave::ValueSchedule::GetSwitchPoint
bool GetSwitchPoint(uint8 const _idx, uint8 *o_hours, uint8 *o_minutes, int8 *o_setback) const
Definition ValueSchedule.cpp:289
OpenZWave::ValueSchedule::GetAsString
virtual string const GetAsString() const
Definition ValueSchedule.cpp:362
OpenZWave::ValueSchedule::ValueSchedule
ValueSchedule()
Definition ValueSchedule.cpp:66
OpenZWave::Value
Base class for values associated with a node.
Definition Value.h:49
OpenZWave
Definition Bitfield.h:35