Skip to content

Commit ca9d8ce

Browse files
committed
Remove unused bind for broadcast Tally instance
Broadcast tallies should never be added to Screen.tallies
1 parent f6dc343 commit ca9d8ce

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/tslumd/tallyobj.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -475,18 +475,13 @@ def get_or_create_tally(self, index_: int) -> Tally:
475475
return self.add_tally(index_)
476476

477477
def _add_tally_obj(self, tally: Tally):
478+
assert not tally.is_broadcast
478479
self.tallies[tally.index] = tally
479-
if tally.is_broadcast:
480-
tally.bind(
481-
on_update=self._on_broadcast_tally_updated,
482-
on_control=self._on_broadcast_tally_updated,
483-
)
484-
else:
485-
tally.bind(
486-
on_update=self._on_tally_updated,
487-
on_control=self._on_tally_control,
488-
)
489-
self.emit('on_tally_added', tally)
480+
tally.bind(
481+
on_update=self._on_tally_updated,
482+
on_control=self._on_tally_control,
483+
)
484+
self.emit('on_tally_added', tally)
490485

491486
def update_from_message(self, msg: Message):
492487
"""Handle an incoming :class:`~.Message`

0 commit comments

Comments
 (0)