久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

標題: matlab中GUI的串口調試程序 [打印本頁]

作者: wxmajl    時間: 2018-5-23 15:58
標題: matlab中GUI的串口調試程序
function varargout = untitled(varargin)
% UNTITLED M-file for untitled.fig
%     UNTITLED, by itself, creates a new UNTITLED or raises the existing
%     singleton*.
%
%     H = UNTITLED returns the handle to a new UNTITLED or the handle to
%     the existing singleton*.
%
%     UNTITLED('CALLBACK',hObject,eventData,handles,...) calls the local
%     function named CALLBACK in UNTITLED.M with the given input arguments.
%
%     UNTITLED('Property','Value',...) creates a new UNTITLED or raises the
%      existing singleton*.  Starting from the left, property value pairsare
%     applied to the GUI before untitled_OpeningFcn gets called.  An
%     unrecognized property name or invalid value makes property application
%     stop.  All inputs are passed tountitled_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 theresponse to help untitled
% Last Modified by GUIDE v2.5 07-Sep-201313:47:05
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn',@untitled_OpeningFcn, ...
                   'gui_OutputFcn',  @untitled_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 untitled is madevisible.
function untitled_OpeningFcn(hObject,eventdata, handles, varargin)
% This function has no output args, seeOutputFcn.
% 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 untitled (see VARARGIN)
% 初始化
set(handles.caiji,'UserData',0);
setappdata(handles.save,'ApplicationData',0);
% Choose default command line output foruntitled
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes untitled wait for userresponse (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function arereturned to the command line.
function varargout = untitled_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 fromhandles structure
varargout{1} = handles.output;
% --- Executes on button press in on.
function on_Callback(hObject, eventdata,handles)
% hObject   handle to on (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles   structure with handles and user data (see GUIDATA)
clc;
s1 =instrfind('Type','serial','Port','COM1','Tag','');    % 查看端口是否存在
s2 =instrfind('Type','serial','Port','COM2','Tag','');
s3 =instrfind('Type','serial','Port','COM3','Tag','');    % 查看端口是否存在
s4 =instrfind('Type','serial','Port','COM4','Tag','');
% 獲取參數值
if (isempty(s1) &&get(handles.port,'Value')==1 )          % 如果端口1存在,存創建端口
    s= serial('COM1');                   % 創建串口號
   if(get(handles.botelv,'Value')==1)   % 設置串口參數
       s.BaudRate = 1200;                  
   elseif(get(handles.botelv,'Value')==2)
       s.BaudRate = 2400;   
   elseif(get(handles.botelv,'Value')==3)
       s.BaudRate = 4800;   
    elseif(get(handles.botelv,'Value')==4)
       s.BaudRate = 9600;  
   elseif(get(handles.botelv,'Value')==5)
       s.BaudRate = 19200;
   elseif(get(handles.botelv,'Value')==6)
       s.BaudRate = 38400;
   elseif(get(handles.botelv,'Value')==7)
       s.BaudRate = 76800;
   elseif(get(handles.botelv,'Value')==8)
       s.BaudRate = 115200;  
   end
   if(get(handles.jiaoyanw,'Value')==1)
       s.Parity = 'none';                     % 無校驗位
   elseif(get(handles.jiaoyanw,'Value')==2)
       s.Parity = 'odd';                     % 偶校驗
   elseif(get(handles.jiaoyanw,'Value')==3)
       s.Parity = 'even';                     % 奇校驗
   end
   if(get(handles.dataw,'Value')==1)           % 數據位
       s.DataBits = 8;
   elseif(get(handles.dataw,'Value')==2)
       s.DataBits = 7;
   elseif(get(handles.dataw,'Value')==3)
       s.DataBits = 6;
   elseif(get(handles.dataw,'Value')==4)
       s.DataBits = 5;
   end
   if(get(handles.stopw,'Value')==1)           % 停止位
       s.StopBits = 1;
   elseif(get(handles.stopw,'Value')==2)
       s.StopBits = 1.5;
   elseif(get(handles.stopw,'Value')==3)
       s.StopBits = 2;  
   end
   s.Timeout = 0.1;
   s.InputBufferSize = 3072;
   s.OutputBufferSize = 3072;
   s.ReadAsyncMode = 'continuous';
   
   handles.sbuff = s;
   guidata(hObject, handles);
   s.BytesAvailableFcnMode = 'byte';
   s.BytesAvailableFcnCount = 10;
   s.BytesAvailableFcn = {@recive_data, handles};
   fopen(s);
   set(handles.caiji,'Enable','On');
   set(handles.off,'Enable','On');
   set(handles.on,'Enable','Off');
   set(handles.edit1,'String','打開成功!');
   set(handles.exit,'Enable','Off');
   set(handles.edit1,'backgroundcolor',[0 1 0]);
   
elseif (isempty(s2) &&get(handles.port,'Value')==2 )        % 如果端口2存在,存創建端口
    s= serial('COM2');                   % 創建串口號
   if(get(handles.botelv,'Value')==1)   % 設置串口參數
       s.BaudRate = 1200;                  
   elseif(get(handles.botelv,'Value')==2)
       s.BaudRate = 2400;   
   elseif(get(handles.botelv,'Value')==3)
       s.BaudRate = 4800;   
   elseif(get(handles.botelv,'Value')==4)
       s.BaudRate = 9600;  
   elseif(get(handles.botelv,'Value')==5)
       s.BaudRate = 19200;
   elseif(get(handles.botelv,'Value')==6)
       s.BaudRate = 38400;
   elseif(get(handles.botelv,'Value')==7)
       s.BaudRate = 76800;
   elseif(get(handles.botelv,'Value')==8)
       s.BaudRate = 115200;  
   end
   if(get(handles.jiaoyanw,'Value')==1)
       s.Parity = 'none';                     % 無校驗位
   elseif(get(handles.jiaoyanw,'Value')==2)
       s.Parity = 'odd';                     % 偶校驗
   elseif(get(handles.jiaoyanw,'Value')==3)
       s.Parity = 'even';                     % 奇校驗
    end
   if(get(handles.dataw,'Value')==1)           % 數據位
       s.DataBits = 8;
   elseif(get(handles.dataw,'Value')==2)
       s.DataBits = 7;
   elseif(get(handles.dataw,'Value')==3)
       s.DataBits = 6;
   elseif(get(handles.dataw,'Value')==4)
       s.DataBits = 5;
   end
   if(get(handles.stopw,'Value')==1)           % 停止位
       s.StopBits = 1;
   elseif(get(handles.stopw,'Value')==2)
       s.StopBits = 1.5;
   elseif(get(handles.stopw,'Value')==3)
       s.StopBits = 2;  
   end
    s.Timeout = 0.1;
   s.InputBufferSize = 3072;
   s.OutputBufferSize = 3072;
   s.ReadAsyncMode = 'continuous';
   
   handles.sbuff = s;
   guidata(hObject, handles);
   s.BytesAvailableFcnMode = 'byte';
   s.BytesAvailableFcnCount = 10;
   s.BytesAvailableFcn = {@recive_data, handles};
   fopen(s);
   set(handles.caiji,'Enable','On');
   set(handles.off,'Enable','On');
   set(handles.on,'Enable','Off');
   set(handles.exit,'Enable','Off');
   set(handles.edit1,'String','打開成功!');
    set(handles.edit1,'backgroundcolor',[0 1 0]);
   
elseif (isempty(s3) &&get(handles.port,'Value')==3 )        % 如果端口3存在,存創建端口
    s= serial('COM3');                   % 創建串口號
   if(get(handles.botelv,'Value')==1)   % 設置串口參數
       s.BaudRate = 1200;                  
   elseif(get(handles.botelv,'Value')==2)
       s.BaudRate = 2400;   
   elseif(get(handles.botelv,'Value')==3)
       s.BaudRate = 4800;   
   elseif(get(handles.botelv,'Value')==4)
       s.BaudRate = 9600;  
   elseif(get(handles.botelv,'Value')==5)
       s.BaudRate = 19200;
   elseif(get(handles.botelv,'Value')==6)
       s.BaudRate = 38400;
   elseif(get(handles.botelv,'Value')==7)
       s.BaudRate = 76800;
   elseif(get(handles.botelv,'Value')==8)
       s.BaudRate = 115200;  
   end
   if(get(handles.jiaoyanw,'Value')==1)
       s.Parity = 'none';                     % 無校驗位
   elseif(get(handles.jiaoyanw,'Value')==2)
       s.Parity = 'odd';                     % 偶校驗
   elseif(get(handles.jiaoyanw,'Value')==3)
       s.Parity = 'even';                     % 奇校驗
   end
   if(get(handles.dataw,'Value')==1)           % 數據位
       s.DataBits = 8;
   elseif(get(handles.dataw,'Value')==2)
       s.DataBits = 7;
    elseif(get(handles.dataw,'Value')==3)
       s.DataBits = 6;
   elseif(get(handles.dataw,'Value')==4)
       s.DataBits = 5;
   end
   if(get(handles.stopw,'Value')==1)           % 停止位
       s.StopBits = 1;
   elseif(get(handles.stopw,'Value')==2)
        s.StopBits = 1.5;
   elseif(get(handles.stopw,'Value')==3)
       s.StopBits = 2;  
   end
   s.Timeout = 0.1;
   s.InputBufferSize = 3072;
   s.OutputBufferSize = 3072;
   s.ReadAsyncMode = 'continuous';
   
   handles.sbuff = s;
   guidata(hObject, handles);
   s.BytesAvailableFcnMode = 'byte';
   s.BytesAvailableFcnCount = 10;
   s.BytesAvailableFcn = {@recive_data, handles};
   fopen(s);
   set(handles.caiji,'Enable','On');
   set(handles.off,'Enable','On');
   set(handles.on,'Enable','Off');
   set(handles.exit,'Enable','Off');
   set(handles.edit1,'String','打開成功!');
   set(handles.edit1,'backgroundcolor',[0 1 0]);
   
elseif (isempty(s4) &&get(handles.port,'Value')==4 )        % 如果端口4存在,存創建端口
    s= serial('COM4');                   % 創建串口號
   if(get(handles.botelv,'Value')==1)   % 設置串口參數
       s.BaudRate = 1200;                  
   elseif(get(handles.botelv,'Value')==2)
       s.BaudRate = 2400;   
   elseif(get(handles.botelv,'Value')==3)
       s.BaudRate = 4800;   
   elseif(get(handles.botelv,'Value')==4)
       s.BaudRate = 9600;  
   elseif(get(handles.botelv,'Value')==5)
       s.BaudRate = 19200;
   elseif(get(handles.botelv,'Value')==6)
       s.BaudRate = 38400;
   elseif(get(handles.botelv,'Value')==7)
       s.BaudRate = 76800;
   elseif(get(handles.botelv,'Value')==8)
       s.BaudRate = 115200;  
   end
   if(get(handles.jiaoyanw,'Value')==1)
       s.Parity = 'none';                     % 無校驗位
   elseif(get(handles.jiaoyanw,'Value')==2)
       s.Parity = 'odd';                     % 偶校驗
   elseif(get(handles.jiaoyanw,'Value')==3)
       s.Parity = 'even';                     % 奇校驗
   end
   if(get(handles.dataw,'Value')==1)           % 數據位
       s.DataBits = 8;
   elseif(get(handles.dataw,'Value')==2)
       s.DataBits = 7;
   elseif(get(handles.dataw,'Value')==3)
       s.DataBits = 6;
   elseif(get(handles.dataw,'Value')==4)
       s.DataBits = 5;
   end
   if(get(handles.stopw,'Value')==1)           % 停止位
       s.StopBits = 1;
   elseif(get(handles.stopw,'Value')==2)
       s.StopBits = 1.5;
   elseif(get(handles.stopw,'Value')==3)
       s.StopBits = 2;  
   end
   s.Timeout = 0.1;
   s.InputBufferSize = 3072;
   s.OutputBufferSize = 3072;
   s.ReadAsyncMode = 'continuous';
   
   handles.sbuff = s;
   guidata(hObject, handles);
   s.BytesAvailableFcnMode = 'byte';
   s.BytesAvailableFcnCount = 10;
   s.BytesAvailableFcn = {@recive_data, handles};
   fopen(s);
   set(handles.caiji,'Enable','On');
   set(handles.off,'Enable','On');
   set(handles.on,'Enable','Off');
   set(handles.exit,'Enable','Off');
   set(handles.edit1,'String','打開成功!');
   set(handles.edit1,'backgroundcolor',[0 1 0]);
else
   msgbox('串口不存在或被占用!');
   set(handles.edit1,'String','打開失敗!');
   set(handles.edit1,'backgroundcolor',[1 0/255 0]);
end
   
% 中斷處理程序
function recive_data(t,  event, handles)
if(getappdata(handles.caiji,'ApplicationData')~=0)            % 收到單擊采集信號的信息
   
    g= handles.sbuff;
   [out,huanchongcout] = fread(g,10);                       % 讀取數據
%    plot(handles.axes1,out);  
    %解析數據
   if(out(1)==128 &&bitxor(bitxor(bitxor(bitxor(out(2),out(3)),out(4)),out(5)),out(6)) == out(7))
       data2 = dec2bin(out(2),8);
       data3 = dec2bin(out(3),8);
       data4 = dec2bin(out(4),8);
       data5 = dec2bin(out(5),8);
       data6 = dec2bin(out(6),8);
       cur_data0 = 0;      % 初始化脈沖值
       cur_data1 = dec2bin(cur_data0,32);  % 轉成二進制,有效位數為32
       cur_data1(1:4) = data6(5:8);
       cur_data1(5:11) = data5(2:8);
       cur_data1(12:18) = data4(2:8);
       cur_data1(19:25) = data3(2:8);
       cur_data1(26:32) = data2(2:8);
       cur_data2 = cur_data1;
       set(handles.current_data,'String',bin2dec(cur_data2));
   end
   
   
   if(getappdata(handles.save,'ApplicationData') ~=0)        % 開始存儲數據
      
       File = get(handles.save_play,'String');
       fid = fopen(File,'a');
       fprintf(fid,'%d\t',bin2dec(cur_data2));
       fprintf(fid,'\n');
       fclose(fid);
      
   end      
end  
% --- Executes on button press in off.
function off_Callback(hObject, eventdata,handles)
% hObject   handle to off (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles   structure with handles and user data (see GUIDATA)
    s= handles.sbuff;      % 傳遞
   fclose(s);              % 關閉串口設備對象
   delete(s);              % 刪除內存中的串口設備對象
   clear s;                % 清除工作區間的串口設備對象
   setappdata(handles.axes1,'ApplicationData',0);  % 清空緩存數據
   set(handles.axes1,'UserData',0);                % 將計數器清0
   set(handles.save,'UserData',0);                 % 將數據保存區清0
   set(handles.edit1,'String','串口關閉');
   set(handles.edit1,'backgroundcolor',[0 0/255 1]);
   set(handles.caiji,'Enable','Off');
   set(handles.on,'Enable','On');
   set(handles.save,'Enable','Off');
   set(handles.off,'Enable','Off');
   set(handles.exit,'Enable','On');
% --- Executes on selection change in port.
function port_Callback(hObject, eventdata,handles)
% hObject   handle to port (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 port contents as cell array
%       contents{get(hObject,'Value')} returns selected item from port
% --- Executes during object creation,after setting all properties.
function port_CreateFcn(hObject, eventdata,handles)
% hObject   handle to port (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 awhite 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 inbotelv.
function botelv_Callback(hObject,eventdata, handles)
% hObject   handle to botelv (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 botelv contents as cell array
%       contents{get(hObject,'Value')} returns selected item from botelv
% --- Executes during object creation,after setting all properties.
function botelv_CreateFcn(hObject,eventdata, handles)
% hObject   handle to botelv (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 awhite 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 indataw.
function dataw_Callback(hObject, eventdata,handles)
% hObject   handle to dataw (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 dataw contents as cell array
%       contents{get(hObject,'Value')} returns selected item from dataw
% --- Executes during object creation,after setting all properties.
function dataw_CreateFcn(hObject,eventdata, handles)
% hObject   handle to dataw (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 awhite 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 injiaoyanw.
function jiaoyanw_Callback(hObject,eventdata, handles)
% hObject   handle to jiaoyanw (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 jiaoyanw contents as cell array
%       contents{get(hObject,'Value')} returns selected item from jiaoyanw
% --- Executes during object creation,after setting all properties.
function jiaoyanw_CreateFcn(hObject,eventdata, handles)
% hObject   handle to jiaoyanw (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 awhite 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 instopw.
function stopw_Callback(hObject, eventdata,handles)
% hObject   handle to stopw (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 stopw contents as cell array
%       contents{get(hObject,'Value')} returns selected item from stopw
% --- Executes during object creation,after setting all properties.
function stopw_CreateFcn(hObject,eventdata, handles)
% hObject   handle to stopw (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 awhite background on Windows.
%      See ISPC and COMPUTER.
if ispc &&isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
   set(hObject,'BackgroundColor','white');
end
% --- 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 topopulate axes1
if ispc &&isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
   set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in caiji.
function caiji_Callback(hObject, eventdata,handles)
% hObject   handle to caiji (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles   structure with handles and user data (see GUIDATA)
% data = handles.data;
% 發送信號,傳遞給中斷,將信號暫存在采集控件中
% t =str2num(get(handles.save_time,'String'));
index =get(handles.save_lujin,'UserData');        % 是否設定存儲路徑
g = handles.sbuff;
[a,b] = fread(g);
if ( b==0 )
   msgbox('當前無數據輸入!');
   set(handles.save,'Enable','Off');
else
   if(get(handles.caiji,'UserData')==0)
       set(handles.caiji,'String','停止采集');
       set(handles.caiji,'BackgroundColor',[1 0 0]);
       setappdata(handles.caiji,'ApplicationData',1);   % 用于傳遞給中斷響應函數,可以接收并顯示數據了
       set(handles.caiji,'UserData',1);
       if(  index~=0 )                                       % 設定存儲條件
           set(handles.save,'Enable','On');
       else
           set(handles.save,'Enable','Off');
       end
   else
       set(handles.caiji,'String','開始采集');
       setappdata(handles.caiji,'ApplicationData',0);
       set(handles.caiji,'BackgroundColor',[0.8 0.8 0.8]);
       set(handles.caiji,'UserData',0);
       set(handles.save,'Enable','Off');
       set(handles.save_time,'String',0);
   end
   
end
% --- Executes on button press in save.
function save_Callback(hObject, eventdata,handles)
% hObject   handle to save (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles   structure with handles and user data (see GUIDATA)
% 發送開始存儲信號,并帶有時間控制功能
setappdata(handles.save,'ApplicationData',1);
% g = handles.sbuff;
% [data,b] = fread(g)
  t =str2num(get(handles.save_time,'String'));
acc_time = t;        % 中間變量     
set(handles.time_play,'String',num2str(t));
  fori = 1:t         % 時間顯示     
     
    pause(0.995);
    set(handles.time_play,'String',num2str(acc_time-1));   
    acc_time = acc_time-1;     
     
end   
setappdata(handles.save,'ApplicationData',0);
%  File = get(handles.save_play,'String');                     % 獲取存儲路徑
%  fopen(File);
%   g= handles.sbuff;
%  [data,b] = fread(g)
%  fprintf(File,'%12.8e\t',data);
% save ( File ,'uint8','data');
% --- Executes on button press in exit.
function exit_Callback(hObject, eventdata,handles)
% hObject   handle to exit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles   structure with handles and user data (see GUIDATA)
close(gcbf);
function save_play_Callback(hObject,eventdata, handles)
% hObject   handle to save_play (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') returnscontents of save_play as text
%       str2double(get(hObject,'String')) returns contents of save_play as adouble
% --- Executes during object creation,after setting all properties.
function save_play_CreateFcn(hObject,eventdata, handles)
% hObject   handle to save_play (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 whitebackground on Windows.
%      See ISPC and COMPUTER.
if ispc &&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))
   set(hObject,'BackgroundColor','white');
end
% --- Executes on button press insave_lujin.
function save_lujin_Callback(hObject,eventdata, handles)
% hObject   handle to save_lujin (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles   structure with handles and user data (see GUIDATA)
set(handles.save,'Enable','On');
[file, pathname, index] =uiputfile({'*.txt';'*.dat';'*.mat'},'文件另存為');
file1 = strcat(pathname,file);
set(handles.save_play,'String',file1);
set(handles.save_lujin,'UserData',index);      % 判斷是否設定了保存文件的路徑
function save_time_Callback(hObject, eventdata,handles)
% hObject   handle to save_time (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') returnscontents of save_time as text
%       str2double(get(hObject,'String')) returns contents of save_time as adouble
% --- Executes during object creation,after setting all properties.
function save_time_CreateFcn(hObject,eventdata, handles)
% hObject   handle to save_time (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 whitebackground on Windows.
%      See ISPC and COMPUTER.
if ispc &&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))
   set(hObject,'BackgroundColor','white');
end
% --- Executes during object creation,after setting all properties.
function time_play_CreateFcn(hObject, eventdata,handles)
% hObject   handle to time_play (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles   empty - handles not created until after all CreateFcns called
function current_data_Callback(hObject,eventdata, handles)
% hObject   handle to current_data (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') returnscontents of current_data as text
%       str2double(get(hObject,'String')) returns contents of current_data as adouble
% --- Executes during object creation,after setting all properties.
function current_data_CreateFcn(hObject,eventdata, handles)
% hObject   handle to current_data (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 whitebackground on Windows.
%      See ISPC and COMPUTER.
if ispc &&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))
   set(hObject,'BackgroundColor','white');
end






歡迎光臨 (http://www.zg4o1577.cn/bbs/) Powered by Discuz! X3.1
主站蜘蛛池模板: 最新免费黄色网址 | 久艹av| 黄色一级毛片 | 爱爱爱av | 国产成人精品免费视频大全最热 | 国产japanhdxxxx麻豆 | 狼色网 | 精品国产一级片 | 久久久久久国产一区二区三区 | 亚洲综合五月天婷婷 | 欧美综合一区二区三区 | 91免费在线 | 欧美片网站免费 | 97精品视频在线 | 一区二区三区高清不卡 | 久久一区二区精品 | 国产在线精品一区二区三区 | 成人精品一区亚洲午夜久久久 | 欧美激情va永久在线播放 | 亚洲免费成人 | 99久热在线精品视频观看 | 一级毛片在线播放 | av国产在线观看 | 日本精品在线一区 | 亚洲国产成人精品久久久国产成人一区 | 国产91亚洲精品 | 国产剧情一区 | 亚洲 中文 欧美 日韩 在线观看 | 日本大香伊一区二区三区 | 国产成人一区二区三区电影 | 天天精品在线 | 精品久久久久久久久亚洲 | 日日操av | 亚洲综合色婷婷 | 欧美在线视频观看 | 四虎影院在线观看免费视频 | 美女一区| 欧美性受xxx| 成人在线免费观看 | 亚洲一区二区中文字幕 | 久久久av |