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

Generate Id for ParameterIdentificationFeedback object so it can be serialized #1489

Conversation

abdelr
Copy link
Member

@abdelr abdelr commented Feb 9, 2022

Fixes #1488 (Saving project with parameter identification feedback view => crash)

@msevestre
Copy link
Member

This line in PK-Sim should be changes
https://github.com/Open-Systems-Pharmacology/PK-Sim/blob/develop/src/PKSim.Presentation/Services/WorkspaceLayoutUpdater.cs#L70

Instead of creating an Id that will not be registered anywhere. CLosing this PR as this will not work

@msevestre msevestre closed this Feb 10, 2022
@abdelr
Copy link
Member Author

abdelr commented Feb 10, 2022

This line in PK-Sim should be changes https://github.com/Open-Systems-Pharmacology/PK-Sim/blob/develop/src/PKSim.Presentation/Services/WorkspaceLayoutUpdater.cs#L70

Instead of creating an Id that will not be registered anywhere. CLosing this PR as this will not work

@msevestre Well, it did not crash anymore. The idea of saving the object was inspired by the fact that you mentioned that there is a way to save the project so you could resume it later in the exact state it was when it closed. So, for example, all dialogs that were opened should remain as they were. In such a case, we do need to have the object saved into the project, right?

@msevestre
Copy link
Member

For this the object needs to be registered. and available. By creating the ID by hand, it defeats the purpose of registration.

@abdelr
Copy link
Member Author

abdelr commented Feb 10, 2022

Ok so, should we register it and make it available or should we ignore it as you propose modifying the WorkspaceLayoutUpater? Also, I was considering some more changes to turn the subject into a IWithId, otherwise the downcast is missing some logic to return null in case it is not implementing the inteface.

@msevestre
Copy link
Member

no downacast. Jsut use as if it's null return? or what a I missing?

@abdelr
Copy link
Member Author

abdelr commented Feb 10, 2022

Could we talk?

@abdelr
Copy link
Member Author

abdelr commented Feb 10, 2022

The code on WorkspaceLayoutUpater already deal with null. The problem is that DowncastTo should do something like:
return objectToCast as T;
So it will return null if the object does not implement T. This is what I mean.

@msevestre
Copy link
Member

Yes don't use downcast.
Instead as

@msevestre msevestre deleted the 1488_Generate_Id_for_ParameterIdentificationFeedback_object_so_it_can_be_serialized branch April 11, 2022 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saving a project in PKSim with Parameter Identification => Crash
2 participants