parameters: (self)
docstring: Calculate the values which describe the standard timings
         for the protocol.
docstring_summary: Calculate the values which describe the standard timings
         for the protocol.
docstring_tokens: Calculate the values which describe the standard timings for the protocol .
function: def _calc_values(self):
      """Calculate the values which describe the standard timings
         for the protocol."""
      if self.verbose:
        self.output.write(f"Potential Mark Candidates:\n{self.marks}\n"
                          f"Potential Space Candidates:\n{self.spaces}\n")
      # The bit mark is likely to be the smallest mark.
      self.bit_mark = self.marks[-1]
      if len(self.marks) > 2:  # Possible leader mark?
        self.ldr_mark = self.marks[0]
        self.hdr_mark = self.marks[1]
      elif len(self.marks) > 1:  # At least two marks
        # Largest mark is likely the kHdrMark
        self.hdr_mark = self.marks[0]
      else:
        # Probably no header mark.
        self.hdr_mark = 0
  
      if self.is_space_encoded() and len(self.spaces) >= 2:
        if self.verbose and len(self.marks) > 2:
          self.output.write("DANGER: Unusual number of mark timings!")
        # We should have 3 space candidates at least.
        # They should be: zero_space (smallest), one_space, & hdr_space (largest)
        spaces = list(self.spaces)
        if spaces:
          self.zero_space = spaces.pop()
        if spaces:
          self.one_space = spaces.pop()
        if spaces:
          self.hdr_space = spaces.pop()
        # Rest are probably message gaps
        self.gaps = spaces
function_tokens: def _calc_values ( self ) : if self . verbose : self . output . write ( f"Potential Mark Candidates:\n{self.marks}\n" f"Potential Space Candidates:\n{self.spaces}\n" ) # The bit mark is likely to be the smallest mark. self . bit_mark = self . marks [ - 1 ] if len ( self . marks ) > 2 : # Possible leader mark? self . ldr_mark = self . marks [ 0 ] self . hdr_mark = self . marks [ 1 ] elif len ( self . marks ) > 1 : # At least two marks # Largest mark is likely the kHdrMark self . hdr_mark = self . marks [ 0 ] else : # Probably no header mark. self . hdr_mark = 0 if self . is_space_encoded ( ) and len ( self . spaces ) >= 2 : if self . verbose and len ( self . marks ) > 2 : self . output . write ( "DANGER: Unusual number of mark timings!" ) # We should have 3 space candidates at least. # They should be: zero_space (smallest), one_space, & hdr_space (largest) spaces = list ( self . spaces ) if spaces : self . zero_space = spaces . pop ( ) if spaces : self . one_space = spaces . pop ( ) if spaces : self . hdr_space = spaces . pop ( ) # Rest are probably message gaps self . gaps = spaces