Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncs up chimes with reel coil pulse #1634

Merged
merged 1 commit into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions mpf/devices/score_reel.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ async def _advance_reel_if_position_does_not_match(self):
self.log.debug("Advancing reel to value %s (current value: %s repeat_pulse_time: %sms)",
self._destination_value, self.assumed_value, self.config['repeat_pulse_time'])
while self._destination_value != self.assumed_value:
self.machine.events.post('reel_{}_will_advance'.format(self.name))
wait_ms = self.config['coil_inc'].pulse(max_wait_ms=500)
self.machine.events.post('reel_{}_advancing'.format(self.name))
previous_value = self.assumed_value

await asyncio.sleep((wait_ms + self.config['repeat_pulse_time']) / 1000)
Expand All @@ -163,8 +165,8 @@ async def _advance_reel_if_position_does_not_match(self):
self.check_hw_switches()

if previous_value != self.assumed_value and self.assumed_value >= 0:
self.machine.events.post('reel_{}_advance'.format(self.name))
'''event: reel_(name)_advance
self.machine.events.post('reel_{}_advanced'.format(self.name))
'''event: reel_(name)_advanced

desc: The reel (name) advanced to the next position.
'''
Expand Down
2 changes: 1 addition & 1 deletion mpf/devices/score_reel_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async def _initialize(self):
if self.config['chimes'][i]:
if not self.reels[i]:
self.raise_config_error("Invalid reel for chime {}".format(self.config['chimes'][i]), 1)
self.machine.events.add_handler(event='reel_' + self.reels[i].name + '_advance',
self.machine.events.add_handler(event='reel_' + self.reels[i].name + '_advancing',
toomanybrians marked this conversation as resolved.
Show resolved Hide resolved
handler=self.chime,
chime=self.config['chimes'][i])

Expand Down