Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

getComponentModifierNames() for modified paramters in extended classes

getComponentModifierNames() for modified paramters in extended classes

Is there any equivalent of getComponentModifierNames() for modified paramters in extended classes, in the OMC_API?
Or is there some other way to retrieve those names and values? 

As an example...

Code:


model master
extends base(p1=10);
end master;

Code:


model base
  parameter Real p1 = 3;
  Real x;
  Real y;
equation
  x = 1;
  y = p1 * x;
end base;

How can I obtain the parameter p1 and the value 10?

Any help appreciated.

cheers,

Patrik

P.S. A last resort would be to "list()" the whole class and parse the code, but figure there might be a simpler way. D.S.

Re: getComponentModifierNames() for modified paramters in extended classes

You need to check the inheritance of master class and then get modifiers of the inherited class. I posted the sequence of commands,

Code:

>> getInheritanceCount(master)

<< 1
>> getNthInheritedClass(master, 1)
<< base
>> getExtendsModifierNames(master, base)
<< {p1}
>> getExtendsModifierValue(master, base, p1)
<< = 10

Adeel.

Re: getComponentModifierNames() for modified paramters in extended classes

Ok, great! Thanks a lot!

In general;
is there a more complete list of these functions than the one provided in the documents of the installer?

cheers,

patrik

Re: getComponentModifierNames() for modified paramters in extended classes

Re: getComponentModifierNames() for modified paramters in extended classes

Ok thanks,

unfortunately it's not rather complete either.. Couldn't find neither getExtendsModifierNames() nor getExtendsModifierValue() in that list.

/Patrik

Re: getComponentModifierNames() for modified paramters in extended classes

Hey again,

so now i can collect the ordinary parameters that are used to modify the parameters of the extended class. However I also need to collect modifications that includes redefinitions of entire types and classes. These have the keyword redeclare in front of the.

I have gotten what looks like an exhaustive list of the different function calls ;


protected function showStatement
protected function selectResultstr
protected function getEcho
protected function evaluateAlgStmt "function: evaluateAlgStmt
protected function evaluateForStmt
protected function evaluateForStmtRangeOpt
protected function evaluateWhileStmt
protected function evaluatePartOfIfStatement
protected function evaluateIfStatementLst
protected function evaluateAlgStmtLst
protected function evaluateExpr
protected function stringRepresOfExpr
protected function evaluateExprToStr
protected function getIdentFromTupleCrefexp
protected function addVarsToSymboltable
protected function deleteVarFromVarlist
protected function addVarToVarlist
protected function addVarsToEnv
protected function matchApiFunction
protected function getApiFunctionArgs
protected function getApiFunctionNamedArgs
protected function evaluateGraphicalApi
protected function evaluateGraphicalApi_dispatch
protected function listClass
protected function extractAllComponentreplacements
protected function isClassReadOnly
protected function renameComponent
protected function renameComponentOnlyInClass
protected function extractRenamedClassesAsStringList
protected function renameComponentFromComponentreplacements
protected function renameComponentVisitor
protected function renameComponentInClass
protected function renameComponentInParts
protected function renameComponentInElements
protected function renameComponentInElementSpec
protected function renameComponentInComponentitems
protected function renameComponentInEquationList
protected function renameComponentInExpEquationitemList
protected function renameComponentInEquation
protected function renameComponentInExpList
protected function renameComponentInExpListList
protected function renameComponentInExpTupleList
protected function renameComponentInElementArgList
protected function renameComponentInElementArg
protected function renameComponentInCode
protected function renameComponentInExp
protected function renameComponentInAlgorithms
protected function renameComponentInAlgorithm
protected function renameComponentInExpAlgoritmsList
protected function renameComponentInFunctionArgs
protected function renameComponentInIterators
protected function renameComponentInNamedArgs
protected function renameComponentInExternalDecl
protected function replaceStartInComponentRef
protected function replaceStartInComponentRef2
protected function getComponentreplacementsrules
protected function getNewComponentreplacementsrulesForEachRule
protected function makeComponentsReplacementRulesFromComponents
protected function emptyComponentReplacementRules
protected function joinComponentReplacementRules
protected function lengthComponentReplacementRules
protected function firstComponentReplacement
protected function restComponentReplacementRules
protected function getDependencyOnClass
protected function getDependencyWithType
protected function getComponentsWithComponentsClass
protected function getComponentsWithComponentsType
protected function getComponentsFromClass
protected function getComponentsWithType
protected function extractAllComponents
protected function extractAllComponentsVisitor
protected function isReadOnly
protected function extractComponentsFromClass
protected function extractComponentsFromClassdef
protected function extractComponentsFromClassparts
protected function extractComponentsFromElements
protected function extractComponentsFromElementspec
protected function extractComponentsFromComponentitems
protected function extractComponentsFromElementargs
protected function extractComponentsFromModificationOption
protected function joinComponents
protected function existsComponentInComponents
protected function emptyComponents
protected function firstComponent
protected function restComponents
protected function lengthComponents
protected function addComponentToComponents
protected function dumpComponentsToString
protected function isParameterElement
protected function getParameterNames
protected function setComponentProperties
protected function setComponentPropertiesInClass
protected function setComponentPropertiesInClassparts
protected function setComponentPropertiesInElementitems
protected function setComponentPropertiesInElement
protected function setReplaceableKeywordAttributes
protected function setInnerOuterAttributes
protected function setComponentPropertiesInElementspec
protected function itemsContainCompname
protected function setElementAttributes
protected function setElementParallelism
protected function setElementVariability
protected function setElementCausality
protected function selectString
protected function getCrefInfo
protected function getImportString
protected function getElementType
protected function getElementInfo
protected function constructElementsInfo
protected function appendNonEmptyStrings
protected function getElementsInfo
protected function setExtendsModifierValue
protected function setExtendsSubmodifierInClass
protected function setExtendsSubmodifierInClassparts
protected function setExtendsSubmodifierInElementitems
protected function setExtendsSubmodifierInElement
protected function getExtendsModifierValue
protected function makeExtendsFullyQualified
protected function getExtendsModifierNames
protected function extendsElementspecNamed
protected function extendsName
protected function getExtendsElementspecInClass
protected function getExtendsElementspecInClassparts
protected function getExtendsElementspecInElementitems
protected function getExtendsElementspecInElement
protected function setComponentModifier
protected function setComponentSubmodifierInClass
protected function setComponentSubmodifierInClassparts
protected function setComponentSubmodifierInElementitems
protected function setComponentSubmodifierInElement
protected function setComponentSubmodifierInCompitems
protected function createOptModificationFromEltargs
protected function setSubmodifierInElementargs
protected function findCrefModification
protected function getComponentModifierValue
protected function getComponentModifierNames
protected function getModificationNames
protected function getComponentBinding
protected function getVariableBindingInComponentitem
protected function setParameterValue
protected function setVariableBindingInClass
protected function setVariableBindingInClassparts
protected function setVariableBindingInElementitems
protected function setVariableBindingInElement
protected function setVariableBindingInCompitems
protected function componentitemNamed
protected function getComponentitemName
protected function getComponentitemsInElement
protected function renameClass
protected function renameClassVisitor
protected function renameClassInClass
protected function renameClassInParts
protected function renameClassInElements
protected function renameClassInElementSpec
protected function renameClassInImport
protected function changeLastIdent
protected function traverseClasses2
protected function classHasLocalClasses
protected function partsHasLocalClass
protected function eltsHasLocalClass
protected function traverseInnerClass
protected function traverseInnerClassParts
protected function traverseInnerClassElements
protected function traverseInnerClassElementspec
protected function deleteClass
protected function deleteClassFromList
protected function setClassCommentInClass
protected function setClassCommentInClassdef
protected function setClassCommentInCommentOpt
protected function getClassInformation
protected function getShortDefinitionBaseClassInformation
protected function getExternalFunctionSpecification
protected function getClassDimensions
protected function getClassAttributes
protected function getClassComment2
protected function isConnector
protected function isRecord
protected function isBlock
protected function isClass
protected function isParameter
protected function isProtected
protected function isConstant
protected function isEnumeration
protected function isReplaceable
protected function isReplaceableInElements
protected function isProtectedClassInElements
protected function getEnumLiterals
protected function getElementitemContainsName
protected function getComponentsContainsName
protected function getElementContainsName
protected function getCompitemNamed
protected function removeAnySubFunctions
protected function removeAnyPartsFunctions
protected function removeVarFromVarlist
protected function getVariableValue
protected function getVariableValueLst
protected function lookupClassdef
protected function deleteComponent
protected function deleteComponentFromClass
protected function deleteComponentFromElementitems
protected function getDefaultPrefixes "Retrieves default prefixes by looking at the defaultComponentPrefixes annotation"
protected function makeReplaceableIfPartial
protected function getDefaultInnerOuter "helper function to getDefaultPrefixes"
protected function getDefaultReplaceable "helper function to getDefaultPrefixes"
protected function getDefaultAttr "helper function to getDefaultPrefixes"
protected function getDefaultComponentPrefixesModStr "Extractor function for defaultComponentPrefixes modifier"
protected function updateComponent
protected function addClassAnnotation
protected function addClassAnnotationToClass
protected function replaceElementAnnotationInElements
protected function replaceElementAnnotationInEquations
protected function replaceElementAnnotationInAlgorithms
protected function getElementAnnotationInElements
protected function getElementAnnotationInEquations
protected function getElementAnnotationInAlgorithms
protected function mergeAnnotations
protected function removeModificationInElementargs
protected function getInheritanceCount
protected function getNthInheritedClass
protected function getNthInheritedClassAnnotationOpt
protected function getMapAnnotationStr
protected function getNthInheritedClassMapAnnotation
protected function getExtendsInClass
protected function getExtendsInParts
protected function getExtendsInElementitems
protected function getNthInheritedClass2
protected function countComponents
protected function countComponentsInElts
protected function getNthComponent "function: getNthComponent
protected function getNthComponent2
protected function useQuotes
protected function getComponents2
protected function getComponentAnnotations "function: getComponentAnnotations
protected function getNthComponentAnnotation "function: getNthComponentAnnotation
protected function getNthComponentModification "function: getNthComponentModification
protected function getNthComponentCondition
protected function getComponentCondition
protected function getComponentitemsCondition
protected function getConnectionCount "function: getConnectionCount
protected function getNthConnection "function: getNthConnection
protected function getStringComment "function: getStringComment
protected function getStringComment2
protected function addConnection "function: addConnection
protected function deleteConnection "function: deleteConnection
protected function deleteEquationInClass
protected function deleteEquationInEqlist
protected function getComponentComment
protected function getComponentCommentInClass
protected function getComponentCommentInParts
protected function getComponentCommentInElementitems
protected function getComponentCommentInElementspec
protected function getComponentCommentInCompitems
protected function getClassCommentInCommentOpt
protected function setComponentComment
protected function setComponentCommentInClass
protected function setComponentCommentInParts
protected function setComponentCommentInElementitems
protected function setComponentCommentInElementspec
protected function setComponentCommentInCompitems
protected function setConnectionComment
protected function setConnectionCommentInClass
protected function setConnectionCommentInParts
protected function setConnectionCommentInEquations
protected function getNthConnectionAnnotation
protected function getConnectorCount
protected function getNthConnector
protected function getNthConnectorIconAnnotation
protected function getDiagramAnnotation
protected function getUsesAnnotationString
protected function getUsesAnnotationString2
protected function getIconAnnotation
protected function getTopPackagesInProgram
protected function getPackagesInClass
protected function getPackagesInParts
protected function getPackagesInElts
protected function getTopQualifiedClassnames
protected function getClassnamesInClass
protected function getBaseClasses
protected function getBaseClassesFromParts
protected function getBaseClassesFromElts
protected function countBaseClasses
protected function countBaseClassesFromParts
protected function countBaseClassesFromElts
protected function getAnnotationInClass
protected function getAnnotationFromParts
protected function getAnnotationFromElts
protected function isAnnotationType
protected function containAnnotation
protected function getAnnotationFromEqns
protected function getAnnotationFromAlgs
protected function getAnnotationStr
protected function getNamedAnnotationInParts
protected function getNamedAnnotationInElItems
protected function getNamedAnnotationInEquItems
protected function getNamedAnnotationInAlgItems
protected function getDefaultComponentName
protected function getDefaultComponentNameModStr
protected function getDefaultComponentPrefixes
protected function getNamedAnnotationStr
protected function getExperimentAnnotationString2
protected function getDocumentationAnnotationInfo
protected function getDocumentationAnnotationRevision
protected function getNthPublicConnectorStr
protected function getNthConnectorStr
protected function getNthCompname
protected function countPublicConnectors
protected function countConnectors
protected function getConnectionAnnotationStrElArgs
protected function getConnectionAnnotationStr
protected function createFuncargsFromElementargs
protected function getNthConnectionitemInClass
protected function getNthConnectionitemInClassparts
protected function getNthConnectionitemInEquations
protected function getConnectionStr
protected function countConnections
protected function countConnectionsInClassparts
protected function countConnectionsInEquations
protected function getComponentAnnotationsFromElts
protected function getComponentitemsAnnotations
protected function getComponentitemsAnnotationsElArgs
protected function getComponentitemsAnnotationsFromItems
protected function getComponentAnnotation
protected function modelicaAnnotationProgram
protected function getComponentitemsAnnotation
protected function getComponentitemsModification
protected function buildEnvForGraphicProgram
protected function getAnnotationString
protected function stripGraphicsAndInteractionModification
protected function getPublicComponentsInClass
protected function getProtectedComponentsInClass
protected function getComponentsInElementitems
protected function getNthComponentInClass
protected function getNthComponentInElementitems
protected function getComponentInfo
protected function arrayDimensionStr
protected function getComponentsInfo
protected function getComponentsInfo2
protected function keywordReplaceable
protected function getComponentInfoOld
protected function innerOuterStr
protected function attrFlowStr
protected function attrStreamStr
protected function attrParallelismStr
protected function attrVariabilityStr
protected function attrDimensionStr
protected function attrDirectionStr
protected function getComponentitemsDimension
protected function suffixInfos
protected function prefixTypename
protected function addToProtected
protected function addToEquation
protected function buildPath
protected function replaceClassInProgram
protected function insertClassInProgram
protected function insertClassInClass "function: insertClassInClass
protected function getFirstIdentFromPath "function: getFirstIdentFromPath
protected function removeInnerClass "function: removeInnerClass
protected function removeClassInElementitemlist
protected function replaceInnerClass
protected function replaceClassInElementitemlist
protected function getInnerClass
protected function replacePublicList
protected function replaceProtectedList "function: replaceProtectedList
protected function replaceEquationList "function: replaceEquationList
protected function replaceInitialEquationList "function: replaceInitialEquationList
protected function replaceAlgorithmList "function: replaceAlgorithmList
protected function replaceInitialAlgorithmList "function: replaceInitialAlgorithmList
protected function deletePublicList "function: deletePublicList
protected function deleteProtectedList "function: deleteProtectedList
protected function getPublicList "function: getPublicList
protected function getProtectedList "function: getProtectedList
protected function getEquationList "function: getEquationList
protected function getInitialEquationList "function: getInitialEquationList
protected function getAlgorithmList "function: getAlgorithmList
protected function getInitialAlgorithmList "function: getInitialAlgorithmList
protected function getClassFromElementitemlist "function: getClassFromElementitemlist
protected function classInProgram
protected function getClassesInClass
protected function getClassesInParts
protected function getClassesInElts
protected function getClassInProgram
protected function modificationToAbsyn
protected function modificationToAbsyn2
protected function selectAnnotation
protected function annotationListToAbsynComment
protected function annotationListToAbsynComment2
protected function commentToAbsyn
protected function annotationListToAbsyn
protected function recordConstructorToModification
protected function namedargToModification
protected function removeInnerDiffFiledClasses
protected function removeInnerDiffFiledClass
protected function removeClassDiffFiledInElementitemlist
protected function getSurroundingPackage
protected function transformFlatClass
protected function transformFlatClassDef
protected function transformFlatElementItem
protected function transformFlatElement
protected function transformFlatElementSpec
protected function transformFlatComponentItem
protected function transformFlatComponent
protected function transformFlatArrayDim
protected function transformFlatSubscript
protected function transformFlatElementArg
protected function transformFlatModificationOption
protected function transformFlatComponentRef
protected function transformFlatEquationItem
protected function transformFlatEquation
protected function transformFlatElseIfPart
protected function transformFlatFunctionArgs
protected function transformFlatNamedArg
protected function transformFlatExpTrav
protected function transformFlatExp
protected function transformFlatAlgorithmItem
protected function transformFlatAlgorithm
protected function transformFlatElseIfAlgorithm
protected function expandUnionTypes
protected function expandUnionTypesInClass
protected function updateLoadedFiles
protected function getLoadedFileInfo
protected function checkLoadedFiles
protected function getDefinitions
protected function getLocalVariables
protected function getLocalVariablesInClassParts
protected function getLocalVariablesInAlgorithmsItems
protected function getLocalVariablesInAlgorithmItem
protected function printWithNewline
protected function getDefinitions2
protected function getDefinitionsClass
protected function getDefinitionsReplaceableClass
protected function getEnumerationLiterals
protected function getDefinitionPathString
protected function getDefinitionDimensions
protected function getDefinitionParts
protected function getDefinitionContent
protected function getDefinitionDirString
protected function getDefinitionComponents
protected function getElementName
protected function getElementTypeName
protected function getDescIfVis ""
protected function getNameFromElementIfVisType
protected function constructVisTypesList
protected function getVisElementNameFromStr
protected function getComponentBindingMapable
protected function getClassnamesInClassList
protected function joinPaths
protected function getComponentInClass
protected function getFunctionsInClasses
protected function getAllClassesInClass

However, some of these do not seem to be implemented. And the list doesn't give me any information about the input arguments. I get the following Error msg when I tried some of them (with arguments I assumed to be valid).

"Error: Class getExtendsElementspecInClass not found in scope <global scope> (looking for a function or record).

Could this be due to me using inappropriate arguments? Or is it, just as the Error msg implies, due to the fact that the function it is not implemented?


Sorry for the long post,

Cheers,

Patrik

There are 0 guests and 0 other users also viewing this topic
You are here: