Example #1
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ["HARPIA_DATA_DIR"]

        filename = self.m_sDataDir + "glade/liveDelay.ui"
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = ["Properties", "frameNumber", "BackgroundColor", "BorderColor", "HelpView", "prop_confirm"]

        handlers = [
            "on_cancel_clicked",
            "on_prop_confirm_clicked",
            "on_BackColorButton_clicked",
            "on_BorderColorButton_clicked",
        ]

        top_window = "Properties"

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:
            name = Property.getAttr("name")
            value = Property.getAttr("value")

            if name == "frameNumber":
                self.widgets["frameNumber"].set_value(int(float(value)))

        self.configure()
Example #2
0
    def __init__(self, PropertiesXML, S2iBlockProperties):
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/show.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'SHOWDisable',
            'BackgroundColor',
            'BorderColor',
            'HelpView'
        ]

        handlers = [
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',
            'on_cancel_clicked',
            'on_confirm_clicked'
        ]

        top_window = 'Properties'
        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)


        # load properties values
        # There is no properties
        # load block state
        t_bState = self.m_oS2iBlockProperties.GetState()

        self.widgets['SHOWDisable'].set_active(not t_bState)

        self.configure()
Example #3
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ["HARPIA_DATA_DIR"]

        filename = self.m_sDataDir + "glade/comment.ui"
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = ["Properties", "BackgroundColor", "BorderColor", "HelpView", "COMMENTView"]

        handlers = [
            "on_BackColorButton_clicked",
            "on_BorderColorButton_clicked",
            "on_cancel_clicked",
            "on_comment_confirm_clicked",
        ]

        top_window = "Properties"

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")

        for Property in self.block_properties:

            # self.widgets['FILLBackgroundColor'].modify_bg(gtk.STATE_NORMAL,t_oColor)
            name = Property.getAttr("name")
            value = Property.getAttr("value")

            if name == "comment":
                self.m_sComment = str(value)

        self.configure()
Example #4
0
    def __init__(self, PropertiesXML, S2iBlockProperties):
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/not.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'BackgroundColor',
            'BorderColor',
            'HelpView'
        ]

        handlers = [
            'on_cancel_clicked',
            'on_not_confirm_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.configure()
Example #5
0
    def __init__( self, PropertiesXML, S2iBlockProperties):
        
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
        
        filename = self.m_sDataDir+'glade/canny.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'CANNThreshold1',
            'CANNThreshold2',
            'CANNApertureSize',
            'BackgroundColor',
            'BorderColor',
            'HelpView',
						'canny_confirm'
            ]

        handlers = [
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',
            'on_cancel_clicked',
            'on_canny_confirm_clicked'
            ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)
        

        #load properties values
        for Property in self.m_oPropertiesXML.properties.block.property:

            if Property.name == "threshold1":
                self.widgets['CANNThreshold1'].set_value( float(Property.value) )

            if Property.name == "threshold2":
                self.widgets['CANNThreshold2'].set_value( float(Property.value) )

            if Property.name == "apertureSize":
              #  if Property.value == "1":
              #      self.widgets['CANNApertureSize'].set_active( int(0) )
                if Property.value == "3":
                    self.widgets['CANNApertureSize'].set_active( int(0) )
                if Property.value == "5":
                    self.widgets['CANNApertureSize'].set_active( int(1) )
                if Property.value == "7":
                    self.widgets['CANNApertureSize'].set_active( int(2) )

        self.configure()

        #load help text
        t_oS2iHelp = bt.bind_file(self.m_sDataDir+"help/canny"+ _("_en.help"))
        
        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['HelpView'].set_buffer( t_oTextBuffer )
Example #6
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/pow.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'POWExponent', 'BackgroundColor', 'BorderColor',
            'HelpView'
        ]

        handlers = [
            'on_cancel_clicked', 'on_pow_confirm_clicked',
            'on_BackColorButton_clicked', 'on_BorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag(
            "properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:

            if Property.name == "exponent":
                self.widgets['POWExponent'].set_value(int(Property.value))

        self.configure()
Example #7
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/saveVideo.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'SAVEFilename', 'SAVEType', 'SAVEFrameRate',
            'BackgroundColor', 'BorderColor', 'codecSelection', 'HelpView',
            'save_confirm'
        ]

        handlers = [
            'on_SAVEButtonSearch_clicked', 'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked', 'on_cancel_clicked',
            'on_save_confirm_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag(
            "properties").getTag("block").getChildTags("property")

        for Property in self.block_properties:

            if Property.name == "filename":
                self.widgets['SAVEFilename'].set_text(
                    os.path.expanduser(Property.value))
            if Property.name == "framerate":
                self.widgets['SAVEFrameRate'].set_value(float(Property.value))
            if Property.name == "codecSelection":
                if Property.value == "MPEG1":
                    self.widgets['codecSelection'].set_active(0)
                elif Property.value == "mjpeg":
                    self.widgets['codecSelection'].set_active(1)
                elif Property.value == "MPEG4.2":
                    self.widgets['codecSelection'].set_active(2)
                elif Property.value == "MPEG4.3":
                    self.widgets['codecSelection'].set_active(3)
                elif Property.value == "MPEG4":
                    self.widgets['codecSelection'].set_active(4)
                elif Property.value == "H263":
                    self.widgets['codecSelection'].set_active(5)
                elif Property.value == "H263I":
                    self.widgets['codecSelection'].set_active(6)
                elif Property.value == "FLV1":
                    self.widgets['codecSelection'].set_active(7)

                    #           if Property.name == "filetype":
                    #               if Property.value == "png":
                    #                   self.widgets['SAVEType'].set_active( int(0) )
                    #               if Property.value == "jpeg":
                    #                   self.widgets['SAVEType'].set_active( int(1) )

        self.configure()
Example #8
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/pow.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'POWExponent',
            'BackgroundColor',
            'BorderColor',
            'HelpView'
        ]

        handlers = [
            'on_cancel_clicked',
            'on_pow_confirm_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:

            if Property.name == "exponent":
                self.widgets['POWExponent'].set_value(int(Property.value))

        self.configure()
    def __init__(self, PropertiesXML, S2iBlockProperties):
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/equalizeHistogram.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'BackgroundColor',
            'BorderColor',
            'HelpView'
        ]

        handlers = [
            #  'on_EQUARadioAutomatic_pressed',
            #  'on_EQUARadioBand_pressed',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',
            'on_cancel_clicked',
            'on_equalizeHistogram_confirm_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.configure()
Example #10
0
    def __init__(self, PropertiesXML, S2iBlockProperties):
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/equalizeHistogram.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'BackgroundColor', 'BorderColor', 'HelpView'
        ]

        handlers = [
            #  'on_EQUARadioAutomatic_pressed',
            #  'on_EQUARadioBand_pressed',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',
            'on_cancel_clicked',
            'on_equalizeHistogram_confirm_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.configure()
Example #11
0
    def __init__(self):
        """
			Sets the Glade file where the about window is defined and Connects the
			signals and its handlers through GladeWindow __init__
    	"""

        ## Get the file with the about window
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
        filename = self.m_sDataDir + 'glade/about.ui'
        ## The widget list
        widget_list = [
            'about', 'harpia_name', 'about_s2i_logo', 'about_finep_logo'
        ]
        handlers = []
        # The top three widget
        top_window = 'about'

        # Starts the Glade Window
        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)
        # Set the Icons and logos
        self.widgets['about'].set_icon_from_file(self.m_sDataDir +
                                                 "images/harpia_ave.png")
        self.widgets['harpia_name'].set_from_file(self.m_sDataDir +
                                                  "images/harpia_name.png")
        self.widgets['about_s2i_logo'].set_from_file(self.m_sDataDir +
                                                     "images/s2ilogo.png")
        self.widgets['about_finep_logo'].set_from_file(self.m_sDataDir +
                                                       "images/finep_logo.gif")
Example #12
0
    def __init__(self, PropertiesXML, S2iBlockProperties):
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/division.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'BackgroundColor',
            'BorderColor',
            'HelpView'
        ]

        handlers = [
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',
            'on_cancel_clicked',
            'on_division_confirm_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.configure()

        # load help text
        t_oS2iHelp = XMLParser(self.m_sDataDir + "help/division" + _("_en.help"))

        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text(unicode(str(t_oS2iHelp.getTag("help").getTag("content").getTagContent())))

        self.widgets['HelpView'].set_buffer(t_oTextBuffer)
Example #13
0
    def __init__(self, PropertiesXML, S2iBlockProperties):
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/isOnRect.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'BackgroundColor',
            'BorderColor',
            'HelpView',
            'prop_confirm'
        ]

        handlers = [
            'on_cancel_clicked',
            'on_prop_confirm_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        # for Property in self.m_oPropertiesXML.properties.block.property:
        # if Property.name == "angle":
        # self.widgets['angle'].set_value( float(Property.value) );


        self.configure()
Example #14
0
    def __init__(self, PropertiesXML, S2iBlockProperties):
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/show.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'SHOWDisable', 'BackgroundColor', 'BorderColor',
            'HelpView'
        ]

        handlers = [
            'on_BackColorButton_clicked', 'on_BorderColorButton_clicked',
            'on_cancel_clicked', 'on_confirm_clicked'
        ]

        top_window = 'Properties'
        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        # There is no properties
        # load block state
        t_bState = self.m_oS2iBlockProperties.GetState()

        self.widgets['SHOWDisable'].set_active(not t_bState)

        self.configure()
Example #15
0
    def __init__(self, PropertiesXML, S2iBlockProperties):
        self.m_sDataDir = os.environ["HARPIA_DATA_DIR"]

        filename = self.m_sDataDir + "glade/equalizeHistogram.ui"
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = ["Properties", "BackgroundColor", "BorderColor", "HelpView"]

        handlers = [
            #  'on_EQUARadioAutomatic_pressed',
            #  'on_EQUARadioBand_pressed',
            "on_BackColorButton_clicked",
            "on_BorderColorButton_clicked",
            "on_cancel_clicked",
            "on_equalizeHistogram_confirm_clicked",
        ]

        top_window = "Properties"

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.configure()

        # load help text
        t_oS2iHelp = XMLParser(self.m_sDataDir + "help/equalizeHistogram" + _("_en.help"))

        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text(unicode(str(t_oS2iHelp.getTag("help").getTag("content").getTagContent())))

        self.widgets["HelpView"].set_buffer(t_oTextBuffer)
Example #16
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/rotate.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'isAtCenter',
            'isAtPoint',
            'isScalling',
            'isFilling',
            'xC',
            'yC',
            'BackgroundColor',
            'BorderColor',
            'HelpView',
            'prop_confirm'
        ]

        handlers = [
            'on_cancel_clicked',
            'on_prop_confirm_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:
            if Property.name == "xC":
                self.widgets['xC'].set_value(float(Property.value));
            if Property.name == "yC":
                self.widgets['yC'].set_value(float(Property.value));

            if Property.name == "isFilling":
                if Property.value == "true":
                    self.widgets['isFilling'].set_active(True);
                else:
                    self.widgets['isFilling'].set_active(False);

            if Property.name == "isScalling":
                if Property.value == "true":
                    self.widgets['isScalling'].set_active(True);
                else:
                    self.widgets['isScalling'].set_active(False);

            if Property.name == "isCenter":
                if Property.value == "true":
                    self.widgets['isAtCenter'].set_active(True);
                else:
                    self.widgets['isAtPoint'].set_active(True);

        self.configure()
Example #17
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/runCmd.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'cmdString', 'BackgroundColor', 'BorderColor',
            'HelpView', 'enIsntZero'
        ]

        handlers = [
            'on_cancel_clicked', 'on_prop_confirm_clicked',
            'on_BackColorButton_clicked', 'on_BorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag(
            "properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:
            if Property.name == "cmdString":
                self.widgets['cmdString'].set_text(Property.value)
            if Property.name == "enIsntZero":
                self.widgets['enIsntZero'].set_active(Property.value == "True")

        self.configure()
Example #18
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ["HARPIA_DATA_DIR"]

        filename = self.m_sDataDir + "glade/cropImage.ui"
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = ["Properties", "BackgroundColor", "BorderColor", "HelpView"]

        handlers = [
            "on_cancel_clicked",
            "on_prop_confirm_clicked",
            "on_BackColorButton_clicked",
            "on_BorderColorButton_clicked",
        ]

        top_window = "Properties"

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.configure()
        # load help text
        t_oS2iHelp = bt.bind_file(self.m_sDataDir + "help/cropImage" + _("_en.help"))

        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text(unicode(str(t_oS2iHelp.help.content)))

        self.widgets["HelpView"].set_buffer(t_oTextBuffer)
Example #19
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/liveDelay.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'frameNumber', 'BackgroundColor', 'BorderColor',
            'HelpView', 'prop_confirm'
        ]

        handlers = [
            'on_cancel_clicked', 'on_prop_confirm_clicked',
            'on_BackColorButton_clicked', 'on_BorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.block_properties = self.m_oPropertiesXML.getTag(
            "properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:
            name = Property.getAttr("name")
            value = Property.getAttr("value")

            if name == "frameNumber":
                self.widgets['frameNumber'].set_value(int(float(value)))

        self.configure()
Example #20
0
 def __init__( self ):
     """
         Sets the Glade file where the about window is defined and Connects the
         signals and its handlers through GladeWindow __init__
     """
         
     ## Get the file with the about window
     self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
     filename = self.m_sDataDir+'glade/about.ui'
     ## The widget list
     widget_list = [
             'about',
             'harpia_name',
             'about_s2i_logo',
             'about_finep_logo'
             ]
     handlers = [            ]
     # The top three widget
     top_window = 'about'
     
     # Starts the Glade Window
     GladeWindow.__init__(self, filename, top_window, widget_list, handlers)
     # Set the Icons and logos
     self.widgets['about'].set_icon_from_file(self.m_sDataDir+"images/harpia_ave.png")
     self.widgets['harpia_name'].set_from_file(self.m_sDataDir+"images/harpia_name.png")
     self.widgets['about_s2i_logo'].set_from_file(self.m_sDataDir+"images/s2ilogo.png")
     self.widgets['about_finep_logo'].set_from_file(self.m_sDataDir+"images/finep_logo.gif")
Example #21
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/rotate.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'isAtCenter',
            'isAtPoint',
            'isScalling',
            'isFilling',
            'xC',
            'yC',
            'BackgroundColor',
            'BorderColor',
            'HelpView',
            'prop_confirm'
        ]

        handlers = [
            'on_cancel_clicked',
            'on_prop_confirm_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:
            if Property.name == "xC":
                self.widgets['xC'].set_value(float(Property.value));
            if Property.name == "yC":
                self.widgets['yC'].set_value(float(Property.value));

            if Property.name == "isFilling":
                if Property.value == "true":
                    self.widgets['isFilling'].set_active(True);
                else:
                    self.widgets['isFilling'].set_active(False);

            if Property.name == "isScalling":
                if Property.value == "true":
                    self.widgets['isScalling'].set_active(True);
                else:
                    self.widgets['isScalling'].set_active(False);

            if Property.name == "isCenter":
                if Property.value == "true":
                    self.widgets['isAtCenter'].set_active(True);
                else:
                    self.widgets['isAtPoint'].set_active(True);

        self.configure()
Example #22
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/sobel.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'SOBEXOrder',
            'SOBEYOrder',
            'SOBEMaskSize',
            'BackgroundColor',
            'BorderColor',
            'HelpView'
        ]

        handlers = [
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',
            'on_cancel_clicked',
            'on_sobel_confirm_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.OrderLimit = 6
        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:

            if Property.name == "xorder":
                self.widgets['SOBEXOrder'].set_value(int(Property.value))

            if Property.name == "yorder":
                self.widgets['SOBEYOrder'].set_value(int(Property.value))

            if Property.name == "masksize":
                if Property.value == "1":
                    self.widgets['SOBEMaskSize'].set_active(int(0))
                if Property.value == "3":
                    self.widgets['SOBEMaskSize'].set_active(int(1))
                if Property.value == "5":
                    self.widgets['SOBEMaskSize'].set_active(int(2))
                if Property.value == "7":
                    self.widgets['SOBEMaskSize'].set_active(int(3))

        self.configure()

        # load help text
        t_oS2iHelp = XMLParser(self.m_sDataDir + "help/sobel" + _("_en.help"))

        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text(unicode(str(t_oS2iHelp.getTag("help").getTag("content").getTagContent())))

        self.widgets['HelpView'].set_buffer(t_oTextBuffer)
Example #23
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ["HARPIA_DATA_DIR"]

        filename = self.m_sDataDir + "glade/runCmd.ui"
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = ["Properties", "cmdString", "BackgroundColor", "BorderColor", "HelpView", "enIsntZero"]

        handlers = [
            "on_cancel_clicked",
            "on_prop_confirm_clicked",
            "on_BackColorButton_clicked",
            "on_BorderColorButton_clicked",
        ]

        top_window = "Properties"

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:
            if Property.name == "cmdString":
                self.widgets["cmdString"].set_text(Property.value)
            if Property.name == "enIsntZero":
                self.widgets["enIsntZero"].set_active(Property.value == "True")

        self.configure()
Example #24
0
    def __init__(self, PropertiesXML, S2iBlockProperties):
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/isOnRect.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'BackgroundColor',
            'BorderColor',
            'HelpView',
            'prop_confirm'
        ]

        handlers = [
            'on_cancel_clicked',
            'on_prop_confirm_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        # for Property in self.m_oPropertiesXML.properties.block.property:
        # if Property.name == "angle":
        # self.widgets['angle'].set_value( float(Property.value) );


        self.configure()
Example #25
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/and.glade'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'ANDBackgroundColor', 'ANDBorderColor', 'ANDHelpView'
        ]

        handlers = [
            'on_ANDBackColorButton_clicked', 'on_ANDBorderColorButton_clicked',
            'on_and_cancel_clicked', 'on_and_confirm_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.widgets['Properties'].set_icon_from_file(self.m_sDataDir +
                                                      "images/harpia_ave.png")

        #load border color
        self.m_oBorderColor = self.m_oS2iBlockProperties.GetBorderColor()

        t_nBorderRed = self.m_oBorderColor[0] * 257
        t_nBorderGreen = self.m_oBorderColor[1] * 257
        t_nBorderBlue = self.m_oBorderColor[2] * 257

        t_oBorderColor = gtk.gdk.Color(red=t_nBorderRed,
                                       green=t_nBorderGreen,
                                       blue=t_nBorderBlue)

        self.widgets['ANDBorderColor'].modify_bg(gtk.STATE_NORMAL,
                                                 t_oBorderColor)

        #load block color
        self.m_oBackColor = self.m_oS2iBlockProperties.GetBackColor()

        t_nBackRed = self.m_oBackColor[0] * 257
        t_nBackGreen = self.m_oBackColor[1] * 257
        t_nBackBlue = self.m_oBackColor[2] * 257

        t_oBackColor = gtk.gdk.Color(red=t_nBackRed,
                                     green=t_nBackGreen,
                                     blue=t_nBackBlue)

        self.widgets['ANDBackgroundColor'].modify_bg(gtk.STATE_NORMAL,
                                                     t_oBackColor)

        #load help text
        t_oS2iHelp = bt.bind_file(self.m_sDataDir + "help/and" + _("_en.help"))

        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text(unicode(str(t_oS2iHelp.help.content)))

        self.widgets['ANDHelpView'].set_buffer(t_oTextBuffer)
Example #26
0
    def __init__( self, PropertiesXML, S2iBlockProperties):
        
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
        
        filename = self.m_sDataDir+'glade/cropImage.glade'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'propBackgroundColor',
            'propBorderColor',
            'propHelpView'
            ]

        handlers = [
            'on_prop_cancel_clicked',
            'on_prop_confirm_clicked',
            'on_propBackColorButton_clicked',
            'on_propBorderColorButton_clicked'
            ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)
        
        self.widgets['Properties'].set_icon_from_file(self.m_sDataDir+"images/harpia_ave.png")

        #load properties values

        #load border color
        self.m_oBorderColor = self.m_oS2iBlockProperties.GetBorderColor()

        t_nBorderRed   = self.m_oBorderColor[0] * 257
        t_nBorderGreen = self.m_oBorderColor[1] * 257
        t_nBorderBlue  = self.m_oBorderColor[2] * 257

        t_oBorderColor = gtk.gdk.Color(red=t_nBorderRed,green=t_nBorderGreen,blue=t_nBorderBlue)

        self.widgets['propBorderColor'].modify_bg(gtk.STATE_NORMAL,t_oBorderColor)        

        #load block color
        self.m_oBackColor = self.m_oS2iBlockProperties.GetBackColor()

        t_nBackRed   = self.m_oBackColor[0] * 257
        t_nBackGreen = self.m_oBackColor[1] * 257
        t_nBackBlue  = self.m_oBackColor[2] * 257

        t_oBackColor = gtk.gdk.Color(red=t_nBackRed,green=t_nBackGreen,blue=t_nBackBlue)

        self.widgets['propBackgroundColor'].modify_bg(gtk.STATE_NORMAL,t_oBackColor)

        #load help text
        t_oS2iHelp = bt.bind_file(self.m_sDataDir+'help/cropImage'+ _('_en.help'))
        
        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['propHelpView'].set_buffer( t_oTextBuffer )
Example #27
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/findSquares.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'BackgroundColor',
            'BorderColor',
            'HelpView',
            'minVal',
            'maxVal',
            'enMin',
            'enMax',
            'prop_confirm'
        ]

        handlers = [
            'on_cancel_clicked',
            'on_prop_confirm_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',
            'on_enMin_toggled',
            'on_enMax_toggled'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")

        for Property in self.block_properties:

            name = Property.getAttr("name")
            value = Property.getAttr("value")

            if name == "minVal":
                self.widgets['minVal'].set_value(int(float(value)))
            if name == "maxVal":
                self.widgets['maxVal'].set_value(int(float(value)))
            if name == "enMin":
                self.widgets['enMin'].set_active(value == 'True')
            if name == "enMax":
                self.widgets['enMax'].set_active(value == 'True')

        self.configure()

        # load help text
        t_oS2iHelp = XMLParser(self.m_sDataDir + 'help/findSquares' + _('_en.help'))

        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text(unicode(str(t_oS2iHelp.getTag("help").getTag("content").getTagContent())))

        self.widgets['HelpView'].set_buffer(t_oTextBuffer)
Example #28
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/threshold.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'THREThreshold',
            'THREThresholdType',
            'THRELabelMaxValue',
            'THREMaxValue',
            'BackgroundColor',
            'BorderColor',
            'HelpView'
        ]

        handlers = [
            'on_THREThresholdType_changed',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',
            'on_cancel_clicked',
            'on_threshold_confirm_clicked',
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:

            if Property.name == "threshold":
                self.widgets['THREThreshold'].set_value(float(Property.value))

            if Property.name == "maxValue":
                self.widgets['THREMaxValue'].set_value(float(Property.value))

            if Property.name == "thresholdType":
                if Property.value == "CV_THRESH_BINARY":
                    self.widgets['THREThresholdType'].set_active(int(0))
                    self.on_THREThresholdType_changed()
                if Property.value == "CV_THRESH_BINARY_INV":
                    self.widgets['THREThresholdType'].set_active(int(1))
                    self.on_THREThresholdType_changed()
                if Property.value == "CV_THRESH_TRUNC":
                    self.widgets['THREThresholdType'].set_active(int(2))
                    self.on_THREThresholdType_changed()
                if Property.value == "CV_THRESH_TOZERO":
                    self.widgets['THREThresholdType'].set_active(int(3))
                    self.on_THREThresholdType_changed()
                if Property.value == "CV_THRESH_TOZERO_INV":
                    self.widgets['THREThresholdType'].set_active(int(4))
                    self.on_THREThresholdType_changed()

        self.configure()
Example #29
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/threshold.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'THREThreshold',
            'THREThresholdType',
            'THRELabelMaxValue',
            'THREMaxValue',
            'BackgroundColor',
            'BorderColor',
            'HelpView'
        ]

        handlers = [
            'on_THREThresholdType_changed',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',
            'on_cancel_clicked',
            'on_threshold_confirm_clicked',
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:

            if Property.name == "threshold":
                self.widgets['THREThreshold'].set_value(float(Property.value))

            if Property.name == "maxValue":
                self.widgets['THREMaxValue'].set_value(float(Property.value))

            if Property.name == "thresholdType":
                if Property.value == "CV_THRESH_BINARY":
                    self.widgets['THREThresholdType'].set_active(int(0))
                    self.on_THREThresholdType_changed()
                if Property.value == "CV_THRESH_BINARY_INV":
                    self.widgets['THREThresholdType'].set_active(int(1))
                    self.on_THREThresholdType_changed()
                if Property.value == "CV_THRESH_TRUNC":
                    self.widgets['THREThresholdType'].set_active(int(2))
                    self.on_THREThresholdType_changed()
                if Property.value == "CV_THRESH_TOZERO":
                    self.widgets['THREThresholdType'].set_active(int(3))
                    self.on_THREThresholdType_changed()
                if Property.value == "CV_THRESH_TOZERO_INV":
                    self.widgets['THREThresholdType'].set_active(int(4))
                    self.on_THREThresholdType_changed()

        self.configure()
Example #30
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/colorConversion.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'COLOConversionType', 'BackgroundColor',
            'BorderColor', 'HelpView'
        ]

        handlers = [
            'on_BackColorButton_clicked', 'on_BorderColorButton_clicked',
            'on_cancel_clicked', 'on_colorConversion_confirm_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.block_properties = self.m_oPropertiesXML.getTag(
            "properties").getTag("block").getChildTags("property")
        #load properties values
        for Property in self.block_properties:

            name = Property.getAttr("name")
            value = Property.getAttr("value")

            if name == "type":
                if value == "RGB -> GRAY":
                    self.widgets['COLOConversionType'].set_active(int(0))
                if value == "RGB -> YCrCb":
                    self.widgets['COLOConversionType'].set_active(int(1))
                if value == "YCrCb -> RGB":
                    self.widgets['COLOConversionType'].set_active(int(2))
                if value == "RGB -> HSV":
                    self.widgets['COLOConversionType'].set_active(int(3))
                if value == "HSV -> RGB":
                    self.widgets['COLOConversionType'].set_active(int(4))
                if value == "RGB -> HLS":
                    self.widgets['COLOConversionType'].set_active(int(5))
                if value == "HLS -> RGB":
                    self.widgets['COLOConversionType'].set_active(int(6))
                if value == "RGB -> CIE.XYZ":
                    self.widgets['COLOConversionType'].set_active(int(7))
                if value == "CIE.XYZ -> RGB":
                    self.widgets['COLOConversionType'].set_active(int(8))
                if value == "RGB -> CIE.LAB":
                    self.widgets['COLOConversionType'].set_active(int(9))
                if value == "CIE.LAB -> RGB":
                    self.widgets['COLOConversionType'].set_active(int(10))
                if value == "RGB -> CIE.LUV":
                    self.widgets['COLOConversionType'].set_active(int(11))
                if value == "CIE.LUV -> RGB":
                    self.widgets['COLOConversionType'].set_active(int(12))

        self.configure()
Example #31
0
    def __init__( self, PropertiesXML, S2iBlockProperties):
        
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
        
        filename = self.m_sDataDir+'glade/smooth.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'SMOOType',
            'SMOOParam1',
            'SMOOParam2',
            'BackgroundColor',
            'BorderColor',
            'HelpView'
            ]

        handlers = [
            'on_cancel_clicked',
            'on_smooth_confirm_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked'
            ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)
        
        #load properties values
        for Property in self.m_oPropertiesXML.properties.block.property:

            if Property.name == "type":
                if Property.value == "CV_BLUR":
                    self.widgets['SMOOType'].set_active( int(0) )
                if Property.value == "CV_GAUSSIAN":
                    self.widgets['SMOOType'].set_active( int(1) )
                if Property.value == "CV_MEDIAN":
                    self.widgets['SMOOType'].set_active( int(2) )
             #   if Property.value == "CV_BILATERAL":
             #       self.widgets['SMOOType'].set_active( int(4) )

            if Property.name == "param1":
                self.widgets['SMOOParam1'].set_value( int(Property.value) )

            if Property.name == "param2":
                self.widgets['SMOOParam2'].set_value( int(Property.value) )

        self.configure()

        #load help text
        t_oS2iHelp = bt.bind_file(self.m_sDataDir+"help/smooth"+ _("_en.help"))
        
        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['HelpView'].set_buffer( t_oTextBuffer )
Example #32
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/erode.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'ERODMaskSize',
            'ERODIterations',
            'BackgroundColor',
            'BorderColor',
            'HelpView',
            'erode_confirm'
        ]

        handlers = [
            'on_cancel_clicked',
            'on_erode_confirm_clicked',
            'on_BorderColorButton_clicked',
            'on_BackColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")
        # load properties values
        for Property in self.block_properties:

            name = Property.getAttr("name")
            value = Property.getAttr("value")

            if name == "masksize":
                if value == "3x3":
                    self.widgets['ERODMaskSize'].set_active(int(0))
                if value == "5x5":
                    self.widgets['ERODMaskSize'].set_active(int(1))
                if value == "7x7":
                    self.widgets['ERODMaskSize'].set_active(int(2))

            if name == "iterations":
                self.widgets['ERODIterations'].set_value(int(value))

        self.configure()

        # load help text
        t_oS2iHelp = XMLParser(self.m_sDataDir + "help/erode" + _("_en.help"))

        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text(unicode(str(t_oS2iHelp.getTag("help").getTag("content").getTagContent())))

        self.widgets['HelpView'].set_buffer(t_oTextBuffer)
Example #33
0
    def __init__( self, PropertiesXML, S2iBlockProperties):
        
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
        
        filename = self.m_sDataDir+'glade/comment.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'BackgroundColor',
            'BorderColor',
            'HelpView',
            'COMMENTView'
            ]

        handlers = [
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',
            'on_cancel_clicked',
            'on_comment_confirm_clicked'
            ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)
        
        #load properties values
        for Property in self.m_oPropertiesXML.properties.block.property:

            #self.widgets['FILLBackgroundColor'].modify_bg(gtk.STATE_NORMAL,t_oColor)
            
            if Property.name == "comment":
                self.m_sComment = str(Property.value)
                #print self.m_sComment

        self.configure()

        
        #load help text
        t_oS2iHelp = bt.bind_file(self.m_sDataDir+"help/comment"+ _("_en.help"))
        
        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['HelpView'].set_buffer( t_oTextBuffer )
		
        # Comment View
        
        t_sComment = gtk.TextBuffer()
        t_sComment.set_text(self.m_sComment)
        
        self.widgets['COMMENTView'].set_buffer(t_sComment)
        self.widgets['COMMENTView'].set_property('editable', True)
        
        self.widgets['COMMENTView'].set_cursor_visible(True)
Example #34
0
File: not.py Project: erggo/Harpy
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ["HARPIA_DATA_DIR"]

        filename = self.m_sDataDir + "glade/not.glade"
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = ["Properties", "NOTBackgroundColor", "NOTBorderColor", "NOTHelpView"]

        handlers = [
            "on_not_cancel_clicked",
            "on_not_confirm_clicked",
            "on_NOTBackColorButton_clicked",
            "on_NOTBorderColorButton_clicked",
        ]

        top_window = "Properties"

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.widgets["Properties"].set_icon_from_file(self.m_sDataDir + "images/harpia_ave.png")

        # load properties values
        # there is no properties

        # load border color
        self.m_oBorderColor = self.m_oS2iBlockProperties.GetBorderColor()

        t_nBorderRed = self.m_oBorderColor[0] * 257
        t_nBorderGreen = self.m_oBorderColor[1] * 257
        t_nBorderBlue = self.m_oBorderColor[2] * 257

        t_oBorderColor = gtk.gdk.Color(red=t_nBorderRed, green=t_nBorderGreen, blue=t_nBorderBlue)

        self.widgets["NOTBorderColor"].modify_bg(gtk.STATE_NORMAL, t_oBorderColor)

        # load block color
        self.m_oBackColor = self.m_oS2iBlockProperties.GetBackColor()

        t_nBackRed = self.m_oBackColor[0] * 257
        t_nBackGreen = self.m_oBackColor[1] * 257
        t_nBackBlue = self.m_oBackColor[2] * 257

        t_oBackColor = gtk.gdk.Color(red=t_nBackRed, green=t_nBackGreen, blue=t_nBackBlue)

        self.widgets["NOTBackgroundColor"].modify_bg(gtk.STATE_NORMAL, t_oBackColor)

        # load help text
        t_oS2iHelp = bt.bind_file(self.m_sDataDir + "help/not" + _("_en.help"))

        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text(unicode(str(t_oS2iHelp.help.content)))

        self.widgets["NOTHelpView"].set_buffer(t_oTextBuffer)
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/plotHistogram.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'HISTImageType',
            'HISTLabelChannel',
            'HISTRadioR',
            'HISTRadioG',
            'HISTRadioB',
            'BackgroundColor',
            'BorderColor',
            'HelpView'
        ]

        handlers = [
            # 'on_HISTRadioR_pressed',
            # 'on_HISTRadioG_pressed',
            # 'on_HISTRadioB_pressed',
            'on_HISTImageType_changed',
            'on_cancel_clicked',
            'on_histogram_confirm_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:

            if Property.name == "type":
                if Property.value == "allcolors":
                    self.widgets['HISTImageType'].set_active(int(0))
                if Property.value == "color":
                    self.widgets['HISTImageType'].set_active(int(1))
                self.on_HISTImageType_changed()

            if Property.name == "channel":
                if Property.value == "R":
                    self.widgets['HISTRadioR'].set_active(True);
                if Property.value == "G":
                    self.widgets['HISTRadioG'].set_active(True);
                if Property.value == "B":
                    self.widgets['HISTRadioB'].set_active(True);

        self.configure()
Example #36
0
    def __init__( self, PropertiesXML, S2iBlockProperties):
        
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
        
        filename = self.m_sDataDir+'glade/haarDetect.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties
        
        widget_list = [
            'Properties',
            'ACQULabelFilename',
            'ACQUFilename',
            'min_neighbors',
            'ACQUButtonSearch',
            'BackgroundColor',
            'BorderColor',
            'HelpView',
						'acquisition_confirm'
            ]

        handlers = [
            'on_ACQUButtonSearch_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',            
            'on_acquisition_confirm_clicked',
            'on_cancel_clicked'
            ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)


        self.m_sCurrentActive = 'file'
        #load properties values        
        for Property in self.m_oPropertiesXML.properties.block.property:
            if Property.name == "cascade_name":
                self.widgets['ACQUFilename'].set_text( Property.value );
            if Property.name == "min_neighbors":
                self.widgets['min_neighbors'].set_value( int(float(Property.value)) );

        #load block state 
        t_bState = self.m_oS2iBlockProperties.GetState()

        self.configure()

        #load help text
        #t_oS2iHelp = bt.bind_file("../etc/acquisition/acquisition.help")
        t_oS2iHelp = bt.bind_file(self.m_sDataDir+"help/haarDetect"+ _("_en.help"))
        
        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['HelpView'].set_buffer( t_oTextBuffer )
Example #37
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/smooth.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'SMOOType',
            'SMOOParam1',
            'SMOOParam2',
            'BackgroundColor',
            'BorderColor',
            'HelpView'
        ]

        handlers = [
            'on_cancel_clicked',
            'on_smooth_confirm_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values

        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")

        for Property in self.block_properties:
            name = Property.getAttr("name")
            value = Property.getAttr("value")

            if name == "type":
                if value == "CV_BLUR":
                    self.widgets['SMOOType'].set_active(int(0))
                if value == "CV_GAUSSIAN":
                    self.widgets['SMOOType'].set_active(int(1))
                if value == "CV_MEDIAN":
                    self.widgets['SMOOType'].set_active(int(2))
                    #   if Property.value == "CV_BILATERAL":
                    #       self.widgets['SMOOType'].set_active( int(4) )

            if name == "param1":
                self.widgets['SMOOParam1'].set_value(int(value))

            if name == "param2":
                self.widgets['SMOOParam2'].set_value(int(value))

    	self.configure()
Example #38
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/canny.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'CANNThreshold1',
            'CANNThreshold2',
            'CANNApertureSize',
            'BackgroundColor',
            'BorderColor',
            'HelpView',
            'canny_confirm'
        ]

        handlers = [
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',
            'on_cancel_clicked',
            'on_canny_confirm_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")

        # load properties values
        for Property in block_properties:
            name = Property.getAttr("name")
            value = Property.getAttr("value")

            if name == "threshold1":
                self.widgets['CANNThreshold1'].set_value(float(value))

            if name == "threshold2":
                self.widgets['CANNThreshold2'].set_value(float(value))

            if name == "apertureSize":
                #  if Property.value == "1":
                #      self.widgets['CANNApertureSize'].set_active( int(0) )
                if value == "3":
                    self.widgets['CANNApertureSize'].set_active(int(0))
                if value == "5":
                    self.widgets['CANNApertureSize'].set_active(int(1))
                if value == "7":
                    self.widgets['CANNApertureSize'].set_active(int(2))

        self.configure()
Example #39
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ["HARPIA_DATA_DIR"]

        filename = self.m_sDataDir + "glade/dilate.ui"
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            "Properties",
            "DILAMaskSize",
            "DILAIterations",
            "BackgroundColor",
            "BorderColor",
            "HelpView",
            "dilate_confirm",
        ]

        handlers = [
            "on_BackColorButton_clicked",
            "on_BorderColorButton_clicked",
            "on_cancel_clicked",
            "on_dilate_confirm_clicked",
        ]

        top_window = "Properties"

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        for Property in self.m_oPropertiesXML.properties.block.property:

            if Property.name == "masksize":
                if Property.value == "3x3":
                    self.widgets["DILAMaskSize"].set_active(int(0))
                if Property.value == "5x5":
                    self.widgets["DILAMaskSize"].set_active(int(1))
                if Property.value == "7x7":
                    self.widgets["DILAMaskSize"].set_active(int(2))

            if Property.name == "iterations":
                self.widgets["DILAIterations"].set_value(int(Property.value))

        self.configure()

        # load help text
        t_oS2iHelp = bt.bind_file(self.m_sDataDir + "help/dilate" + _("_en.help"))

        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text(unicode(str(t_oS2iHelp.help.content)))

        self.widgets["HelpView"].set_buffer(t_oTextBuffer)
Example #40
0
    def __init__( self, PropertiesXML, S2iBlockProperties):
        
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
        
        filename = self.m_sDataDir+'glade/findSquares.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'BackgroundColor',
            'BorderColor',
            'HelpView',
            'minVal',
            'maxVal',
            'enMin',
            'enMax',
            'prop_confirm'
            ]

        handlers = [
            'on_cancel_clicked',
            'on_prop_confirm_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',
            'on_enMin_toggled',
            'on_enMax_toggled'
            ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)
        
        for Property in self.m_oPropertiesXML.properties.block.property:
          if Property.name == "minVal":
            self.widgets['minVal'].set_value( int(float(Property.value)) );
          if Property.name == "maxVal":
            self.widgets['maxVal'].set_value( int(float(Property.value)) );
          if Property.name == "enMin":
            self.widgets['enMin'].set_active( Property.value == 'True' );
          if Property.name == "enMax":
            self.widgets['enMax'].set_active( Property.value == 'True' );

        self.configure()

        #load help text
        t_oS2iHelp = bt.bind_file(self.m_sDataDir+'help/findSquares'+ _('_en.help'))
        
        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['HelpView'].set_buffer( t_oTextBuffer )
Example #41
0
    def __init__( self, PropertiesXML, S2iBlockProperties):
        
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
        
        filename = self.m_sDataDir+'glade/newRect.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'x0',
            'y0',
            'width',
            'height',
            'BackgroundColor',
            'BorderColor',
            'HelpView',
            'prop_confirm'
            ]

        handlers = [
            'on_cancel_clicked',
            'on_prop_confirm_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked'
            ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)
        
        #load properties values
        for Property in self.m_oPropertiesXML.properties.block.property:
					if Property.name == "x0":
						self.widgets['x0'].set_value( float(Property.value) );
					if Property.name == "y0":
						self.widgets['y0'].set_value( float(Property.value) );
					if Property.name == "width":
						self.widgets['width'].set_value( float(Property.value) );
					if Property.name == "height":
						self.widgets['height'].set_value( float(Property.value) );

        self.configure()

        #load help text
        t_oS2iHelp = bt.bind_file(self.m_sDataDir+'help/newRect'+ _('_en.help'))
        
        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['HelpView'].set_buffer( t_oTextBuffer )
Example #42
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/save.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'SAVEFilename',
            'SAVEType',
            'BackgroundColor',
            'BorderColor',
            'HelpView'
        ]

        handlers = [
            'on_SAVEButtonSearch_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',
            'on_cancel_clicked',
            'on_save_confirm_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:

            if Property.name == "filename":
                self.widgets['SAVEFilename'].set_text(Property.value);
                #           if Property.name == "filetype":
                #               if Property.value == "png":
                #                   self.widgets['SAVEType'].set_active( int(0) )
                #               if Property.value == "jpeg":
                #                   self.widgets['SAVEType'].set_active( int(1) )

        self.configure()

        # load help text
        t_oS2iHelp = XMLParser(self.m_sDataDir + "help/save" + _("_en.help"))

        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text(unicode(str(t_oS2iHelp.getTag("help").getTag("content").getTagContent())))

        self.widgets['HelpView'].set_buffer(t_oTextBuffer)
Example #43
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/minMax.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'minX', 'maxX', 'minY', 'maxY', 'minVal', 'maxVal',
            'min', 'max', 'Pos', 'Val', 'BackgroundColor', 'BorderColor',
            'HelpView'
        ]

        handlers = [
            'on_cancel_clicked', 'on_prop_confirm_clicked',
            'on_BackColorButton_clicked', 'on_BorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag(
            "properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:
            if Property.name == "minX":
                self.widgets['minX'].set_value(float(Property.value))
            if Property.name == "maxX":
                self.widgets['maxX'].set_value(float(Property.value))
            if Property.name == "minY":
                self.widgets['minY'].set_value(float(Property.value))
            if Property.name == "maxY":
                self.widgets['maxY'].set_value(float(Property.value))
            if Property.name == "minVal":
                self.widgets['minVal'].set_value(float(Property.value))
            if Property.name == "maxVal":
                self.widgets['maxVal'].set_value(float(Property.value))
            if Property.name == "criteria":
                if Property.value == "pos":
                    self.widgets['Pos'].set_active(True)
                elif Property.value == "val":
                    self.widgets['Val'].set_active(True)
            if Property.name == "minORmax":
                if Property.value == "min":
                    self.widgets['min'].set_active(True)
                elif Property.value == "max":
                    self.widgets['max'].set_active(True)

        self.configure()
Example #44
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/checkLin.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'qThresh', 'minC', 'maxG', 'aX', 'aY', 'aR', 'bX',
            'bY', 'bR', 'BackgroundColor', 'BorderColor', 'HelpView',
            'prop_confirm'
        ]

        handlers = [
            'on_cancel_clicked', 'on_prop_confirm_clicked',
            'on_BackColorButton_clicked', 'on_BorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.block_properties = self.m_oPropertiesXML.getTag(
            "properties").getTag("block").getChildTags("property")

        # load properties values
        for Property in self.block_properties:
            name = Property.getAttr("name")
            value = Property.getAttr("value")

            if name == "qThresh":
                self.widgets['qThresh'].set_value(float(value))
            if name == "minC":
                self.widgets['minC'].set_value(float(value))
            if name == "maxG":
                self.widgets['maxG'].set_value(float(value))
            if name == "aX":
                self.widgets['aX'].set_value(float(value))
            if name == "aY":
                self.widgets['aY'].set_value(float(value))
            if name == "aR":
                self.widgets['aR'].set_value(float(value))
            if name == "bX":
                self.widgets['bX'].set_value(float(value))
            if name == "bY":
                self.widgets['bY'].set_value(float(value))
            if name == "bR":
                self.widgets['bR'].set_value(float(value))

        self.configure()
Example #45
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/matchTem.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'method',
            'scaleFactor',
            'BackgroundColor',
            'BorderColor',
            'HelpView'
        ]

        handlers = [
            'on_cancel_clicked',
            'on_prop_confirm_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)


        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:
            if Property.name == "scaleFactor":
                self.widgets['scaleFactor'].set_value(float(Property.value));
            if Property.name == "method":
                if Property.value == "CV_TM_CCOEFF_NORMED":
                    self.widgets['method'].set_active(int(0))
                if Property.value == "CV_TM_CCOEFF":
                    self.widgets['method'].set_active(int(1))
                if Property.value == "CV_TM_CCORR_NORMED":
                    self.widgets['method'].set_active(int(2))
                if Property.value == "CV_TM_CCORR":
                    self.widgets['method'].set_active(int(3))
                if Property.value == "CV_TM_SQDIFF_NORMED":
                    self.widgets['method'].set_active(int(4))
                if Property.value == "CV_TM_SQDIFF":
                    self.widgets['method'].set_active(int(5))

        self.configure()
Example #46
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/canny.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'CANNThreshold1', 'CANNThreshold2',
            'CANNApertureSize', 'BackgroundColor', 'BorderColor', 'HelpView',
            'canny_confirm'
        ]

        handlers = [
            'on_BackColorButton_clicked', 'on_BorderColorButton_clicked',
            'on_cancel_clicked', 'on_canny_confirm_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        block_properties = self.m_oPropertiesXML.getTag("properties").getTag(
            "block").getChildTags("property")

        # load properties values
        for Property in block_properties:
            name = Property.getAttr("name")
            value = Property.getAttr("value")

            if name == "threshold1":
                self.widgets['CANNThreshold1'].set_value(float(value))

            if name == "threshold2":
                self.widgets['CANNThreshold2'].set_value(float(value))

            if name == "apertureSize":
                #  if Property.value == "1":
                #      self.widgets['CANNApertureSize'].set_active( int(0) )
                if value == "3":
                    self.widgets['CANNApertureSize'].set_active(int(0))
                if value == "5":
                    self.widgets['CANNApertureSize'].set_active(int(1))
                if value == "7":
                    self.widgets['CANNApertureSize'].set_active(int(2))

        self.configure()
Example #47
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/dilate.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'DILAMaskSize',
            'DILAIterations',
            'BackgroundColor',
            'BorderColor',
            'HelpView',
            'dilate_confirm'
        ]

        handlers = [
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',
            'on_cancel_clicked',
            'on_dilate_confirm_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)
        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")

        # load properties values
        for Property in self.block_properties:
            
            name = Property.getAttr("name")
            value = Property.getAttr("value")

            if name == "masksize":
                if value == "3x3":
                    self.widgets['DILAMaskSize'].set_active(int(0))
                if value == "5x5":
                    self.widgets['DILAMaskSize'].set_active(int(1))
                if value == "7x7":
                    self.widgets['DILAMaskSize'].set_active(int(2))

            if name == "iterations":
                self.widgets['DILAIterations'].set_value(int(value))

        self.configure()
Example #48
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/sobel.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'SOBEXOrder', 'SOBEYOrder', 'SOBEMaskSize',
            'BackgroundColor', 'BorderColor', 'HelpView'
        ]

        handlers = [
            'on_BackColorButton_clicked', 'on_BorderColorButton_clicked',
            'on_cancel_clicked', 'on_sobel_confirm_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.OrderLimit = 6
        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag(
            "properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:

            if Property.name == "xorder":
                self.widgets['SOBEXOrder'].set_value(int(Property.value))

            if Property.name == "yorder":
                self.widgets['SOBEYOrder'].set_value(int(Property.value))

            if Property.name == "masksize":
                if Property.value == "1":
                    self.widgets['SOBEMaskSize'].set_active(int(0))
                if Property.value == "3":
                    self.widgets['SOBEMaskSize'].set_active(int(1))
                if Property.value == "5":
                    self.widgets['SOBEMaskSize'].set_active(int(2))
                if Property.value == "7":
                    self.widgets['SOBEMaskSize'].set_active(int(3))

        self.configure()
Example #49
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/newRect.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'x0',
            'y0',
            'width',
            'height',
            'BackgroundColor',
            'BorderColor',
            'HelpView',
            'prop_confirm'
        ]

        handlers = [
            'on_cancel_clicked',
            'on_prop_confirm_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:
            if Property.name == "x0":
                self.widgets['x0'].set_value(float(Property.value));
            if Property.name == "y0":
                self.widgets['y0'].set_value(float(Property.value));
            if Property.name == "width":
                self.widgets['width'].set_value(float(Property.value));
            if Property.name == "height":
                self.widgets['height'].set_value(float(Property.value));

        self.configure()
Example #50
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/haarDetect.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'ACQULabelFilename', 'ACQUFilename', 'min_neighbors',
            'ACQUButtonSearch', 'BackgroundColor', 'BorderColor', 'HelpView',
            'acquisition_confirm'
        ]

        handlers = [
            'on_ACQUButtonSearch_clicked', 'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked', 'on_acquisition_confirm_clicked',
            'on_cancel_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.m_sCurrentActive = 'file'
        # load properties values

        self.block_properties = self.m_oPropertiesXML.getTag(
            "properties").getTag("block").getChildTags("property")

        for Property in self.block_properties:

            name = Property.getAttr("name")
            value = Property.getAttr("value")
            if name == "cascade_name":
                self.widgets['ACQUFilename'].set_text(value)
            if name == "min_neighbors":
                self.widgets['min_neighbors'].set_value(int(float(value)))

        # load block state
        t_bState = self.m_oS2iBlockProperties.GetState()

        self.configure()
Example #51
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/findSquares.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'BackgroundColor', 'BorderColor', 'HelpView',
            'minVal', 'maxVal', 'enMin', 'enMax', 'prop_confirm'
        ]

        handlers = [
            'on_cancel_clicked', 'on_prop_confirm_clicked',
            'on_BackColorButton_clicked', 'on_BorderColorButton_clicked',
            'on_enMin_toggled', 'on_enMax_toggled'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.block_properties = self.m_oPropertiesXML.getTag(
            "properties").getTag("block").getChildTags("property")

        for Property in self.block_properties:

            name = Property.getAttr("name")
            value = Property.getAttr("value")

            if name == "minVal":
                self.widgets['minVal'].set_value(int(float(value)))
            if name == "maxVal":
                self.widgets['maxVal'].set_value(int(float(value)))
            if name == "enMin":
                self.widgets['enMin'].set_active(value == 'True')
            if name == "enMax":
                self.widgets['enMax'].set_active(value == 'True')

        self.configure()
Example #52
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/resize.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'method',
            'BackgroundColor',
            'BorderColor',
            'HelpView'
        ]

        handlers = [
            'on_cancel_clicked',
            'on_prop_confirm_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:
            if Property.name == "method":
                if Property.value == "CV_INTER_NN":
                    self.widgets['method'].set_active(int(0))
                if Property.value == "CV_INTER_LINEAR":
                    self.widgets['method'].set_active(int(1))
                if Property.value == "CV_INTER_AREA":
                    self.widgets['method'].set_active(int(2))
                if Property.value == "CV_INTER_CUBIC":
                    self.widgets['method'].set_active(int(3))

        self.configure()
Example #53
0
    def __init__( self, PropertiesXML, S2iBlockProperties):
        
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
        
        filename = self.m_sDataDir+'glade/comment.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'BackgroundColor',
            'BorderColor',
            'HelpView',
            'COMMENTView'
            ]

        handlers = [
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',
            'on_cancel_clicked',
            'on_comment_confirm_clicked'
            ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)
        
        #load properties values
        self.block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")

        for Property in self.block_properties:

            #self.widgets['FILLBackgroundColor'].modify_bg(gtk.STATE_NORMAL,t_oColor)
            name = Property.getAttr("name")
            value = Property.getAttr("value")

            if name == "comment":
                self.m_sComment = str(value)

        self.configure()
Example #54
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/save.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'SAVEFilename', 'SAVEType', 'BackgroundColor',
            'BorderColor', 'HelpView'
        ]

        handlers = [
            'on_SAVEButtonSearch_clicked', 'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked', 'on_cancel_clicked',
            'on_save_confirm_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        # load properties values
        self.block_properties = self.m_oPropertiesXML.getTag(
            "properties").getTag("block").getChildTags("property")
        for Property in self.block_properties:

            if Property.name == "filename":
                self.widgets['SAVEFilename'].set_text(Property.value)
                #           if Property.name == "filetype":
                #               if Property.value == "png":
                #                   self.widgets['SAVEType'].set_active( int(0) )
                #               if Property.value == "jpeg":
                #                   self.widgets['SAVEType'].set_active( int(1) )

        self.configure()
Example #55
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/comment.glade'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'COMMENTBackgroundColor', 'COMMENTBorderColor',
            'COMMENTHelpView', 'COMMENTView'
        ]

        handlers = [
            'on_COMMENTBackColorButton_clicked',
            'on_COMMENTBorderColorButton_clicked', 'on_comment_cancel_clicked',
            'on_comment_confirm_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.widgets['Properties'].set_icon_from_file(self.m_sDataDir +
                                                      "images/harpia_ave.png")

        #load block color
        self.m_oBackColor = self.m_oS2iBlockProperties.GetBackColor()

        #load properties values
        for Property in self.m_oPropertiesXML.properties.block.property:

            #self.widgets['FILLBackgroundColor'].modify_bg(gtk.STATE_NORMAL,t_oColor)

            if Property.name == "comment":
                self.m_sComment = str(Property.value)
                #print self.m_sComment

        #load border color
        self.m_oBorderColor = self.m_oS2iBlockProperties.GetBorderColor()

        t_nBorderRed = self.m_oBorderColor[0] * 257
        t_nBorderGreen = self.m_oBorderColor[1] * 257
        t_nBorderBlue = self.m_oBorderColor[2] * 257

        t_oBorderColor = gtk.gdk.Color(red=t_nBorderRed,
                                       green=t_nBorderGreen,
                                       blue=t_nBorderBlue)

        self.widgets['COMMENTBorderColor'].modify_bg(gtk.STATE_NORMAL,
                                                     t_oBorderColor)

        #load block color
        #self.m_oBackColor = self.m_oS2iBlockProperties.GetBackColor()

        t_nBackRed = self.m_oBackColor[0] * 257
        t_nBackGreen = self.m_oBackColor[1] * 257
        t_nBackBlue = self.m_oBackColor[2] * 257

        t_oBackColor = gtk.gdk.Color(red=t_nBackRed,
                                     green=t_nBackGreen,
                                     blue=t_nBackBlue)

        self.widgets['COMMENTBackgroundColor'].modify_bg(
            gtk.STATE_NORMAL, t_oBackColor)

        #load help text
        t_oS2iHelp = bt.bind_file(self.m_sDataDir + "help/comment" +
                                  _("_en.help"))

        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text(unicode(str(t_oS2iHelp.help.content)))

        self.widgets['COMMENTHelpView'].set_buffer(t_oTextBuffer)

        # Comment View

        t_sComment = gtk.TextBuffer()
        t_sComment.set_text(self.m_sComment)

        self.widgets['COMMENTView'].set_buffer(t_sComment)
        self.widgets['COMMENTView'].set_property('editable', True)

        self.widgets['COMMENTView'].set_cursor_visible(True)
Example #56
0
    def __init__( self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir+'glade/acquisition.ui'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'ACQURadioFile',
            'ACQURadioNewImage',
            'ACQURadioCapture',
            'ACQURadioLive',
            'ACQURadioVideo',
            'ACQULabelFileProperty',
            'ACQULabelFilename',
            'ACQUFilename',
            'video_name',
            'video_name_BT',
            'video_name_LABEL',
            'video_name_LABEL2',
            'ACQUButtonSearch',
            'ACQULabelNewImage',
            'ACQULabelImageSize',
            'ACQULabelWidth',
            'ACQULabelHeight',
            'ACQUWidth',
            'ACQUHeight',
            'ACQULabelCameraProperty',
            'ACQULabelCamera',
            'ACQUCamera',
            'ACQULabelSize',
            'ACQUSize',
            'BackgroundColor',
            'BorderColor',
            'HelpView',
            'frameRate_Label',
            'frameRate',
            'streamProperties_label',
            'frameRate_label2',
                        'acquisition_confirm'
            ]

        handlers = [
            'on_ACQURadioFile_pressed',
            'on_ACQURadioNewImage_pressed',
            'on_ACQURadioCapture_pressed',
            'on_ACQURadioLive_pressed',
            'on_ACQUButtonSearch_clicked',
            'on_ACQUVideoSearch_clicked',
            'on_BackColorButton_clicked',
            'on_BorderColorButton_clicked',
            'on_ACQURadioVideo_pressed',
            'on_acquisition_confirm_clicked',
            'on_cancel_clicked'
            ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.m_nNumAvailableCams = 4

        if os.name == 'posix':
          self.m_nNumAvailableCams = 0
          t_lListVidDevs = glob("/dev/video*")
          self.m_nNumAvailableCams = len(t_lListVidDevs)

        self.widgets['ACQUCamera'].remove_text(0)
        for cam in range(self.m_nNumAvailableCams):
          self.widgets['ACQUCamera'].append_text(str("/dev/video"+ str(cam)))
        self.widgets['ACQUCamera'].append_text(str("Default"))



        self.m_sCurrentActive = 'file'
        #load properties values
        block_properties = self.m_oPropertiesXML.getTag("properties").getTag("block").getChildTags("property")

        for Property in block_properties:

            name = Property.getAttr("name")
            value = Property.getAttr("value")

            if name == "type":
                if value == "file":
                    self.widgets['ACQURadioFile'].set_active( True );
                    self.on_ACQURadioFile_pressed()
                elif value == "camera":
                    self.widgets['ACQURadioCapture'].set_active( True );
                    self.on_ACQURadioCapture_pressed()
                    self.m_sCurrentActive = 'camera'
                elif value == "live":
                    self.widgets['ACQURadioLive'].set_active( True );
                    self.on_ACQURadioLive_pressed()
                    self.m_sCurrentActive = 'live'
                elif value == "video":
                    self.widgets['ACQURadioVideo'].set_active( True );
                    self.on_ACQURadioVideo_pressed()
                    self.m_sCurrentActive = 'video'
                else:
                    self.widgets['ACQURadioNewImage'].set_active( True );
                    self.on_ACQURadioNewImage_pressed()
                    self.m_sCurrentActive = 'newimage'
            if name == "filename":
                self.widgets['ACQUFilename'].set_text( value );
            if name == "video_name":
                self.widgets['video_name'].set_text( value );

            if name == "camera" or name == 'live':
              if os.name == 'posix':
                if int(value) < self.m_nNumAvailableCams:
                  self.widgets['ACQUCamera'].set_active( int(value) );
                else:
                  self.widgets['ACQUCamera'].set_active(self.m_nNumAvailableCams); #will set None

            if name == "frameRate":
                self.widgets['frameRate'].set_value(float(value));

            # Use the property size to set the New Image size too.
            if name == "size":
                if value == "1024x768":
                    self.widgets['ACQUSize'].set_active( 0 );
                if value == "800x600":
                    self.widgets['ACQUSize'].set_active( 1 );
                if value == "832x624":
                    self.widgets['ACQUSize'].set_active( 2 );
                if value == "640x480":
                    self.widgets['ACQUSize'].set_active( 3 );
                else:
                    self.widgets['ACQUSize'].set_active( 0 );
                # New Image size

                self.widgets['ACQUWidth'].set_value( float(value[ :value.find('x')]) )
                self.widgets['ACQUHeight'].set_value( float( value[value.find('x')+1: ]) )



        self.configure()
Example #57
0
File: smooth.py Project: tvi/Harpy
    def __init__(self, PropertiesXML, S2iBlockProperties):

        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']

        filename = self.m_sDataDir + 'glade/smooth.glade'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties', 'SMOOType', 'SMOOParam1', 'SMOOParam2',
            'SMOOBackgroundColor', 'SMOOBorderColor', 'SMOOHelpView'
        ]

        handlers = [
            'on_smooth_cancel_clicked', 'on_smooth_confirm_clicked',
            'on_SMOOBackColorButton_clicked',
            'on_SMOOBorderColorButton_clicked'
        ]

        top_window = 'Properties'

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)

        self.widgets['Properties'].set_icon_from_file(self.m_sDataDir +
                                                      "images/harpia_ave.png")

        #load properties values
        for Property in self.m_oPropertiesXML.properties.block.property:

            if Property.name == "type":
                if Property.value == "CV_BLUR":
                    self.widgets['SMOOType'].set_active(int(0))
                if Property.value == "CV_GAUSSIAN":
                    self.widgets['SMOOType'].set_active(int(1))
                if Property.value == "CV_MEDIAN":
                    self.widgets['SMOOType'].set_active(int(2))
            #   if Property.value == "CV_BILATERAL":
            #       self.widgets['SMOOType'].set_active( int(4) )

            if Property.name == "param1":
                self.widgets['SMOOParam1'].set_value(int(Property.value))

            if Property.name == "param2":
                self.widgets['SMOOParam2'].set_value(int(Property.value))

        #load border color
        self.m_oBorderColor = self.m_oS2iBlockProperties.GetBorderColor()

        t_nBorderRed = self.m_oBorderColor[0] * 257
        t_nBorderGreen = self.m_oBorderColor[1] * 257
        t_nBorderBlue = self.m_oBorderColor[2] * 257

        t_oBorderColor = gtk.gdk.Color(red=t_nBorderRed,
                                       green=t_nBorderGreen,
                                       blue=t_nBorderBlue)

        self.widgets['SMOOBorderColor'].modify_bg(gtk.STATE_NORMAL,
                                                  t_oBorderColor)

        #load block color
        self.m_oBackColor = self.m_oS2iBlockProperties.GetBackColor()

        t_nBackRed = self.m_oBackColor[0] * 257
        t_nBackGreen = self.m_oBackColor[1] * 257
        t_nBackBlue = self.m_oBackColor[2] * 257

        t_oBackColor = gtk.gdk.Color(red=t_nBackRed,
                                     green=t_nBackGreen,
                                     blue=t_nBackBlue)

        self.widgets['SMOOBackgroundColor'].modify_bg(gtk.STATE_NORMAL,
                                                      t_oBackColor)

        #load help text
        t_oS2iHelp = bt.bind_file(self.m_sDataDir + "help/smooth" +
                                  _("_en.help"))

        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text(unicode(str(t_oS2iHelp.help.content)))

        self.widgets['SMOOHelpView'].set_buffer(t_oTextBuffer)
Example #58
0
    def __init__( self, PropertiesXML, S2iBlockProperties):
        
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
        
        filename = self.m_sDataDir+'glade/fillRect.glade'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'FILLBackgroundColor',
            'FILLBorderColor',
            'FILLHelpView',
            'FILLFillColor'
            ]

        handlers = [
            'on_FILLBackColorButton_clicked',
            'on_FILLBorderColorButton_clicked',
            'on_FILLFillColorButton_clicked',
            'on_fill_cancel_clicked',
            'on_fill_confirm_clicked'
            ]

        top_window = 'Properties'

        self.m_oFillColor = [0,0,0]

        GladeWindow.__init__(self, filename, top_window, widget_list, handlers)
        
        self.widgets['Properties'].set_icon_from_file(self.m_sDataDir+"images/harpia_ave.png")

        #load block color
        self.m_oBackColor = self.m_oS2iBlockProperties.GetBackColor()
        
        #load properties values
        for Property in self.m_oPropertiesXML.properties.block.property:

            #self.widgets['FILLBackgroundColor'].modify_bg(gtk.STATE_NORMAL,t_oColor)
            
            if Property.name == "red":
                self.m_oBackColor[0] = float(Property.value)
                #self.widgets['FILLFillColor'].set_value( float(Property.value) )
                self.m_oFillColor[0] = float(Property.value)
                
            if Property.name == "green":
                self.m_oBackColor[1] = float(Property.value)
                self.m_oFillColor[1] = float(Property.value)
                
            if Property.name == "blue":
                self.m_oBackColor[2] = float(Property.value)
                self.m_oFillColor[2] = float(Property.value)

        #load border color
        self.m_oBorderColor = self.m_oS2iBlockProperties.GetBorderColor()

        t_nBorderRed   = self.m_oBorderColor[0] * 257
        t_nBorderGreen = self.m_oBorderColor[1] * 257
        t_nBorderBlue  = self.m_oBorderColor[2] * 257

        t_oBorderColor = gtk.gdk.Color(red=t_nBorderRed,green=t_nBorderGreen,blue=t_nBorderBlue)

        self.widgets['FILLBorderColor'].modify_bg(gtk.STATE_NORMAL,t_oBorderColor)        

        #load block color
        #self.m_oBackColor = self.m_oS2iBlockProperties.GetBackColor()

        t_nBackRed   = self.m_oBackColor[0] * 257
        t_nBackGreen = self.m_oBackColor[1] * 257
        t_nBackBlue  = self.m_oBackColor[2] * 257

        t_oBackColor = gtk.gdk.Color(red=int(t_nBackRed),green=int(t_nBackGreen),blue=int(t_nBackBlue))

        self.widgets['FILLBackgroundColor'].modify_bg(gtk.STATE_NORMAL,t_oBackColor)
        
        #########################
        # Sets the Fill Color the same as the background color in inicialization
        self.widgets['FILLFillColor'].modify_bg(gtk.STATE_NORMAL,t_oBackColor)

        #load help text
        t_oS2iHelp = bt.bind_file(self.m_sDataDir+"help/fillRect"+ _("_en.help"))
        
        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['FILLHelpView'].set_buffer( t_oTextBuffer )