Class PtidyOSCodeGenerator

    • Field Detail

      • fileExtension

        protected java.lang.String fileExtension
        The index of the list of code files to generate code for. 0 refers to the c file, and 1 refers to the startup .S code file.
    • Constructor Detail

      • PtidyOSCodeGenerator

        public PtidyOSCodeGenerator​(NamedObj container,
                                    java.lang.String name)
                             throws IllegalActionException,
                                    NameDuplicationException
        Create a new instance of the PtidyOS code generator.
        Parameters:
        container - The container.
        name - The name of the PtidyOS code generator.
        Throws:
        IllegalActionException - If the super class throws the exception or error occurs when setting the file path.
        NameDuplicationException - If the super class throws the exception or an error occurs when setting the file path.
    • Method Detail

      • generateCode

        public int generateCode​(java.lang.StringBuffer code)
                         throws KernelException
        Generate code. This is the main entry point. The generateCode() of the super method is called. After which code is generated for the assembly file.
        Overrides:
        generateCode in class GenericCodeGenerator
        Parameters:
        code - The code buffer into which to generate the code.
        Returns:
        The return value of the last subprocess that was executed. or -1 if no commands were executed.
        Throws:
        KernelException - If a type conflict occurs or the model is running.
      • _generateAdditionalCodeFiles

        protected void _generateAdditionalCodeFiles()
                                             throws IllegalActionException
        Generate code for the assembly file.
        Throws:
        IllegalActionException - If getAdapter() throws it, or if the PtidyOSCodeGenerator is not used in a Ptides environment.
      • _isTopLevel

        protected boolean _isTopLevel()
                               throws IllegalActionException
        Overwrite the base class, and use a method from the Ptides director to determine whether this is top level. Test if the containing actor is in the top level.
        Overrides:
        _isTopLevel in class GenericCodeGenerator
        Returns:
        true if the containing actor is in the top level.
        Throws:
        IllegalActionException - If the director is not a PtidesDirector.