powertrain-build 1.13.1__py3-none-any.whl → 1.13.3.dev3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. powertrain_build/__init__.py +40 -40
  2. powertrain_build/__main__.py +6 -6
  3. powertrain_build/a2l.py +582 -582
  4. powertrain_build/a2l_merge.py +650 -650
  5. powertrain_build/a2l_templates.py +717 -717
  6. powertrain_build/build.py +985 -985
  7. powertrain_build/build_defs.py +309 -309
  8. powertrain_build/build_proj_config.py +690 -690
  9. powertrain_build/check_interface.py +575 -575
  10. powertrain_build/cli.py +141 -141
  11. powertrain_build/config.py +542 -542
  12. powertrain_build/core.py +395 -395
  13. powertrain_build/core_dummy.py +343 -343
  14. powertrain_build/create_conversion_table.py +73 -73
  15. powertrain_build/dids.py +916 -916
  16. powertrain_build/dummy.py +157 -157
  17. powertrain_build/dummy_spm.py +252 -252
  18. powertrain_build/environmentcheck.py +52 -52
  19. powertrain_build/ext_dbg.py +255 -255
  20. powertrain_build/ext_var.py +327 -327
  21. powertrain_build/feature_configs.py +301 -301
  22. powertrain_build/gen_allsysteminfo.py +227 -227
  23. powertrain_build/gen_label_split.py +449 -449
  24. powertrain_build/handcode_replacer.py +124 -124
  25. powertrain_build/html_report.py +133 -133
  26. powertrain_build/interface/__init__.py +4 -4
  27. powertrain_build/interface/application.py +511 -511
  28. powertrain_build/interface/base.py +500 -500
  29. powertrain_build/interface/csp_api.py +490 -490
  30. powertrain_build/interface/device_proxy.py +677 -677
  31. powertrain_build/interface/ems.py +67 -67
  32. powertrain_build/interface/export_global_vars.py +121 -121
  33. powertrain_build/interface/generate_adapters.py +132 -132
  34. powertrain_build/interface/generate_hi_interface.py +87 -87
  35. powertrain_build/interface/generate_service.py +69 -69
  36. powertrain_build/interface/generate_wrappers.py +147 -147
  37. powertrain_build/interface/generation_utils.py +142 -142
  38. powertrain_build/interface/hal.py +194 -194
  39. powertrain_build/interface/model_yaml_verification.py +348 -348
  40. powertrain_build/interface/service.py +296 -296
  41. powertrain_build/interface/simulink.py +249 -249
  42. powertrain_build/interface/update_call_sources.py +180 -180
  43. powertrain_build/interface/update_model_yaml.py +186 -186
  44. powertrain_build/interface/zone_controller.py +362 -362
  45. powertrain_build/lib/__init__.py +4 -4
  46. powertrain_build/lib/helper_functions.py +127 -127
  47. powertrain_build/lib/logger.py +55 -55
  48. powertrain_build/matlab_scripts/CodeGen/BuildAutomationPyBuild.m +78 -78
  49. powertrain_build/matlab_scripts/CodeGen/Generate_A2L.m +154 -154
  50. powertrain_build/matlab_scripts/CodeGen/generateTLUnit.m +239 -239
  51. powertrain_build/matlab_scripts/CodeGen/getAsilClassification.m +28 -28
  52. powertrain_build/matlab_scripts/CodeGen/modelConfiguredForTL.m +28 -28
  53. powertrain_build/matlab_scripts/CodeGen/moveDefOutports.m +88 -88
  54. powertrain_build/matlab_scripts/CodeGen/parseCalMeasData.m +410 -410
  55. powertrain_build/matlab_scripts/CodeGen/parseCoreIdentifiers.m +139 -139
  56. powertrain_build/matlab_scripts/CodeGen/parseDIDs.m +141 -141
  57. powertrain_build/matlab_scripts/CodeGen/parseInPorts.m +106 -106
  58. powertrain_build/matlab_scripts/CodeGen/parseIncludeConfigs.m +25 -25
  59. powertrain_build/matlab_scripts/CodeGen/parseModelInfo.m +38 -38
  60. powertrain_build/matlab_scripts/CodeGen/parseNVM.m +81 -81
  61. powertrain_build/matlab_scripts/CodeGen/parseOutPorts.m +120 -120
  62. powertrain_build/matlab_scripts/CodeGen/parsePreProcBlks.m +23 -23
  63. powertrain_build/matlab_scripts/CodeGen/struct2JSON.m +128 -128
  64. powertrain_build/matlab_scripts/CodeGen/updateCodeSwConfig.m +31 -31
  65. powertrain_build/matlab_scripts/Init_PyBuild.m +91 -91
  66. powertrain_build/matlab_scripts/__init__.py +2 -2
  67. powertrain_build/matlab_scripts/helperFunctions/Get_Full_Name.m +46 -46
  68. powertrain_build/matlab_scripts/helperFunctions/Get_SrcLines.m +12 -12
  69. powertrain_build/matlab_scripts/helperFunctions/Init_Models.m +78 -78
  70. powertrain_build/matlab_scripts/helperFunctions/Init_Projects.m +67 -67
  71. powertrain_build/matlab_scripts/helperFunctions/Read_Units.m +34 -34
  72. powertrain_build/matlab_scripts/helperFunctions/SetProjectTimeSamples.m +26 -26
  73. powertrain_build/matlab_scripts/helperFunctions/Strip_Suffix.m +16 -16
  74. powertrain_build/matlab_scripts/helperFunctions/followLink.m +118 -118
  75. powertrain_build/matlab_scripts/helperFunctions/getCodeSwitches.m +50 -50
  76. powertrain_build/matlab_scripts/helperFunctions/getConsumerBlocks.m +30 -30
  77. powertrain_build/matlab_scripts/helperFunctions/getDefBlock.m +39 -39
  78. powertrain_build/matlab_scripts/helperFunctions/getDefOutport.m +58 -58
  79. powertrain_build/matlab_scripts/helperFunctions/getDstBlocks.m +19 -19
  80. powertrain_build/matlab_scripts/helperFunctions/getDstLines.m +13 -13
  81. powertrain_build/matlab_scripts/helperFunctions/getInterfaceSignals.m +37 -37
  82. powertrain_build/matlab_scripts/helperFunctions/getName.m +37 -37
  83. powertrain_build/matlab_scripts/helperFunctions/getPath.m +6 -6
  84. powertrain_build/matlab_scripts/helperFunctions/getProperValue.m +21 -21
  85. powertrain_build/matlab_scripts/helperFunctions/getSrcBlocks.m +19 -19
  86. powertrain_build/matlab_scripts/helperFunctions/getSrcLines.m +13 -13
  87. powertrain_build/matlab_scripts/helperFunctions/loadLibraries.m +10 -10
  88. powertrain_build/matlab_scripts/helperFunctions/loadjson.m +6 -6
  89. powertrain_build/matlab_scripts/helperFunctions/modifyEnumStructField.m +21 -21
  90. powertrain_build/matlab_scripts/helperFunctions/removeConfigDuplicates.m +31 -31
  91. powertrain_build/matlab_scripts/helperFunctions/sortSystemByClass.m +26 -26
  92. powertrain_build/matlab_scripts/helperFunctions/tl_getfast.m +89 -89
  93. powertrain_build/matlab_scripts/helperFunctions/topLevelSystem.m +20 -20
  94. powertrain_build/matlab_scripts/helperFunctions/updateModels.m +131 -131
  95. powertrain_build/memory_section.py +224 -224
  96. powertrain_build/nvm_def.py +729 -729
  97. powertrain_build/problem_logger.py +86 -86
  98. powertrain_build/pt_matlab.py +430 -430
  99. powertrain_build/pt_win32.py +144 -144
  100. powertrain_build/replace_compu_tab_ref.py +105 -105
  101. powertrain_build/rte_dummy.py +254 -254
  102. powertrain_build/sched_funcs.py +209 -207
  103. powertrain_build/signal.py +7 -7
  104. powertrain_build/signal_if_html_rep.py +221 -221
  105. powertrain_build/signal_if_html_rep_all.py +302 -302
  106. powertrain_build/signal_incons_html_rep.py +180 -180
  107. powertrain_build/signal_incons_html_rep_all.py +366 -366
  108. powertrain_build/signal_incons_html_rep_base.py +168 -168
  109. powertrain_build/signal_inconsistency_check.py +641 -641
  110. powertrain_build/signal_interfaces.py +864 -864
  111. powertrain_build/templates/Index_SigCheck_All.html +22 -22
  112. powertrain_build/templates/Index_SigIf_All.html +19 -19
  113. powertrain_build/types.py +218 -218
  114. powertrain_build/unit_configs.py +419 -419
  115. powertrain_build/user_defined_types.py +660 -660
  116. powertrain_build/versioncheck.py +66 -66
  117. powertrain_build/wrapper.py +512 -512
  118. powertrain_build/xlrd_csv.py +87 -87
  119. powertrain_build/zone_controller/__init__.py +4 -4
  120. powertrain_build/zone_controller/calibration.py +176 -176
  121. powertrain_build/zone_controller/composition_yaml.py +880 -878
  122. {powertrain_build-1.13.1.dist-info → powertrain_build-1.13.3.dev3.dist-info}/METADATA +100 -100
  123. powertrain_build-1.13.3.dev3.dist-info/RECORD +130 -0
  124. {powertrain_build-1.13.1.dist-info → powertrain_build-1.13.3.dev3.dist-info}/WHEEL +1 -1
  125. {powertrain_build-1.13.1.dist-info → powertrain_build-1.13.3.dev3.dist-info}/licenses/LICENSE +202 -202
  126. powertrain_build-1.13.3.dev3.dist-info/pbr.json +1 -0
  127. powertrain_build-1.13.1.dist-info/RECORD +0 -130
  128. powertrain_build-1.13.1.dist-info/pbr.json +0 -1
  129. {powertrain_build-1.13.1.dist-info → powertrain_build-1.13.3.dev3.dist-info}/entry_points.txt +0 -0
  130. {powertrain_build-1.13.1.dist-info → powertrain_build-1.13.3.dev3.dist-info}/licenses/AUTHORS +0 -0
  131. {powertrain_build-1.13.1.dist-info → powertrain_build-1.13.3.dev3.dist-info}/licenses/NOTICE +0 -0
  132. {powertrain_build-1.13.1.dist-info → powertrain_build-1.13.3.dev3.dist-info}/top_level.txt +0 -0
@@ -1,58 +1,58 @@
1
- % Copyright 2024 Volvo Car Corporation
2
- % Licensed under Apache 2.0.
3
-
4
- function outport = getDefOutport(startBlock)
5
- %% Find the blocks where the lowest level outport for the defining block
6
- tmpSrcBlock=getSrcBlocks(startBlock);
7
- tmpPort=get_param(getSrcLines(startBlock), 'srcporthandle');
8
- outport = -1;
9
- while 1
10
- %% If multiple links were found
11
- tmpH=getDstBlockHandles(tmpSrcBlock, tmpPort);
12
- if length(tmpH) > 1
13
- break
14
-
15
- %% If the block is a inport, but not a TL-port
16
- elseif strcmp(get_param(tmpSrcBlock, 'blocktype'), 'Inport') && ...
17
- isempty(get_param(tmpSrcBlock,'MaskType'))
18
- tmp=get_param(get_param(tmpSrcBlock, 'parent'), 'linehandles');
19
- tmpPort=get_param(tmp.Inport(str2num(get_param(tmpSrcBlock, 'port'))), 'srcporthandle');
20
- tmpSrcBlock=get_param(tmp.Inport(str2num(get_param(tmpSrcBlock, 'port'))), 'srcblockhandle');
21
-
22
- %% If the block is a From-block
23
- elseif strcmp(get_param(tmpSrcBlock, 'blocktype'), 'From')
24
- goto=find_system(get_param(tmpSrcBlock,'parent'), 'lookundermasks', ...
25
- 'on','searchdepth',1,'blocktype','Goto','GotoTag', ...
26
- get_param(tmpSrcBlock,'GotoTag'));
27
- tmp=get_param(goto{1},'linehandles');
28
- tmpPort=get_param(tmp.Inport,'srcporthandle');
29
- tmpSrcBlock=get_param(tmp.Inport,'srcblockhandle');
30
-
31
- %% If subsystem
32
- elseif strcmp(get_param(tmpSrcBlock,'blocktype'),'SubSystem')
33
- % Don't move outports inside library blocks
34
- if ~isempty(get_param(tmpSrcBlock, 'MaskType')) &&...
35
- (strncmp(get_param(tmpSrcBlock, 'MaskType'), 'VCC_', 4) ||...
36
- strncmp(get_param(tmpSrcBlock, 'MaskType'), 'TL_', 3))
37
- break
38
- end
39
-
40
- outport=find_system(tmpSrcBlock,'lookundermasks','on','searchdepth',1, ...
41
- 'blocktype','Outport','port', ...
42
- num2str(get(tmpPort,'PortNumber')));
43
- tmpPort=get_param(getSrcLines(outport),'srcporthandle');
44
- tmpSrcBlock=getSrcBlocks(outport);
45
- else
46
- break
47
- end
48
- end
49
- end
50
-
51
- function dstBlocks = getDstBlockHandles(block, port)
52
- dstBlocks=[];
53
- tmp=get_param(block,'linehandles');
54
- tmpNum=get_param(port,'PortNumber');
55
- if isfield(tmp,'Outport')
56
- dstBlocks = get_param(tmp.Outport(tmpNum),'dstblockhandle');
57
- end
58
- end
1
+ % Copyright 2024 Volvo Car Corporation
2
+ % Licensed under Apache 2.0.
3
+
4
+ function outport = getDefOutport(startBlock)
5
+ %% Find the blocks where the lowest level outport for the defining block
6
+ tmpSrcBlock=getSrcBlocks(startBlock);
7
+ tmpPort=get_param(getSrcLines(startBlock), 'srcporthandle');
8
+ outport = -1;
9
+ while 1
10
+ %% If multiple links were found
11
+ tmpH=getDstBlockHandles(tmpSrcBlock, tmpPort);
12
+ if length(tmpH) > 1
13
+ break
14
+
15
+ %% If the block is a inport, but not a TL-port
16
+ elseif strcmp(get_param(tmpSrcBlock, 'blocktype'), 'Inport') && ...
17
+ isempty(get_param(tmpSrcBlock,'MaskType'))
18
+ tmp=get_param(get_param(tmpSrcBlock, 'parent'), 'linehandles');
19
+ tmpPort=get_param(tmp.Inport(str2num(get_param(tmpSrcBlock, 'port'))), 'srcporthandle');
20
+ tmpSrcBlock=get_param(tmp.Inport(str2num(get_param(tmpSrcBlock, 'port'))), 'srcblockhandle');
21
+
22
+ %% If the block is a From-block
23
+ elseif strcmp(get_param(tmpSrcBlock, 'blocktype'), 'From')
24
+ goto=find_system(get_param(tmpSrcBlock,'parent'), 'lookundermasks', ...
25
+ 'on','searchdepth',1,'blocktype','Goto','GotoTag', ...
26
+ get_param(tmpSrcBlock,'GotoTag'));
27
+ tmp=get_param(goto{1},'linehandles');
28
+ tmpPort=get_param(tmp.Inport,'srcporthandle');
29
+ tmpSrcBlock=get_param(tmp.Inport,'srcblockhandle');
30
+
31
+ %% If subsystem
32
+ elseif strcmp(get_param(tmpSrcBlock,'blocktype'),'SubSystem')
33
+ % Don't move outports inside library blocks
34
+ if ~isempty(get_param(tmpSrcBlock, 'MaskType')) &&...
35
+ (strncmp(get_param(tmpSrcBlock, 'MaskType'), 'VCC_', 4) ||...
36
+ strncmp(get_param(tmpSrcBlock, 'MaskType'), 'TL_', 3))
37
+ break
38
+ end
39
+
40
+ outport=find_system(tmpSrcBlock,'lookundermasks','on','searchdepth',1, ...
41
+ 'blocktype','Outport','port', ...
42
+ num2str(get(tmpPort,'PortNumber')));
43
+ tmpPort=get_param(getSrcLines(outport),'srcporthandle');
44
+ tmpSrcBlock=getSrcBlocks(outport);
45
+ else
46
+ break
47
+ end
48
+ end
49
+ end
50
+
51
+ function dstBlocks = getDstBlockHandles(block, port)
52
+ dstBlocks=[];
53
+ tmp=get_param(block,'linehandles');
54
+ tmpNum=get_param(port,'PortNumber');
55
+ if isfield(tmp,'Outport')
56
+ dstBlocks = get_param(tmp.Outport(tmpNum),'dstblockhandle');
57
+ end
58
+ end
@@ -1,19 +1,19 @@
1
- % Copyright 2024 Volvo Car Corporation
2
- % Licensed under Apache 2.0.
3
-
4
- function dstBlocks = getDstBlocks(block)
5
- %% Find the blocks where the input variables are defined
6
-
7
- dstBlocks=[];
8
- tmp=get_param(block,'linehandles');
9
-
10
- if isfield(tmp,'Outport')
11
- for i=1:length(tmp.Outport)
12
- if tmp.Outport(i)<0
13
- dstBlocks(i)=-1;
14
- else
15
- dstBlocks = [dstBlocks; get_param(tmp.Outport(i),'dstblockhandle')];
16
- end
17
- end
18
- end
19
- end
1
+ % Copyright 2024 Volvo Car Corporation
2
+ % Licensed under Apache 2.0.
3
+
4
+ function dstBlocks = getDstBlocks(block)
5
+ %% Find the blocks where the input variables are defined
6
+
7
+ dstBlocks=[];
8
+ tmp=get_param(block,'linehandles');
9
+
10
+ if isfield(tmp,'Outport')
11
+ for i=1:length(tmp.Outport)
12
+ if tmp.Outport(i)<0
13
+ dstBlocks(i)=-1;
14
+ else
15
+ dstBlocks = [dstBlocks; get_param(tmp.Outport(i),'dstblockhandle')];
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,13 +1,13 @@
1
- % Copyright 2024 Volvo Car Corporation
2
- % Licensed under Apache 2.0.
3
-
4
- function dstLines = getDstLines(Block)
5
-
6
- tmp=get_param(Block,'linehandles');
7
-
8
- if isfield(tmp,'Outport')
9
- dstLines=tmp.Outport;
10
- else
11
- dstLines=[];
12
- end
13
- end
1
+ % Copyright 2024 Volvo Car Corporation
2
+ % Licensed under Apache 2.0.
3
+
4
+ function dstLines = getDstLines(Block)
5
+
6
+ tmp=get_param(Block,'linehandles');
7
+
8
+ if isfield(tmp,'Outport')
9
+ dstLines=tmp.Outport;
10
+ else
11
+ dstLines=[];
12
+ end
13
+ end
@@ -1,37 +1,37 @@
1
- % Copyright 2024 Volvo Car Corporation
2
- % Licensed under Apache 2.0.
3
-
4
- function interfaceSignals = getInterfaceSignals(rootFolder)
5
- activeInterfaceFiles = dir([rootFolder '/Projects/*/Config/ActiveInterfaces/*Output.csv']);
6
- disp('Reading active interface files');
7
- signalNameColumn = 2;
8
- signalMinColumn = 5;
9
- signalMaxColumn = 6;
10
- signalInitValueColumn = 9;
11
- signals = [];
12
- minimums = [];
13
- maximums = [];
14
- values = [];
15
-
16
- for fileIndex = 1:length(activeInterfaceFiles)
17
- interfaceFile = activeInterfaceFiles(fileIndex, :);
18
- filePath = fullfile(interfaceFile.folder, interfaceFile.name);
19
- disp(['Reading:' filePath])
20
- options = detectImportOptions(filePath);
21
- options.LineEnding = {'\r\n'};
22
- csvContent = readtable(filePath, options);
23
- signals = [signals; csvContent{:, signalNameColumn}];
24
- minimums = [minimums; csvContent{:, signalMinColumn}];
25
- maximums = [maximums; csvContent{:, signalMaxColumn}];
26
- values = [values; csvContent{:, signalInitValueColumn}];
27
- % Remove duplicate signals, hopefully, the initial values were the same...
28
- [signals, indices] = unique(signals, 'stable');
29
- minimums = minimums(indices);
30
- maximums = maximums(indices);
31
- values = values(indices);
32
- end
33
-
34
- replaceNaNs = isnan(values);
35
- values(replaceNaNs) = 0;
36
- interfaceSignals = horzcat(signals, num2cell(minimums), num2cell(maximums), num2cell(values));
37
- end
1
+ % Copyright 2024 Volvo Car Corporation
2
+ % Licensed under Apache 2.0.
3
+
4
+ function interfaceSignals = getInterfaceSignals(rootFolder)
5
+ activeInterfaceFiles = dir([rootFolder '/Projects/*/Config/ActiveInterfaces/*Output.csv']);
6
+ disp('Reading active interface files');
7
+ signalNameColumn = 2;
8
+ signalMinColumn = 5;
9
+ signalMaxColumn = 6;
10
+ signalInitValueColumn = 9;
11
+ signals = [];
12
+ minimums = [];
13
+ maximums = [];
14
+ values = [];
15
+
16
+ for fileIndex = 1:length(activeInterfaceFiles)
17
+ interfaceFile = activeInterfaceFiles(fileIndex, :);
18
+ filePath = fullfile(interfaceFile.folder, interfaceFile.name);
19
+ disp(['Reading:' filePath])
20
+ options = detectImportOptions(filePath);
21
+ options.LineEnding = {'\r\n'};
22
+ csvContent = readtable(filePath, options);
23
+ signals = [signals; csvContent{:, signalNameColumn}];
24
+ minimums = [minimums; csvContent{:, signalMinColumn}];
25
+ maximums = [maximums; csvContent{:, signalMaxColumn}];
26
+ values = [values; csvContent{:, signalInitValueColumn}];
27
+ % Remove duplicate signals, hopefully, the initial values were the same...
28
+ [signals, indices] = unique(signals, 'stable');
29
+ minimums = minimums(indices);
30
+ maximums = maximums(indices);
31
+ values = values(indices);
32
+ end
33
+
34
+ replaceNaNs = isnan(values);
35
+ values(replaceNaNs) = 0;
36
+ interfaceSignals = horzcat(signals, num2cell(minimums), num2cell(maximums), num2cell(values));
37
+ end
@@ -1,37 +1,37 @@
1
- % Copyright 2024 Volvo Car Corporation
2
- % Licensed under Apache 2.0.
3
-
4
- function macro = getName(handle, macro)
5
-
6
- if nargin == 1
7
- macro = tl_get(handle, 'output.name');
8
- end
9
- tmp_system = get_param(handle, 'Parent');
10
- idx = strfind(tmp_system, '/');
11
- TLSystem = tmp_system(1:idx(1)-1);
12
- if ~isempty(strfind(macro,'$L'))
13
- %get_param(Handle,'masktype')
14
- if ismember(get_param(handle,'masktype'),{'TL_Outport', 'TL_BusOutport'})
15
- line=getSrcLines(handle);
16
- lineName=get(line,'name');
17
- if isempty(lineName)
18
- lineName=get(get(line,'SrcPortHandle'),'PropagatedSignals');
19
- end
20
- macro=strrep(macro,'$L',lineName);
21
- else
22
- macro=strrep(macro,'$L',get(getDstLines(handle),'name'));
23
- end
24
- end
25
-
26
- if ~isempty(strfind(macro,'$N'))
27
- macro=strrep(macro,'$N',TLSystem);
28
- end
29
- if ~isempty(strfind(macro,'$B'))
30
- macro=strrep(macro,'$B',get_param(handle,'name'));
31
- end
32
- if ~isempty(strfind(macro,'$S'))
33
- parent=get_param(handle,'Parent');
34
- backslash=strfind(parent,'/');
35
- macro=strrep(macro,'$S',parent(backslash(end)+1:end));
36
- end
37
- end
1
+ % Copyright 2024 Volvo Car Corporation
2
+ % Licensed under Apache 2.0.
3
+
4
+ function macro = getName(handle, macro)
5
+
6
+ if nargin == 1
7
+ macro = tl_get(handle, 'output.name');
8
+ end
9
+ tmp_system = get_param(handle, 'Parent');
10
+ idx = strfind(tmp_system, '/');
11
+ TLSystem = tmp_system(1:idx(1)-1);
12
+ if ~isempty(strfind(macro,'$L'))
13
+ %get_param(Handle,'masktype')
14
+ if ismember(get_param(handle,'masktype'),{'TL_Outport', 'TL_BusOutport'})
15
+ line=getSrcLines(handle);
16
+ lineName=get(line,'name');
17
+ if isempty(lineName)
18
+ lineName=get(get(line,'SrcPortHandle'),'PropagatedSignals');
19
+ end
20
+ macro=strrep(macro,'$L',lineName);
21
+ else
22
+ macro=strrep(macro,'$L',get(getDstLines(handle),'name'));
23
+ end
24
+ end
25
+
26
+ if ~isempty(strfind(macro,'$N'))
27
+ macro=strrep(macro,'$N',TLSystem);
28
+ end
29
+ if ~isempty(strfind(macro,'$B'))
30
+ macro=strrep(macro,'$B',get_param(handle,'name'));
31
+ end
32
+ if ~isempty(strfind(macro,'$S'))
33
+ parent=get_param(handle,'Parent');
34
+ backslash=strfind(parent,'/');
35
+ macro=strrep(macro,'$S',parent(backslash(end)+1:end));
36
+ end
37
+ end
@@ -1,6 +1,6 @@
1
- % Copyright 2024 Volvo Car Corporation
2
- % Licensed under Apache 2.0.
3
-
4
- function path = getPath(handle)
5
- path=[get_param(handle,'parent') '/' get_param(handle,'name')];
6
- end
1
+ % Copyright 2024 Volvo Car Corporation
2
+ % Licensed under Apache 2.0.
3
+
4
+ function path = getPath(handle)
5
+ path=[get_param(handle,'parent') '/' get_param(handle,'name')];
6
+ end
@@ -1,21 +1,21 @@
1
- % Copyright 2024 Volvo Car Corporation
2
- % Licensed under Apache 2.0.
3
-
4
- function jsonValue = getProperValue(tlPort, tlValue)
5
- %GETPROPERVALUE Get a value fitting for a json file, given a TL property
6
- %value.
7
- if strcmp(tlValue, 'IMPLICIT_ENUM')
8
- tlValue = getEnumName(tlPort);
9
- end
10
-
11
- if ischar(tlValue)
12
- jsonValue = tlValue;
13
- elseif isempty(tlValue)
14
- jsonValue = '-';
15
- else
16
- jsonValue = tlValue(1);
17
- if isnan(jsonValue)
18
- jsonValue = '-';
19
- end
20
- end
21
- end
1
+ % Copyright 2024 Volvo Car Corporation
2
+ % Licensed under Apache 2.0.
3
+
4
+ function jsonValue = getProperValue(tlPort, tlValue)
5
+ %GETPROPERVALUE Get a value fitting for a json file, given a TL property
6
+ %value.
7
+ if strcmp(tlValue, 'IMPLICIT_ENUM')
8
+ tlValue = getEnumName(tlPort);
9
+ end
10
+
11
+ if ischar(tlValue)
12
+ jsonValue = tlValue;
13
+ elseif isempty(tlValue)
14
+ jsonValue = '-';
15
+ else
16
+ jsonValue = tlValue(1);
17
+ if isnan(jsonValue)
18
+ jsonValue = '-';
19
+ end
20
+ end
21
+ end
@@ -1,19 +1,19 @@
1
- % Copyright 2024 Volvo Car Corporation
2
- % Licensed under Apache 2.0.
3
-
4
- function srcBlocks = getSrcBlocks(block)
5
-
6
- srcBlocks=[];
7
- tmp=get_param(block,'linehandles');
8
-
9
- if isfield(tmp,'Inport')
10
- srcBlocks=zeros(size(tmp.Inport));
11
- for i=1:length(tmp.Inport)
12
- if tmp.Inport(i)<0
13
- srcBlocks(i)=-1;
14
- else
15
- srcBlocks(i)=get_param(tmp.Inport(i),'srcblockhandle');
16
- end
17
- end
18
- end
19
- end
1
+ % Copyright 2024 Volvo Car Corporation
2
+ % Licensed under Apache 2.0.
3
+
4
+ function srcBlocks = getSrcBlocks(block)
5
+
6
+ srcBlocks=[];
7
+ tmp=get_param(block,'linehandles');
8
+
9
+ if isfield(tmp,'Inport')
10
+ srcBlocks=zeros(size(tmp.Inport));
11
+ for i=1:length(tmp.Inport)
12
+ if tmp.Inport(i)<0
13
+ srcBlocks(i)=-1;
14
+ else
15
+ srcBlocks(i)=get_param(tmp.Inport(i),'srcblockhandle');
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,13 +1,13 @@
1
- % Copyright 2024 Volvo Car Corporation
2
- % Licensed under Apache 2.0.
3
-
4
- function srcLines = getSrcLines(block)
5
-
6
- tmp=get_param(block,'linehandles');
7
-
8
- if isfield(tmp,'Inport')
9
- srcLines=tmp.Inport;
10
- else
11
- srcLines=[];
12
- end
13
- end
1
+ % Copyright 2024 Volvo Car Corporation
2
+ % Licensed under Apache 2.0.
3
+
4
+ function srcLines = getSrcLines(block)
5
+
6
+ tmp=get_param(block,'linehandles');
7
+
8
+ if isfield(tmp,'Inport')
9
+ srcLines=tmp.Inport;
10
+ else
11
+ srcLines=[];
12
+ end
13
+ end
@@ -1,10 +1,10 @@
1
- % Copyright 2024 Volvo Car Corporation
2
- % Licensed under Apache 2.0.
3
-
4
- function loadLibraries(root_folder)
5
- block_libraries = dir(fullfile(root_folder, '**/*.slx'));
6
- for i=1:length(block_libraries)
7
- block_library = block_libraries(i);
8
- load_system(block_library.name);
9
- end
10
- end
1
+ % Copyright 2024 Volvo Car Corporation
2
+ % Licensed under Apache 2.0.
3
+
4
+ function loadLibraries(root_folder)
5
+ block_libraries = dir(fullfile(root_folder, '**/*.slx'));
6
+ for i=1:length(block_libraries)
7
+ block_library = block_libraries(i);
8
+ load_system(block_library.name);
9
+ end
10
+ end
@@ -1,6 +1,6 @@
1
- % Copyright 2024 Volvo Car Corporation
2
- % Licensed under Apache 2.0.
3
-
4
- function A = loadjson(filename)
5
- A = jsondecode(fileread(filename));
6
- end
1
+ % Copyright 2024 Volvo Car Corporation
2
+ % Licensed under Apache 2.0.
3
+
4
+ function A = loadjson(filename)
5
+ A = jsondecode(fileread(filename));
6
+ end
@@ -1,21 +1,21 @@
1
- % Copyright 2024 Volvo Car Corporation
2
- % Licensed under Apache 2.0.
3
-
4
- function outStruct = modifyEnumStructField(inStruct)
5
- % MODIFYENUMSTRUCTFIELD Update a given struct with data based on type.
6
- % If the given struct contains enumeration data, insert default value.
7
- % If not, remove the default field if present.
8
- %
9
- % NOTE: Used in parse*Ports/parseCalMeasData where "instruct" is
10
- % created outside and then rewritten inside a for-loop.
11
- % Only enum variables should have the default field.
12
- %
13
- % See also parseInPorts, parseOutPorts, parseCalMeasData.
14
- tmpEnum = enumeration(inStruct.type);
15
- if ~isempty(tmpEnum)
16
- inStruct.default = char(tmpEnum.getDefaultValue());
17
- elseif isfield(inStruct, 'default')
18
- inStruct = rmfield(inStruct, 'default');
19
- end
20
- outStruct = inStruct;
21
- end
1
+ % Copyright 2024 Volvo Car Corporation
2
+ % Licensed under Apache 2.0.
3
+
4
+ function outStruct = modifyEnumStructField(inStruct)
5
+ % MODIFYENUMSTRUCTFIELD Update a given struct with data based on type.
6
+ % If the given struct contains enumeration data, insert default value.
7
+ % If not, remove the default field if present.
8
+ %
9
+ % NOTE: Used in parse*Ports/parseCalMeasData where "instruct" is
10
+ % created outside and then rewritten inside a for-loop.
11
+ % Only enum variables should have the default field.
12
+ %
13
+ % See also parseInPorts, parseOutPorts, parseCalMeasData.
14
+ tmpEnum = enumeration(inStruct.type);
15
+ if ~isempty(tmpEnum)
16
+ inStruct.default = char(tmpEnum.getDefaultValue());
17
+ elseif isfield(inStruct, 'default')
18
+ inStruct = rmfield(inStruct, 'default');
19
+ end
20
+ outStruct = inStruct;
21
+ end
@@ -1,32 +1,32 @@
1
- % Copyright 2024 Volvo Car Corporation
2
- % Licensed under Apache 2.0.
3
-
4
- function out = removeConfigDuplicates(config)
5
- %Take a cell array with configs an return
6
- %a config cell array without duplicates
7
-
8
- confs = {};
9
- lenConfig = length(config);
10
- j=1;
11
- for i=1:lenConfig
12
- if ~checkIfDefined(config{i},confs)
13
- confs{j} = config{i};
14
- j=j+1;
15
- end
16
- end
17
- out = confs;
18
- end
19
-
20
- function def = checkIfDefined(cellArr, inCellArrArr)
21
- % Check if cell array is defined within an array of cell arrays
22
- def = 0;
23
- for i=1:length(inCellArrArr)
24
- lenCellArr = length(cellArr);
25
- if lenCellArr == length(inCellArrArr{i})
26
- if sum(strcmp(sort(cellArr),sort(inCellArrArr{i}))) == lenCellArr
27
- def = 1;
28
- return
29
- end
30
- end
31
- end
1
+ % Copyright 2024 Volvo Car Corporation
2
+ % Licensed under Apache 2.0.
3
+
4
+ function out = removeConfigDuplicates(config)
5
+ %Take a cell array with configs an return
6
+ %a config cell array without duplicates
7
+
8
+ confs = {};
9
+ lenConfig = length(config);
10
+ j=1;
11
+ for i=1:lenConfig
12
+ if ~checkIfDefined(config{i},confs)
13
+ confs{j} = config{i};
14
+ j=j+1;
15
+ end
16
+ end
17
+ out = confs;
18
+ end
19
+
20
+ function def = checkIfDefined(cellArr, inCellArrArr)
21
+ % Check if cell array is defined within an array of cell arrays
22
+ def = 0;
23
+ for i=1:length(inCellArrArr)
24
+ lenCellArr = length(cellArr);
25
+ if lenCellArr == length(inCellArrArr{i})
26
+ if sum(strcmp(sort(cellArr),sort(inCellArrArr{i}))) == lenCellArr
27
+ def = 1;
28
+ return
29
+ end
30
+ end
31
+ end
32
32
  end
@@ -1,26 +1,26 @@
1
- % Copyright 2024 Volvo Car Corporation
2
- % Licensed under Apache 2.0.
3
-
4
- function classSortedBlocks = sortSystemByClass(system)
5
- classes={'CVC_DISP'; 'CVC_CAL'};
6
- classSortedBlocks=struct;
7
- for i=1:length(classes)
8
- classSortedBlocks.(classes{i}) = [];
9
- end
10
-
11
- %TODO: this parsing is not that nice, as it will find combinations of class
12
- %suffixes, which does not exist.
13
- blksWithType = find_system(system, 'FindAll', 'on', 'lookundermasks', 'on', 'regexp', 'on', ...
14
- 'masktype', 'TL(?!_PreProcessorIf|_MilHandler|_Enable|_SimFrame|_MainDialog|_Function|_StateflowLogger|_StateflowLoggingMain|_ToolSelector|_AddFile|_DummyTrigger|_DataStoreRead|_DataStoreWrite|_CustomCode|SAMPLES_BW_LOGICAL_OPERATOR|SAMPLES_ROUNDING_FUNCTION|SAMPLES_16BIT_DECODER|SAMPLES_16BIT_ENCODER).*', 'data', '.*?''output''\,.*?');
15
- classWithType= tl_get(blksWithType, 'output.class');
16
- if ~isempty(classWithType)
17
- for i=1:length(classes)
18
- class = classes{i};
19
- filter_tmp = regexp(classWithType,['(?:ASIL_[ABCD]/){0,1}' class '(?:_MERGEABLE|_BURAM)?' '(?:_ASIL_[ABCD]){0,1}' '$']);
20
- if ~isempty(filter_tmp)
21
- filter = cellfun(@(c)~isempty(c), filter_tmp);
22
- classSortedBlocks.(classes{i}) = blksWithType(filter);
23
- end
24
- end
25
- end
26
- end
1
+ % Copyright 2024 Volvo Car Corporation
2
+ % Licensed under Apache 2.0.
3
+
4
+ function classSortedBlocks = sortSystemByClass(system)
5
+ classes={'CVC_DISP'; 'CVC_CAL'};
6
+ classSortedBlocks=struct;
7
+ for i=1:length(classes)
8
+ classSortedBlocks.(classes{i}) = [];
9
+ end
10
+
11
+ %TODO: this parsing is not that nice, as it will find combinations of class
12
+ %suffixes, which does not exist.
13
+ blksWithType = find_system(system, 'FindAll', 'on', 'lookundermasks', 'on', 'regexp', 'on', ...
14
+ 'masktype', 'TL(?!_PreProcessorIf|_MilHandler|_Enable|_SimFrame|_MainDialog|_Function|_StateflowLogger|_StateflowLoggingMain|_ToolSelector|_AddFile|_DummyTrigger|_DataStoreRead|_DataStoreWrite|_CustomCode|SAMPLES_BW_LOGICAL_OPERATOR|SAMPLES_ROUNDING_FUNCTION|SAMPLES_16BIT_DECODER|SAMPLES_16BIT_ENCODER).*', 'data', '.*?''output''\,.*?');
15
+ classWithType= tl_get(blksWithType, 'output.class');
16
+ if ~isempty(classWithType)
17
+ for i=1:length(classes)
18
+ class = classes{i};
19
+ filter_tmp = regexp(classWithType,['(?:ASIL_[ABCD]/){0,1}' class '(?:_MERGEABLE|_BURAM)?' '(?:_ASIL_[ABCD]){0,1}' '$']);
20
+ if ~isempty(filter_tmp)
21
+ filter = cellfun(@(c)~isempty(c), filter_tmp);
22
+ classSortedBlocks.(classes{i}) = blksWithType(filter);
23
+ end
24
+ end
25
+ end
26
+ end