12:31, EEST
February 21, 2014
Greetings,
I’m attaching a DataChangeListener to a variable node in a generated code class. The changeHandler is properly called upon a change, yet it returns values of the class StructureDataValue.ToRoot instead of, in this case, a simple UInt32. This makes validation or accessing the values in a typed manner a bit difficult (even though in my case the “intValue()” conversion works).
Is there a way to extract the “original” DataValue from the change listener, including the correct type?
One more general question relating to the use of the DataChange listener (or some other construct): is there any way I can perform validation of the to-be written values and eventually return a BAD status code without having to implement an IOManager?
== Answer to myself after some more testing: the changeListener seems to be called before the new value is applied. Thus throwing a StatusException will prevent the write.
Thanks,
Hans-Uwe
15:41, EEST
December 21, 2011
StructureDataValue.ToRoot is a subclass of DataValue, and the fields should be equal to the original ones. So if you use getValue() like with a normal DataValue, you should get the original value. At least, that’s how I understand it…
And good that you figured the ChangeListener: that’s exactly the idea that you can cancel the write request in the handler by throwing the proper StatusException.
Most Users Ever Online: 518
Currently Online:
10 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
hbrackel: 135
pramanj: 86
Francesco Zambon: 81
rocket science: 77
ibrahim: 75
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
fred: 41
Member Stats:
Guest Posters: 0
Members: 680
Moderators: 16
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1467
Posts: 6259
Newest Members:
DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule, rashadbrownrigg, christi10l, ahamad1, Flores FrederickModerators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5
Administrators: admin: 1