How to get enumerations defined by Simulink.IntEnumType to appear in data assistant?
이전 댓글 표시
Hi,
I have various classdef EMyEnum < Simulink.IntEnumType m-files which all work fine except that they do not autopopulate in the data assisstant drop down. If I enter Enum: EMyEnum it comes in fine, but the drop down doesn't list the enums that are defined in my m-files only the enums defined in a data dictionary. Is there a way to get the ModelExplorer and Simulink to display enumerations defined like this?
For instance EDriveState is defined in an M-file (see below). This comes in fine when typed but its not suggested as an option by the data type assistant. The 2 Enums which do show up are in the data dictionary.

classdef EDriveState < Simulink.IntEnumType
enumeration
STOPPED (1) % The drive is not running, but is ready to start.
PRE_START (2) % The drive is not yet running, but actions are being taken to prepare to start.
STARTING (3) % The drive is starting.
WARM_UP (4) % The drive is operating at reduced speed or load to allow correct operating temperature to be reached.
RUNNING (5) % The drive is running in steady state operation and can be loaded.
COOL_DOWN (6) % The drive is operating at reduced speed or load to allow the operating temperature to drop before stopping.
STOPPING (7) % The drive is stopping.
POST_RUN (8) % The drive is not turning, but actions are being taken to complete the shutdown sequence.
ERROR (9) % An error has occurred and the drive is unavailable.
end
methods (Static)
function retVal = getDescription()
retVal = 'Abstract super states, possible Drive States. Specific drive states can be mapped to these states.';
end
function retVal = getDefaultValue()
retVal = EDriveState.STOPPED;
end
end
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Types에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!