⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 softtdm02.m

📁 Matlab实现SONET/SDH光通信系统simulink仿真程序源代码
💻 M
字号:
function varargout = SoftTDM02(varargin)
% SoftTDM02 M-file for SoftTDM02.fig
%      SoftTDM02, by itself, creates a new SoftTDM02 or raises the existing
%      singleton*.
%
%      H = SoftTDM02 returns the handle to a new SoftTDM02 or the handle to
%      the existing singleton*.
%
%      SoftTDM02('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in SoftTDM02.M with the given input arguments.
%
%      SoftTDM02('Property','Value',...) creates a new SoftTDM02 or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before SoftTDM02_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to SoftTDM02_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 SoftTDM02

% Last Modified by GUIDE v2.5 31-Mar-2004 13:36:40

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @SoftTDM02_OpeningFcn, ...
                   'gui_OutputFcn',  @SoftTDM02_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin & isstr(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 u01 is made visible.
function SoftTDM02_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 SoftTDM02 (see VARARGIN)

set(hObject, 'Units', 'pixels');
fondo = imread('FONDO_3.bmp','bmp'); % Lee la imagen fibra.jpg
image(fondo);
 
% Choose default command line output for SoftTDM02
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes SoftTDM02 wait for user response (see UIRESUME)
% uiwait(handles.figure2);

[b1,b1_map]=imread('openbutt.bmp','bmp');
RGB_b1=ind2rgb(b1,b1_map);
set(handles.pushbutton1,'CData',RGB_b1);

[b2,b2_map]=imread('new.bmp','bmp');
RGB_b2=ind2rgb(b2,b2_map);
set(handles.pushbutton2,'CData',RGB_b2);

[b3,b3_map]=imread('helpicon.bmp','bmp');
RGB_b3=ind2rgb(b3,b3_map);
set(handles.pushbutton3,'CData',RGB_b3);

[b4,b4_map]=imread('home_.bmp','bmp');
RGB_b4=ind2rgb(b4,b4_map);
set(handles.pushbutton4,'CData',RGB_b4);

x=imread('boton050.jpg','jpg');
set(handles.pushbutton5,'CData',x);

% --- Outputs from this function are returned to the command line.
function varargout =SoftTDM02_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 button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

file = uigetfile(...
    {'*.mdl','Modelos en Simulink (*.mdl)'; ...
        '*.*',  'Todo los Archivos (*.*)'}, ...
       'Abrir un Modelo');
if ~isequal(file, 0)
    open(file);
end;  

% --- 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)

% Crea y Abre el archivo untiled.mdl para crear un nuevo sistema en
% Simulink, el cual puede ser cambiado al momento de guardar su archivo o
% modelo creado.
if exist('untiled') ==0
    simver(5.0);
        new_system('untiled');
        open_system('untiled')
        set_param('untiled', 'location', [400,130,800,500]);
        set_param('untiled','StopTime','0.000125');
        set_param('untiled','LimitDataPoints','off');
        set_param('untiled','SaveTime','off');
        set_param('untiled','SaveOutput','off');
    elseif exist('untiled') ==4
        selection = questdlg('Ya Existe una modelo llamado "Untiled", debe guardarlo para poder abrir uno nuevo.','Seleccion','Ok','Ok');
        if strcmp(selection,'Ok')
            return            
        end
    end
        
% --- 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)

HelpPach=which('Manual de Usuario.pdf');
open(HelpPach);
 
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

if isempty(find(Acerca_SoftTDM))
    Acerca_SoftTDMpath=which('Acerca_SoftTDM.fig');
    openfig('Acerca_SoftTDM.fig');
end

% --- 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)

selection = questdlg('縀sta seguro que desea salir de SoftTDM Ver1.5?','Cerrar','Yes','No','No');
if strcmp(selection,'No')
    return;
else
     delete(gcf);
end;

% --- Executes during object deletion, before destroying properties.
function figure2_DeleteFcn(hObject, eventdata, handles)
% hObject    handle to figure2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

delete(gcf);

% --- 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)

        SoftTDMLib_Compactapath=which('SoftTDMLib_Compacta.mdl');
        open('SoftTDMLib_Compacta.mdl');
    
        

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -