diff --git a/McuLib/m/customtable.m b/McuLib/m/customtable.m index 94b011f..43ab261 100644 --- a/McuLib/m/customtable.m +++ b/McuLib/m/customtable.m @@ -8,13 +8,13 @@ classdef customtable tableControl = mask.getDialogControl(table_name); tableParameter = mask.getParameter(table_name); nCols = tableControl.getNumberOfColumns; - if nCols > 0 - for i = 1:nCols - tableControl.removeColumn(1); - end - end - column = tableControl.addColumn(Name='Title', Type='edit'); - tableControl.Sortable = 'on'; + % if nCols > 0 + % for i = 1:nCols + % tableControl.removeColumn(1); + % end + % end + % column = tableControl.addColumn(Name='Title', Type='edit'); + % tableControl.Sortable = 'on'; column.Name = tableParameter.Alias; end diff --git a/McuLib/m/editCode.m b/McuLib/m/editCode.m index 5780303..c7388ea 100644 --- a/McuLib/m/editCode.m +++ b/McuLib/m/editCode.m @@ -74,6 +74,7 @@ classdef editCode end % Формируем новую секцию с нужным текстом + % newText = strrep(newText, '\', '\\'); % экранируем для корректной вставки replacement = sprintf('%s START\n%s\n%s END', sectionName, newText, sectionName); % Заменяем всю найденную секцию на новую diff --git a/McuLib/m/mcuMask.m b/McuLib/m/mcuMask.m index d372e8c..da7bd16 100644 --- a/McuLib/m/mcuMask.m +++ b/McuLib/m/mcuMask.m @@ -48,7 +48,7 @@ classdef mcuMask table_names = {'srcTable', 'incTable'}; for k = 1:numel(table_names) table_name = table_names{k}; - % customtable.format(table_name); + customtable.format(table_name); end % запись описания блока textDesc = ['Блок для настройки параметров симуляции микроконтроллера. ' newline ... @@ -178,6 +178,7 @@ classdef mcuMask newBody = get_param(block, 'wrapperCode'); code = fileread(filename); code = regexprep(code, '\r\n?', '\n'); + newBody = strrep(newBody, '\', '\\'); code = editCode.insertSection(code, section, newBody); % else % % Обновляем тело функции diff --git a/McuLib/m/mcuPorts.m b/McuLib/m/mcuPorts.m index 315871e..4135698 100644 --- a/McuLib/m/mcuPorts.m +++ b/McuLib/m/mcuPorts.m @@ -190,10 +190,10 @@ classdef mcuPorts for i = 1:n if i == 1 - lines{end+1} = '#define OFFSET_ARRAY_1 0'; + lines{end+1} = sprintf('#define OFFSET_%s_ARRAY_1 0', upperPrefix); else - lines{end+1} = sprintf('#define OFFSET_ARRAY_%d (OFFSET_ARRAY_%d + %s_PORT_%d_WIDTH)', ... - i, i - 1, upper(portPrefixes{i - 1}), i - 1); + lines{end+1} = sprintf('#define OFFSET_%s_ARRAY_%d (OFFSET_%s_ARRAY_%d + %s_PORT_%d_WIDTH)', ... + upperPrefix, i, upperPrefix, i - 1, upper(portPrefixes{i - 1}), i - 1); end end newAuto = strjoin(lines, newline); @@ -251,7 +251,7 @@ classdef mcuPorts if i == n comma = ''; end - lines{end+1} = sprintf(' OFFSET_ARRAY_%d%s', i, comma); + lines{end+1} = sprintf(' OFFSET_%s_ARRAY_%d%s', upperPrefix, i, comma); end lines{end+1} = '};'; lines{end+1} = ''; diff --git a/McuLib/m/mexing.m b/McuLib/m/mexing.m index 88ff18c..5880b4a 100644 --- a/McuLib/m/mexing.m +++ b/McuLib/m/mexing.m @@ -68,9 +68,6 @@ function res = mexing(compile_mode) config = periphConfig.update_config(blockPath, config); periphConfig.write_config(config); periphConfig.update(blockPath, config); - % Порты S-Function - mcuPorts.write(); - % set_param(gcb, 'consoleOutput', 'Peripheral configuration file loaded. Re-open Block Parameters'); end end diff --git a/McuLib/m/periphConfig.m b/McuLib/m/periphConfig.m index 01e3061..16bd25c 100644 --- a/McuLib/m/periphConfig.m +++ b/McuLib/m/periphConfig.m @@ -399,7 +399,6 @@ classdef periphConfig 'Container', periphName ... ); - param.Alias = def.Def; param.Evaluate = 'off'; if def.NewRow @@ -407,6 +406,7 @@ classdef periphConfig else param.DialogControl.Row = 'current'; end + param.Alias = def.Def; end