Dynamic Properties

HouseBot Plugin Development Discussions.
Post Reply
roweiss
Member
Posts: 12
Joined: Thu Mar 10, 2005 12:34 am

Dynamic Properties

Post by roweiss »

Scott,



It's not quite clear to me how to implement dynamic properties.



I have an asynchronous activity that I'm performing in my DeviceRun loop, activated by a timeout from the "WaitForMultipleObjects" call. I know have new values I want to place in the dynamic properties.



I've tried:


Code: Select all

pValue = m_pProperty->CreatePropertyValue ( newvalue );
if (pValue)
{
     pValue->ChangeRequestCompleted();
    delete pValue;
}
Nothing happens, I'm not able to see the dynamic updates to the properties.

Also, what are these exported functions for, and how are they used:

Code: Select all

BOOL InitDynamicProperty( ... );
BOOL SetDynamicProperty( ... );
BOOL DeleteDynamicProperty( ... );


InitDynamicProperty in my device get's called for each instance of a dynamic property that I have. Not sure what to do.



Also, another thing. It appears that the only type of property that I can create that will appear to be dynamic is the ptAlphaList.



I noticed on the TV Listing Sample device that there are a number of properties that behave as though they are dynamic (their contents change dynamically), yet they are modifiable from the UI. They all appear to be of type ptAlpha. The only two that restrict UI modification are the two that are type ptAlphaList.



I'm guessing that I could just use ptAlpha types, just make them readonly, however I don't seem to get called for any of the *DynamicProperty callbacks.



My primary issue, however is to be able to change the values.



Thanks,



Rick
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Rick,



Dynamic Properties are only used on a couple of Devices and generally aren't needed. Also the internal support for them is not up to par with standard non-dynamic Properties.



Before we dive into your dynamic Property questions, I want to make sure you are using the right thing for what you need. Can you tell me a little bit more about the Property and what it is used for?



A standard non-dynamic Property can be updated (dynamically) from the Device without a user action. So you can still, for example, update a temperature Property value from the Device running in a thread at any time. These changes will be immediately reflected in the HouseBot Device to trigger Tasks or display on Software Remotes.
Scott
roweiss
Member
Posts: 12
Joined: Thu Mar 10, 2005 12:34 am

Post by roweiss »

Scott,



Thanks for your reply. Since posting, I experimented some more, found a bug in my code and was able to get standard properties to do what I wanted. I had been under the impression that I needed dynamic properties to do dynamic device side updates to push content to the server and software remote.



To answer your question, I'm using a web interface to my Tivo to extract the current state of the tuner(s) with respect to what channel/program is being viewed and what is being recorded. I query the tivo, get a response back, populate the properties and they get displayed on the software remote. All this is done on a configured poll cycle.



I am using a set of PtAlpha properties to display portions of the data, like "Channel", "Tilte", "Episode", "Description", ...



I had obviously been under the impression that I needed dynamic properties to do the above, however was able to get it to work with standard properties.



So, what does make "dynamic" properties dynamic? It appears that they must be PtAlphaList and have the "dynamic" parameter set when they are registered. Once that is done, it appears that you call InitDynamicProperty whenever I try to view the property from the UI. I tried some code in the InitDynamicProperty call and it caused HouseBot to crash. I was presuming I would have to clear the array, and then add new values. I wasn't sure when I would be called for SetDynamicProperty, or DeleteDynamicProperty.



I'm asking because one of the other things I'm contemplating is to extract program listing information from the Tivo (presuming I'm successful in figuring out how to get such information in the device) and adding that functionality to my device implementation, much like the "TV Listing Sample" device.



Thanks,



Rick
Post Reply