Fixed bug in getting the configured parameter type. Fixed bug in processing object presets.

This commit is contained in:
Zaid Abdulla committed 2013-12-07 01:18:25 +03:00
1 parent 6f0d7a747e
commit 1fe72e93a9
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -13,9 +13,9 @@ MAX_PARAMETERS = 52
getLsb = (num) -> getLsb = (num) ->
i = -1 i = -1
while num > 0 while num > 0
++ i
break if num & 1 break if num & 1
num >>= 1 num >>= 1
++ i
return i return i
+2 -2
View File
@@ -200,7 +200,7 @@ exports.processDevicePreset = (deviceId, devicePreset, callback) ->
for objectName, objectDetails of object for objectName, objectDetails of object
continue if not objectDetails.current? continue if not objectDetails.current?
if objectDetails.preset? if objectDetails.preset?
if Object.keys(objectDetails.current) > 0 if Object.keys(objectDetails.current).length > 0
for i, obj of objectDetails.current for i, obj of objectDetails.current
for paramName, paramValue of objectDetails.preset for paramName, paramValue of objectDetails.preset
continue if paramName[0] == '_' continue if paramName[0] == '_'
@@ -214,7 +214,7 @@ exports.processDevicePreset = (deviceId, devicePreset, callback) ->
for k,v of objectDetails.preset for k,v of objectDetails.preset
vals.push([k, v]) if k[0] != '_' vals.push([k, v]) if k[0] != '_'
taskList.push({device : deviceId, name : 'addObject', objectName : parameterPath, parameterValues : vals, instanceName : objectName}) taskList.push({device : deviceId, name : 'addObject', objectName : parameterPath, parameterValues : vals, instanceName : objectName})
else if Object.keys(objectDetails.current) > 0 else if Object.keys(objectDetails.current).length > 0
for i, obj of objectDetails.current for i, obj of objectDetails.current
taskList.push({device : deviceId, name : 'deleteObject', objectName : "#{parameterPath}.#{i}"}) taskList.push({device : deviceId, name : 'deleteObject', objectName : "#{parameterPath}.#{i}"})