a b/edit3_Callback.m
1
% This function decides the value of static text which hold info about
2
% maximum of Threshold
3
function edit3_Callback(hObject, eventdata, handles)
4
    % hObject    handle to edit3 (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 edit3 as text
9
    %        str2double(get(hObject,'String')) returns contents of edit3 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.Min_threshold 
17
            handles.Max_threshold = Val;
18
            handles.Message_Bar.String = sprintf('Maximum Threshold Updated to %3d', handles.Max_threshold);
19
        else
20
            handles.Message_Bar.String = sprintf('Maximum Threshold cannot be less than Minimum threshold');
21
        end
22
    else
23
        handles.Message_Bar.String = 'Please use a number for Maximum Threshold';
24
    end
25
    
26
    % Display the latest value
27
    hObject.String = handles.Max_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
end