[dss-commits] digitalSTROM Server branch, master, updated. ff4f5806bb1230291d7095db2f5903ce40b0474f

git version control dss-commits at forum.digitalstrom.org
Mon Dec 7 15:22:16 CET 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "digitalSTROM Server".

The branch, master has been updated
       via  ff4f5806bb1230291d7095db2f5903ce40b0474f (commit)
       via  3d7c7bb0c929e12aa9df380e6f8df1954d077246 (commit)
      from  9ff3a80a5dc1de028557c8bf4b8f6ec459e7e888 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ff4f5806bb1230291d7095db2f5903ce40b0474f
Author: Patrick Stählin <pstaehlin at futurelab.ch>
Date:   Mon Dec 7 15:20:05 2009 +0100

    Set specifier addDevices works now
    
    Added additional specifier empty() which returns an empty set.

commit 3d7c7bb0c929e12aa9df380e6f8df1954d077246
Author: Patrick Stählin <pstaehlin at futurelab.ch>
Date:   Mon Dec 7 11:22:55 2009 +0100

    Really add the device in soap::SetAddDevice

-----------------------------------------------------------------------

Changes:
diff --git a/core/setbuilder.cpp b/core/setbuilder.cpp
index 4f775cb..fb4f09d 100644
--- a/core/setbuilder.cpp
+++ b/core/setbuilder.cpp
@@ -111,9 +111,14 @@ namespace dss {
     } else if(_functionName == "remove") {
       Set inner = parseSet(_index, _zone.getDevices(), _zone);
       result = _set.remove(inner);
+    } else if(_functionName == "empty") {
+      // nop
     } else if(_functionName == "addDevices") {
       result = _set;
       do {
+        if(m_SetDescription[_index] == ',') {
+          _index++;
+        }
         if(m_SetDescription[_index] == '\'') {
           std::string name = readString(_index);
           result.addDevice(m_Apartment.getDeviceByName(name));
diff --git a/tests/modeltests.cpp b/tests/modeltests.cpp
index 1cb3eb8..c7ef87d 100644
--- a/tests/modeltests.cpp
+++ b/tests/modeltests.cpp
@@ -289,6 +289,9 @@ BOOST_AUTO_TEST_CASE(testSetBuilder) {
 
   builderTest = builder.buildSet("group('broadcast').remove(dsid(1))", &apt.getZone(0));
   BOOST_CHECK_EQUAL(3, builderTest.length());
+
+  builderTest = builder.buildSet("empty().addDevices(1,2,3)", &apt.getZone(0));
+  BOOST_CHECK_EQUAL(3, builderTest.length());
 } // testSetBuilder
 
 BOOST_AUTO_TEST_CASE(testRemoval) {
diff --git a/webservices/model_soap.cpp b/webservices/model_soap.cpp
index e00da67..d9e5443 100644
--- a/webservices/model_soap.cpp
+++ b/webservices/model_soap.cpp
@@ -247,7 +247,7 @@ int dss__SetAddDeviceByID(struct soap *soap, int _token, char* _setSpec, char* _
     if(!result.empty()) {
       result += ".";
     }
-    result += "addDevice(" + devRef.getDSID().toString() + ")";
+    result += "dsid(" + devRef.getDSID().toString() + ")";
   } catch(dss::ItemNotFoundException& _ex) {
     return soap_receiver_fault(soap, "Could not find device", NULL);
   }


hooks/post-receive
-- 
digitalSTROM Server


More information about the dss-commits mailing list