MCPcopy Index your code
hub / github.com/rawpython/remi / __init__

Method __init__

editor/widgets/toolbox_siemens.py:389–411  ·  view source on GitHub ↗

Args: text (str): The text that will be displayed on the label. kwargs: See Widget.__init__()

(self, text='bit status widget', db_index=-1, byte_index=-1, bit_index=-1, *args, **kwargs)

Source from the content-addressed store, hash-verified

387 label_value = None #a gui.Label widget that shows the value as '1' or '0'
388
389 def __init__(self, text='bit status widget', db_index=-1, byte_index=-1, bit_index=-1, *args, **kwargs):
390 """
391 Args:
392 text (str): The text that will be displayed on the label.
393 kwargs: See Widget.__init__()
394 """
395 default_style = {'position':'absolute','left':'10px','top':'10px', 'align-items':'stretch', 'justify-content':'flex-start'}
396 default_style.update(kwargs.get('style',{}))
397 kwargs['style'] = default_style
398 kwargs['width'] = kwargs['style'].get('width', kwargs.get('width','100px'))
399 kwargs['height'] = kwargs['style'].get('height', kwargs.get('height','30px'))
400 super(BitStatusWidget, self).__init__(*args, **kwargs)
401 SiemensWidget._setup(self)
402 _style = style_inheritance_text_dict
403 _style.update(style_inheritance_dict)
404 _style['border'] = '1px solid black'
405 self.label = gui.Label(text, width="100%", height="100%", style=_style)
406 _style.update({'background-color':'gray', 'text-align':'center'})
407 self.label_value = gui.Label("0", width='30px', height="100%", style=_style)
408 self.append([self.label, self.label_value])
409 self.db_index = db_index
410 self.byte_index = byte_index
411 self.bit_index = bit_index
412
413 def update(self, *args):
414 if self.plc_instance==None:

Callers

nothing calls this directly

Calls 4

updateMethod · 0.45
__init__Method · 0.45
_setupMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected