Example #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
Example #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
Example #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)
Example #5
0
	def serialize(self):
		data  = ControlBase.serialize(self)
		data.update({ 
			'legend': 	self.legend, 
			'value': 	self._value 
		})
		return data
Example #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
Example #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
Example #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
Example #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
Example #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
Example #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
Example #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
Example #13
0
	def __init__(self, label = "", defaultValue = "", helptext=''):
		self._filename = ''
		ControlBase.__init__(self, label, defaultValue, helptext)
Example #14
0
	def serialize(self):
		data = ControlBase.serialize(self)
		data.update({ 'css': self.css })
		return data
Example #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)
Example #16
0
 def deserialize(self, properties):
     ControlBase.deserialize(self, properties)
     self.css = properties[u'css']
Example #17
0
	def deserialize(self, properties):
		ControlBase.deserialize(self, properties)
		self.legend = properties[u'legend']
		self.value 	= properties[u'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)
Example #19
0
	def deserialize(self, properties):
		ControlBase.deserialize(self,properties)
		self.max = properties[u'max']
		self.min = properties[u'min']
		
Example #20
0
	def deserialize(self, properties):
		ControlBase.deserialize(self,properties)
		self.css = properties[u'css']
Example #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)
Example #22
0
 def deserialize(self, properties):
     ControlBase.deserialize(self, properties)
     self.max = properties[u'max']
     self.min = properties[u'min']
Example #23
0
 def serialize(self):
     data = ControlBase.serialize(self)
     data.update({'max': self.max, 'min': self.min})
     return data
Example #24
0
	def deserialize(self, properties):
		ControlBase.deserialize(self, properties)
		self._filename   = properties['filename']
		self.value       = self._filename
		self.video_index = properties['video_index']
Example #25
0
 def deserialize(self, properties):
     ControlBase.deserialize(self, properties)
     self._filename = properties['filename']
     self.value = self._filename
     self.video_index = properties['video_index']
Example #26
0
 def serialize(self):
     data = ControlBase.serialize(self)
     data.update({'css': self.css})
     return data
Example #27
0
 def __init__(self, label="", defaultValue="", helptext=''):
     self._filename = ''
     ControlBase.__init__(self, label, defaultValue, helptext)
Example #28
0
	def serialize(self):
		data = ControlBase.serialize(self)
		data.update({ 'max': self.max, 'min': self.min })
		return data