Closed GoogleCodeExporter closed 9 years ago
Attached is a patch which remedies this by saving the values in WriteXML and
reloads them in ReadXML.
However I don't know if that's the correct approach, so please review it.
Original comment by matthias...@googlemail.com
on 24 Jan 2013 at 9:12
Attachments:
Fixed in r638.
Original comment by glsatz
on 10 Feb 2013 at 6:51
Thank you!
But unfortunatly it doesn't work yet. The mapping is saved but not loaded.
The problem is that the Basic Class loads the mapping and calls SetMapping.
Then SetMapping searches for the mapped command class, but this does not exist
at the time the basic class is loaded/created. So nothing happens :-(
So we should either wait until the whole node was loaded before calling
SetMapping or store and load the mapping in both classes like in my patch.
Original comment by matthias...@googlemail.com
on 10 Feb 2013 at 2:18
Another alternative is to look up if the current class is basic mapped in the
CommandClass::ReadXML like this. However it works only if we are sure that all
other command classes are stored after basic in the XML. Also m_mapping would
have to be set in Basic::ReadXML without checking that the mapped Class really
exists.
if( this->GetCommandClassId() != NoOperation::StaticGetCommandClassId() &&
this->GetCommandClassId() != Basic::StaticGetCommandClassId())
{
if( Node const* node = GetNodeUnsafe() )
{
if( CommandClass* cc = node->GetCommandClass( Basic::StaticGetCommandClassId() ) )
{
if (cc == NULL) return;
if (((Basic*)cc)->GetMapping() == GetCommandClassId()) SetBasicMapped( true );
}
}
}
Original comment by matthias...@googlemail.com
on 10 Feb 2013 at 3:05
Original comment by glsatz
on 10 Feb 2013 at 4:54
How about we save the BASIC class xml at the end of the list of xml command
classes? This cleans up lots of code and we just have to document this behavior?
Original comment by glsatz
on 10 Feb 2013 at 4:55
For me this is also fine if this helps with this problem and maybe also others.
But you and others know the internals of OZW much better than me and should
take this decision. I have not looked in detail about how nodes and command
classes are discovered, created, loaded and saved.
Are there any special cases like devices that do not provide a basic command
class at all? If yes then this also has to be considered.
Original comment by matthias...@googlemail.com
on 11 Feb 2013 at 8:50
The mapping has been simplified to only map from BASIC to the mapped class.
This makes the order of saving the output unnecessary. Give the latest
repository version a try, please.
Original comment by glsatz
on 15 Feb 2013 at 5:27
Hi!
I think I'm experiencing an issue linked to this one - since the implementation
of the BASIC class has been changed some of the helper methods like SetNodeOn
and SetNodeOff are not working (r645 for instance).
I checked the xml configuration file, and I can see some mapping, but the
helper methods never work: not at first launch, and not after a restart of the
application.
On the contrary SwitchAllOn and SwitchAllOff are working (my app now crashes
after executing the command, however). Is there something specific I should
know.
Cheers,
Didier
Original comment by didier.d...@gmail.com
on 12 Mar 2013 at 7:02
Original comment by glsatz
on 15 Apr 2013 at 2:25
Original issue reported on code.google.com by
matthias...@googlemail.com
on 24 Jan 2013 at 9:10