Diff of /edit1_Callback.m [000000] .. [81c116]

Switch to unified view

a b/edit1_Callback.m
1
% This function decides the value of static text which hold info about
2
% minimum of Threshold
3
function edit1_Callback(hObject, eventdata, handles)
4
    % hObject    handle to edit1 (see GCBO)
5
    % eventdata  reserved - to be defined in a future version of MATLAB
6
    % handles    structure with handles and user data (see GUIDATA)
7
8
    % Hints: get(hObject,'String') returns contents of edit1 as text
9
    %        str2double(get(hObject,'String')) returns contents of edit1 as a double
10
    
11
    % handles.Bmode is false if the input data is Pulsed Doppler data
12
    if( handles.Bmode ~= true ), return; end
13
    
14
    if ~isnan(str2double(hObject.String))
15
        Val = str2double(hObject.String);
16
        if Val < handles.Max_threshold 
17
            handles.Min_threshold = Val;
18
            handles.Message_Bar.String = sprintf('Threshold Updated to %3d', handles.Min_threshold);
19
        else
20
            handles.Message_Bar.String = sprintf('Minimum Threshold cannot be more than Maximum threshold');
21
        end
22
    else
23
        handles.Message_Bar.String = 'Please use a number for Minimum Threshold';
24
    end
25
    
26
    % Display the latest value
27
    hObject.String = handles.Min_threshold;
28
       
29
    % Update the Threshold based on the new end values of the slider, stops any
30
    % running timers, update box locations
31
    script_update_Threshold_and_display;
32
    
33
    % Update handles structure
34
    guidata(hObject, handles);
35
36
end