how to introduce a lamp in this app designer code
2 次查看(过去 30 天)
显示 更早的评论
Hello,
I want to introduce a app.Lamp i my GUI. When I press the Capture Button I want the Lamp to start a camera capture process and when the process ends, I want the lamp to turn off.
classdef Main_Draft_2 < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
iSCAT matlab.ui.Figure
CameraControlsMenu matlab.ui.container.Menu
ZWOCameraMenu matlab.ui.container.Menu
TabGroup matlab.ui.container.TabGroup
AcquisitionTab matlab.ui.container.Tab
iSCATImagesPanel matlab.ui.container.Panel
iscatimage matlab.ui.control.UIAxes
AveragedImagePanel matlab.ui.container.Panel
averagedimage matlab.ui.control.UIAxes
CAPTUREButton matlab.ui.control.Button
FinalImagePanel matlab.ui.container.Panel
finalimage matlab.ui.control.UIAxes
AnyDropDown matlab.ui.control.DropDown
iSCATimageButtonGroup matlab.ui.container.ButtonGroup
FirstButton matlab.ui.control.RadioButton
SecondButton matlab.ui.control.RadioButton
ThirdButton matlab.ui.control.RadioButton
FinalButton matlab.ui.control.RadioButton
AcquisitionParametersPanel matlab.ui.container.Panel
HighSpeedMode matlab.ui.control.CheckBox
FAN matlab.ui.control.CheckBox
ExposureusEditFieldLabel matlab.ui.control.Label
ExposureusEditField matlab.ui.control.NumericEditField
GainEditFieldLabel matlab.ui.control.Label
GainEditField matlab.ui.control.NumericEditField
GammaEditFieldLabel matlab.ui.control.Label
GammaEditField matlab.ui.control.NumericEditField
HeightpxEditFieldLabel matlab.ui.control.Label
Heightpx matlab.ui.control.NumericEditField
WidthpxEditFieldLabel matlab.ui.control.Label
Widthpx matlab.ui.control.NumericEditField
BinningEditFieldLabel matlab.ui.control.Label
BinningEditField matlab.ui.control.EditField
ImageTypeEditFieldLabel matlab.ui.control.Label
ImageTypeEditField matlab.ui.control.EditField
ModeDropDownLabel matlab.ui.control.Label
ModeDropDown matlab.ui.control.DropDown
PhaseShiftsEditFieldLabel matlab.ui.control.Label
PhaseShiftsEditField matlab.ui.control.EditField
CyclesEditFieldLabel matlab.ui.control.Label
CyclesEditField matlab.ui.control.NumericEditField
DirectoryPath matlab.ui.control.EditField
SaveButton matlab.ui.control.Button
CycleDropDownLabel matlab.ui.control.Label
CycleDropDown matlab.ui.control.DropDown
CapturedImagesEditFieldLabel matlab.ui.control.Label
CapturedImagesEditField matlab.ui.control.NumericEditField
FPSEditFieldLabel matlab.ui.control.Label
FPSEditField matlab.ui.control.NumericEditField
DisplayDelayEditFieldLabel matlab.ui.control.Label
DisplayDelayEditField matlab.ui.control.NumericEditField
UploadButton matlab.ui.control.Button
AcquiredImagesTab matlab.ui.container.Tab
FirstPhase matlab.ui.control.UIAxes
SecondPhase matlab.ui.control.UIAxes
ThidPhase matlab.ui.control.UIAxes
FourthPhase matlab.ui.control.UIAxes
LoadButton matlab.ui.control.Button
LoadButton_2 matlab.ui.control.Button
LoadButton_3 matlab.ui.control.Button
LoadButton_4 matlab.ui.control.Button
SecondPhase_2 matlab.ui.control.UIAxes
FourthPhase_2 matlab.ui.control.UIAxes
LoadButton_5 matlab.ui.control.Button
LoadButton_6 matlab.ui.control.Button
StageControlTab matlab.ui.container.Tab
up matlab.ui.control.Button
left matlab.ui.control.Button
right matlab.ui.control.Button
down matlab.ui.control.Button
elevate matlab.ui.control.Button
deelevate matlab.ui.control.Button
STOPButton matlab.ui.control.Button
SpeedmmsEditFieldLabel matlab.ui.control.Label
SpeedmmsEditField matlab.ui.control.NumericEditField
MoveDistancemicronEditFieldLabel matlab.ui.control.Label
MoveDistancemicronEditField matlab.ui.control.NumericEditField
XAxisErrorButton matlab.ui.control.Button
YAxisErrorButton matlab.ui.control.Button
ZAxisErrorButton matlab.ui.control.Button
ErorLogTextAreaLabel matlab.ui.control.Label
ErorLogTextArea matlab.ui.control.TextArea
LogPanel matlab.ui.container.Panel
LogTextAreaLabel matlab.ui.control.Label
LogTextArea matlab.ui.control.TextArea
end
properties (Access = private)
ControlsApp
exposureval=32;
gainval=0;
gammaval=0; % Description
heightval=3672;
widthval=5496;
binval='Bin 1';
formatval='RAW8';
imagelistglobal;
countglobal;
end
methods (Access = public)
function updatedata(app,newexposure,newgain,newgamma, height, width, bin, format)
app.exposureval=newexposure;
app.gainval=newgain;
app.gammaval=newgamma;
app.heightval=height;
app.widthval=width;
app.binval=bin;
app.formatval=format;
app.ExposureusEditField.Value=newexposure;
app.GainEditField.Value=newgain;
app.GammaEditField.Value=newgamma;
app.Heightpx.Value=height;
app.Widthpx.Value=width;
app.BinningEditField.Value=bin;
app.ImageTypeEditField.Value=format;
end
end
methods (Access = private)
function logfunction(app,val)
value=size(app.LogTextArea.Value);
value=value(1);
temp=0;
val=sprintf('%s %s',datetime, val);
%app.LogTextArea.Value{1}=val;
while temp<value
app.LogTextArea.Value{value+1-temp}=app.LogTextArea.Value{value-temp}
temp=temp+1
end
app.LogTextArea.Value{1}=val;
end
%----------------------------------------------------------------------------------------------------------------------------------------------------------%
% Camera functions %
%----------------------------------------------------------------------------------------------------------------------------------------------------------%
%-------------------------------------------------InitDrivers-----------------------------------------------------------------------------------------------%
function initDrivers(app)
if ~libisloaded('ASICamera2')
loadlibrary('ASICamera2', @ASICamera2_proto)
% message='Libary Loaded';
% logfunction(app,message);
else
% message='Libary already Loaded';
% logfunction(app,message);
end
end
%-------------------------------------------------InitCameras-----------------------------------------------------------------------------------------------%
function [CamNum]=initCameras(app)
CamNum = calllib('ASICamera2', 'ASIGetNumOfConnectedCameras');
if CamNum<1
unloadlibrary('ASICamera2');
%logfunction(app,"Camera Not Connected")
end
Sizes=cell(1,CamNum);
%Get names of the cameras
for i=0:CamNum-1
Properties=CreateProperties(); %Creates structs for used functions
info=libstruct('s_ASI_CAMERA_INFO',Properties);
n=calllib('ASICamera2', 'ASIGetCameraProperty', info,i);
if n~=0
logfunction(app,"No camera connected or index value out of boundary")
end
get(info);
end
%open and init cameras
for i=0:CamNum-1
a=calllib('ASICamera2', 'ASIOpenCamera',i);
b=calllib('ASICamera2', 'ASIInitCamera',i);
if a==0 && b==0
logfunction(app,"Camera opened!")
else
logfunction(app,"Camera not opened!")
end
end
end
%-------------------------------------------------ShowVideo-----------------------------------------------------------------------------------------------%
function [count,val,imagelist]=showVideo(app,CameraNumber,OutputValue,Sizes)
set_Output(CameraNumber,Sizes,OutputValue);
calllib('ASICamera2','ASIStartVideoCapture',CameraNumber);
if OutputValue==0
factor=1;
elseif OutputValue==1
factor=3;
elseif OutputValue==2
factor=2;
elseif OutputValue==3
factor=1;
end
value = libpointer ( 'int32Ptr' , int32(0));
asiBool = libpointer ( 'int32Ptr' , int32(0));
calllib('ASICamera2','ASIGetControlValue',CameraNumber,int32(1), value, asiBool);
ExposureTime=value.Value;
lBuffSize=factor*Sizes{CameraNumber+1}(2)*Sizes{CameraNumber+1}(1); %Set the buffer
images = libpointer ( 'uint8Ptr' , uint8(zeros(1,lBuffSize)));
count=1
i=0;
tic
while i==0
calllib('ASICamera2','ASIGetVideoData',CameraNumber, images, int32(lBuffSize), int32(ExposureTime*2+(500)));
image=images.Value;
% if OutputValue==1 || OutputValue==2
% image = typecast(image(:), 'uint16');
% end
image=reshape(image,[Sizes{CameraNumber+1}(2),Sizes{CameraNumber+1}(1)]);
%imshow(image,[]);
imagelist{count}=image;
count=count+1
% if ~ishghandle(a)
% break
% end
loopval=(3*app.CyclesEditField.Value);
if count>loopval
break
end
end
calllib('ASICamera2','ASIStopVideoCapture',CameraNumber);
val= toc;
end
%-------------------------------------------------------method end----------------------------------------------------------------------------------------%
end
% Callbacks that handle component events
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
updatedata(app,app.exposureval,app.gainval,app.gammaval,app.heightval,app.widthval,app.binval,app.formatval)
drawnow;
app.iSCAT.WindowState = 'maximized';
end
% Menu selected function: ZWOCameraMenu
function ZWOCameraMenuSelected(app, event)
app.ControlsApp = ASICAP_Camera_Controls(app,app.ExposureusEditField.Value,app.GainEditField.Value,app.GammaEditField.Value,app.Heightpx.Value,app.Widthpx.Value,app.BinningEditField.Value,app.ImageTypeEditField.Value);
end
% Button pushed function: CAPTUREButton
function CAPTUREButtonPushed(app, event)
logfunction(app,"started")
warning('off', 'Images:initSize:adjustingMag');
initDrivers(app);
[CamNum]=initCameras(app);
Sizes{1}=[app.Heightpx.Value,app.Widthpx.Value];
Gain=app.GainEditField.Value;
Exposure=app.ExposureusEditField.Value;
Gamma=app.GammaEditField.Value;
calllib('ASICamera2','ASISetControlValue',0,0, int32(Gain), int32(0)) %Gain
calllib('ASICamera2','ASISetControlValue',0,1, int32(Exposure), int32(0)) %Exposure
calllib('ASICamera2','ASISetControlValue',0,2, int32(Gamma), int32(1)) %Gamma
% calllib('ASICamera2','ASISetControlValue',0,3, int32(0), int32(0))
% calllib('ASICamera2','ASISetControlValue',0,4, int32(0), int32(0))
% calllib('ASICamera2','ASISetControlValue',0,5, int32(0), int32(0))
% calllib('ASICamera2','ASISetControlValue',0,6, int32(100), int32(0))
calllib('ASICamera2','ASISetControlValue',0,9, int32(2), int32(0)) %Image Flip
% calllib('ASICamera2','ASISetControlValue',0,14, int32(1), int32(0))
%----------------------------------------------FAN------------------------------------------------------%
if app.FAN.Value==1
calllib('ASICamera2','ASISetControlValue',0,19, int32(1), int32(0));
message='Fan ON';
logfunction(app,message);
else
calllib('ASICamera2','ASISetControlValue',0,19, int32(0), int32(0));
message='Fan OFF';
logfunction(app,message);
end
%----------------------------------------------High Speed Mode-------------------------------------------%
if app.HighSpeedMode.Value==1
calllib('ASICamera2','ASISetControlValue',0,14, int32(1), int32(0));
logfunction(app,"High Speed Mode ON")
else
calllib('ASICamera2','ASISetControlValue',0,14, int32(0), int32(0));
logfunction(app,"High Speed Mode OFF")
end
%------------------------------------First Camera Detected-------------------------------------------------%
CameraNumber=0;
%---------------------------------------Image Mode-----------------------------------------%
if app.ImageTypeEditField.Value=="RAW8"
OutputValue=0;
elseif app.ImageTypeEditField.Value=="RAW16"
OutputValue=2;
end
set_Output(CameraNumber,Sizes,OutputValue);
%----------------------------------------Camera Mode-------------------%
if app.ModeDropDown.Value=="Camera"
loopval=(3*app.CyclesEditField.Value);
temploopval=1;
tic
while temploopval<=loopval
image=makeExposure(CameraNumber,OutputValue,Sizes);
imagelist{temploopval}=image;
temploopval=temploopval+1;
end
timestamp=toc
app.countglobal=loopval;
app.CapturedImagesEditField.Value=temploopval-1;
app.FPSEditField.Value=(temploopval-1)/timestamp;
imagelistval=size(imagelist)
count=1;
%formattedlist=[]
averagedimage=0;
while(count<=loopval)
image=imagelist{count};
image=reshape(image,[app.Widthpx.Value,app.Heightpx.Value] );
image=imrotate(image,90);
formattedlist{count}=image;
%imshow(formattedlist{count},[],'Parent',app.averagedimage)
%pause(app.DisplayDelayEditField.Value)
averagedimage=averagedimage+formattedlist{count};
count=count+1;
end
averagedimage=averagedimage/loopval;
imshow(averagedimage,[],'Parent',app.averagedimage);
count=count-1;
size(formattedlist)
idx=1;
i=1;
app.imagelistglobal=[]
newtempval=app.CyclesEditField.Value;
for i=1:newtempval
while(idx<loopval)
val=formattedlist(idx);
app.imagelistglobal=[app.imagelistglobal val]
idx=idx+1
val=formattedlist(idx);
app.imagelistglobal=[app.imagelistglobal val]
idx=idx+1
val=formattedlist(idx);
app.imagelistglobal=[app.imagelistglobal val]
idx=idx+1
end
end
% size(Cellimages)
selectedButton = app.iSCATimageButtonGroup.SelectedObject;
switch selectedButton
case app.FirstButton
imshow(app.imagelistglobal{1},[],'Parent',app.iscatimage)
case app.SecondButton
imshow(app.imagelistglobal{2},[],'Parent',app.iscatimage)
case app.ThirdButton
imshow(app.imagelistglobal{3},[],'Parent',app.iscatimage)
end
size(app.imagelistglobal)
%
% i=1;
% while i<count
% app.imagelistglobal{i}=formattedlist{i}
% i=i+1;
% end
%---------------------------Video Mode-----------------------------------------------------------------%
elseif app.ModeDropDown.Value=="Video"
OutputValue=0;
[count,val,imagelist]=showVideo(app,CameraNumber,OutputValue,Sizes);
count=count-1;
averagedimageval=0;
for i=1:count
image=imagelist{i};
image=imrotate(image,90);
imagelist{i}=image;
averagedimageval=averagedimageval+image;
end
averagedimageval=averagedimageval/count;
imshow(averagedimageval,[],'Parent',app.averagedimage);
app.CapturedImagesEditField.Value=count;
app.FPSEditField.Value=count/val;
size(imagelist)
app.countglobal=count;
idx=1;
i=1;
app.imagelistglobal=[]
newtempval=app.CyclesEditField.Value;
for i=1:newtempval
while(idx<count)
val= imagelist(idx);
app.imagelistglobal=[app.imagelistglobal val]
idx=idx+1
val= imagelist(idx);
app.imagelistglobal=[app.imagelistglobal val]
idx=idx+1
val= imagelist(idx);
app.imagelistglobal=[app.imagelistglobal val]
idx=idx+1
end
end
selectedButton = app.iSCATimageButtonGroup.SelectedObject;
switch selectedButton
case app.FirstButton
imshow(app.imagelistglobal{1},[],'Parent',app.iscatimage)
case app.SecondButton
imshow(app.imagelistglobal{2},[],'Parent',app.iscatimage)
case app.ThirdButton
imshow(app.imagelistglobal{3},[],'Parent',app.iscatimage)
end
size(app.imagelistglobal)
end
%---------------------------------Complete---------------------------------------------------------------------%
closeCameras(CamNum);
logfunction(app,"Camera Closed!")
value = app.LogTextArea.Value; % Value entered in textArea
f=fopen('log.txt','a');
formatSpec= "%s";
for i =1:length(value)
fprintf(f,formatSpec,value{i});
end
% app.Lamp.Color="Red"
end
% Value changed function: ModeDropDown
function ModeDropDownValueChanged(app, event)
value = app.ModeDropDown.Value;
switch value
case 'Video'
app.ImageTypeEditField.Value='RAW8';
case'Camera'
app.ImageTypeEditField.Value='RAW16';
end
end
% Selection changed function: iSCATimageButtonGroup
function iSCATimageButtonGroupSelectionChanged(app, event)
cycleval=(app.CycleDropDown.Value);
cycleval=str2double(cycleval);
selectedButton = app.iSCATimageButtonGroup.SelectedObject;
count=0;
for i=1:cycleval
switch selectedButton
case app.FirstButton
im=app.imagelistglobal{1+count};
imshow(im,[],'Parent',app.iscatimage)
case app.SecondButton
im=app.imagelistglobal{2+count};
imshow(im,[],'Parent',app.iscatimage)
case app.ThirdButton
im=app.imagelistglobal{3+count};
imshow(im,[],'Parent',app.iscatimage)
end
count=count+3;
end
end
% Value changed function: CyclesEditField
function CyclesEditFieldValueChanged(app, event)
value = app.CyclesEditField.Value;
%app.CycleDropDown.Items=["1","2","3"];
for i=1:value
list{i}=num2str(i)
end
app.CycleDropDown.Items=list;
end
% Value changed function: CycleDropDown
function CycleDropDownValueChanged(app, event)
cycleval=(app.CycleDropDown.Value);
cycleval=str2double(cycleval);
selectedButton = app.iSCATimageButtonGroup.SelectedObject;
count=0;
for i=1:cycleval
switch selectedButton
case app.FirstButton
im=app.imagelistglobal{1+count};
imshow(im,[],'Parent',app.iscatimage)
case app.SecondButton
im=app.imagelistglobal{2+count};
imshow(im,[],'Parent',app.iscatimage)
case app.ThirdButton
im=app.imagelistglobal{3+count};
imshow(im,[],'Parent',app.iscatimage)
end
count=count+3;
end
end
% Button pushed function: SaveButton
function SaveButtonPushed(app, event)
selpath = uigetdir(path);
app.DirectoryPath.Value=selpath;
count=(app.countglobal)
for i=1:count
data=app.imagelistglobal{i};
Folder = app.DirectoryPath.Value;
BaseName=sprintf('RAW%d',i);
Path=selpath;
Name=fullfile(Path,BaseName);
save(Name,'data');
BaseName=sprintf('RAW%d.tiff',i);
Name=fullfile(Path,BaseName);
data=imadjust(data);
imwrite(data, Name );
end
end
% Value changed function: AnyDropDown
function AnyDropDownValueChanged(app, event)
value = app.AnyDropDown.Value;
switch value
case 'Upload'
app.UploadButton.Visible='on'
app.iSCATImagesPanel.Title='Upload'
app.CycleDropDown.Visible='off'
app.iSCATimageButtonGroup.Visible='off'
case 'Flouroscence'
app.UploadButton.Visible='off'
app.iSCATImagesPanel.Title='Flouroscence'
app.CycleDropDown.Visible='off'
app.iSCATimageButtonGroup.Visible='off'
case 'iSCAT'
app.UploadButton.Visible='off'
app.iSCATImagesPanel.Title='iSCAT'
app.CycleDropDown.Visible='on'
app.iSCATimageButtonGroup.Visible='on'
end
end
% Button pushed function: UploadButton
function UploadButtonPushed(app, event)
[file,path] = uigetfile;
file=fullfile(path,file);
file=load(file);
file=file.data;
imshow(file,[],'Parent',app.finalimage);
end
end
% Component initialization
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Create iSCAT and hide until all components are created
app.iSCAT = uifigure('Visible', 'off');
app.iSCAT.Position = [100 100 1839 966];
app.iSCAT.Name = 'iSCAT (v.1)';
% Create CameraControlsMenu
app.CameraControlsMenu = uimenu(app.iSCAT);
app.CameraControlsMenu.Text = 'Camera Controls';
% Create ZWOCameraMenu
app.ZWOCameraMenu = uimenu(app.CameraControlsMenu);
app.ZWOCameraMenu.MenuSelectedFcn = createCallbackFcn(app, @ZWOCameraMenuSelected, true);
app.ZWOCameraMenu.Text = 'ZWO Camera';
% Create TabGroup
app.TabGroup = uitabgroup(app.iSCAT);
app.TabGroup.Position = [1 0 1839 967];
% Create AcquisitionTab
app.AcquisitionTab = uitab(app.TabGroup);
app.AcquisitionTab.Title = 'Acquisition';
% Create iSCATImagesPanel
app.iSCATImagesPanel = uipanel(app.AcquisitionTab);
app.iSCATImagesPanel.TitlePosition = 'centertop';
app.iSCATImagesPanel.Title = 'iSCAT Images';
app.iSCATImagesPanel.FontWeight = 'bold';
app.iSCATImagesPanel.Position = [1 564 632 380];
% Create iscatimage
app.iscatimage = uiaxes(app.iSCATImagesPanel);
title(app.iscatimage, '')
xlabel(app.iscatimage, '')
ylabel(app.iscatimage, '')
app.iscatimage.PlotBoxAspectRatio = [1 1 1];
app.iscatimage.ClippingStyle = 'rectangle';
app.iscatimage.Box = 'on';
app.iscatimage.XColor = 'none';
app.iscatimage.YColor = 'none';
app.iscatimage.Color = 'none';
app.iscatimage.Position = [-2 1 633 359];
% Create AveragedImagePanel
app.AveragedImagePanel = uipanel(app.AcquisitionTab);
app.AveragedImagePanel.TitlePosition = 'centertop';
app.AveragedImagePanel.Title = 'Averaged Image';
app.AveragedImagePanel.FontWeight = 'bold';
app.AveragedImagePanel.Position = [632 564 613 380];
% Create averagedimage
app.averagedimage = uiaxes(app.AveragedImagePanel);
title(app.averagedimage, '')
xlabel(app.averagedimage, '')
ylabel(app.averagedimage, '')
app.averagedimage.PlotBoxAspectRatio = [1 1 1];
app.averagedimage.ClippingStyle = 'rectangle';
app.averagedimage.Box = 'on';
app.averagedimage.XColor = 'none';
app.averagedimage.YColor = 'none';
app.averagedimage.Color = 'none';
app.averagedimage.Position = [1 1 613 359];
% Create CAPTUREButton
app.CAPTUREButton = uibutton(app.AcquisitionTab, 'push');
app.CAPTUREButton.ButtonPushedFcn = createCallbackFcn(app, @CAPTUREButtonPushed, true);
app.CAPTUREButton.FontSize = 20;
app.CAPTUREButton.FontWeight = 'bold';
app.CAPTUREButton.Position = [896 308 112 31];
app.CAPTUREButton.Text = 'CAPTURE';
% Create FinalImagePanel
app.FinalImagePanel = uipanel(app.AcquisitionTab);
app.FinalImagePanel.TitlePosition = 'centertop';
app.FinalImagePanel.Title = 'Final Image';
app.FinalImagePanel.FontWeight = 'bold';
app.FinalImagePanel.Position = [1244 564 593 380];
% Create finalimage
app.finalimage = uiaxes(app.FinalImagePanel);
title(app.finalimage, '')
xlabel(app.finalimage, '')
ylabel(app.finalimage, '')
app.finalimage.PlotBoxAspectRatio = [1 1 1];
app.finalimage.BoxStyle = 'full';
app.finalimage.XColor = 'none';
app.finalimage.YColor = 'none';
app.finalimage.Color = 'none';
app.finalimage.Position = [1 1 593 360];
% Create AnyDropDown
app.AnyDropDown = uidropdown(app.AcquisitionTab);
app.AnyDropDown.Items = {'iSCAT', 'Flouroscence', 'Upload'};
app.AnyDropDown.ValueChangedFcn = createCallbackFcn(app, @AnyDropDownValueChanged, true);
app.AnyDropDown.Position = [7 501 100 22];
app.AnyDropDown.Value = 'iSCAT';
% Create iSCATimageButtonGroup
app.iSCATimageButtonGroup = uibuttongroup(app.AcquisitionTab);
app.iSCATimageButtonGroup.SelectionChangedFcn = createCallbackFcn(app, @iSCATimageButtonGroupSelectionChanged, true);
app.iSCATimageButtonGroup.TitlePosition = 'centertop';
app.iSCATimageButtonGroup.Title = 'iSCAT image';
app.iSCATimageButtonGroup.FontWeight = 'bold';
app.iSCATimageButtonGroup.Position = [245 498 305 55];
% Create FirstButton
app.FirstButton = uiradiobutton(app.iSCATimageButtonGroup);
app.FirstButton.Text = 'First';
app.FirstButton.FontWeight = 'bold';
app.FirstButton.Position = [11 9 59 22];
app.FirstButton.Value = true;
% Create SecondButton
app.SecondButton = uiradiobutton(app.iSCATimageButtonGroup);
app.SecondButton.Text = 'Second';
app.SecondButton.FontWeight = 'bold';
app.SecondButton.Position = [80 9 65 22];
% Create ThirdButton
app.ThirdButton = uiradiobutton(app.iSCATimageButtonGroup);
app.ThirdButton.Text = 'Third';
app.ThirdButton.FontWeight = 'bold';
app.ThirdButton.Position = [155 9 65 22];
end
end
% App creation and deletion
methods (Access = public)
% Construct app
function app = Main_Draft_2
% Create UIFigure and components
createComponents(app)
% Register the app with App Designer
registerApp(app, app.iSCAT)
% Execute the startup function
runStartupFcn(app, @startupFcn)
if nargout == 0
clear app
end
end
% Code that executes before app deletion
function delete(app)
% Delete UIFigure when app is deleted
delete(app.iSCAT)
end
end
end
If I introduce the Lamp right at the start of the Capture Button the Lamp doesn't start at all because the transitiion is so fast. Please suggest me something.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!