|
149 | 149 | [ir_struct, ir_handle_struct_map, ir_json_path] = nasa_toLustre.IR_pp.internalRep_pp(ir_struct, 1, output_dir);
|
150 | 150 |
|
151 | 151 | % add enumeration from Stateflow and from IR
|
152 |
| - add_IR_Enum(ir_struct); |
| 152 | + add_IR_Enum(ir_struct, lus_backend); |
153 | 153 |
|
154 | 154 | %% Unsupported blocks detection
|
155 | 155 | if skip_unsupportedblocks
|
|
178 | 178 | end
|
179 | 179 | %% display report files
|
180 | 180 | if isempty(unsupportedOptions)
|
| 181 | + msg = sprintf(['The model does not contain unsupported blocks.\n' ... |
| 182 | + 'Some blocks may be partially supported.\n'... |
| 183 | + 'When running verification or code generation, other errors may appear if some blocks are partially supported.']); |
181 | 184 | if mode_display == 1
|
| 185 | + |
182 | 186 | if exist('success.png', 'file')
|
183 | 187 | [icondata,iconcmap] = imread('success.png');
|
184 |
| - msgbox('Your model is compatible with CoCoSim!','Success','custom',icondata,iconcmap); |
| 188 | + msgbox(msg,'Success','custom',icondata,iconcmap); |
185 | 189 | else
|
186 |
| - msgbox('Your model is compatible with CoCoSim!'); |
| 190 | + msgbox(msg); |
187 | 191 | end
|
188 | 192 | end
|
189 | 193 | % display it too in command window.
|
190 |
| - display_msg('Your model is compatible with CoCoSim!', ... |
191 |
| - MsgType.RESULT, 'ToLustreUnsupportedBlocks', ''); |
| 194 | + display_msg(msg, MsgType.RESULT, 'ToLustreUnsupportedBlocks', ''); |
192 | 195 |
|
193 | 196 | elseif mode_display == 1
|
194 | 197 | try
|
|
281 | 284 |
|
282 | 285 |
|
283 | 286 | %% add enumeration from IR
|
284 |
| -function add_IR_Enum(ir) |
| 287 | +function add_IR_Enum(ir, lus_backend) |
285 | 288 | global TOLUSTRE_ENUMS_MAP TOLUSTRE_ENUMS_CONV_NODES;
|
286 | 289 | if isfield(ir, 'meta') && isfield(ir.meta, 'Declarations') ...
|
287 | 290 | && isfield(ir.meta.Declarations, 'Enumerations')
|
288 | 291 | enums = ir.meta.Declarations.Enumerations;
|
289 | 292 | for i=1:numel(enums)
|
290 |
| - % put the type name in LOWER case: Lustrec limitation |
291 |
| - name = lower(enums{i}.Name); |
| 293 | + if coco_nasa_utils.LusBackendType.isKIND2(lus_backend) |
| 294 | + name = enums{i}.Name; |
| 295 | + else |
| 296 | + % put the type name in LOWER case: Lustrec limitation |
| 297 | + name = lower(enums{i}.Name); |
| 298 | + end |
292 | 299 | if isKey(TOLUSTRE_ENUMS_MAP, name)
|
293 | 300 | continue;
|
294 | 301 | end
|
|
0 commit comments