-
Notifications
You must be signed in to change notification settings - Fork 0
/
ControllViewPort.m
74 lines (70 loc) · 2.21 KB
/
ControllViewPort.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
%NOT TESTED
% Amirkabir University of Tehran (Tehran Polytechnic)
% Summer 2011
% http://www.mechatronics3d.com
function ControllViewPort(Robot,ViewNum,View1,View2,View3,View4)
if nargin > 6
error('Too many input arguments');
elseif nargin < 2
error('Too few input arguments');
elseif nargin == 6
ViewNum=CheckInput(ViewNum);
Msg=['SET {Type Viewports} {Config ' ViewNum '}'];
if ~strcmpi(View1,'Same')
Msg=[Msg ' {Viewport1 ' View1 '}'];
end
if ~strcmpi(View2,'Same')
Msg=[Msg ' {Viewport2 ' View2 '}'];
end
if ~strcmpi(View3,'Same')
Msg=[Msg ' {Viewport3 ' View3 '}'];
end
if ~strcmpi(View4,'Same')
Msg=[Msg ' {Viewport4 ' View4 '}'];
end
elseif nargin == 5
ViewNum=CheckInput(ViewNum);
Msg=['SET {Type Viewports} {Config ' ViewNum '}'];
if ~strcmpi(View1,'Same')
Msg=[Msg ' {Viewport1 ' View1 '}'];
end
if ~strcmpi(View2,'Same')
Msg=[Msg ' {Viewport2 ' View2 '}'];
end
if ~strcmpi(View3,'Same')
Msg=[Msg ' {Viewport3 ' View3 '}'];
end
elseif nargin == 4
ViewNum=CheckInput(ViewNum);
Msg=['SET {Type Viewports} {Config ' ViewNum '}'];
if ~strcmpi(View1,'Same')
Msg=[Msg ' {Viewport1 ' View1 '}'];
end
if ~strcmpi(View2,'Same')
Msg=[Msg ' {Viewport2 ' View2 '}'];
end
elseif nargin == 3
ViewNum=CheckInput(ViewNum);
Msg=['SET {Type Viewports} {Config ' ViewNum '}'];
if ~strcmpi(View1,'Same')
Msg=[Msg ' {Viewport1 ' View1 '}'];
end
elseif nargin == 2
ViewNum=CheckInput(ViewNum);
Msg=['SET {Type Viewports} {Config ' ViewNum '}'];
end
fprintf(Robot.Connection,Msg);
function OutViewNum=CheckInput(ViewNum)
if ischar(ViewNum)
if ~(strcmpi(ViewNum,'QuadView')||strcmpi(ViewNum,'SingleView'))
Out='QuadView';
end
else
if ViewNum
OutViewNum='QuadView';
else
OutViewNum='SingleView';
end
end
end
end