ptolemy.codegen.c.actor.lib.gui
Class PlotterBase

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.codegen.kernel.CodeGeneratorHelper
          extended by ptolemy.codegen.c.kernel.CCodeGeneratorHelper
              extended by ptolemy.codegen.c.actor.lib.gui.PlotterBase
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ActorCodeGenerator, ComponentCodeGenerator, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
Direct Known Subclasses:
SequencePlotter, TimedPlotter, XYPlotter

public class PlotterBase
extends CCodeGeneratorHelper

Common static methods for codegen plotters.

This class contains common code for the codegen plotters. In regular interpreted Ptolemy II plotters, we extend actor.lib.gui.PlotterBase. However, because in codegen we need to extend CCode

Since:
Ptolemy II 6.0
Version:
$Id: PlotterBase.java 57046 2010-01-27 23:35:53Z cxh $
Author:
Christopher Brooks, Gang Zhou
See Also:
Serialized Form
Accepted Rating:
Red (cxh)
Proposed Rating:
Yellow (cxh)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.codegen.kernel.CodeGeneratorHelper
CodeGeneratorHelper.Channel, CodeGeneratorHelper.VariableScope
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
 
Fields inherited from class ptolemy.codegen.kernel.CodeGeneratorHelper
_codeGenerator, _codeStream, _eol, _INDENT1, _INDENT2, _parseTreeCodeGenerator, _portConversions, _referencedParameters
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
PlotterBase(PlotterBase actor)
          Constructor method for the XYPlotter helper.
 
Method Summary
 java.lang.String generateInitializeCode()
          Generate initialize code.
 java.lang.String generatePlotFireCode(int width)
          Generate plot specfic fire code.
 java.lang.String generateWrapupCode()
          Generate the wrapup code.
 java.util.Set getHeaderFiles()
          Get the header files needed by the code generated for the XYPlotter actor.
 
Methods inherited from class ptolemy.codegen.c.kernel.CCodeGeneratorHelper
_generateInputVariableDeclaration, _generateOutputVariableDeclaration, _generateReferencedParameterDeclaration, _generateTypeConvertStatement, _generateTypeConvertVariableDeclaration, _getFireFunctionArguments, _replaceMacro, generateVariableDeclaration, getCodeGenerator, getJVMHeaderFiles, getParseTreeCodeGenerator
 
Methods inherited from class ptolemy.codegen.kernel.CodeGeneratorHelper
_createBufferSizeAndOffsetMap, _createInputBufferSizeAndOffsetMap, _findClosedParen, _generateBlockCode, _generateBlockCode, _generateFireCode, _generateTypeConvertMethod, _generateTypeConvertStatements, _getCastType, _getChannelAndOffset, _getHelper, _getHelper, _getIndentPrefix, _getReference, _getReferenceChannels, _getTypeConvertChannels, _getTypeConvertReference, _indexOf, addFunctionUsed, addNewTypeUsed, analyzeTypeConvert, checkLocal, checkRemote, codeGenType, copyFilesToCodeDirectory, createOffsetVariablesIfNeeded, generateChannelOffset, generateFireCode, generateFireFunctionCode, generateFireFunctionCode2, generateModeTransitionCode, generateName, generateOffset, generatePortReference, generatePostfireCode, generatePrefireCode, generatePreinitializeCode, generateSimpleName, generateTypeConvertFireCode, generateTypeConvertFireCode, generateVariableInitialization, generateVariableName, getBufferSize, getBufferSize, getComponent, getDefaultBlocks, getDirector, getDirectorHelper, getFunctionInvocation, getIncludeDirectories, getLibraries, getLibraryDirectories, getModifiedVariables, getNewInvocation, getObject, getParameterValue, getPort, getRates, getReadOffset, getReference, getReference, getReference, getReference, getSharedCode, getSinkChannels, getSize, getSourceChannel, getWCET, getWriteOffset, isPrimitive, isPrimitive, parseList, processCode, resetInputPortsOffset, setBufferSize, setCodeGenerator, setReadOffset, setWriteOffset, targetType, toString
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _description, _exportMoMLContents, _getContainedObject, _isMoMLSuppressed, _markContentsDerived, _propagateExistence, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getContainer, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setName, setPersistent, setSource, sortContainedObjects, toplevel, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlotterBase

public PlotterBase(PlotterBase actor)
Constructor method for the XYPlotter helper.

Parameters:
actor - the associated actor.
Method Detail

generatePlotFireCode

public java.lang.String generatePlotFireCode(int width)
                                      throws IllegalActionException
Generate plot specfic fire code.

Parameters:
width - The width.
Returns:
The generated code.
Throws:
IllegalActionException - If the code stream encounters errors in processing the specified code blocks.

generateInitializeCode

public java.lang.String generateInitializeCode()
                                        throws IllegalActionException
Generate initialize code.

Specified by:
generateInitializeCode in interface ComponentCodeGenerator
Overrides:
generateInitializeCode in class CodeGeneratorHelper
Returns:
The generated code.
Throws:
IllegalActionException - If the code stream encounters errors in processing the specified code blocks.

generateWrapupCode

public java.lang.String generateWrapupCode()
                                    throws IllegalActionException
Generate the wrapup code.

Specified by:
generateWrapupCode in interface ComponentCodeGenerator
Overrides:
generateWrapupCode in class CodeGeneratorHelper
Returns:
The generated wrapup code.
Throws:
IllegalActionException

getHeaderFiles

public java.util.Set getHeaderFiles()
                             throws IllegalActionException
Get the header files needed by the code generated for the XYPlotter actor.

Specified by:
getHeaderFiles in interface ActorCodeGenerator
Overrides:
getHeaderFiles in class CCodeGeneratorHelper
Returns:
A set of strings that are names of the header files needed by the code generated for the XYPlotter actor.
Throws:
IllegalActionException - Not Thrown in this subclass.