[dss-commits] r8859 - dss/trunk/core

dss-commits at forum.digitalstrom.org dss-commits at forum.digitalstrom.org
Thu Oct 22 16:11:11 CEST 2009


Author: pstaehlin
Date: 2009-10-22 16:11:10 +0200 (Thu, 22 Oct 2009)
New Revision: 8859

Modified:
   dss/trunk/core/model.cpp
Log:
Structural changes should only be initiated by the user.

Also demote a fatal log message to a warning.

Fixes #195

Modified: dss/trunk/core/model.cpp
===================================================================
--- dss/trunk/core/model.cpp	2009-10-22 14:11:09 UTC (rev 8858)
+++ dss/trunk/core/model.cpp	2009-10-22 14:11:10 UTC (rev 8859)
@@ -1762,7 +1762,7 @@
   void Zone::addDevice(DeviceReference& _device) {
     const Device& dev = _device.getDevice();
   	int oldZoneID = dev.getZoneID();
-  	if(oldZoneID != -1) {
+  	if((oldZoneID != -1) && (oldZoneID != 0)) {
   		try {
   		  Zone& oldZone = dev.getApartment().getZone(oldZoneID);
   		  oldZone.removeDevice(_device);
@@ -1771,11 +1771,8 @@
   	}
     if(!contains(m_Devices, _device)) {
       m_Devices.push_back(_device);
-      if(!dev.getApartment().isInitializing()) {
-        DSS::getInstance()->getDS485Interface().setZoneID(dev.getModulatorID(), dev.getShortAddress(), m_ZoneID);
-      }
     } else {
-      Logger::getInstance()->log("Zone::addDevice: DUPLICATE DEVICE Detected Zone: " + intToString(m_ZoneID) + " device: " + _device.getDSID().toString(), lsFatal);
+      Logger::getInstance()->log("Zone::addDevice: DUPLICATE DEVICE Detected Zone: " + intToString(m_ZoneID) + " device: " + _device.getDSID().toString(), lsWarning);
     }
     _device.getDevice().setZoneID(m_ZoneID);
   } // addDevice



More information about the dss-commits mailing list