[81c116]: / edit1_Callback.m

Download this file

36 lines (29 with data), 1.5 kB

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