[dss-commits] r8811 - dss/trunk/core
dss-commits at forum.digitalstrom.org
dss-commits at forum.digitalstrom.org
Thu Oct 1 12:14:01 CEST 2009
Author: pstaehlin
Date: 2009-10-01 12:14:01 +0200 (Thu, 01 Oct 2009)
New Revision: 8811
Modified:
dss/trunk/core/ds485const.h
dss/trunk/core/model.cpp
Log:
- Use constants for max-scene
- Corrected log-messages to reflect the real log reason
Modified: dss/trunk/core/ds485const.h
===================================================================
--- dss/trunk/core/ds485const.h 2009-10-01 09:10:55 UTC (rev 8810)
+++ dss/trunk/core/ds485const.h 2009-10-01 10:14:01 UTC (rev 8811)
@@ -148,6 +148,8 @@
const uint8_t SceneEnergyClassF = 0x37;
const uint8_t SceneLocalOff = 0x3D;
const uint8_t SceneLocalOn = 0x3E;
+
+ const uint8_t MaxSceneNumber = 0x3F;
const uint16_t SceneFlagLocalOff = 0x0100;
Modified: dss/trunk/core/model.cpp
===================================================================
--- dss/trunk/core/model.cpp 2009-10-01 09:10:55 UTC (rev 8810)
+++ dss/trunk/core/model.cpp 2009-10-01 10:14:01 UTC (rev 8811)
@@ -820,8 +820,8 @@
Group* pGroup = zone.getGroup(groupID);
assert(pGroup != NULL);
log(" zoneID: " + intToString(zoneID) + " groupID: " + intToString(groupID) + " lastScene: " + intToString(lastCalledScene));
- if(lastCalledScene < 0 || lastCalledScene > 63) {
- log("Zone id is out of bounds. zoneID: " + intToString(zoneID) + " groupID: " + intToString(groupID) + " lastScene: " + intToString(lastCalledScene), lsError);
+ if(lastCalledScene < 0 || lastCalledScene > MaxSceneNumber) {
+ log("scanModulator: _sceneID is out of bounds. zoneID: " + intToString(zoneID) + " groupID: " + intToString(groupID) + " scene: " + intToString(lastCalledScene), lsError);
} else {
onGroupCallScene(zoneID, groupID, lastCalledScene);
}
@@ -1431,8 +1431,8 @@
void Apartment::onGroupCallScene(const int _zoneID, const int _groupID, const int _sceneID) {
try {
- if(_sceneID < 0 || _sceneID > 63) {
- log("Zone id is out of bounds. zoneID: " + intToString(_zoneID) + " groupID: " + intToString(_groupID) + " lastScene: " + intToString(_sceneID), lsError);
+ if(_sceneID < 0 || _sceneID > MaxSceneNumber) {
+ log("onGroupCallScene: Scene number is out of bounds. zoneID: " + intToString(_zoneID) + " groupID: " + intToString(_groupID) + " scene: " + intToString(_sceneID), lsError);
return;
}
Zone& zone = getZone(_zoneID);
@@ -1474,8 +1474,8 @@
void Apartment::onDeviceCallScene(const int _modulatorID, const int _deviceID, const int _sceneID) {
try {
- if(_sceneID < 0 || _sceneID > 63) {
- log("Zone id is out of bounds. modulator-id '" + intToString(_modulatorID) + "' for device '" + intToString(_deviceID) + "' scene: " + intToString(_sceneID), lsError);
+ if(_sceneID < 0 || _sceneID > MaxSceneNumber) {
+ log("onDeviceCallScene: _sceneID is out of bounds. modulator-id '" + intToString(_modulatorID) + "' for device '" + intToString(_deviceID) + "' scene: " + intToString(_sceneID), lsError);
return;
}
Modulator& mod = getModulatorByBusID(_modulatorID);
More information about the dss-commits
mailing list