Skip to content

Commit

Permalink
Remove unused bind for broadcast Tally instance
Browse files Browse the repository at this point in the history
Broadcast tallies should never be added to Screen.tallies
  • Loading branch information
nocarryr committed Jan 2, 2024
1 parent f6dc343 commit ca9d8ce
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/tslumd/tallyobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,18 +475,13 @@ def get_or_create_tally(self, index_: int) -> Tally:
return self.add_tally(index_)

def _add_tally_obj(self, tally: Tally):
assert not tally.is_broadcast
self.tallies[tally.index] = tally
if tally.is_broadcast:
tally.bind(
on_update=self._on_broadcast_tally_updated,
on_control=self._on_broadcast_tally_updated,
)
else:
tally.bind(
on_update=self._on_tally_updated,
on_control=self._on_tally_control,
)
self.emit('on_tally_added', tally)
tally.bind(
on_update=self._on_tally_updated,
on_control=self._on_tally_control,
)
self.emit('on_tally_added', tally)

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

0 comments on commit ca9d8ce

Please sign in to comment.