1234567891011121314151617181920212223242526272829303132333435 |
- function [Type, Name, Column] = SelectConnection(tag, map)
- %GET_CONNECTION 读取信号连接信息
- % type为信号连接类型:
- % 's'-连接至软件注入点
- % 'p'-连接至物理注入点
- % 'v'-连接至变量
- % 'a'-连接至数组
- % 'n'-无效连接
- Type = 'n';
- Name = '';
- Column = 0;
- for i = 1:length(map)
- if strcmp(tag, map(i).from)
- if isa(map(i).to, 'char')
- Type = 'v';
- Name = map(i).to;
- elseif isa(map(i).to, 'struct')
- if strcmp(map(i).to.type, 'port')
- if strcmp(map(i).to.spec, 'software')
- Type = 's';
- Name = map(i).to.channel;
- elseif strcmp(map(i).to.spec, 'physical')
- Type = 'p';
- Name = map(i).to.channel;
- end
- elseif strcmp(map(i).to.type, "array")
- Type = 'a';
- Name = map(i).to.name;
- Column = map(i).to.column;
- end
- end
- break;
- end
- end
|