-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathManualProjectAllocation.m
More file actions
executable file
·113 lines (77 loc) · 2.83 KB
/
ManualProjectAllocation.m
File metadata and controls
executable file
·113 lines (77 loc) · 2.83 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
function [Decisions_gui,msg_gui] = ManualProjectAllocation(Rolls,projs)
clc
msg = 'NaN';
f = figure('Name','Manual Selection','NumberTitle','off','units','normalized','Color',[1 1 1]);
set(f, 'MenuBar', 'none');
f.WindowState = 'maximized';
f.Position = [100,100,1107,833];
%f.Position = [300 50 1000 700];
%f = uifigure('Position',[300 50 1000 700]);
%
% Rolls = {'184107102' ;'184107103';'184107104' ;'184107105' ;'184107106' ...
% '184107107' ;'184107108' ;'184107109' ;'184107110' ;'184107111' ;};
%
%projs = {'tamalproj2'; 'tamalproj3';'tamalproj4';'tamalproj5';'tamalproj6'...
% 'tamalproj7';'tamalproj8'; 'tamalproj9'; 'tamalproj10'; 'tamalproj11';'kjdslk';};
%
% fig = uifigure;
% uit = uitable(fig,'Data',projs);
M = 1;
text_field = uicontrol('style','text','string','Manually Allocate The Projects');
text_field.Position = [168 900 900 42];
text_field.FontSize = 25;
for K = 1 : length(Rolls)
LH(K) = uicontrol('Parent',f,'Style','pushbutton','string', string(Rolls(K,1)));
LH(K).HorizontalAlignment = 'left';
LH(K).FontSize = 12;
LH(K).FontName = 'Helvetica';
t = 870-K*60; % vertical distance between the labels
LH(K).Position = [102 t 110 42]; %[42 t 200 50];
%Drop downs
%u = 700-M*60;
DD(M) = uicontrol('style','popup','string',projs(M,:));
DD(M).FontSize = 13;
DD(M).Position = [362 t-15 764 52]; %[300 u 800 50];
if M == size(projs,1)
break
end
M = M + 1;
end
% LastName = projs;
% Age = [38;43;38;40;49];
% Height = [71;69;64;67;64];
% Weight = [176;163;131;133;119];
% T = table(projs,'RowNames',Rolls);
%
%
%
% uitable('Data',T{:,:},'ColumnName',T.Properties.VariableNames,...
% 'RowName',T.Properties.RowNames,'Units', 'Normalized', 'Position',[0.5 0.2 0.1 0.1]);
assignin('base','D',DD);
PB = uicontrol('Style', 'push', 'String', 'Confirm','CallBack',@(source,event) PushB(DD,Rolls));
PB.Position = [499 650 120 52];
PB.FontSize = 13;
PB.FontName = 'Helvetica';
% global Decisions
function Decisions = PushB(DD,Rolls)
% data = guidata(gcbo)
for K = 1: length(Rolls)
sprojs = projs(K,:);
Decisions(K) = sprojs(DD(K).Value);
end
uiresume(f)
closereq
setappdata(0,'final',Decisions);
if length(unique(Decisions))< length(Rolls)
m = errordlg('Clash in user assigned choices. Make sure the choices are unique','Error');
msg = 'Clash in user assigned choices. Make sure the choices are unique';
end
setappdata(0,'msg_gui',msg);
% assignin("same_CGPA",'Decisions_gui',Decisions);
% assignin("same_CGPA",'msg_gui',msg);
end
% delete uit;
uiwait(f);
Decisions_gui = getappdata(0,'final');
msg_gui = getappdata(0,'msg_gui');
end