gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnumed-devel] GNUmed plugin development - part 7


From: Sebastian Hilbert
Subject: [Gnumed-devel] GNUmed plugin development - part 7
Date: Thu, 9 Apr 2009 16:02:01 +0200
User-agent: KMail/1.11.1 (Linux/2.6.22.19-0.2-default; KDE/4.2.1; i686; ; )

Now on to the real stuff. Looking at

    class gmCardiacDevicePlugin(gmPlugin.cNotebookPlugin):

            def GetWidget (self, parent):
                    self._widget = 
gmMedDocWidgets.cSelectablySortedDocTreePnl(parent, -1)
                    return self._widget

in gmCardiacDevicePlugin.py tells me that in the case of the Document archive 
plugin we borrowed from the class cSelectablySortedDocTreePnl is located in 
the file gmMedDocWidgets. The name implies that this is a collection of 
classes of medical document widgets. The device parameters are essentially 
measurements.

There is a file called gmMeasurementWidgets available and I am going to extend 
that one. I added a class cCardiacDeviceMeasurementsPnl to the file 
gmMeasurementWidgets.py just before the __main__ statement.

    #================================================================
    class 
cCardiacDeviceMeasurementsPnl(wxgCardiacDevicePluginPnl.wxgCardiacDevicePluginPnl,
 
gmRegetMixin.cRegetOnPaintMixin):

            """Panel holding a number of widgets to manage implanted cardiac 
devices. Used as notebook page."""

            def __init__(self, *args, **kwargs):

                    
wxgCardiacDevicePluginPnl.wxgCardiacDevicePluginPnl.__init__(self, 
*args, **kwargs)
                    gmRegetMixin.cRegetOnPaintMixin.__init__(self)
                    self.__init_ui()
                    self.__register_interests()
            #--------------------------------------------------------
            # event handling
            #--------------------------------------------------------


An extended import is needed as well.

    from Gnumed.wxGladeWidgets import wxgMeasurementsPnl, 
wxgMeasurementsReviewDlg
    from Gnumed.wxGladeWidgets import wxgMeasurementEditAreaPnl
    from Gnumed.wxGladeWidgets import wxgCardiacDevicePluginPnl


Now back to gmCardiacDevicePlugin.py to reflect the changes.

    class gmCardiacDevicePlugin(gmPlugin.cNotebookPlugin):

            def GetWidget (self, parent):
                    self._widget = 
gmMeasurementWidgets.cCardiacDeviceMeasurementsPnl(parent, -1)
                    return self._widget


A change in the import statements is needed here too.

    from Gnumed.wxpython import gmMeasurementWidgets, gmPlugin

instead of

    from Gnumed.wxpython import gmMedDocWidgets, gmPlugin, 
images_Archive_plugin

If you followed the above steps you might notice that the plugin throws many 
errors in the file gnumed.log. This file can be viewed directly from within 
GNUmed. It does not show up. The reason is simple. I use a complex set of 
widgets that are scattered across the files gmMeasurementWidgets and 
gmNarrativeWidgets.

The errors are that widgets found in gmNarrativeWidgets are not found, most 
likely because I put the class cCardiacDeviceMeasurementsPnl(parent, -1) in 
gmMeasurementWidgets. It could help to move the class into narrative widgets 
but that is not what I want. I could as well start another file called 
gmDeviceWidgets.

Any help is appreciated.

Attachment: gm-from-cvs.log
Description: Der Anhang =?utf-8?q?=E2=80=9Egm-from-cvs=2Elog=E2=80=9C _wurde?= =?utf-8?q?_gel=C3=B6scht=2E?=


reply via email to

[Prev in Thread] Current Thread [Next in Thread]