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
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
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)
def serialize(self): data = ControlBase.serialize(self) data.update({ 'legend': self.legend, 'value': self._value }) return data
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
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
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
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
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
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
def __init__(self, label = "", defaultValue = "", helptext=''): self._filename = '' ControlBase.__init__(self, label, defaultValue, helptext)
def serialize(self): data = ControlBase.serialize(self) data.update({ 'css': self.css }) return data
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)
def deserialize(self, properties): ControlBase.deserialize(self, properties) self.css = properties[u'css']
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)
def deserialize(self, properties): ControlBase.deserialize(self,properties) self.max = properties[u'max'] self.min = properties[u'min']
def deserialize(self, properties): ControlBase.deserialize(self,properties) self.css = properties[u'css']
def __init__(self, label="", defaultValue=0, min=0, max=100): self._updateSlider = True self._min = min self._max = max ControlBase.__init__(self, label, defaultValue)
def deserialize(self, properties): ControlBase.deserialize(self, properties) self.max = properties[u'max'] self.min = properties[u'min']
def serialize(self): data = ControlBase.serialize(self) data.update({'max': self.max, 'min': self.min}) return data
def deserialize(self, properties): ControlBase.deserialize(self, properties) self._filename = properties['filename'] self.value = self._filename self.video_index = properties['video_index']
def serialize(self): data = ControlBase.serialize(self) data.update({'css': self.css}) return data
def __init__(self, label="", defaultValue="", helptext=''): self._filename = '' ControlBase.__init__(self, label, defaultValue, helptext)
def serialize(self): data = ControlBase.serialize(self) data.update({ 'max': self.max, 'min': self.min }) return data