parameters: (self, id, name)
return_statement: return name_string
docstring: Return a command stem name per MSL naming rules.
          1. Convert all characters to uppercase.
          2. Test for trailing _cmd or _CMD and remove.
          3. Test for leading module name and if none add.
          4. Test for any char not [A-Z] or [0-9] or _.
          5. Test for 32 character limit on command name (configurable)
             and if exceeded then clip name.
          5. If all was ok return the command stem name.
          @param id: The module id.
          @param name: Original function name with '_' separation.
          @return: Valid command stem name stri
docstring_summary: Return a command stem name per MSL naming rules.
          1. Convert all characters to uppercase.
          2. Test for trailing _cmd or _CMD and remove.
          3. Test for leading module name and if none add.
          4. Test for any char not [A-Z] or [0-9] or _.
          5. Test for 32 character limit on command name (configurable)
             and if exceeded then clip name.
          5. If all was ok return the command stem name.
docstring_tokens: Return a command stem name per MSL naming rules . 1 . Convert all characters to uppercase . 2 . Test for trailing _cmd or _CMD and remove . 3 . Test for leading module name and if none add . 4 . Test for any char not [ A - Z ] or [ 0 - 9 ] or _ . 5 . Test for 32 character limit on command name ( configurable ) and if exceeded then clip name . 5 . If all was ok return the command stem name .
function: def opcodeStemName(self, id, name):
          """
          Return a command stem name per MSL naming rules.
          1. Convert all characters to uppercase.
          2. Test for trailing _cmd or _CMD and remove.
          3. Test for leading module name and if none add.
          4. Test for any char not [A-Z] or [0-9] or _.
          5. Test for 32 character limit on command name (configurable)
             and if exceeded then clip name.
          5. If all was ok return the command stem name.
          @param id: The module id.
          @param name: Original function name with '_' separation.
          @return: Valid command stem name stri
          """
  
          max_stem_length = int(self.__config.get("ipc", "max_stem_length"))
  
          name_list = name.upper().split("_")
          mod_id = id.upper()
          # Test for trailing _CMD and remove.
          if name_list[-1] == "CMD":
              del name_list[-1]
          # Test for leading module name.
          if name_list[0] != mod_id:
              name_list = [mod_id] + name_list
          # Make the string and clip to 32 chars.
          name_string = "_"
          name_string = name_string.join(name_list)[:max_stem_length]
          # Check characters
          if len(re.findall("[^A-Z0-9_]", name_string)) != 0:
              PRINT.info(
                  "ERROR: DETECTED AN INVALID CHARACTER IN COMMAND STEM NAME (%s)."
                  % name_string
              )
              raise Exception(
                  "Fatal error, detected an invalid character in command stem name."
              )
          # All is ok
          return name_string
function_tokens: def opcodeStemName ( self , id , name ) : max_stem_length = int ( self . __config . get ( "ipc" , "max_stem_length" ) ) name_list = name . upper ( ) . split ( "_" ) mod_id = id . upper ( ) # Test for trailing _CMD and remove. if name_list [ - 1 ] == "CMD" : del name_list [ - 1 ] # Test for leading module name. if name_list [ 0 ] != mod_id : name_list = [ mod_id ] + name_list # Make the string and clip to 32 chars. name_string = "_" name_string = name_string . join ( name_list ) [ : max_stem_length ] # Check characters if len ( re . findall ( "[^A-Z0-9_]" , name_string ) ) != 0 : PRINT . info ( "ERROR: DETECTED AN INVALID CHARACTER IN COMMAND STEM NAME (%s)." % name_string ) raise Exception ( "Fatal error, detected an invalid character in command stem name." ) # All is ok return name_string