Merging two .sldd without duplicates

I have a situation where I am supposed to read two different .sldd-files from different sources into a Simulink-model, where I know that there may be duplicate definitions of some variables, and I need a way to merge them together, where one of the sourses have higher priority.
If conflicting definitions exists I would like to get a way to issue a warning to the offending source.
We have tried the "addDataSource(dataDictionary, dataDictionaryToAdd)", but that only adds the new dictionary and then we get duplicate definitions.
Alternatively I would like a way to go through the dictionary afterwards and delete the definition from the source with the lower priority.

1 件のコメント

Walter Roberson
Walter Roberson 2020 年 10 月 7 日
.sldd files are zip'd xml files
You can unzip and examine data/chunk0.xml . It will have objects with class DD.ENTRY .
At the moment, the way to connect entries to sections is not obvious to me.

サインインしてコメントする。

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2020 年 10 月 7 日

0 投票

  1. using API, you can go through all the entries in the two .sldd files, find duplicate ones and remove them from one of the SLDD
  2. To make it work for your model, specify one of them as your SLDD and reference the other. There got to be a priority. Try one parameter to figure out which one has the priority.
  3. Export the SLDD to .m files. Run them in a particular order (higher priority one runs later) to merge the data and then import (merge) the two SLDD into one SLDD.

2 件のコメント

John Eriksson
John Eriksson 2020 年 10 月 7 日
That sounds like just what I want.
What are the commands I should use to start researching this?
Fangjun Jiang
Fangjun Jiang 2020 年 10 月 7 日
The above 3 are all options, not in sequence. For API

サインインしてコメントする。

製品

リリース

R2018b

タグ

質問済み:

2020 年 10 月 7 日

コメント済み:

2020 年 10 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by