From a7df9502130a7321d7f8e81210d54aada58f8b4e Mon Sep 17 00:00:00 2001 From: cobra18t Date: Tue, 11 Apr 2023 11:23:23 -0700 Subject: [PATCH 1/4] Add basic speedometer section --- mpf/config_spec.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mpf/config_spec.yaml b/mpf/config_spec.yaml index 4fe213b41..a83a0447b 100644 --- a/mpf/config_spec.yaml +++ b/mpf/config_spec.yaml @@ -1760,6 +1760,9 @@ sound_ducking: sound_marker: time: single|secs| events: list|event_posted| +speedometers: + start_switch: single|machine(switches)|None + stop_switch: single|machine(switches)|None spi_bit_bang: __valid_in__: machine __type__: config From 8894effb2a7fcf9103b91af0458819f39346d596 Mon Sep 17 00:00:00 2001 From: cobra18t Date: Tue, 11 Apr 2023 11:51:28 -0700 Subject: [PATCH 2/4] Add speedometer hit event with delta time payload --- mpf/devices/speedometer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mpf/devices/speedometer.py b/mpf/devices/speedometer.py index f827e779c..b61599208 100644 --- a/mpf/devices/speedometer.py +++ b/mpf/devices/speedometer.py @@ -37,4 +37,5 @@ def _handle_stop_switch(self, **kwargs): delta = self.config['stop_switch'].last_change - self.time_start self.time_start = None print(delta) + self.machine.events.post("{}_hit".format(self.name), delta = delta) # TODO: post event From 07a892c0a490a10ed67a39194ff99f59ff6ccfde Mon Sep 17 00:00:00 2001 From: cobra18t Date: Mon, 17 Apr 2023 22:13:28 -0700 Subject: [PATCH 3/4] correct speedometers section --- mpf/config_spec.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mpf/config_spec.yaml b/mpf/config_spec.yaml index a83a0447b..b1f1bee97 100644 --- a/mpf/config_spec.yaml +++ b/mpf/config_spec.yaml @@ -1761,6 +1761,8 @@ sound_marker: time: single|secs| events: list|event_posted| speedometers: + __valid_in__: machine, mode + __type__: device start_switch: single|machine(switches)|None stop_switch: single|machine(switches)|None spi_bit_bang: From 8faad1d1fc4569053c64f2da44e4df21fd8fb354 Mon Sep 17 00:00:00 2001 From: cobra18t Date: Mon, 17 Apr 2023 22:14:15 -0700 Subject: [PATCH 4/4] add speedometers --- mpf/mpfconfig.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mpf/mpfconfig.yaml b/mpf/mpfconfig.yaml index 3fa12e43b..2945d7fb7 100644 --- a/mpf/mpfconfig.yaml +++ b/mpf/mpfconfig.yaml @@ -85,6 +85,7 @@ mpf: timers: mpf.devices.timer.Timer segment_displays: mpf.devices.segment_display.segment_display.SegmentDisplay sequence_shots: mpf.devices.sequence_shot.SequenceShot + speedometers: mpf.devices.speedometer.Speedometer hardware_sound_systems: mpf.devices.hardware_sound_system.HardwareSoundSystem steppers: mpf.devices.stepper.Stepper state_machines: mpf.devices.state_machine.StateMachine