Пример #1
0
	def deserialize(self, properties):
		ControlBase.deserialize(self,properties)
		
		self.horizontalHeaders 	= properties['horizontal_headers']
		self._read_only 		= properties['read_only']==1
		self._selected_index 	= properties['selected_index']
		self._selectEntireRow 	= properties['select_entire_row']==1
Пример #2
0
    def deserialize(self, properties):
        ControlBase.deserialize(self, properties)

        self.horizontalHeaders = properties['horizontal_headers']
        self._read_only = properties['read_only'] == 1
        self._selected_index = properties['selected_index']
        self._selectEntireRow = properties['select_entire_row'] == 1
Пример #3
0
    def deserialize(self, properties):
        ControlBase.deserialize(self,properties)
        self._items = {}

        for item in properties['items']:
            self.addItem(item['label'], item['value'])

        self.value = properties['value']
 def __init__(self,
              label="",
              defaultValue=(0, 100),
              min=0,
              max=100,
              horizontal=False,
              **kwargs):
     self._min = min
     self._max = max
     self._horizontal = horizontal
     ControlBase.__init__(self, label, defaultValue, **kwargs)
Пример #5
0
	def serialize(self):
		data  = ControlBase.serialize(self)
		data.update({ 
			'legend': 	self.legend, 
			'value': 	self._value 
		})
		return data
Пример #6
0
    def serialize(self):
        data = ControlBase.serialize(self)

        if self.value:
            capture = self.value
            _, image = capture.read()

            if isinstance(image, np.ndarray):
                image = self.processFrame(image)
                if isinstance(image, list) or isinstance(image, tuple):
                    image = tools.groupImage(image, True)

                if len(image.shape) > 2:
                    image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
                image = Image.fromarray(image)
                buff = StringIO.StringIO()
                image.save(buff, format="PNG")
                content = buff.getvalue()
                buff.close()
                data.update({'base64content': base64.b64encode(content)})

        data.update({'value': self._filename})
        data.update({'filename': self._filename})
        data.update({'startFrame': self.startFrame})
        data.update({'endFrame': self.endFrame})
        data.update({'video_index': self.video_index})
        return data
Пример #7
0
	def serialize(self):
		data    = ControlBase.serialize(self)

		if self.value:
			capture = self.value
			_, image = capture.read()

			
			if isinstance(image, np.ndarray):
				image = self.processFrame(image)
				if isinstance(image, list) or isinstance(image, tuple): image = tools.groupImage(image, True)
				
				if len(image.shape)>2: image = cv2.cvtColor(image,cv2.COLOR_BGR2RGB)
				image = Image.fromarray(image)
				buff = StringIO.StringIO()
				image.save(buff, format="PNG")
				content = buff.getvalue()
				buff.close()
				data.update({ 'base64content': base64.b64encode(content) })

		data.update({ 'value':       self._filename      })
		data.update({ 'filename':       self._filename      })
		data.update({ 'startFrame':     self.startFrame     })
		data.update({ 'endFrame':       self.endFrame       })
		data.update({ 'video_index':    self.video_index    })
		return data
Пример #8
0
    def serialize(self):
        data = ControlBase.serialize(self)
        items = []
        for key, value in self._items.items():
            items.append({'label': str(key), 'value': str(value)}) 

        data.update({ 'items': items, 'value': str(self._value) })
        return data
Пример #9
0
    def serialize(self):
        data = ControlBase.serialize(self)

        data.update({
            'horizontal_headers': self.horizontalHeaders,
            'read_only': 1 if self._read_only else 0,
            'selected_index': self._selected_index,
            'select_entire_row': 1 if self._selectEntireRow else 0,
        })
        return data
Пример #10
0
	def serialize(self):
		data 	= ControlBase.serialize(self)
		
		data.update({ 
			'horizontal_headers': 	self.horizontalHeaders,
			'read_only':			1 if self._read_only else 0,
			'selected_index':		self._selected_index,
			'select_entire_row': 	1 if self._selectEntireRow else 0,
		})
		return data
Пример #11
0
	def serialize(self):
		data  = ControlBase.serialize(self)
		image = self.value
		if isinstance(image, np.ndarray):
			if len(image.shape)>2: image = cv2.cvtColor(image,cv2.COLOR_BGR2RGB)
			image = Image.fromarray(image)
			buff = StringIO.StringIO()
			image.save(buff, format="PNG")
			content = buff.getvalue()
			buff.close()
			
			data.update({ 'base64content': base64.b64encode(content) })
		data.update({ 'filename': self._filename })
		return data
Пример #12
0
    def serialize(self):
        data = ControlBase.serialize(self)
        image = self.value
        if isinstance(image, np.ndarray):
            if len(image.shape) > 2:
                image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
            image = Image.fromarray(image)
            buff = StringIO.StringIO()
            image.save(buff, format="PNG")
            content = buff.getvalue()
            buff.close()

            data.update({'base64content': base64.b64encode(content)})
        data.update({'filename': self._filename})
        return data
Пример #13
0
	def __init__(self, label = "", defaultValue = "", helptext=''):
		self._filename = ''
		ControlBase.__init__(self, label, defaultValue, helptext)
Пример #14
0
	def serialize(self):
		data = ControlBase.serialize(self)
		data.update({ 'css': self.css })
		return data
Пример #15
0
 def __init__(self, label = "%p%", defaultValue = 0, min = 0, max = 100):
     self._updateSlider = True
     self._min = min
     self._max = max
     ControlBase.__init__(self, label, defaultValue)
Пример #16
0
 def deserialize(self, properties):
     ControlBase.deserialize(self, properties)
     self.css = properties[u'css']
Пример #17
0
	def deserialize(self, properties):
		ControlBase.deserialize(self, properties)
		self.legend = properties[u'legend']
		self.value 	= properties[u'value']
		
Пример #18
0
 def __init__(self, label = "", defaultValue=(0,100) , min = 0, max = 100, horizontal=False, **kwargs):
     self._min = min
     self._max = max
     self._horizontal = horizontal
     ControlBase.__init__(self, label, defaultValue, **kwargs)
Пример #19
0
	def deserialize(self, properties):
		ControlBase.deserialize(self,properties)
		self.max = properties[u'max']
		self.min = properties[u'min']
		
Пример #20
0
	def deserialize(self, properties):
		ControlBase.deserialize(self,properties)
		self.css = properties[u'css']
Пример #21
0
    def __init__(self, label="", defaultValue=0, min=0, max=100):
        self._updateSlider = True
        self._min = min
        self._max = max

        ControlBase.__init__(self, label, defaultValue)
Пример #22
0
 def deserialize(self, properties):
     ControlBase.deserialize(self, properties)
     self.max = properties[u'max']
     self.min = properties[u'min']
Пример #23
0
 def serialize(self):
     data = ControlBase.serialize(self)
     data.update({'max': self.max, 'min': self.min})
     return data
Пример #24
0
	def deserialize(self, properties):
		ControlBase.deserialize(self, properties)
		self._filename   = properties['filename']
		self.value       = self._filename
		self.video_index = properties['video_index']
Пример #25
0
 def deserialize(self, properties):
     ControlBase.deserialize(self, properties)
     self._filename = properties['filename']
     self.value = self._filename
     self.video_index = properties['video_index']
Пример #26
0
 def serialize(self):
     data = ControlBase.serialize(self)
     data.update({'css': self.css})
     return data
Пример #27
0
 def __init__(self, label="", defaultValue="", helptext=''):
     self._filename = ''
     ControlBase.__init__(self, label, defaultValue, helptext)
Пример #28
0
	def serialize(self):
		data = ControlBase.serialize(self)
		data.update({ 'max': self.max, 'min': self.min })
		return data