changing property values

HouseBot Plugin Development Discussions.
Post Reply
peter
Member
Posts: 35
Joined: Wed May 31, 2006 3:51 am
Location: Berlin , GER

changing property values

Post by peter »

Hi Scott,
probably an easy question for you.
How can I change a property's value inside of my own DLL without!!! triggering the DeviceRun function. Normally, so my understanding, I have to call the ChangeRequest function. That is what I'm doing all the time and what works well. But this will cause adding this property to the server's change queue. What I want is, to avoid that the server calls my DeviceRun function for this particular property in this case. I tried ChangeRequestCompleted instead of ChangeRequest. It seems to work but I'm not sure if there are any side effects.

Thanks in advance
peter
ScottBot
Site Admin
Posts: 2786
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Re: changing property values

Post by ScottBot »

You got it.

Just create the propertyvalue object, call ChangeRequestCompleted() on it, then delete the property value object.

The system time device does it every second.
Scott
ScottBot
Site Admin
Posts: 2786
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Re: changing property values

Post by ScottBot »

And a helper function for doing it is included in Device.cpp. If you call CreatePropertyValueAndChange( CProperty* pProperty, const char* szNewValue ) on the Device object, it will take care of creating the PV object, calling the changerequestcomplete method and then deleting the object.
Scott
Post Reply