function varargout = A_FindUnconScope(varargin)
gui_Singleton = 1;
gui_State = ('gui_Name', mfilename,...
'gui_Singleton', gui_Singleton,...
'gui_OpeningFcn', @A_FindUnconScope_OpeningFcn,...
'gui_OutputFcn', @A_FindUnconScope_OutputFcn,...
'gui_LayoutFcn', [],...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
function A_FindUnconScope_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
guidata(hObject, handles);
function varargout = A_FindUnconScope_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
function ScopeList.Callback(hObject, eventdata, handles)
sel = get(gcf, 'selectiontype');
if strcmp(sel, 'open')
str = get(hObject, 'string');
n = get(hObject, 'value');
hilite_system(str(n));
end
%----Executes on button press in button_looup.
function button_looup_Callback(hObject, eventdata, handles)
% hObject handle to button_looup (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Block_Handle=get_param(find_system(bdroot, 'FollowLinks','on','LookUnderMasks','all'),'Handles');
for i=2:length(Block_Handle)
Block_type=get(Block_Handle{i},'BlockType');
if strcmp(Block_type,'Scope')==0
Block_Handle{i}= '';
end
end
j=1;
for ii=2:length(Block_Handle)
%%Scope_Ports_NumVct=get(Block_Handle{ii},'Ports');
%%Scope_Ports_Num=Scope_Ports_NumVct(1);
if~isempty(Block_Handle{ii})
Scope_Ports_Connect_Struct=get(Block_Handle{ii},'PortConnectivity');
Scope_Ports_Connect_Cell=(struct2cell(Scope_Ports_Connect_Struce))';
ScopeUnconnect=cell2mat(Scope_Ports_Connect_Cell(:,3));
if any(ScopeUnconnect==-1)
AAAA{1,j}=get(Block_Handle{ii},'Path');
AAAA{2,J}=get(Block_Handle{ii},'Name');
AAAA{3,J}=strcat(AAAA(1,j),'/',AAAA(2,j));
j=j+1;
end
end
end
if j>1
for num=1:j-1
AAAAA{num,1}=AAAA{3,num};
end
set (handles.ScopeList,'string',AAAAA);
else
msgbox('无未连接Scope','modal');
end
MATLAB脚本——自动查找未连接的scope
最新推荐文章于 2024-03-10 14:15:19 发布