Skip to content

Commit

Permalink
Merge pull request #1616 from missionpinball/add_service_mode_for_seg…
Browse files Browse the repository at this point in the history
…ment_displays

feature: service mode for segment displays
  • Loading branch information
jabdoa2 authored Nov 8, 2021
2 parents 55a459a + 89cb2c1 commit faa9848
Show file tree
Hide file tree
Showing 5 changed files with 563 additions and 337 deletions.
4 changes: 2 additions & 2 deletions mpf/core/service_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def start_service(self):
self._enabled = True

self.info_log("Entered service mode. Resetting game if running. Resetting hardware interface now.")
# this will stop attact and game mode
# this will stop attract and game mode
for mode in self.machine.modes.values():
if not mode.active or mode.name in ["service", "game"]:
if not mode.active or mode.name in ["service", "service_segment_display", "service_dmd", "game"]:
continue
mode.stop(service=True)

Expand Down
4 changes: 3 additions & 1 deletion mpf/modes/service/code/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ async def _make_option_slide(self, title, question, options, warning):
option=options[position], warning=warning)
key = await self._get_key()
if key == 'ESC':
self.machine.events.post("service_options_slide_stop")
return None
if key == 'UP':
position += 1
Expand Down Expand Up @@ -321,6 +322,7 @@ async def _make_menu(self, items):
self._update_main_menu(items, position)
elif key == 'ENTER':
# call submenu
self.machine.events.post("service_menu_deselected")
await items[position].callback()
self._update_main_menu(items, position)

Expand Down Expand Up @@ -447,7 +449,7 @@ async def _audits_menu(self):
def _update_audits_slide(self, items, position):
item = items[position][0]
value = items[position][1]
self.machine.events.post("service_audits_menu_show", audits_label=item, value_label=value)
self.machine.events.post("service_audits_menu_show", audits_label=str(item), value_label=str(value))

async def _audits_submenu(self, items):
position = 0
Expand Down
334 changes: 0 additions & 334 deletions mpf/modes/service/config/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,337 +35,3 @@ sounds:
sound_player:
service_power_off: power_off
service_switch_hit: switch_hit

slide_player:
# door open
service_door_opened:
service_door_open:
action: play
service_door_closed:
service_door_open:
action: remove
master_volume_decrease:
service_volume_changed:
action: play
expire: 3s
master_volume_increase:
service_volume_changed:
action: play
expire: 3s

# menu
service_menu_show:
service_menu:
action: play
priority: 1
service_menu_hide:
service_menu:
action: remove

# switch test
service_switch_test_start:
service_switch_test:
action: play
priority: 2
service_switch_test_stop:
service_switch_test:
action: remove

# coil test:
service_coil_test_start:
service_coil_test:
action: play
priority: 2
service_coil_test_stop:
service_coil_test:
action: remove

# light test:
service_light_test_start:
service_light_test:
action: play
priority: 2
service_light_test_stop:
service_light_test:
action: remove

# confirm slides
service_options_slide_start:
service_options_slide:
action: play
priority: 2
service_options_slide_stop:
service_options_slide:
action: remove

# software update
service_software_update_choice:
software_update:
action: play
priority: 2
service_software_update_stop:
software_update:
action: remove

# settings:
service_settings_start:
service_settings:
action: play
priority: 2
service_settings_edit:
action: remove
service_settings_edit:
service_settings_edit:
action: play
priority: 3
service_settings_stop:
service_settings:
action: remove

# audits:
service_audits_menu_show:
service_audits_menu:
action: play
priority: 1
service_audits_menu_hide:
service_audits_menu:
action: remove

widget_player:
# power off
service_power_off:
service_power_off_door_open:
action: add
slide: service_door_open
service_power_off_coil_test:
action: add
slide: service_coil_test
service_power_on:
service_power_off_door_open:
action: remove
slide: service_door_open
service_power_off_coil_test:
action: remove
slide: service_coil_test

# menu items
service_menu_selected:
service_menu_item:
action: add
slide: service_menu
service_menu_deselected:
service_menu_item:
action: remove
slide: service_menu

slides:
# volume changed
service_volume_changed:
- type: text
text: "Volume (machine|master_volume)"
style: medium
y: middle
# door open
service_door_open:
- type: text
text: Door Open
style: medium
y: bottom + 80%
- type: text
text: "Volume (machine|master_volume)"
style: medium
y: bottom + 60%
- type: text
text: Press enter for service
style: small
y: bottom + 40%
# menu
service_menu:
- type: text
text: Service Menu
style: small
x: center
y: bottom + 80%
# confirm slide
service_options_slide:
- type: text
text: "(title)"
style: small
x: center
y: bottom + 80%
- type: text
text: "(question)"
style: small
y: bottom + 60%
- type: text
text: "(option)"
style: small
y: bottom + 40%
- type: text
text: "(warning)"
style: small
y: bottom + 20%
# switch test
service_switch_test:
- type: text
text: Switch Test
style: small
x: center
y: bottom + 85%
- type: text
text: "Last: (switch_num)"
style: small
y: bottom + 67%
- type: text
text: "(switch_name)"
style: small
y: bottom + 50%
- type: text
text: "(switch_label)"
style: small
y: bottom + 31%
- type: text
text: (switch_state)
style: small
y: bottom + 10%
# coil test
service_coil_test:
- type: text
text: "Coil Test - (board_name)"
style: small
x: center
y: bottom + 85%
- type: text
text: "(coil_name)"
style: small
y: bottom + 67%
- type: text
text: "(coil_label)"
style: small
y: bottom + 50%
- type: text
text: "(coil_num)"
style: small
y: bottom + 31%
# coil test
service_light_test:
- type: text
text: "Light Test - (board_name)"
style: small
x: center
y: bottom + 80%
- type: text
text: "(light_name)"
style: small
y: bottom + 60%
- type: text
text: "(light_label)"
style: small
y: bottom + 40%
- type: text
text: "(light_num)/(test_color)"
style: small
y: bottom + 20%
# software update
software_update:
- type: text
text: "Perform software update?"
style: small
x: center
y: bottom + 80%
- type: text
text: "(run_update)"
style: small
y: bottom + 60%
- type: text
text: "DO NOT TURN OFF POWER DURING UPDATE"
style: small
y: bottom + 40%
opacity: 0.5
# settings
service_settings:
- type: text
text: "Settings"
style: small
x: center
y: bottom + 80%
- type: text
text: "(settings_label)"
style: small
y: bottom + 60%
- type: text
text: "(value_label)"
style: small
y: bottom + 40%
opacity: 0.5
service_settings_edit:
- type: text
text: "Settings"
style: small
x: center
y: bottom + 80%
- type: text
text: "(settings_label)"
style: small
y: bottom + 60%
opacity: 0.5
- type: text
text: "(value_label)"
style: small
y: bottom + 40%

service_audits_menu:
- type: text
text: "Audits"
style: small
x: center
y: bottom + 80%
- type: text
text: "(audits_label)"
style: small
y: bottom + 60%
- type: text
text: "(value_label)"
style: small
y: bottom + 40%

widgets:
# power off on door open slide
service_power_off_door_open:
type: text
text: Coil Power Off
y: bottom + 20%
style: medium
animations:
add_to_slide:
- property: opacity
value: 1
duration: 0.5s
- property: opacity
value: 0
duration: 0.5s
repeat: true
# power off on coil test slide
service_power_off_coil_test:
type: text
text: Coil Power Off
style: small
y: bottom + 10%
animations:
add_to_slide:
- property: opacity
value: 1
duration: 0.5s
- property: opacity
value: 0
duration: 0.5s
repeat: true

# menu items
service_menu_item:
type: text
text: (label)
style: medium
valign: top
halign: left

Loading

0 comments on commit faa9848

Please sign in to comment.