Hi, sorry, no idea from afar. Did you already try to place some breakpoints in the service implementation to check, if it is really instantiated and things like that?
Best, Stefan ________________________________________ Von: Nil Goyette [nil.goye...@imeka.ca] Gesendet: Montag, 4. April 2016 22:26 An: Kislinskiy, Stefan; mitk-users@lists.sourceforge.net Betreff: Re: [mitk-users] Scene properties Hi Stefan, My class extending mitk::PropertyListReplacedObserver is in a module now, but I still can't get it to work. GetPeristenceService() always return a nullptr, wathever I try. I tried mimicking OpenCVVideoSupport as much as possible, to no avail. Do you have any ideas on what I could have done wrong? Thank you for your time. Nil Le 2016-03-15 04:40, Kislinskiy, Stefan a écrit : Hi Nil, I would recommend to move such code into a module. That’s why it is working in Modules/IGTUI/Qmitk and Modules/OpenCVVideoSupport/UI. The alternative is to make your plugin context available by providing a static access method for the context in your plugin activator. See org_mitk_gui_qt_simulation_Activator.h for an example. In QmitkSimulationView.cpp right below the includes I wrote a helper method to get a service by using this plugin context. You should be able to get the persistence service like this without the macros (just follow the macros, they are doing nothing special, they are just for convenience). I still would recommend the former solution though, as it is clean and wouldn’t require any workaround code. I’ll correct the typo in GetPeristenceService() for the upcoming release. Best, Stefan From: Nil Goyette [mailto:nil.goye...@imeka.ca] Sent: Montag, 14. März 2016 21:09 To: mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net> Subject: Re: [mitk-users] Scene properties Hi Stefan, I tried the persistence service and I got this error each time I use GetPeristenceService(). WARNING: In us::GetModuleContext at \Modules\CppMicroServices\core\include\usGetModuleContext.h:57 : Module 'org_imeka_qt_brainanalysis' unknown. The calling module probably misses a US_MODULE_NAME compile definition and/or a call to US_INITIALIZE_MODULE in one of its source files. I didn't find such a thing in the QmitkOpenCVVideoControls example so I randomly added a US_INITIALIZE_MODULE in my plugin activator and now GetPersistenceService() finds its module but returns a nullptr. I can't give you more information than that because PersistenceService.h is a macro hell. Do you know how to make it work? Nil Le 2016-03-07 09:35, Nil Goyette a écrit : Hi Stefan, These properties can be stored inside a MITK scene together with the data so that the user loads data and restores the application state at once. - MITK Persistence Service I can't test it now but this is exactly what I needed. Thank you. Nil Le 2016-03-07 01:29, Kislinskiy, Stefan a écrit : Hi Nil, please see http://docs.mitk.org/2015.05/PersistenceConceptPage.html. Best, Stefan ________________________________________ Von: Nil Goyette [nil.goye...@imeka.ca<mailto:nil.goye...@imeka.ca>] Gesendet: Freitag, 4. März 2016 15:15 An: mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net> Betreff: [mitk-users] Scene properties Hi all, Is there a concept of scene property? I have some parameters(widget) in my plugin, like MinFiberLength, MaxFiberLength, etc. which are not saved when I save the scene. These parameters don't belong to any node, and they don't fit as a Preference because the user will probably change them when loading other data. That leaves me with "scene property", but I don't think they exist. My plan is to put the properties in a hidden node, but it does seem like an hack. It's still the less hackish method I can find without modifying MITK's code. Is there a right way to do that? Nil ------------------------------------------------------------------------------ _______________________________________________ mitk-users mailing list mitk-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mitk-users