function varargout = GUI_Hohenheim(varargin)
% GUI_HOHENHEIM MATLAB code for GUI_Hohenheim.fig
%      GUI_HOHENHEIM, by itself, creates a new GUI_HOHENHEIM or raises the existing
%      singleton*.
%
%      H = GUI_HOHENHEIM returns the handle to a new GUI_HOHENHEIM or the handle to
%      the existing singleton*.
%
%      GUI_HOHENHEIM('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in GUI_HOHENHEIM.M with the given input arguments.
%
%      GUI_HOHENHEIM('Property','Value',...) creates a new GUI_HOHENHEIM or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before GUI_Hohenheim_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to GUI_Hohenheim_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_Hohenheim

% Last Modified by GUIDE v2.5 07-May-2013 15:56:53

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @GUI_Hohenheim_OpeningFcn, ...
                   'gui_OutputFcn',  @GUI_Hohenheim_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_Hohenheim is made visible.
function GUI_Hohenheim_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_Hohenheim (see VARARGIN)

axes(handles.axes_image) % das muss vor dem Image sein, da das Image sonst in der zweiten....
%Achse erscheint, wo die eigentlich die Colorbar hinsoll
 
backgroundImage = importdata('vulkan_Bild.jpg');
image(backgroundImage);

ylabel('Height above Crater (km)')
xlabel('Width of Eruptioncolumn (km)')

set(handles.axes_image,'XTick',[1 50 100 150 200 250 300 350 400])
set(handles.axes_image,'XTickLabel',{'40';'30';'20';'10';'0';'10';'20';'30';'40'})

set(handles.axes_image,'YTick',[1 130 220 310 400] )
set(handles.axes_image,'YTickLabel',{'30','20','10','0','-10'})

%my_cmap ist meine definierte colormap. ich hatte mir eine colormap in
%einer figure definiert und mit dem befehl get(gcf,'colormap')mir die
%matrix ausgeben lassen. diese habe ich hier reinkopiert. 
%image(backgroundImage);

my_cmap = [        0                   0   0.562500000000000;
                   0                   0   1.000000000000000;
                   0   1.000000000000000   1.000000000000000;
   1.000000000000000   1.000000000000000                   0;
   1.000000000000000   0.941176474094391                   0;
   1.000000000000000   0.882352948188782                   0;
   1.000000000000000   0.823529422283173                   0;
   1.000000000000000   0.764705896377563                   0;
   1.000000000000000   0.705882370471954                   0;
   1.000000000000000   0.647058844566345                   0;
   1.000000000000000   0.588235318660736                   0;
   1.000000000000000   0.529411792755127                   0;
   1.000000000000000   0.470588237047195                   0;
   1.000000000000000   0.411764711141586                   0;
   1.000000000000000   0.352941185235977                   0;
   1.000000000000000   0.294117659330368                   0;
   1.000000000000000   0.235294118523598                   0;
   1.000000000000000   0.176470592617989                   0;
   1.000000000000000   0.117647059261799                   0;
   1.000000000000000   0.058823529630899                   0;
   1.000000000000000                   0                   0;
   0.988372087478638                   0                   0;
   0.976744174957275                   0                   0;
   0.965116262435913                   0                   0;
   0.953488349914551                   0                   0;
   0.941860437393188                   0                   0;
   0.930232584476471                   0                   0;
   0.918604671955109                   0                   0;
   0.906976759433746                   0                   0;
   0.895348846912384                   0                   0;
   0.883720934391022                   0                   0;
   0.872093021869659                   0                   0;
   0.860465109348297                   0                   0;
   0.848837196826935                   0                   0;
   0.837209284305573                   0                   0;
   0.825581371784210                   0                   0;
   0.813953459262848                   0                   0;
   0.802325606346130                   0                   0;
   0.790697693824768                   0                   0;
   0.779069781303406                   0                   0;
   0.767441868782043                   0                   0;
   0.755813956260681                   0                   0;
   0.744186043739319                   0                   0;
   0.732558131217957                   0                   0;
   0.720930218696594                   0                   0;
   0.709302306175232                   0                   0;
   0.697674393653870                   0                   0;
   0.686046540737152                   0                   0;
   0.674418628215790                   0                   0;
   0.662790715694427                   0                   0;
   0.651162803173065                   0                   0;
   0.639534890651703                   0                   0;
   0.627906978130341                   0                   0;
   0.616279065608978                   0                   0;
   0.604651153087616                   0                   0;
   0.593023240566254                   0                   0;
   0.581395328044891                   0                   0;
   0.569767415523529                   0                   0;
   0.558139562606812                   0                   0;
   0.546511650085449                   0                   0;
   0.534883737564087                   0                   0;
   0.523255825042725                   0                   0;
   0.511627912521362                   0                   0;
   0.500000000000000                   0                   0];
 
%colormap(my_cmap)
colormap hot
colorbar('horizontal','position',[0.15 0.045 0.5 0.045],...
    'xTick',0:9.14:64,'xtickmode','manual',...
    'xTicklabel',{'150','300','450','600','750','900','1050','1200'});
%colorbar([0.1 0.05 0.4 0.05]);
%'location','southoutside'



handles.output = hObject;

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


% --- Outputs from this function are returned to the command line.
function varargout = GUI_Hohenheim_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]

cla  % setzt die Figure immer wieder auf Null
glaze_hohenheim(get(handles.sliderVelocity,'value'),...
                 get(handles.sliderRadius,'Value'),...
                 get(handles.sliderN,'Value'),...
                 get(handles.sliderT,'Value'));
 
%hold(handles.axes_image,'on');
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)
%



% --- 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.editGas,'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 editGas_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.editGas,'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');        
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 axes_image_CreateFcn(hObject, eventdata, handles)
% hObject    handle to axes_image (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 axes_image


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


% --- Executes during object creation, after setting all properties.
function info_CreateFcn(hObject, eventdata, handles)
% hObject    handle to info (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 selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu1
v=get(handles.popupmenu1,'Value');


%   questdlg, msgbox
% switch v
%     case 1
%     set(handles.info,'String','Die Erde besteht aus einem Erdkern, einem Erdmantel und der Erdkruste. Im Erdmantel, mehr als 100 Kilometer unter der Erde kocht ein Brei aus geschmolzenen Steinen. Dieser Brei wird Magma genannt und  ist über 1.200 °C heiß. Zum Vergleich: Das Wasser, das Deine Mutter auf dem Herd kocht, ist 100 °C heiß. In der Tiefe herrscht ein sehr hoher Druck. Wenn der zu hoch wird, steigt das Magma auf und kann die Oberfläche erreichen. Dies geschieht oft durch Explosionen. Hier wird dann das Magma aus der Erde geschleudert. Ein Vulkan nennt man die Struktur, die entsteht, wenn Magma bis zu der Erdoberfläche aufsteigt.');
%     case 2
%     set(handles.info,'String','Magma (das heisst in der griechischen Sprche „geknetete Masse“) heißt die Masse aus Gesteinsschmelze, die in Teilen des oberen Erdmantels und der tieferen Erdkruste vorkommt. Die Fließfähigkeit des Magmas ist die Ursache des Vulkanismus und hat eine große Bedeutung für die Gesteinsbildung, da sich aus dem erstarrenden Magma die magmatischen Gesteine oder Magmatite bilden.die Magmatemperatur ist wichtig');
%     case 3
%     set(handles.info,'String','Ein wichtiger Faktor beim Aufstieg von Magma sind Gase. Diese funktionieren ähnlich der Kohlensäure im Sekt: Sie wollen sich ausdehnen. Wird eine Flasche Sekt geöffnet, drückt die Kohlensäure den Korken aus der Flasche und der Sekt schäumt über. Die Gase im Magma sorgen dafür, dass es in Spalten und Risse in der Erdkruste eindringt. Kommt Magma an die Erdoberfläche, kann es zu einer Explosion kommen. Bei solchen Ausbrüchen kommt es zum Auswurf von Bomben, Lapilli und Asche');
%     case 4
%     set(handles.info,'String','der Radius darf natürlich auch nicht vergessen werden');
%     otherwise
%     set(handles.info,'String','die Geschwindigkeit ist nur drin, weil´s so nen Spass macht damit rumzuspielen und die Kinder soviel davon haben. Ich bin gespannt, wie die das finden');
% end

%uestdlg, msgbox

   switch v
       case 1
   msg = 'Please select';
     case 2
   msg  = 'Building of a volcano begins in the interior of the earth – in the so called earth mantle. There exist very hot rocks (the maximum can reach 1000 degrees. Cocking Water just reaches 100 degrees) and hot pressure. As soon as pressure and temperature is high enough the rocks are melting. These melted rocks are called “Magma”. The earth mantle is like a barrel with heavy currents of cold and warmth. At these points where cold and warm currents come together it could happen that the surface of the earth at some places is lowering and at others lifting. Thereby the crust of the earth can break open. At these places magma out of the interior can find its way to the surface – the volcano is born. If reaching the surface the magma now is called “Lava”.';
     case 3
    msg = 'The hot melted rocks in the interior of the earth, imaginable like a soup, containing bubbles. Inside of these bubbles is a big amount of gas. The hard earth’s surface is acting like a cover over a cocking pot. The magma is like the soup with bubbles in the cocking pot. The surface prevents escaping of the gas out of the magma. If there are cracks inside of the interior the magma could find its way to the surface. This is the eruption. The more gas exists the greater is the power with which the eruption occurs and the higher the magma could erupt. You can imagine this like a bottle of coke. The more you are shaking the bottle, the more bubbles you will find in the coke. If you are now opening the bottle, the coke is effervesce in a high arc out of the jar (“plinian eruptions” could reach a height until 40 kilometres). If the bottle was standing quieter there are not so much bubbles. Opening the bottle there will be a more smooth flow (the most tranquil eruptions you will find within the „Hawaiian Eruptions“).';
    case 4
    msg  = '1. Ash fall: Volcanic ash is highly fragmented volcanic rock in coarse or fine ash. It covers houses and crops. 2. Lava flow: If magma erupts out of the earth surface its called Lava. As long as the Lava is hot it will flow. The temperature ranges between 800 and 1200 degrees. This dangerous flow covers villages and fields under a river of fire that burns everything. 3. Pyroclastic flow. With Lahars they are the greatest volcanic hazards. They could reach temperatures as high as 1075 degrees and speed of 10 - 30 m/s, while larger flows can moves at rates of 200 m/s. The volcano emits a fiery avalanche that burns and destroys everything in its path. 4. Volcanic gas: The volcano spews smoke that may make it hard to breathe or even kill you. 5. Lahar or mud flow: The volcano warms up snow or ice, or rain loosens previous layers of ash, sending mud cascading into inhabited valleys. They can reach a maximum temperature of 100 degrees and speed of 100 km/h. 6.Debris avalanche: It is formed when an unstable slope collapses and debris is transported away from the slope. Large scale avalanches normally occur on very steep volcanoes. There are two types. One is colder and the other is hotter. A cold avalanche results normally from a slope becoming unstable. A hot one resulted out of volcanic activities such as volcanic earthquake or the injection of magma which causes slope instability. The volcano destroys homes and covers the ground and crops with boulders. 7. Volcanic Tsunami: A tsunami is a huge sea wave with extreme power which may flood towns and villages by the edge of the sea or a lake. The volcanic ones can result from violent submarine explosions. They also can result if a calderea collapses, or pyroclastic flow or volcanic flanks are crashing into water. As the wave is formed it can reach 230 km/h in shallow water. They crash into the land. This power doesn´t decrease when they hit the land. There is an extreme amount of energy when the water travels back towards the source.';
    case 5
    msg  = 'Many of the hazards of tephra falls can be mitigated with proper planning and preparation. This includes clearing tephra from roofs as it accumumulates, designing roofs with steep slopes, strengthening roofs and walls, designing filters for machinery, wearing respirators or wet clothes over the mouth and nose';
     case 6
    msg  = 'Lava flows are less dangerous to human life than to property, traffic, and communication because probable path, of lava flows can be roughly predicted and the speed is less far than in case of pyroclastic flows o lahars. Diversion measures, cooling in advance the front with water or disrupt the source or front of lava flow by explosives may be taken in principle. Because these measures often are not such successful you should leave the area in advance.';
     case 7
    msg  =  'Pyroclastic Flows travel long distances. People living near the summit, especially those in valley areas are most likely to be in danger from such a flow. The best course of action for these people to take when a volcano erupts is to evacuate valley areas and head for higher ground away from the volcano. Of course, if the volcano gives ample warning that it is going to erupt, then the best thing to do is evacuate the area and get as far away from the volcano as possible.';
     case 8
    msg  = 'Poisonous, even lethal, gases can be ejected during the eruption of a volcano or can be released without a triggering eruption. The gases are transported away from the vent as acid aerosols. It can damage to the eyes, skin and respiratory systems of animals even in small concentrations. Most volcanic gases are noxious and smell bad, but they can cause mass fatalities. The time available for early warning of gas release is extremely short, and intensified investigation on such gas eruption, as well as keen observation of the respective locations, is absolutely necessary. If you smell something bad in an area of volcanoes tell the police and leave that place immediately';
    case 9
    msg  = 'Lahars ( volcanic mud and debris flows) are travelling long distances. Pulling big rocks with it and reaching a many meters deep they could posses great destructive power and destroy whole cities. Areas farther away may be warned several hours in advance. A sufficient monitoring of individual volcanoes, however, rarely is guaranteed. Small lahars can be diverted by barriers or by artificial channels which lead them away from valuable land or property, but in most cases the volume and force of the Lahar is such that it beyond human power to control. The best course of action for these people to take when a volcano erupts is to evacuate valley areas and head for higher ground away from the volcano. Of course, if the volcano gives ample warning that it is going to erupt, then the best thing to do is evacuate the area and get as far away from the volcano as possible.';
    case 10
    msg  = 'Volcanic debris avalanches generated by sliding of larger portions of volcanic cones are common. These avalanches are highly mobile and may not only bury large tracts of land and dam stream to form lakes than can drain catastrophically and generate lahars and floods but also cause devastating tidal waves (tsunamis) if they advance into lakes or the sea. The only effective method of risk mitigation is evacuation prior to such debris avalanche or tsunamis (if expecting) from areas likely to be affected by this kind of phenomena.';
    otherwise
    msg = 'The only way is to evacuate from areas that are likely to be affected. If you have no time to evacuate far from the area try to reach areas as high as possible.';
 end
 msgbox(msg,'Info','help')



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

% Hint: popupmenu 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 edit13_Callback(hObject, eventdata, handles)
% hObject    handle to edit13 (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 edit13 as text
%        str2double(get(hObject,'String')) returns contents of edit13 as a double


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


% --- Executes during object creation, after setting all properties.
function edit14_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit14 (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 popupmenu1 and none of its controls.
function popupmenu1_KeyPressFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (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)
