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

% Last Modified by GUIDE v2.5 26-Sep-2012 15:35:30

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

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

handles.keypos               = findobj(hObject,'Style','checkbox');
handles.keys                 = cell(1,length(handles.keypos));
% da du checkboxen auf UIPANELs aufgeteilt hast,
% kann man die Kategorien über Zugehörigkeit rausfinden
parent                       = get(handles.keypos,'Parent');
parent                       = [parent{:}];
[dummy,dummy,handles.kat]    = unique(parent);

% Update handles structure
guidata(hObject, handles);

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


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

% Grafik1  einfügen 
axes(handles.axes2);     % Auswahl des entsprechenden Axes-Objekts 
G1=imread('RSe.png');   % Einlesen der Grafik 
image(G1);             % Grafik ausgeben, 
axis image;              %Grafik entzerren 
axis off                  % Koordinatenachsen ausblenden 



% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
FA_plot_2;

% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton6 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
FA_Plot3e;

% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
PGN_SKF = evalin('base','PGN_SKF'); 
Gierrate_Grenzen;

% --- Executes on button press in pushbutton8.
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton8 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% Status1=evalin('base','exist(''key1'')');
% Status2=evalin('base','exist(''key2'')');
% Status3=evalin('base','exist(''key3'')');
% Status4=evalin('base','exist(''key4'')');

% if Status1==1
%     key1 =evalin('base','key1'); 
% end
% if Status2==1
%     key2 =evalin('base','key2'); 
% end
% if Status3==1
%     key3 =evalin('base','key3');
% end
% if Status4==1
%     key4 =evalin('base','key4'); 
% end
% PGN_SKF = evalin('base','PGN_SKF'); 
% vars=whos 
for k=1:length(vars) 
   assignin('base', vars(k).name, eval(vars(k).name)) 
end
vierer_Plot;

% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% Status1=evalin('base','exist(''key1'')');
% 
% if Status1==1
%     key1 =evalin('base','key1'); 
% end

time_step_test_einzelne_dateienGleichNull;

% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Status1=evalin('base','exist(''key1'')');
% Status2=evalin('base','exist(''key2'')');
% Status3=evalin('base','exist(''key3'')');
% Status4=evalin('base','exist(''key4'')');
% 
% if Status1==1
%     key1 =evalin('base','key1'); 
% end
% if Status2==1
%     key2 =evalin('base','key2'); 
% end
% if Status3==1
%     key3 =evalin('base','key3');
% end
% if Status4==1
%     key4 =evalin('base','key4'); 
% end
vars=whos 
for k=1:length(vars) 
   assignin('base', vars(k).name, eval(vars(k).name)) 
end 

NominalMomentGleichNull;
guidata(handles.figure1, handles); 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
% 
% % --- Executes on button press in PGN.
% function PGN_Callback(hObject, eventdata, handles)
% % hObject    handle to PGN (see GCBO)
% % eventdata  reserved - to be defined in a future version of MATLAB
% % handles    structure with handles and user data (see GUIDATA)
% 
% if (get(hObject,'Value') == get(hObject,'Max'))
% SWE= 'PGN';
% assignin('base','SWE',SWE);
% else
% 	evalin('base','clear SWE');
% end
% 
% % Hint: get(hObject,'Value') returns toggle state of PGN
% 
% % --- Executes on button press in SWE.
% function SWE_Callback(hObject, eventdata, handles)
% % hObject    handle to SWE (see GCBO)
% % eventdata  reserved - to be defined in a future version of MATLAB
% % handles    structure with handles and user data (see GUIDATA)
% if (get(hObject,'Value') == get(hObject,'Max'))
% SWE = 'SWE';
% assignin('base','SWE',SWE);
% else
% 	evalin('base','clear SWE');
% end
%  
% % Hint: get(hObject,'Value') returns toggle state of SWE
% 
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%
% % --- Executes on button press in Ibrahim.
% function Ibrahim_Callback(hObject, eventdata, handles)
% % hObject    handle to Ibrahim (see GCBO)
% % eventdata  reserved - to be defined in a future version of MATLAB
% % handles    structure with handles and user data (see GUIDATA)
% 
% if (get(hObject,'Value') == get(hObject,'Max'))
% key2 = 'Ibrahim';
% assignin('base','key2',key2);
% else
% 	evalin('base','clear key2');
% end
%  
% % Hint: get(hObject,'Value') returns toggle state of Ibrahim
% 
% % --- Executes on button press in Michael.
% function Michael_Callback(hObject, eventdata, handles)
% % hObject    handle to Michael (see GCBO)
% % eventdata  reserved - to be defined in a future version of MATLAB
% % handles    structure with handles and user data (see GUIDATA)
% if (get(hObject,'Value') == get(hObject,'Max'))
% key2 = 'Michael';
% assignin('base','key2',key2);
% else
% 	evalin('base','clear key2');
% end
% 
% % Hint: get(hObject,'Value') returns toggle state of Michael
% 
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%
% 
% % --- Executes on button press in checkbox14.
% function checkbox14_Callback(hObject, eventdata, handles)
% % hObject    handle to checkbox14 (see GCBO)
% % eventdata  reserved - to be defined in a future version of MATLAB
% % handles    structure with handles and user data (see GUIDATA)
% if (get(hObject,'Value') == get(hObject,'Max'))
% key3= '1000';
% assignin('base','key3',key3);
% else
% 	evalin('base','clear key3');
% end
% 
% % Hint: get(hObject,'Value') returns toggle state of checkbox14
% 
% % --- Executes on button press in checkbox8.
% function checkbox8_Callback(hObject, eventdata, handles)
% % hObject    handle to checkbox8 (see GCBO)
% % eventdata  reserved - to be defined in a future version of MATLAB
% % handles    structure with handles and user data (see GUIDATA)
% if (get(hObject,'Value') == get(hObject,'Max'))
% key3 = '1200';
% assignin('base','key3',key3);
% else
% 	evalin('base','clear key3');
% end
% 
% % Hint: get(hObject,'Value') returns toggle state of checkbox8
% 
% % --- Executes on button press in checkbox6.
% function checkbox6_Callback(hObject, eventdata, handles)
% % hObject    handle to checkbox6 (see GCBO)
% % eventdata  reserved - to be defined in a future version of MATLAB
% % handles    structure with handles and user data (see GUIDATA)
% if (get(hObject,'Value') == get(hObject,'Max'))
% key3 = '1400';
% assignin('base','key3',key3);
% else
% 	evalin('base','clear key3');
% end
% 
% % Hint: get(hObject,'Value') returns toggle state of checkbox6
% 
% % --- Executes on button press in checkbox9.
% function checkbox9_Callback(hObject, eventdata, handles)
% % hObject    handle to checkbox9 (see GCBO)
% % eventdata  reserved - to be defined in a future version of MATLAB
% % handles    structure with handles and user data (see GUIDATA)
% if (get(hObject,'Value') == get(hObject,'Max'))
% key3 = '1600';
% assignin('base','key3',key3);
% else
% 	evalin('base','clear key3');
% end
% 
% % Hint: get(hObject,'Value') returns toggle state of checkbox9
% 
% % --- Executes on button press in checkbox11.
% function checkbox11_Callback(hObject, eventdata, handles)
% % hObject    handle to checkbox11 (see GCBO)
% % eventdata  reserved - to be defined in a future version of MATLAB
% % handles    structure with handles and user data (see GUIDATA)
% if (get(hObject,'Value') == get(hObject,'Max'))
% key3 = '1800';
% assignin('base','key3',key3);
% else
% 	evalin('base','clear key3');
% end
% 
% % Hint: get(hObject,'Value') returns toggle state of checkbox11
% 
% % --- Executes on button press in checkbox15.
% function checkbox15_Callback(hObject, eventdata, handles)
% % hObject    handle to checkbox15 (see GCBO)
% % eventdata  reserved - to be defined in a future version of MATLAB
% % handles    structure with handles and user data (see GUIDATA)
% if (get(hObject,'Value') == get(hObject,'Max'))
% key3 = '2000';
% assignin('base','key3',key3);
% else
% 	evalin('base','clear key3');
% end


function CheckBox_Callback(hObject,eventdata, handles) 
keynumber = find(handles.keypos==hObject); 
if get(hObject,'Value') 
   handles.keys{keynumber } = get(hObject,'String'); 
else 
  handles.keys{keynumber }   =[]; 
end 
guidata(handles.figure1, handles); 
% assignin('base','handles',handles)
% vars=whos 
% for k=1:length(vars) 
%    assignin('base', vars(k).name, eval(vars(k).name)) 
% end 




  

% GUI_Skripte('CheckBox_Callback',hObject,eventdata,guidata(hObject))

% Hint: get(hObject,'Value') returns toggle state of checkbox15


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%
% 
% 
% % --- Executes on button press in GF.
% function GF_Callback(hObject, eventdata, handles)
% % hObject    handle to GF (see GCBO)
% % eventdata  reserved - to be defined in a future version of MATLAB
% % handles    structure with handles and user data (see GUIDATA)
% if (get(hObject,'Value') == get(hObject,'Max'))
% 	key4 = 'GF';
%     assignin('base','key4',key4);
% else
% 	evalin('base','clear key4');
% end
% 
% % Hint: get(hObject,'Value') returns toggle state of GF
% 
% % --- Executes on button press in SKF.
% function SKF_Callback(hObject, eventdata, handles)
% % hObject    handle to SKF (see GCBO)
% % eventdata  reserved - to be defined in a future version of MATLAB
% % handles    structure with handles and user data (see GUIDATA)
% 
% if (get(hObject,'Value') == get(hObject,'Max'))
% key4 = 'SKF';
% assignin('base','key4',key4);
% else
% 	evalin('base','clear key4');
% end
% 
% % Hint: get(hObject,'Value') returns toggle state of SKF
% 
% 
% % --- Executes on button press in Oval.
% function Oval_Callback(hObject, eventdata, handles)
% % hObject    handle to Oval (see GCBO)
% % eventdata  reserved - to be defined in a future version of MATLAB
% % handles    structure with handles and user data (see GUIDATA)
% if (get(hObject,'Value') == get(hObject,'Max'))
% key4 = 'Oval';
% assignin('base','key4',key4);
% else
% 	evalin('base','clear key4');
% end

% Hint: get(hObject,'Value') returns toggle state of Oval




% --- Executes on button press in pushbutton9.
function pushbutton9_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton9 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
clc;


% --- Executes on button press in pushbutton10.
function pushbutton10_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton10 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
close all;

% --- Executes on button press in pushbutton11.
function pushbutton11_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton11 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
clear all;
evalin('base','clear all');


% --- Executes on button press in pushbutton15.
function pushbutton15_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton15 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
clear PGN_SKF;
evalin('base','clear PGN_SKF');


% --- Executes on button press in pushbutton16.
function pushbutton16_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton16 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% h = findobj( handles.Oval, 'Style', 'checkbox'); 
% set( h, 'Enable', 'on'); 

set( handles.PGN,  'Value',  0);  
set( handles.SWE,  'Value',  0);  
set( handles.Ibrahim,  'Value',  0);  
set( handles.Michael,  'Value',  0);  
set( handles.checkbox14,  'Value',  0);  
set( handles.checkbox8,  'Value',  0);  
set( handles.checkbox6,  'Value',  0);  
set( handles.checkbox9,  'Value',  0);  
set( handles.checkbox11,  'Value',  0); 
set( handles.checkbox15,  'Value',  0); 
set( handles.GF,  'Value',  0); 
set( handles.SKF,  'Value',  0); 
set( handles.Oval,  'Value',  0); 
% evalin('base','clear SWE');
% evalin('base','clear key2');
% evalin('base','clear key3');
% evalin('base','clear key4');



