| 411 | self.bit_index = bit_index |
| 412 | |
| 413 | def update(self, *args): |
| 414 | if self.plc_instance==None: |
| 415 | return |
| 416 | if self.db_index<0 or self.byte_index<0 or self.bit_index<0: |
| 417 | return |
| 418 | value = self.plc_instance.get_bool(self.db_index, self.byte_index, self.bit_index) |
| 419 | self.label_value.set_text( '1' if value else '0' ) |
| 420 | style={'border':'1px solid black', 'background-color':'gray'} |
| 421 | if value: |
| 422 | style={'border':'1px solid black', 'background-color':'yellow'} |
| 423 | self.label_value.style.update(style) |
| 424 | |
| 425 | |
| 426 | class WordEditWidget(SpinBox, SiemensWidget, _Mixin_DB_property, _Mixin_Byte_property): |