Skip to content
Permalink
Browse files

fix segment display mapping for APC

  • Loading branch information...
jabdoa2 committed Aug 6, 2019
1 parent 5606801 commit d8232883fc614177b188bc33f6794bc1fb72ce81
Showing with 7 additions and 2 deletions.
  1. +6 −1 mpf/core/segment_mappings.py
  2. +1 −1 mpf/platforms/lisy/lisy.py
@@ -168,6 +168,11 @@ def get_dpgfedcba_encoding(self) -> bytes:
return bytes([(self.dp << 7) | (self.g << 6) | (self.f << 5) | (self.e << 4) | (self.d << 3) | (self.c << 2) |
(self.b << 1) | self.a])

def get_dpgfeabcd_encoding(self) -> bytes:
"""Return segment in dp gfeabcd order."""
return bytes([(self.dp << 7) | (self.g << 6) | (self.f << 5) | (self.e << 4) | (self.a << 3) | (self.b << 2) |
(self.c << 1) | self.d])


seven_segments = {
None: SevenSegments(dp=0, g=0, f=0, e=0, d=0, c=0, b=0, a=0, char="not mappable char"),
@@ -312,7 +317,7 @@ def get_apc_encoding(self) -> bytes:
return bytes([
(self.dp << 7) | (self.g1 << 6) | (self.f << 5) | (self.e << 4) | (self.a << 3) | (self.b << 2) |
(self.c << 1) | self.d,
(self.n << 7) | (self.dp << 6) | (self.l << 5) | (self.m << 4) | (self.k << 3) | (self.g2 << 2) |
(self.l << 7) | (self.dp << 6) | (self.n << 5) | (self.m << 4) | (self.k << 3) | (self.g2 << 2) |
(self.h << 1) | self.j])


@@ -168,7 +168,7 @@ def _format_text(self, text):
result = map(lambda x: x.get_dpx4x3x2x1_encoding(), mapping)
elif self._type_of_display == 3:
mapping = TextToSegmentMapper.map_text_to_segments(text, self._length_of_display, seven_segments)
result = map(lambda x: x.get_dpgfedcba_encoding(), mapping)
result = map(lambda x: x.get_dpgfeabcd_encoding(), mapping)
elif self._type_of_display == 4:
mapping = TextToSegmentMapper.map_text_to_segments(text, self._length_of_display, fourteen_segments)
result = map(lambda x: x.get_apc_encoding(), mapping)

0 comments on commit d823288

Please sign in to comment.
You can’t perform that action at this time.