wukong-m2m / wukong-darjeeling

Darjeeling for WuKong
Other
20 stars 17 forks source link

When the virtual is no, we should not generate the virtual wuclass for it. #21

Closed wycc closed 10 years ago

wycc commented 11 years ago

I try the binary sensor. The mapper will try to generate virtual wuclass for it.

pencilcheck commented 11 years ago

In getWuObjectList for VM it is only sending the wuobjevt port number and wuclass id, so the master will create every wuobject as if it is all not virtual. We have to fix this, but I'm curious as to why binary sensor wuobject would want to generate a virtual wuobject for it since it will be fetch as non virtual. The application template (application2.java) will check for virtual attribute before generating the virtual wuobject. Can you print the value out to see if where it has gone wrong?

Sincerely, Penn

On Sun, Sep 1, 2013 at 12:43 AM, Yu-Chung Wang notifications@github.comwrote:

I try the binary sensor. The mapper will try to generate virtual wuclass for it.

— Reply to this email directly or view it on GitHubhttps://github.com/wukong-m2m/wukong-darjeeling/issues/21 .

wycc commented 11 years ago

There are two problems here.

(1) In the old mapper, we will check the virtual flag. If a wuclass has virtual attribute, we know that it has Java implementation and use it to create the wuclass. However, we don't have this in the new mapper. (2) The second issue is that. If we have two devices, one with binary sensor and the other without it. We should give the one with native binary sensor a higher priority. However, this is not implemented in the mapper. It will always use the first candidate. We should give evey candidate a score and sort by their scores.

2013/9/1 Penn Su notifications@github.com

In getWuObjectList for VM it is only sending the wuobjevt port number and wuclass id, so the master will create every wuobject as if it is all not virtual. We have to fix this, but I'm curious as to why binary sensor wuobject would want to generate a virtual wuobject for it since it will be fetch as non virtual. The application template (application2.java) will check for virtual attribute before generating the virtual wuobject. Can you print the value out to see if where it has gone wrong?

Sincerely, Penn

On Sun, Sep 1, 2013 at 12:43 AM, Yu-Chung Wang notifications@github.comwrote:

I try the binary sensor. The mapper will try to generate virtual wuclass for it.

— Reply to this email directly or view it on GitHub< https://github.com/wukong-m2m/wukong-darjeeling/issues/21> .

— Reply to this email directly or view it on GitHubhttps://github.com/wukong-m2m/wukong-darjeeling/issues/21#issuecomment-23612689 .

pencilcheck commented 11 years ago

Sure, we would just give higher score for native wuclasses over virtual ones. That should be an easy fix. But how about the issue that you faced? What happened there? Are you sure it detected a virtual wuclass for the binary sensor in the node?

wycc commented 11 years ago

I am sure. I have two devcies. One with binary sensor and the other one do not have binary sensor. The mapper select the one withour binary sensor and use a virtual wuclass.

2013/9/1 Penn Su notifications@github.com

Sure, we would just give higher score for native wuclasses over virtual ones. That should be an easy fix. But how about the issue that you faced? What happened there? Are you sure it detected a virtual wuclass for the binary sensor in the node?

— Reply to this email directly or view it on GitHubhttps://github.com/wukong-m2m/wukong-darjeeling/issues/21#issuecomment-23618449 .

pencilcheck commented 10 years ago

The mapper will reuse non virtual wuobject as much as possible, and create virtual wuobjects from published wuclasses on the wunode, then it will create virtual wuobjects if it cannot find the definition.