function varargout = Kennparametertool(varargin)
%KENNPARAMETERTOOL M-file for Kennparametertool.fig
%      KENNPARAMETERTOOL, by itself, creates a new KENNPARAMETERTOOL or raises the existing
%      singleton*.
%
%      H = KENNPARAMETERTOOL returns the handle to a new KENNPARAMETERTOOL or the handle to
%      the existing singleton*.
%
%      KENNPARAMETERTOOL('Property','Value',...) creates a new KENNPARAMETERTOOL using the
%      given property value pairs. Unrecognized properties are passed via
%      varargin to Kennparametertool_OpeningFcn.  This calling syntax produces a
%      warning when there is an existing singleton*.
%
%      KENNPARAMETERTOOL('CALLBACK') and KENNPARAMETERTOOL('CALLBACK',hObject,...) call the
%      local function named CALLBACK in KENNPARAMETERTOOL.M with the given input
%      arguments.
%
%      *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 Kennparametertool

% Last Modified by GUIDE v2.5 24-Feb-2012 22:58:39

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @Kennparametertool_OpeningFcn, ...
                   'gui_OutputFcn',  @Kennparametertool_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 Kennparametertool is made visible.
function Kennparametertool_OpeningFcn(hObject, eventdata, handles, varargin)
set(handles.KP_Auswahl_1,'String',{'Max. Beschleunigung','Regelungsdauer','  '},'Value',3);
set(handles.KP_Auswahl_2,'String',{'Max. Beschleunigung','Regelungsdauer','  '},'Value',3);
set(handles.Einheit_1,'Enable','inactive');
set(handles.Einheit_2,'Enable','inactive');
% 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   unrecognized PropertyName/PropertyValue pairs from the
%            command line (see VARARGIN)

% Choose default command line output for Kennparametertool
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes Kennparametertool wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = Kennparametertool_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 selection change in KP_Auswahl_1.
function KP_Auswahl_1_Callback(hObject, eventdata, handles)
switch get(handles.KP_Auswahl_1,'Value')
    case 1
       Einheit='m/s^2';
    case 2
       Einheit='s';
    case 3
       Einheit='  ';
end
set(handles.Einheit_1,'String',{Einheit});
guidata(hObject,handles)


% hObject    handle to KP_Auswahl_1 (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 KP_Auswahl_1 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from KP_Auswahl_1


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


% --- Executes on selection change in Manoever.
function Manoever_Callback(hObject, eventdata, handles)
% hObject    handle to Manoever (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 Manoever contents as cell array
%        contents{get(hObject,'Value')} returns selected item from Manoever


% --- Executes during object creation, after setting all properties.
function Manoever_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Manoever (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 Wert1_Callback(hObject, eventdata, handles)
Wert_1 = str2double(get(hObject,'String'));
if isnan(Wert_1)
    Wert_1 = 0;
    set(hObject,'String',Wert_1);
    errordlg('Eingabe muss eine Zahl sein', 'Error')
end
handles.Wert1 = Wert_1;
set(handles.edit3,'String',Wert_1);
guidata(hObject,handles)
% hObject    handle to Wert1 (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 Wert1 as text
%        str2double(get(hObject,'String')) returns contents of Wert1 as a double


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


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


% --- Executes during object creation, after setting all properties.
function Einheit_1_CreateFcn(hObject, eventdata, handles)

% hObject    handle to Einheit_1 (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 edit3_Callback(hObject, eventdata, handles)
set(handles.Wert1,'String');

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


% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit3 (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 KP_Auswahl_2.
function KP_Auswahl_2_Callback(hObject, eventdata, handles)
switch get(handles.KP_Auswahl_2,'Value')
    case 1
       Einheit='m/s^2';
    case 2
       Einheit='s';
    case 3
       Einheit='  ';
end
set(handles.Einheit_2,'String',{Einheit});
guidata(hObject,handles)
% hObject    handle to KP_Auswahl_2 (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 KP_Auswahl_2 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from KP_Auswahl_2


% --- Executes during object creation, after setting all properties.
function KP_Auswahl_2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to KP_Auswahl_2 (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 Wert2_Callback(hObject, eventdata, handles)
Wert_2 = str2double(get(hObject,'String'));
if isnan(Wert_2)
    Wert_2 = 0;
    set(hObject,'String',Wert_2);
    errordlg('Eingabe muss eine Zahl sein', 'Error')
end
handles.Wert1 = Wert_2;
set(handles.edit3,'String',Wert_2);
guidata(hObject,handles)
% hObject    handle to Wert2 (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 Wert2 as text
%        str2double(get(hObject,'String')) returns contents of Wert2 as a double


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


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