TargetLink函数解密之dsdd-SelectObject

在targetLink的众多API中,个人觉得dsdd SelectObject是极其强大的一个,因为dsdd是链接dd文件和block之间的桥梁(暂且这样来形容)。通过dsdd SelectObject能够获取到dd中的各种属性,结合get_tlcg_data,set_tlcg_data从而实现修改block的各种属性(Variable,Class,Type,Scaling…)。

函数简介

对于SelectObject,官方是这样解释的

1
2
3
Opens a modal dialog with which a DD object can be selected. 
Which object are selectable is specified with keywords.
This command is for internal use only, and its interface may be subject to future modifications.

试译:通过关键字打开一个能够选择特定DD属性的模态框

语法

1
2
[currentPath,bModified] = dsdd('SelectObject'[,'currentPath',<currentPath>],'entryPath',<entryPath>,<keyword1>,<keyword2>, ... ,<keywordn>);
[currentPath,bModified] = dsdd('SelectObject'[,'currentPath',<currentPath>],'objectKind',<objectKind>,<keyword1>,<keyword2>, ... ,<keywordn>);

输入参数说明

NameTypeDescription
currentPathstringcurrent value for reference property
objectKindobject kindstring or cell array of strings specifies object kind(s)
entryPathDD pathrelative DD root where objects reside

输出参数说明

NameTypeDescription
currentPathstringobject which has been selected (empty string if no object hase been selected)
bModifiedboolean1 if user has selected an object, 0 if not
#### 举例
打开数据类型模态框,设置仅显示整型,且默认值Int8为选中
1
2
3
4
5
>> selectedType = dsdd('SelectObject','CurrentPath','Int8','objectKind','Typedef','OnlyInteger')

selectedType =

UInt16

打开 选中

ObjectKind列表

objectKind试译
AccessFunctionDescribes a function that provides access to a variable in the production code.
AccessFunctionTemplateTemplate for access functions.
AcknowledgementDescribes the acknowledge behavior of a sender-receiver data element.
ActionSpecifies an action that should be started when a message is received or an alarm expires.
AlarmDescribes an OSEK OS alarm.
AnnotationEnables to add annotations to the object that owns an instance of this object.
ApplicationDataTypeComponentDefines one structure component of a data type on the application level.
ApplicationDataTypeGroupUsed to group ApplicationDataType objects.
ApplicationDataTypeDefines a data type on the application level.
ApplicationErrorDescribes a user-defined error that is associated with an element of an interface.
ApplicationModeDefines properties of a OSEK application mode.
ApplicationDescribes an application built from code generated for one or more Simulink systems.
AsynchronousServerCallPointDescribes an AUTOSAR asynchronous server call point.
AsynchronousServerCallResultPointDescribes an AUTOSAR asynchronous server call result point.
AutosarAccessPointDescribes an AUTOSAR access point.
AutosarThis object keeps AUTOSAR-related objects.
BaseTypesSpecifies base datatypes that are used. Each child object describes one particular base data type.
BlockGroupUsed to group Block objects. BlockGroup objects correspond with subsystem blocks in Simulink models, or with Simulink models.
BlockDescribes a Simulink block. In the Subsystems area, Block objects describe blocks in the Simulink system that has been processed by the Code Generator. In the Pool area, Block objects can be used for DD based code generation.
BlockVariableDescribes a Simulink block variable.
BuildDescribes an executable that was built to run the production code application.
CalPrmAccessPointDescribes an AUTOSAR access point for a calibratable parameter.
CalPrmComSpecDefines how a calprm element is accessed by the receiver.
CalPrmElementDescribes a calibration parameter in a CalPrmInterface. Calibration parameters are typically declared as constants (read-only) in the source code. Nevertheless, such parameters may be modified by a calibration system.
CalPrmInterfaceDefines an interface which contains calibratable parameters. The interface is provided by a CalPrm component and consumed by one or more application components.
CalibrationMethodDefines a calibration method that can be used to access the target hardware, for example, InCircuit, SERAM, DSERAP, BSERAP.
CatalogEntryObject representing a file reference with additional information.
CatalogGroupUsed to group calatog objects.
CatalogContains file references and file category information of files such as source code files (.h/.c) or AUTOSAR files (.arxml/.epc).
ClientComSpecDescribes communication attributes for an operation call (client side).
ClientPortDescribes an AUTOSAR require client-server port.
ClientServerInterfaceDefines an interface which contains operations that a client may invoke on a server.
CodeGenerationUnitGroupUsed to group CodeGenerationUnit objects.
CodeGenerationUnitUsed to specify code generation form DDs.
ConfigThe Config object contains general configuration data. Each DD has one Config object which is a child of the DD’s root.
ContainerContains additional data attached to a DD object.
CounterDescribes a counter that is used by the operating system.
CoverageDataContains data for code coverage analysis.
CustomCodeFileDescribes the content of a custom code file as used by TargetLink Custom Code blocks.
CustomCodeSectionDescribes one custom code section.
DDIncludeFileSpecifies a DD file which is automatically loaded (saved) when a DD project is opened (closed). DDIncludeFile objects are thus used to specify points of inclusion.
DDUseCaseDefines a use case for the Data Dictionary Manager.
DDUseCaseViewSpecifies a view for a given object kind in a DD use case, i.e. which child objects are visible.
DataDictRoot element of a Data Dictionary workspace. There is only one DataDict object in each DD.
DataElementDescribes a data element, for example, a member of a sender/receiver interface.
DataFilterDefines a filter which can be applied to a received data elements, for example, to exclude values which are out of range.
DataReadAccessDescribes an AUTOSAR data read access.
DataReceivePointDescribes an AUTOSAR data receive point.
DataReceiverComSpecDefines how a data element is accessed by the receiver.
DataSendPointDescribes an AUTOSAR data send point.
DataSenderComSpecDefines how a data element is accessed by the sender .
DataTypeMapSpecifies a mapping between an ApplicationDataType object and a Typedef object.
DataTypeMappingSetGroupUsed to group DataTypeMappingSet objects.
DataTypeMappingSetRepresents a list of mappings between ApplicationDataType and Typedef objects, as well as a list of mappings between ModeDeclarationGroup and Typedef objects.
DataVariantItemSpecifies one data variant item. The DataVariant’s DataVariantItem child objects with their variant IDs constitute one data variant.
DataVariantDefines a data variant. Data variants can be switched at runtime.
DataWriteAccessDescribes an AUTOSAR data write access.
DeviceGroupUsed to group Device objects.
DeviceDescribes a device in the model.
DynamicComponentDefines a component of a struct or union.
EMLFunctionGroupUsed to group EMLFunction objects.
EMLFunctionDefines properties of an EML function.
EventDescribes an operating system event.
EventReceiverComSpecDefines how an event data element is accessed by the receiver.
EventSenderComSpecDefines how an event data element is sent .
ExchangeableWidthDefines a set of variable widths used for width invariant code generation.
ExclusiveAreaDefines an exclusive area, that means a part of the code which is protected against interrupts. The actual type of protection mechanism is selected when performing the mapping onto the RTOS. .
ExperimentSpecifies experiment configurations.
FileInfoSpecifies how a file should be generated.
FileSpecificationDescribes attributes of files which are needed to build an application, for example, generated code files, legacy code files, etc. .
FunctionClassGroupUsed to group FunctionClass objects.
FunctionClassDefines C attributes of a function in production code.
FunctionClassTemplateFunctionClassTemplate objects specify which FunctionClass object should be used when no FunctionClass object is specified. Filter rules define when the FunctionClasstemplate object applies.
FunctionGroupUsed to group Function objects.
FunctionInstanceDescribes one instance of a function.
FunctionIn the Pool area, Function objects describe how functions in the production code should be generated. In the Subsystems area, Function objects describe functions that were generated by the Code Generator.
FunctionTemplateFunctionTemplate objects describe rules how functions that match a specified filter conditions should be generated.
GenericGeneric objects are used to specify arbitrary data that are not defined by the Data Model.
IFDataBlobSpecifies ASAP2 specific blob data information.
IFDataSpecifies ASAP1b specific IF_DATA information (A2L_BLOB). The name contains the value of the name1 struct element which is usually ‘IF_DATA’.
IFDataSourceBlobDescribes an ASAM-MCD 2MC source blob.
IFDataTokenListContains an ASAM MCD 2MC (ASAP2) specific list of tokens (from A2L_TOKEN_LIST).
ISRDescribes an interrupt service routine.
IncludedCodeFileSpecifies header files which are included to a module.
InterRunnableVariableReadAccessDescribes an AUTOSAR inter runnable data read access.
InterRunnableVariableWriteAccessDescribes an AUTOSAR inter runnable data write access.
InterfaceGroupUsed to group Interface objects.
InterfaceVariableDescribes a variable which belongs to a function interface. The variable can be a global input or output, a formal or actual argument, or the function’s return value.
LogVariableGroupUsed to group LogVariable objects.
LogVariableDescribes a variable to be logged during simulations.
LookupFunctionTemplateLookupFunctionTemplate objects describe rules how look-up functions that match a specified filter conditions should be generated.
MemorySegmentDefines properties of an address range in target memory.
MessageAccessorSpecifies how a message variable is accessed by the sender or the receiver.
MessageDescribes a communication connection. In the Pool area, Message objects specify how communication connections should be generated. In the Subsystems area, Message object describe how communication connections have been implemented by the Code Generator.
MessageVariableDefines a variable used to hold message data.
ModeAccessPointDescribes an AUTOSAR mode access point.
ModeDeclarationGroupGroupUsed to group ModeDeclarationGroup objects.
ModeDeclarationGroupDefines a group of modes, which exist for a given application mode of the ECU, for example, INIT, RUN, TERMINATE, …
ModeDeclarationDefines an available ECU mode, for example, INIT.
ModeDisablingDependencySpecifies a mode that disables the RTE event this object belongs to.
ModeElementDescribes an element of a sender/receiver interface which is used to communicate ECU modes (Init, .., Term) to a software component. In AUTOSAR, mode elements are called ‘ModeDeclarationGroupPrototypes’.
ModeReceiverComSpecDescribes attributes for receiver communication.
ModeReceiverPortDescribes an AUTOSAR mode receiver port.
ModeRequestTypeMapSpecifies a mapping between a ModeDeclarationGroup object and a Typedef object.
ModeSenderComSpecDescribes attributes for sender communication.
ModeSenderPortDescribes an AUTOSAR mode sender port.
ModeSwitchInterfaceDescribes an AUTOSAR mode switch interface.
ModeSwitchPointDescribes an AUTOSAR mode switch point.
ModelGroupUsed to group Model objects.
ModelDescribes a Simulink model.
ModuleGroupUsed to group Module objects.
ModuleSecifies a module in production code.
ModuleOwnerShipGroupUsed to group ModuleOwnerShip objects.
ModuleOwnerShipSpecifies module ownership.
ModuleTemplateTemplate for code modules.
OILEntryDescribes one entry in a OIL file.
OILFileContains the memory image of a complete OIL file.
OperationArgumentDescribes an argument of a operation. Operations are elements of client/server interfaces, that means functions which a client component may invoke on a server component.
OperationDescribes an operation. Operations are elements of client/server interfaces, that means functions which a client component may invoke on a server component.
PageSwitchingInfoDescribes a code page which can be switched.
PerInstanceMemoryVariableAccessDescribes an AUTOSAR per instance memory variable access.
PoolThe Pool object is a child of the DD root and constitutes the Pool area in which data for code generation are specified.
PortGroupUsed to group AUTOSAR port objects.
PortDescribes a port of a Simulink system.
PropertyValueListList of propertyname/value pairs. All property values are strings. Additional PropertyValueList objects can be inserted to create a hierarchical composition.
ProtectionMechanismDefines a mechanism used to protect code sections against preemption by tasks or ISRs.
ProvideCalPrmPortDescribes an AUTOSAR SWC port where a CalPrmInterface is provided.
RTOSContains RTOS objects needed for multirate code generation.
RasterDefines a measurement raster which can be used for data acquisition by a calibration system.
ReceiverPortDescribes an AUTOSAR require sender-receiver port.
RecordLayoutSpecifies how a table map for a look-up function should be generated.
RequireCalPrmPortDescribes an AUTOSAR SWC port where a CalPrmInterface is required.
RequirementInfoRequirementInfo objects keep Simulink RMI data.
ResourceDescribes an OSEK OS resource.
RootFunctionTemplateTemplate for root functions (STEP, INIT, RESTART, TERM, …).
RteEventDescribes an RTE event.
RunnableDescribes an AUTOSAR runnable.
ScalingGroupUsed to group Scaling objects.
ScalingSpecifies scaling parameters.
SectionDescribes a linker section.
SenderPortDescribes an AUTOSAR provide sender-receiver port.
SenderReceiverInterfaceDefines an interface for sending and receiving data via ports.
ServerComSpecDescribes communication attributes for an operation call (server side).
ServerPortDescribes an AUTOSAR provide client-server port.
SharedCalPrmVariableAccessDescribes an AUTOSAR inter runnable shared calibratable access.
SoftwareComponentGroupUsed to group SoftwareComponent objects.
SoftwareComponentDescribes an AUTOSAR software component including it’s internal behavior.
StateflowNodeDescribes a state or subchart in a Statechart.
StructTemplateTemplate for structs.
SubStructTemplateTemplate for substructs.
SubfunctionDescribes a subfunction called from a function instance.
SubsystemConfigContains configuration data for a subsystem. This information is evaluated by the Code Generator.
SubsystemObject containing the description of a generated or imported subsystem.
SwRecordLayoutContentThis element is used together with SwRecordLayoutElements. It describes the serialization of the data (e.g. a look-up table axis) in the ECU memory.
SwRecordLayoutElementDefines an element (group) in a record layout that describes the serialization of the data (e.g. a look-up table axis) in the ECU memory.
SwRecordLayoutGroupUsed to group SwRecordLayout objects.
SwRecordLayoutUsed to describe the various record layouts of the calibratable object (especially look-up table data) in the memory of the ECU.
SymbolGroupUsed to group Symbol objects.
SymbolDefines object kind symbol.
SynchronousServerCallPointDescribes an AUTOSAR synchronous server call point.
TaskDescribes a operating system task.
TaskTemplateDefines properties of a task which are not explicitly defined in the model.
TemplateGroupUsed to group template objects.
TypedefComponentDefines a component of a struct or union data type.
TypedefEnumValueDefines an element of an enum union data type.
TypedefGroupUsed to group Typedef objects.
TypedefSpecifies a data type. In the Pool area, Typedef objects serve as templates that describe how a data type should be generated. In the Subsystems area, Typedef objects describe how a data type was generated in the production code.
TypedefTemplateSpecifies attributes of struct, enum, or union data types that are generated implicitly.
UnitDefines a physical unit based on SI units.
VariableClassGroupUsed to group VariableClass objects.
VariableClassDefines C attributes of variables in the production code.
VariableClassTemplateVariableClassTemplate objects specify which VariableClass object should be used when no VariableClass object is specified. Filter rules define when the VariableClasstemplate object applies.
VariableGroupUsed to group Variable objects.
VariableVariable objects describe variables in production code. In the Pool area, Variable objects serve as templates that specify how a variable should be generated. By associating a TargetLink block variable (for example, a block’s output) with a Variable object in the Pool area, the properties of the Variable object determine how the block variable should be represented in production code. In the Subsystems area, Variable objects describe how an instance of a variable was generated in production code.
VariableTemplateVariableTemplate objects specify how implicit variables should be generated in the production code.
VariantConfigDefines a variant configuration. This variant configuration is activated by setting the /Config/ TargetLink.ActiveVariantConfig property to the name of this object.
VariantItemDefines a variant. VariantItem objects enable to associate varianted properties with variant configurations described by VariantConfig objects.
WaitPointDescribes an AUTOSAR wait point.