Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property Serialization mode is not remebered for dynamically added properties. #839

Open
r-englund opened this issue Jan 22, 2020 · 6 comments

Comments

@r-englund
Copy link
Member

When loading a network with a processor having one or more dynamically added properties with serialization mode set to All, the properties recreated by the deserializer does not have the serialization mode set to All.

For example: The parallel coordinates have a DataFrameColormapProperty. The DataFrameColormapProperty dynamically adds a bunch of ColormapProperty and set them their serialization mode to All.

auto colormapProp = [&]() -> ColormapProperty* {
if (auto p = getPropertyByIdentifier(identifier)) {
if (auto prop = dynamic_cast<ColormapProperty*>(p)) {
return prop;
}
removeProperty(identifier);
}
auto newProp = std::make_unique<ColormapProperty>(identifier, displayName);
auto ptr = newProp.get();
newProp->setVisible(false);
newProp->setSerializationMode(PropertySerializationMode::All);
insertProperty(1, newProp.release());
return ptr;
}();

When the network is saved and have been reloaded the serialization mode of the properties are Default which means the next time the network is saved information such as display name etc. will be lost.

Suggestion: In PropertyOwner, when adding a property to ownedProperties_ the serialization mode should be set to All. IMO, this makes sense since we need it for properties recreated by the deserializer to get, e.g, displayname correct

@r-englund
Copy link
Member Author

r-englund commented Jan 22, 2020

Or just remove serialization mode completely, it's not like we save that much disk space right?

@petersteneteg
Copy link
Member

would it not be more correct to just serialize it?

@r-englund
Copy link
Member Author

would it not be more correct to just serialize it?

We do serialize it, but if the serialization mode is not set to All we do not serialize everything

@petersteneteg
Copy link
Member

Where do we serialize the serialization mode?

@r-englund
Copy link
Member Author

Where do we serialize the serialization mode?

Ahh, I did not realize you meant the serialization mode. But yes, that would be a solution as well I guess, probably the best one.

@petersteneteg
Copy link
Member

This is still on my todo I think

@petersteneteg petersteneteg reopened this Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants