forked from Modi1987/KST-Kuka-Sunrise-Toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfcnCallback_cmd_Load_coammnd_line_Program.m
48 lines (41 loc) · 1.16 KB
/
fcnCallback_cmd_Load_coammnd_line_Program.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
function fcnCallback_cmd_Load_coammnd_line_Program()
%% Load a pre-saved program into command-line
% Copyright: Mohammad SAFEEA, 2018-07-20
% Open file dialog, to select file to load
[file,path] = uigetfile('*.mat');
try
if sum(sum([file,path] ))==0
disp('No file was selected');
return;
end
catch
end
% Load file into the path
x=[];
currentPath=pwd;
try
cd(path);
x=load(file);
cd(currentPath);
catch
message='Can not load the file from the selected path';
fcn_errorMessage(message);
disp('Access denied, can not load file');
cd(currentPath);
return;
end
res=isfield(x,'iiwa_gui_commandLine_Ascii_Program20180720_Mo_Saf');
if res==0
message='File is corrupted or a unsupported file format.';
fcn_errorMessage(message);
return;
end
% If checks are OK, load the pre-saved prgram into the command line
h=findobj(0,'tag','txt_CommandLine');
message='Do you really want to load the current file, this will delete any commands that already exists in the command line';
y=dialog_confirmationDialog(message);
if(y==1)
strArray=x.iiwa_gui_commandLine_Ascii_Program20180720_Mo_Saf;
set(h,'String',strArray);
end
end