function varargout = GUI_Glaze_4_Variablen(varargin)
% GUI_GLAZE_4_VARIABLEN MATLAB code for GUI_Glaze_4_Variablen.fig
%      GUI_GLAZE_4_VARIABLEN, by itself, creates a new GUI_GLAZE_4_VARIABLEN or raises the existing
%      singleton*.
%
%      H = GUI_GLAZE_4_VARIABLEN returns the handle to a new GUI_GLAZE_4_VARIABLEN or the handle to
%      the existing singleton*.
%
%      GUI_GLAZE_4_VARIABLEN('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in GUI_GLAZE_4_VARIABLEN.M with the given input arguments.
%
%      GUI_GLAZE_4_VARIABLEN('Property','Value',...) creates a new GUI_GLAZE_4_VARIABLEN or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before GUI_Glaze_4_Variablen_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to GUI_Glaze_4_Variablen_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help GUI_Glaze_4_Variablen

% Last Modified by GUIDE v2.5 12-Jan-2012 18:49:34

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @GUI_Glaze_4_Variablen_OpeningFcn, ...
                   'gui_OutputFcn',  @GUI_Glaze_4_Variablen_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
% End initialization code - DO NOT EDIT


% --- Executes just before GUI_Glaze_4_Variablen is made visible.
function GUI_Glaze_4_Variablen_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to GUI_Glaze_4_Variablen (see VARARGIN)



backgroundImage = importdata('vulkan_Bild.jpg');
%select the axes
axes(handles.Image);
%place image onto the axes
image(backgroundImage);
%remove the axis tick marks
%axis off
% % Choose default command line output for GUI_Glaze_4_Variablen
 handles.output = hObject;
% 
% % Update handles structure
% guidata(hObject, handles);


guidata(hObject, handles);
% UIWAIT makes GUI_Glaze_4_Variablen wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = GUI_Glaze_4_Variablen_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on slider movement.
function sliderVelocity_Callback(hObject, eventdata, handles)
% hObject    handle to sliderVelocity (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
sliderValue=get(handles.sliderVelocity,'Value');        
y=round(sliderValue/50)*50;
set(handles.sliderVelocity,'Value', y);
set(handles.editV,'String',num2str(y)); %editVelocity

guidata(hObject, handles)
% sliderValue=get(handles.sliderVelocity,'Value');     %   slider1 ist der Tag vom slider ------------------------------------------
% y=round(sliderValue)
% set(handles.editVelocity,'String',num2str(y));  %  slider_editText ist der Tag vom editor --------------------------------------------
% guidata(hObject,handles);  %  immer wenn was geändert wird, das hiermit global bekannt machen---------------------------------------------------)
% f=get(hObject,'value');

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

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end



function editVelocity_Callback(hObject, eventdata, handles)
% hObject    handle to editVelocity (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 editVelocity as text
%        str2double(get(hObject,'String')) returns contents of editVelocity as a double
sliderValue=get(handles.sliderVelocity,'Value');        
y=round(sliderValue);
set(handles.sliderVelocity,'Value', y);
set(handles.editV,'String',num2str(y));
guidata(hObject, handles);

% --- Executes during object creation, after setting all properties.
function editVelocity_CreateFcn(hObject, eventdata, handles)
% hObject    handle to editVelocity (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


% --- Executes on button press in pushbuttonProgramm_laufen_lassen.
function pushbuttonProgramm_laufen_lassen_Callback(hObject, eventdata, handles)
% hObject    handle to pushbuttonProgramm_laufen_lassen (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)%  u0=163; %            eruption velocity [m/s]
%  r0=25; %100;%           vent size [m]
%  n0=0.02; %           initial gas mass fraction
%  thetap0 = 800; %           eruption temperature [K]


%glaze_programm(get(findobj('style','sliderGeschwindigkeit','sliderRadius'),'value'))
%glaze_programm(get(findobj('style','slider'),'value')) 
%fh=figure('numbertitle','off','name','vulkan'); clf
cla  % setzt die Figure immer wieder auf Null
glaze(get(handles.sliderVelocity,'value'),...
                 get(handles.sliderRadius,'Value'),...
                 get(handles.sliderN,'Value'),...
                 get(handles.sliderT,'Value'));
 

guidata(hObject, handles);


% --- Executes on slider movement.
function sliderRadius_Callback(hObject, eventdata, handles)
% hObject    handle to sliderRadius (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
sliderValue=get(handles.sliderRadius,'Value');        
y=round(sliderValue/50)*50;
set(handles.sliderRadius,'Value', y);
set(handles.editR1,'String',num2str(y)); %editRadius
guidata(hObject, handles)
% sliderValue=get(handles.sliderRadius,'Value');     %   slider1 ist der Tag vom slider ------------------------------------------
% y=round(sliderValue);
% set(handles.editRadius,'String',num2str(y));  %  slider_editText ist der Tag vom editor --------------------------------------------
% guidata(hObject,handles);  %  immer wenn was geändert wird, das hiermit global bekannt machen---------------------------------------------------
% f=get(hObject,'value');


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

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end



function editRadius_Callback(hObject, eventdata, handles)
% hObject    handle to editRadius (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 editRadius as text
%        str2double(get(hObject,'String')) returns contents of editRadius as a double
sliderValue=get(handles.sliderRadius,'Value');        
y=round(sliderValue);
set(handles.sliderRadius,'Value', y);
set(handles.editR1,'String',num2str(y));

guidata(hObject, handles)
% --- Executes during object creation, after setting all properties.
function editRadius_CreateFcn(hObject, eventdata, handles)
% hObject    handle to editRadius (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


% --- Executes on slider movement.
function sliderN_Callback(hObject, eventdata, handles)
% hObject    handle to sliderN (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

% sliderValue=get(handles.sliderN,'Value');        
% y=round(sliderValue/100)*100;
% set(handles.sliderN,'Value', y);
% set(handles.editN,'String',num2str(y)); 

sliderValue=get(handles.sliderN,'Value');     %   slider1 ist der Tag vom slider ------------------------------------------
set(handles.editN,'String',num2str(sliderValue));  %  slider_editText ist der Tag vom editor --------------------------------------------
guidata(hObject,handles);  %  immer wenn was geändert wird, das hiermit global bekannt machen---------------------------------------------------
f=get(hObject,'value');
guidata(hObject, handles)
% --- Executes during object creation, after setting all properties.
function sliderN_CreateFcn(hObject, eventdata, handles)
% hObject    handle to sliderN (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


function editT1_Callback(hObject, eventdata, handles)
% hObject    handle to editT (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 editT as text
%        str2double(get(hObject,'String')) returns contents of editT as a double

% sliderValue=get(handles.sliderT,'Value');        
% y=round(sliderValue);
% set(handles.sliderT,'Value', y);
% set(handles.editT,'String',num2str(y)); 

sliderValue=get(handles.sliderT,'Value');        
y=round(sliderValue);
set(handles.sliderT,'Value', y);
set(handles.editT1,'String',num2str(y));
guidata(hObject, handles)
% --- Executes during object creation, after setting all properties.
function editT_CreateFcn(hObject, eventdata, handles)
% hObject    handle to editT (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 editN_Callback(hObject, eventdata, handles)
% hObject    handle to editN (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 editN as text
%        str2double(get(hObject,'String')) returns contents of editN as a double

sliderValue=get(handles.sliderN,'Value');        
y=round(sliderValue);
set(handles.sliderN,'Value', y);
set(handles.editN,'String',num2str(y));
guidata(hObject, handles)
% --- Executes during object creation, after setting all properties.
function editN_CreateFcn(hObject, eventdata, handles)
% hObject    handle to editN (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  --- Executes on slider movement.
function sliderT_Callback(hObject, eventdata, handles)
% hObject    handle to sliderT (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


% sliderValue=get(handles.sliderT,'Value');     %   slider1 ist der Tag vom slider ------------------------------------------
% y=round(sliderValue);
% set(handles.editT,'String',num2str(sliderValue));  %  slider_editText ist der Tag vom editor --------------------------------------------
% guidata(hObject,handles);  %  immer wenn was geändert wird, das hiermit global bekannt machen---------------------------------------------------
% f=get(hObject,'value');

sliderValue=get(handles.sliderT,'Value');        
y=round(sliderValue/100)*100;
set(handles.sliderT,'Value', y);
set(handles.editT1,'String',num2str(y)); 

% %       See ISPC and COMPUTER.
% if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
%     set(hObject,'BackgroundColor','white');
% end

guidata(hObject, handles)

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

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end



function edit6_Callback(hObject, eventdata, handles)
% hObject    handle to edit6 (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 edit6 as text
%        str2double(get(hObject,'String')) returns contents of edit6 as a double


% --- Executes during object creation, after setting all properties.
function edit6_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit6 (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 edit7_Callback(hObject, eventdata, handles)
% hObject    handle to edit7 (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 edit7 as text
%        str2double(get(hObject,'String')) returns contents of edit7 as a double


% --- Executes during object creation, after setting all properties.
function edit7_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit7 (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 edit8_Callback(hObject, eventdata, handles)
% hObject    handle to edit8 (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 edit8 as text
%        str2double(get(hObject,'String')) returns contents of edit8 as a double


% --- Executes during object creation, after setting all properties.
function edit8_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit8 (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


% --- Executes on key press with focus on edit8 and none of its controls.
function edit8_KeyPressFcn(hObject, eventdata, handles)
% hObject    handle to edit8 (see GCBO)
% eventdata  structure with the following fields (see UICONTROL)
%	Key: name of the key that was pressed, in lower case
%	Character: character interpretation of the key(s) that was pressed
%	Modifier: name(s) of the modifier key(s) (i.e., control, shift) pressed
% handles    structure with handles and user data (see GUIDATA)


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

% Hint: place code in OpeningFcn to populate axes1
%axes(handles.axes1)

% Grafik1  einfügen
% axes(handles.Image);   
% imshow('vulkan_Bild.jpg')% Auswahl des entsprechenden Axes-Objekts
% G1=imread('vulkan_Bild.jpg','jpg');   % Einlesen der Grafik
% image (G1); axis image;           % Grafik ausgeben, Grafik entzerren
% axis off     
% axes(handles.ViewBox1);
% imshow(im)
%imshow('vulkan_Bild.jpg')



function edit10_Callback(hObject, eventdata, handles)
% hObject    handle to edit10 (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 edit10 as text
%        str2double(get(hObject,'String')) returns contents of edit10 as a double


% --- Executes during object creation, after setting all properties.
function edit10_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit10 (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 edit11_Callback(hObject, eventdata, handles)
% hObject    handle to edit11 (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 edit11 as text
%        str2double(get(hObject,'String')) returns contents of edit11 as a double


% --- Executes during object creation, after setting all properties.
function edit11_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit11 (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 edit12_Callback(hObject, eventdata, handles)
% hObject    handle to edit12 (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 edit12 as text
%        str2double(get(hObject,'String')) returns contents of edit12 as a double


% --- Executes during object creation, after setting all properties.
function edit12_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit12 (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
