필터 지우기
필터 지우기

How do I specify the '.CustomAt​tributes.T​ypeName'

조회 수: 2 (최근 30일)
Craig Barry
Craig Barry 2012년 11월 13일
Hi guys,
I have defined a custom storage class. It currently defines the structure as 'Instant specific' (as per the cscdesigner). I then assign variables into the desired structure with an m script which does the following:
wibble.RTWInfo.CustomAttributes.StructName = 'runtime_structname';
When generating code, it comes out looking like this:
extern const runtime_structname_type = *runtime_structname;
This is not what I want to generate, I want to also specify the 'TypeName', as mentioned in the 'csc_registeration.m'. When not set as instant specific the structure type can be defined, but I want to dynamically assign this to make code that looks like this (notice the type does not contain the word runtime):
extern const structname_t = *runtime_structname;
Unfortunately, I cannot access the TypeName class, the following error is generated, "No public field TypeName exists for class"
Does anyone know how I can achieve what I want?
Thanks in advance.
Craig
  댓글 수: 1
Craig Barry
Craig Barry 2012년 11월 17일
For anyone interested, the workaround for this issue, in handcode I have a script which automates the inclusion of an additional typedef to the required type:
typedef struct structname structname_t; /* This is the required format */
typedef structname_t runtime_structname_type; /* This typedefs the RTW generated code into my required form */
extern const structname_t *runtime_structname; /* Declare pointer to struct of required type */

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by