예제 #1
0
파일: cropImage.py 프로젝트: erggo/Harpy
    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 )
예제 #2
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)
예제 #3
0
파일: canny.py 프로젝트: rsachetto/harpia
    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 )
예제 #4
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)
예제 #5
0
파일: sobel.py 프로젝트: rsachetto/harpia
    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
        for Property in self.m_oPropertiesXML.properties.block.property:

            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 = bt.bind_file(self.m_sDataDir+"help/sobel"+ _("_en.help"))
        
        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['HelpView'].set_buffer( t_oTextBuffer )
예제 #6
0
파일: smooth.py 프로젝트: rsachetto/harpia
    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 )
예제 #7
0
파일: comment.py 프로젝트: rsachetto/harpia
    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)
예제 #8
0
파일: not.py 프로젝트: 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)
예제 #9
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 )
예제 #10
0
파일: dilate.py 프로젝트: rsachetto/harpia
    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)
예제 #11
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 )
예제 #12
0
파일: newRect.py 프로젝트: rsachetto/harpia
    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 )
예제 #13
0
파일: save.py 프로젝트: rsachetto/harpia
    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
        for Property in self.m_oPropertiesXML.properties.block.property:

            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 = bt.bind_file(self.m_sDataDir+"help/save"+ _("_en.help"))
        
        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['HelpView'].set_buffer( t_oTextBuffer )
예제 #14
0
파일: resize.py 프로젝트: rsachetto/harpia
    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
        for Property in self.m_oPropertiesXML.properties.block.property:
					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()

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

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['HelpView'].set_buffer( t_oTextBuffer )
예제 #15
0
파일: show.py 프로젝트: rsachetto/harpia
    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_show_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()


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

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['HelpView'].set_buffer( t_oTextBuffer )
예제 #16
0
파일: runCmd.py 프로젝트: rsachetto/harpia
    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
        for Property in self.m_oPropertiesXML.properties.block.property:
					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()

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

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['HelpView'].set_buffer( t_oTextBuffer )
예제 #17
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 = bt.bind_file(self.m_sDataDir+"help/equalizeHistogram"+ _("_en.help"))
        
        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['HelpView'].set_buffer( t_oTextBuffer )
예제 #18
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)
        
        #load properties values
        for Property in self.m_oPropertiesXML.properties.block.property:

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

        self.configure()

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

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

        widget_list = [
            'Properties',
            'qThresh',
						'minC',
						'maxG',
						'aX',
						'aY',
						'aR',
						'bX',
						'bY',
						'bR',
            'propBackgroundColor',
            'propBorderColor',
            'propHelpView',
						'prop_confirm'
            ]

        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
        for Property in self.m_oPropertiesXML.properties.block.property:
					if Property.name == "qThresh":
						self.widgets['qThresh'].set_value( float(Property.value) );
					if Property.name == "minC":
						self.widgets['minC'].set_value( float(Property.value) );
					if Property.name == "maxG":
						self.widgets['maxG'].set_value( float(Property.value) );
					if Property.name == "aX":
						self.widgets['aX'].set_value( float(Property.value) );
					if Property.name == "aY":
						self.widgets['aY'].set_value( float(Property.value) );
					if Property.name == "aR":
						self.widgets['aR'].set_value( float(Property.value) );
					if Property.name == "bX":
						self.widgets['bX'].set_value( float(Property.value) );
					if Property.name == "bY":
						self.widgets['bY'].set_value( float(Property.value) );
					if Property.name == "bR":
						self.widgets['bR'].set_value( 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['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/checkLin"+ _("_en.help"))
        
        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['propHelpView'].set_buffer( t_oTextBuffer )
예제 #20
0
파일: minMax.py 프로젝트: rsachetto/harpia
    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
        for Property in self.m_oPropertiesXML.properties.block.property:
					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()

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

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

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

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

        widget_list = [
            'Properties', 'HISTImageType', 'HISTLabelChannel', 'HISTRadioR',
            'HISTRadioG', 'HISTRadioB', 'HISTBackgroundColor',
            'HISTBorderColor', 'HISTHelpView'
        ]

        handlers = [
            #'on_HISTRadioR_pressed',
            #'on_HISTRadioG_pressed',
            #'on_HISTRadioB_pressed',
            'on_HISTImageType_changed',
            'on_histogram_cancel_clicked',
            'on_histogram_confirm_clicked',
            'on_HISTBackColorButton_clicked',
            'on_HISTBorderColorButton_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 == "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)

        #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['HISTBorderColor'].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['HISTBackgroundColor'].modify_bg(gtk.STATE_NORMAL,
                                                      t_oBackColor)

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

        t_oTextBuffer = gtk.TextBuffer()

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

        self.widgets['HISTHelpView'].set_buffer(t_oTextBuffer)
예제 #22
0
파일: saveVideo.py 프로젝트: tvi/Harpy
    def __init__(self, PropertiesXML, S2iBlockProperties):

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

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

        widget_list = [
            'Properties', 'SAVEFilename', 'SAVEType', 'SAVEBackgroundColor',
            'SAVEFrameRate', 'SAVEBorderColor', 'codecSelection',
            'SAVEHelpView', 'save_confirm'
        ]

        handlers = [
            'on_SAVEButtonSearch_clicked', 'on_SAVEBackColorButton_clicked',
            'on_SAVEBorderColorButton_clicked', 'on_save_cancel_clicked',
            'on_save_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 properties values
        for Property in self.m_oPropertiesXML.properties.block.property:

            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) )

#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['SAVEBorderColor'].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['SAVEBackgroundColor'].modify_bg(gtk.STATE_NORMAL,
                                                      t_oBackColor)

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

        t_oTextBuffer = gtk.TextBuffer()

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

        self.widgets['SAVEHelpView'].set_buffer(t_oTextBuffer)
예제 #23
0
파일: newPoint.py 프로젝트: tvi/Harpy
    def __init__(self, PropertiesXML, S2iBlockProperties):

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

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

        widget_list = [
            'Properties', 'x0', 'y0', 'propBackgroundColor', 'propBorderColor',
            'propHelpView', 'prop_confirm'
        ]

        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
        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))

        #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/newPoint' +
                                  _('_en.help'))

        t_oTextBuffer = gtk.TextBuffer()

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

        self.widgets['propHelpView'].set_buffer(t_oTextBuffer)
예제 #24
0
파일: haarDetect.py 프로젝트: erggo/Harpy
    def __init__( self, PropertiesXML, S2iBlockProperties):
        
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
        
        filename = self.m_sDataDir+'glade/haarDetect.glade'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties
        
        widget_list = [
            'Properties',
            'ACQULabelFilename',
            'ACQUFilename',
            'min_neighbors',
            'ACQUButtonSearch',
            'ACQUBackgroundColor',
            'ACQUBorderColor',
            'ACQUHelpView',
						'acquisition_confirm'
            ]

        handlers = [
            'on_ACQUButtonSearch_clicked',
            'on_ACQUBackColorButton_clicked',
            'on_ACQUBorderColorButton_clicked',            
            'on_acquisition_confirm_clicked',
            'on_acquisition_cancel_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")

        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()

        #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['ACQUBorderColor'].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['ACQUBackgroundColor'].modify_bg(gtk.STATE_NORMAL,t_oBackColor)

        #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['ACQUHelpView'].set_buffer( t_oTextBuffer )
예제 #25
0
파일: threshold.py 프로젝트: tvi/Harpy
    def __init__(self, PropertiesXML, S2iBlockProperties):

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

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

        widget_list = [
            'Properties', 'THREThreshold', 'THREThresholdType',
            'THRELabelMaxValue', 'THREMaxValue', 'THREBackgroundColor',
            'THREBorderColor', 'THREHelpView'
        ]

        handlers = [
            'on_THREThresholdType_changed',
            'on_THREBackColorButton_clicked',
            'on_THREBorderColorButton_clicked',
            'on_threshold_cancel_clicked',
            'on_threshold_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 properties values
        for Property in self.m_oPropertiesXML.properties.block.property:

            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()

        #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['THREBorderColor'].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['THREBackgroundColor'].modify_bg(gtk.STATE_NORMAL,
                                                      t_oBackColor)

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

        t_oTextBuffer = gtk.TextBuffer()

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

        self.widgets['THREHelpView'].set_buffer(t_oTextBuffer)
예제 #26
0
파일: sobel.py 프로젝트: tvi/Harpy
    def __init__(self, PropertiesXML, S2iBlockProperties):

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

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

        widget_list = [
            'Properties', 'SOBEXOrder', 'SOBEYOrder', 'SOBEMaskSize',
            'SOBEBackgroundColor', 'SOBEBorderColor', 'SOBEHelpView'
        ]

        handlers = [
            'on_SOBEBackColorButton_clicked',
            'on_SOBEBorderColorButton_clicked', 'on_sobel_cancel_clicked',
            'on_sobel_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")

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

            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))

        #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['SOBEBorderColor'].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['SOBEBackgroundColor'].modify_bg(gtk.STATE_NORMAL,
                                                      t_oBackColor)

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

        t_oTextBuffer = gtk.TextBuffer()

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

        self.widgets['SOBEHelpView'].set_buffer(t_oTextBuffer)
예제 #27
0
파일: acquisition.py 프로젝트: tvi/Harpy
    def __init__(self, PropertiesXML, S2iBlockProperties):

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

        filename = self.m_sDataDir + 'glade/acquisition.glade'
        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',
            'ACQUBackgroundColor', 'ACQUBorderColor', 'ACQUHelpView',
            '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_ACQUBackColorButton_clicked',
            'on_ACQUBorderColorButton_clicked', 'on_ACQURadioVideo_pressed',
            'on_acquisition_confirm_clicked', 'on_acquisition_cancel_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")

        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
        for Property in self.m_oPropertiesXML.properties.block.property:

            if Property.name == "type":
                if Property.value == "file":
                    self.widgets['ACQURadioFile'].set_active(True)
                    self.on_ACQURadioFile_pressed()
                elif Property.value == "camera":
                    self.widgets['ACQURadioCapture'].set_active(True)
                    self.on_ACQURadioCapture_pressed()
                    self.m_sCurrentActive = 'camera'
                elif Property.value == "live":
                    self.widgets['ACQURadioLive'].set_active(True)
                    self.on_ACQURadioLive_pressed()
                    self.m_sCurrentActive = 'live'
                elif Property.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 Property.name == "filename":
                self.widgets['ACQUFilename'].set_text(Property.value)
            if Property.name == "video_name":
                self.widgets['video_name'].set_text(Property.value)

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

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

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

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

        #load block state
        #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['ACQUBorderColor'].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['ACQUBackgroundColor'].modify_bg(gtk.STATE_NORMAL,
                                                      t_oBackColor)

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

        t_oTextBuffer = gtk.TextBuffer()

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

        self.widgets['ACQUHelpView'].set_buffer(t_oTextBuffer)
예제 #28
0
파일: laplace.py 프로젝트: erggo/Harpy
    def __init__( self, PropertiesXML, S2iBlockProperties):
        
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
        
        filename = self.m_sDataDir+'glade/laplace.glade'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'LAPLMaskSize',
            'LAPLBackgroundColor',
            'LAPLBorderColor',
            'LAPLHelpView',
						'laplace_confirm'
            ]

        handlers = [
            'on_laplace_cancel_clicked',
            'on_laplace_confirm_clicked',
            'on_LAPLBackColorButton_clicked',
            'on_LAPLBorderColorButton_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 == "masksize":
                if Property.value == "1":
                    self.widgets['LAPLMaskSize'].set_active( int(0) )
                if Property.value == "3":
                    self.widgets['LAPLMaskSize'].set_active( int(1) )
                if Property.value == "5":
                    self.widgets['LAPLMaskSize'].set_active( int(2) )
                if Property.value == "7":
                    self.widgets['LAPLMaskSize'].set_active( int(3) )

        #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['LAPLBorderColor'].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['LAPLBackgroundColor'].modify_bg(gtk.STATE_NORMAL,t_oBackColor)

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

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['LAPLHelpView'].set_buffer( t_oTextBuffer )
예제 #29
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

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

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

        widget_list = [
            'Properties', 'COLOConversionType', 'COLOBackgroundColor',
            'COLOBorderColor', 'COLOHelpView'
        ]

        handlers = [
            'on_COLOBackColorButton_clicked',
            'on_COLOBorderColorButton_clicked',
            'on_colorConversion_cancel_clicked',
            'on_colorConversion_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 properties values
        for Property in self.m_oPropertiesXML.properties.block.property:

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

        #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['COLOBorderColor'].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['COLOBackgroundColor'].modify_bg(gtk.STATE_NORMAL,
                                                      t_oBackColor)

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

        t_oTextBuffer = gtk.TextBuffer()

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

        self.widgets['COLOHelpView'].set_buffer(t_oTextBuffer)
예제 #30
0
파일: newRect.py 프로젝트: erggo/Harpy
    def __init__(self, PropertiesXML, S2iBlockProperties):

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

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

        widget_list = [
            "Properties",
            "x0",
            "y0",
            "width",
            "height",
            "propBackgroundColor",
            "propBorderColor",
            "propHelpView",
            "prop_confirm",
        ]

        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
        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))

                # 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/newRect" + _("_en.help"))

        t_oTextBuffer = gtk.TextBuffer()

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

        self.widgets["propHelpView"].set_buffer(t_oTextBuffer)
예제 #31
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

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

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

        widget_list = [
            'Properties', 'method', '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
        for Property in self.m_oPropertiesXML.properties.block.property:
            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))

        #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/checkCir" +
                                  _("_en.help"))

        t_oTextBuffer = gtk.TextBuffer()

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

        self.widgets['propHelpView'].set_buffer(t_oTextBuffer)
예제 #32
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        
        for Property in self.m_oPropertiesXML.properties.block.property:

            if Property.name == "type":
                if Property.value == "file":
                    self.widgets['ACQURadioFile'].set_active( True );
                    self.on_ACQURadioFile_pressed()
                elif Property.value == "camera":
                    self.widgets['ACQURadioCapture'].set_active( True );
                    self.on_ACQURadioCapture_pressed()
                    self.m_sCurrentActive = 'camera'
                elif Property.value == "live":
                    self.widgets['ACQURadioLive'].set_active( True );
                    self.on_ACQURadioLive_pressed()
                    self.m_sCurrentActive = 'live'
                elif Property.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 Property.name == "filename":
                self.widgets['ACQUFilename'].set_text( Property.value );
            if Property.name == "video_name":
                self.widgets['video_name'].set_text( Property.value );

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

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

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



        self.configure()

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

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

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

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

        widget_list = [
            'Properties', 'ACQULabelFilename', 'ACQUFilename', 'min_neighbors',
            'ACQUButtonSearch', 'ACQUBackgroundColor', 'ACQUBorderColor',
            'ACQUHelpView', 'acquisition_confirm'
        ]

        handlers = [
            'on_ACQUButtonSearch_clicked', 'on_ACQUBackColorButton_clicked',
            'on_ACQUBorderColorButton_clicked',
            'on_acquisition_confirm_clicked', 'on_acquisition_cancel_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")

        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()

        #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['ACQUBorderColor'].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['ACQUBackgroundColor'].modify_bg(gtk.STATE_NORMAL,
                                                      t_oBackColor)

        #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['ACQUHelpView'].set_buffer(t_oTextBuffer)
예제 #34
0
파일: dilate.py 프로젝트: erggo/Harpy
    def __init__(self, PropertiesXML, S2iBlockProperties):

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

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

        widget_list = [
            "Properties",
            "DILAMaskSize",
            "DILAIterations",
            "DILABackgroundColor",
            "DILABorderColor",
            "DILAHelpView",
            "dilate_confirm",
        ]

        handlers = [
            "on_DILABackColorButton_clicked",
            "on_DILABorderColorButton_clicked",
            "on_dilate_cancel_clicked",
            "on_dilate_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 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))

        # 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["DILABorderColor"].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["DILABackgroundColor"].modify_bg(gtk.STATE_NORMAL, t_oBackColor)

        # 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["DILAHelpView"].set_buffer(t_oTextBuffer)
예제 #35
0
    def __init__( self, PropertiesXML, S2iBlockProperties):
        
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
        
        filename = self.m_sDataDir+'glade/plotHistogram.glade'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'HISTImageType',
            'HISTLabelChannel',
            'HISTRadioR',
            'HISTRadioG',          
            'HISTRadioB',
            'HISTBackgroundColor',
            'HISTBorderColor',
            'HISTHelpView'
            ]

        handlers = [
            #'on_HISTRadioR_pressed',
            #'on_HISTRadioG_pressed',
            #'on_HISTRadioB_pressed',
            'on_HISTImageType_changed',
            'on_histogram_cancel_clicked',
            'on_histogram_confirm_clicked',
            'on_HISTBackColorButton_clicked',
            'on_HISTBorderColorButton_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 == "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 );


        #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['HISTBorderColor'].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['HISTBackgroundColor'].modify_bg(gtk.STATE_NORMAL,t_oBackColor)

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

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['HISTHelpView'].set_buffer( t_oTextBuffer )
예제 #36
0
    def __init__(self, PropertiesXML, S2iBlockProperties):

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

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

        widget_list = [
            'Properties', 'EQUABackgroundColor', 'EQUABorderColor',
            'EQUAHelpView'
        ]

        handlers = [
            #  'on_EQUARadioAutomatic_pressed',
            #  'on_EQUARadioBand_pressed',
            'on_EQUABackColorButton_clicked',
            'on_EQUABorderColorButton_clicked',
            'on_equalizeHistogram_cancel_clicked',
            'on_equalizeHistogram_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 properties values

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

        #    if Property.name == "type":
        #        if Property.value == "band":
        #            self.widgets['EQUARadioBand'].set_active( True )
        #            self.on_EQUARadioBand_pressed()
        #
        #        else:
        #            self.widgets['EQUARadioAutomatic'].set_active( True )
        #            self.on_EQUARadioAutomatic_pressed()
        #
        #    if Property.name == "min":
        #        self.widgets['EQUAMinBand'].set_value( int(Property.value) )
        #    if Property.name == "max":
        #        self.widgets['EQUAMaxBand'].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['EQUABorderColor'].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['EQUABackgroundColor'].modify_bg(gtk.STATE_NORMAL,
                                                      t_oBackColor)

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

        t_oTextBuffer = gtk.TextBuffer()

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

        self.widgets['EQUAHelpView'].set_buffer(t_oTextBuffer)
예제 #37
0
파일: gen.py 프로젝트: erggo/Harpy
    def __init__( self ):

        filename = '../etc/rotate/rotate.glade'

        widget_list = [
            'Properties',
            'angle',
						'isAtCenter',
						'isAtPoint',
						'isScalling',
						'isFilling',
						'xC',
						'yC',
            'propDisable',
            '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
        for Property in self.m_oPropertiesXML.properties.block.property:
					if Property.name == "angle":
						self.widgets['angle'].set_value( float(Property.value) );
					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 );

        #load block state 
        t_bState = self.m_oS2iBlockProperties.GetState()
                
        self.widgets['propDisable'].set_active( not t_bState )

        #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('../etc/rotate/rotate'+ _('_en.help'))
        
        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['propHelpView'].set_buffer( t_oTextBuffer )
예제 #38
0
파일: fillRect.py 프로젝트: tvi/Harpy
    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 )
예제 #39
0
파일: minMax.py 프로젝트: tvi/Harpy
    def __init__( self, PropertiesXML, S2iBlockProperties):
        
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
        
        filename = self.m_sDataDir+'glade/minMax.glade'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
						'minX',
						'maxX',
						'minY',
						'maxY',
						'minVal',
						'maxVal',
						'min',
						'max',
						'Pos',
						'Val',
            '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
        for Property in self.m_oPropertiesXML.properties.block.property:
					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 );


        #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/minMax"+ _("_en.help"))
        
        t_oTextBuffer = gtk.TextBuffer()

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['propHelpView'].set_buffer( t_oTextBuffer )
예제 #40
0
파일: smooth.py 프로젝트: 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)
예제 #41
0
    def __init__( self, PropertiesXML, S2iBlockProperties):
        
        self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
        
        filename = self.m_sDataDir+'glade/equalizeHistogram.glade'
        self.m_oPropertiesXML = PropertiesXML
        self.m_oS2iBlockProperties = S2iBlockProperties

        widget_list = [
            'Properties',
            'EQUABackgroundColor',
            'EQUABorderColor',
            'EQUAHelpView'
            ]

        handlers = [
          #  'on_EQUARadioAutomatic_pressed',
          #  'on_EQUARadioBand_pressed',
            'on_EQUABackColorButton_clicked',
            'on_EQUABorderColorButton_clicked',
            'on_equalizeHistogram_cancel_clicked',
            'on_equalizeHistogram_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 properties values
        
		#for Property in self.m_oPropertiesXML.properties.block.property:

        #    if Property.name == "type":
        #        if Property.value == "band":
        #            self.widgets['EQUARadioBand'].set_active( True )
        #            self.on_EQUARadioBand_pressed()
		# 
        #        else:
        #            self.widgets['EQUARadioAutomatic'].set_active( True )
        #            self.on_EQUARadioAutomatic_pressed()
        #            
        #    if Property.name == "min":
        #        self.widgets['EQUAMinBand'].set_value( int(Property.value) )
        #    if Property.name == "max":
        #        self.widgets['EQUAMaxBand'].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['EQUABorderColor'].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['EQUABackgroundColor'].modify_bg(gtk.STATE_NORMAL,t_oBackColor)

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

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['EQUAHelpView'].set_buffer( t_oTextBuffer )
예제 #42
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)
예제 #43
0
    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
        for Property in self.m_oPropertiesXML.properties.block.property:

            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()


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

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

        widget_list = [
            'Properties',
            'COLOConversionType',
            'COLOBackgroundColor',
            'COLOBorderColor',
            'COLOHelpView'
            ]

        handlers = [
            'on_COLOBackColorButton_clicked',
            'on_COLOBorderColorButton_clicked',
            'on_colorConversion_cancel_clicked',
            'on_colorConversion_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 properties values
        for Property in self.m_oPropertiesXML.properties.block.property:

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


        #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['COLOBorderColor'].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['COLOBackgroundColor'].modify_bg(gtk.STATE_NORMAL,t_oBackColor)

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

        t_oTextBuffer.set_text( unicode( str( t_oS2iHelp.help.content) ) )
    
        self.widgets['COLOHelpView'].set_buffer( t_oTextBuffer )
예제 #45
0
파일: gen.py 프로젝트: tvi/Harpy
    def __init__(self):

        filename = '../etc/rotate/rotate.glade'

        widget_list = [
            'Properties', 'angle', 'isAtCenter', 'isAtPoint', 'isScalling',
            'isFilling', 'xC', 'yC', 'propDisable', '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
        for Property in self.m_oPropertiesXML.properties.block.property:
            if Property.name == "angle":
                self.widgets['angle'].set_value(float(Property.value))
            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)

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

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

        #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('../etc/rotate/rotate' + _('_en.help'))

        t_oTextBuffer = gtk.TextBuffer()

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

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