Open Lighting Architecture
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MovingLightResponder.h
Go to the documentation of this file.
1 /*
2  * This library is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU Lesser General Public
4  * License as published by the Free Software Foundation; either
5  * version 2.1 of the License, or (at your option) any later version.
6  *
7  * This library is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10  * Lesser General Public License for more details.
11  *
12  * You should have received a copy of the GNU Lesser General Public
13  * License along with this library; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15  *
16  * MovingLightResponder_h
17  * Copyright (C) 2013 Simon Newton
18  */
19 
29 #ifndef INCLUDE_OLA_RDM_MOVINGLIGHTRESPONDER_H_
30 #define INCLUDE_OLA_RDM_MOVINGLIGHTRESPONDER_H_
31 
32 #include <string>
34 #include "ola/rdm/RDMEnums.h"
35 #include "ola/rdm/ResponderOps.h"
36 #include "ola/rdm/ResponderPersonality.h"
37 #include "ola/rdm/UID.h"
38 
39 namespace ola {
40 namespace rdm {
41 
46  public:
47  explicit MovingLightResponder(const UID &uid);
48 
49  void SendRDMRequest(const RDMRequest *request, RDMCallback *callback);
50 
51  uint16_t StartAddress() const { return m_start_address; }
52  uint16_t Footprint() const {
53  return m_personality_manager.ActivePersonalityFootprint();
54  }
55 
56  private:
60  class RDMOps : public ResponderOps<MovingLightResponder> {
61  public:
62  static RDMOps *Instance() {
63  if (!instance)
64  instance = new RDMOps();
65  return instance;
66  }
67 
68  private:
69  RDMOps() : ResponderOps<MovingLightResponder>(PARAM_HANDLERS) {}
70 
71  static RDMOps *instance;
72  };
73 
77  class Personalities : public PersonalityCollection {
78  public:
79  static const Personalities *Instance();
80 
81  private:
82  explicit Personalities(const PersonalityList &personalities) :
83  PersonalityCollection(personalities) {
84  }
85 
86  static Personalities *instance;
87  };
88 
89  const UID m_uid;
90  uint16_t m_start_address;
91  string m_language;
92  bool m_identify_mode;
93  bool m_pan_invert;
94  bool m_tilt_invert;
95  uint32_t m_device_hours;
96  uint32_t m_lamp_hours;
97  uint32_t m_lamp_strikes;
98  rdm_lamp_state m_lamp_state;
99  rdm_lamp_mode m_lamp_on_mode;
100  uint32_t m_device_power_cycles;
101  rdm_display_invert m_display_invert;
102  uint8_t m_display_level;
103  bool m_pan_tilt_swap;
104  rdm_power_state m_power_state;
105  string m_device_label;
106  PersonalityManager m_personality_manager;
107 
108  const RDMResponse *GetParamDescription(const RDMRequest *request);
109  const RDMResponse *GetDeviceInfo(const RDMRequest *request);
110  const RDMResponse *GetFactoryDefaults(const RDMRequest *request);
111  const RDMResponse *SetFactoryDefaults(const RDMRequest *request);
112  const RDMResponse *GetLanguageCapabilities(const RDMRequest *request);
113  const RDMResponse *GetLanguage(const RDMRequest *request);
114  const RDMResponse *SetLanguage(const RDMRequest *request);
115  const RDMResponse *GetProductDetailList(const RDMRequest *request);
116  const RDMResponse *GetPersonality(const RDMRequest *request);
117  const RDMResponse *SetPersonality(const RDMRequest *request);
118  const RDMResponse *GetPersonalityDescription(const RDMRequest *request);
119  const RDMResponse *GetSlotInfo(const RDMRequest *request);
120  const RDMResponse *GetSlotDescription(const RDMRequest *request);
121  const RDMResponse *GetSlotDefaultValues(const RDMRequest *request);
122  const RDMResponse *GetDmxStartAddress(const RDMRequest *request);
123  const RDMResponse *SetDmxStartAddress(const RDMRequest *request);
124  const RDMResponse *GetDeviceHours(const RDMRequest *request);
125  const RDMResponse *SetDeviceHours(const RDMRequest *request);
126  const RDMResponse *GetLampHours(const RDMRequest *request);
127  const RDMResponse *SetLampHours(const RDMRequest *request);
128  const RDMResponse *GetLampStrikes(const RDMRequest *request);
129  const RDMResponse *SetLampStrikes(const RDMRequest *request);
130  const RDMResponse *GetLampState(const RDMRequest *request);
131  const RDMResponse *SetLampState(const RDMRequest *request);
132  const RDMResponse *GetLampOnMode(const RDMRequest *request);
133  const RDMResponse *SetLampOnMode(const RDMRequest *request);
134  const RDMResponse *GetDevicePowerCycles(const RDMRequest *request);
135  const RDMResponse *SetDevicePowerCycles(const RDMRequest *request);
136  const RDMResponse *GetIdentify(const RDMRequest *request);
137  const RDMResponse *SetIdentify(const RDMRequest *request);
138  const RDMResponse *GetDisplayInvert(const RDMRequest *request);
139  const RDMResponse *SetDisplayInvert(const RDMRequest *request);
140  const RDMResponse *GetDisplayLevel(const RDMRequest *request);
141  const RDMResponse *SetDisplayLevel(const RDMRequest *request);
142  const RDMResponse *GetPanInvert(const RDMRequest *request);
143  const RDMResponse *SetPanInvert(const RDMRequest *request);
144  const RDMResponse *GetTiltInvert(const RDMRequest *request);
145  const RDMResponse *SetTiltInvert(const RDMRequest *request);
146  const RDMResponse *GetPanTiltSwap(const RDMRequest *request);
147  const RDMResponse *SetPanTiltSwap(const RDMRequest *request);
148  const RDMResponse *GetRealTimeClock(const RDMRequest *request);
149  const RDMResponse *SetResetDevice(const RDMRequest *request);
150  const RDMResponse *GetPowerState(const RDMRequest *request);
151  const RDMResponse *SetPowerState(const RDMRequest *request);
152  const RDMResponse *GetManufacturerLabel(const RDMRequest *request);
153  const RDMResponse *GetDeviceLabel(const RDMRequest *request);
154  const RDMResponse *SetDeviceLabel(const RDMRequest *request);
155  const RDMResponse *GetDeviceModelDescription(const RDMRequest *request);
156  const RDMResponse *GetSoftwareVersionLabel(const RDMRequest *request);
157  const RDMResponse *GetOlaCodeVersion(const RDMRequest *request);
158 
160  PARAM_HANDLERS[];
161 };
162 } // namespace rdm
163 } // namespace ola
164 #endif // INCLUDE_OLA_RDM_MOVINGLIGHTRESPONDER_H_