⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scan_mode.asv

📁 利用ccs环境、MATLAB环境、DSP(TMS320F2812)、被测对象和Agilient网络分析仪E5071B
💻 ASV
📖 第 1 页 / 共 2 页
字号:
        set(handles.step1,'visible','off');

        set(handles.start2,'visible','on');
        set(handles.start2,'string',pha_min);
        set(handles.end2,'visible','on');
        set(handles.end2,'string',pha_max);
        set(handles.step2,'visible','on');  
        set(handles.step2,'string','5');
    case 'mode3'
        model_num=3;
         set(handles.amp,'visible','off');
        set(handles.amp_slider,'visible','off');
        set(handles.pha,'visible','on');
        set(handles.pha,'string',pha_min);
        set(handles.pha_slider,'visible','on');
        % Text: start end step 
        set(handles.str1,'visible','on');
        set(handles.str2,'visible','on');
        set(handles.str3,'visible','on');
 
        set(handles.str4,'visible','off');
        set(handles.str5,'visible','off');
        set(handles.str6,'visible','off');
        
        % edit: start end step
        set(handles.start1,'visible','on');
        set(handles.start1,'string',amp_min);
        set(handles.end1,'visible','on');
        set(handles.end1,'string',amp_max);
        set(handles.step1,'visible','on');
        set(handles.step1,'string','0.5');

        set(handles.start2,'visible','off');
        set(handles.end2,'visible','off');
        set(handles.step2,'visible','off');         
    case 'mode4'
        model_num=4;
        set(handles.amp,'visible','off');
        set(handles.amp_slider,'visible','off');
        set(handles.pha,'visible','off');
        set(handles.pha_slider,'visible','off');
        % Text: start end step 
        set(handles.str1,'visible','on');
        set(handles.str2,'visible','on');
        set(handles.str3,'visible','on');
 
        set(handles.str4,'visible','on');
        set(handles.str5,'visible','on');
        set(handles.str6,'visible','on');
        
        % edit: start end step
        set(handles.start1,'visible','on');
        set(handles.start1,'string',amp_min);
        set(handles.end1,'visible','on');
        set(handles.end1,'string',amp_max);
        set(handles.step1,'visible','on');
        set(handles.step1,'string','0.5');

        set(handles.start2,'visible','on');
        set(handles.start2,'string',pha_min);
        set(handles.end2,'visible','on');
        set(handles.end2,'string',pha_max);
        set(handles.step2,'visible','on');  
        set(handles.step2,'string','5');        
    otherwise
        
        % Code for when there is no match.
end




% --- Executes on slider movement.
function amp_slider_Callback(hObject, eventdata, handles)
% hObject    handle to amp_slider (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
global amp_min amp_max pha_max pha_min
slider_value = get(hObject,'Value');
var=slider_value*(amp_max-amp_min)+amp_min;
set(handles.amp,'string',var);




function start1_Callback(hObject, eventdata, handles)
% hObject    handle to start1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of start1 as text
%        str2double(get(hObject,'String')) returns contents of start1 as a double
global amp_min amp_max pha_max pha_min
user_entry = str2double(get(hObject,'string'));
if isnan(user_entry) | user_entry>amp_max |user_entry<amp_min
    errordlg('You must enter a numeric value','Bad Input','modal');
    set(hObject,'string',amp_min);
    return
end

% --- Executes during object creation, after setting all properties.
function start1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to start1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit4_Callback(hObject, eventdata, handles)
% hObject    handle to edit4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit4 as text
%        str2double(get(hObject,'String')) returns contents of edit4 as a double


% --- Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function step1_Callback(hObject, eventdata, handles)
% hObject    handle to step1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of step1 as text
%        str2double(get(hObject,'String')) returns contents of step1 as a double
user_entry = str2double(get(hObject,'string'));
if isnan(user_entry) |user_entry<0.1
    errordlg('You must enter a numeric value','Bad Input','modal');
    set(hObject,'string','0.1');
    return
end

% --- Executes during object creation, after setting all properties.
function step1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to step1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function start2_Callback(hObject, eventdata, handles)
% hObject    handle to start2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of start2 as text
%        str2double(get(hObject,'String')) returns contents of start2 as a double
global amp_min amp_max pha_max pha_min
user_entry = str2double(get(hObject,'string'));
if isnan(user_entry) | user_entry>pha_max |user_entry<pha_min
    errordlg('You must enter a numeric value','Bad Input','modal');
    set(hObject,'string',pha_min);
    return
end

% --- Executes during object creation, after setting all properties.
function start2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to start2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function end2_Callback(hObject, eventdata, handles)
% hObject    handle to end2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of end2 as text
%        str2double(get(hObject,'String')) returns contents of end2 as a double
global amp_min amp_max pha_max pha_min
user_entry = str2double(get(hObject,'string'));
if isnan(user_entry) | user_entry>pha_max |user_entry<pha_min
    errordlg('You must enter a numeric value','Bad Input','modal');
    set(hObject,'string',pha_max);
    return
end

% --- Executes during object creation, after setting all properties.
function end2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to end2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function step2_Callback(hObject, eventdata, handles)
% hObject    handle to step2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of step2 as text
%        str2double(get(hObject,'String')) returns contents of step2 as a double
global amp_min amp_max pha_max pha_min
user_entry = str2double(get(hObject,'string'));
if isnan(user_entry) | user_entry>pha_max |user_entry<0.5
    errordlg('You must enter a numeric value','Bad Input','modal');
    set(hObject,'string','1');
    return
end

% --- Executes during object creation, after setting all properties.
function step2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to step2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end





function end1_Callback(hObject, eventdata, handles)
% hObject    handle to end1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of end1 as text
%        str2double(get(hObject,'String')) returns contents of end1 as a double
global amp_min amp_max pha_max pha_min
user_entry = str2double(get(hObject,'string'));
if isnan(user_entry) | user_entry>amp_max |user_entry<amp_min
    errordlg('You must enter a numeric value','Bad Input','modal');
    set(hObject,'string',amp_min);
    return
end



% --- Executes during object creation, after setting all properties.
function uipanel2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to uipanel2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called




% --- If Enable == 'on', executes on mouse press in 5 pixel border.
% --- Otherwise, executes on mouse press in 5 pixel border or over amp_slider.
function amp_slider_ButtonDownFcn(hObject, eventdata, handles)
% hObject    handle to amp_slider (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
slider_value = get(hObject,'Value');
var=slider_value-20;
set(handles.amp,'string',num2str(var));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -