0001 function varargout = Menu_Canvia_Lots(varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 gui_Singleton = 1;
0012 gui_State = struct('gui_Name', mfilename, ...
0013 'gui_Singleton', gui_Singleton, ...
0014 'gui_OpeningFcn', @Menu_Canvia_Lots_OpeningFcn, ...
0015 'gui_OutputFcn', @Menu_Canvia_Lots_OutputFcn, ...
0016 'gui_LayoutFcn', [] , ...
0017 'gui_Callback', []);
0018 if nargin && ischar(varargin{1})
0019 gui_State.gui_Callback = str2func(varargin{1});
0020 end
0021
0022 if nargout
0023 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
0024 else
0025 gui_mainfcn(gui_State, varargin{:});
0026 end
0027
0028 function Menu_Canvia_Lots_OpeningFcn(hObject, ~, handles, varargin)
0029
0030
0031
0032 handles.output = hObject;
0033 handles=menu(handles);
0034
0035 guidata(hObject, handles);
0036
0037
0038 x=evalin('base','whos();');
0039 list=[];
0040 for i=1:length(x)
0041 if strcmp(x(i).class,'DATA') ~=0
0042 list=[list; {x(i).name}];
0043 end
0044 end
0045 if isempty(list)
0046 list={'No DATA obsects in workspace'};
0047 end
0048 set(handles.popupmenu1,'String',list);
0049
0050 set(handles.popupmenu2,'String',list);
0051
0052 set(handles.listbox1,'Max',999999);
0053 set(handles.listbox2,'Max',999999);
0054
0055 function pushbutton3_Callback(~, ~, handles)
0056
0057 if isempty(get(handles.listbox2,'String'))
0058 errordlg('You must select one object!','Error');
0059
0060 else
0061
0062
0063 dade=get(handles.popupmenu2,'String');
0064 dade=dade{get(handles.popupmenu2,'Value')};
0065
0066
0067
0068 inst=[ dade '.deleteBatch(1:' num2str(evalin('base',[dade '.getBatchCount()'])) ');'];
0069 evalin('base',inst);
0070
0071
0072 aux=evalin('base',[dade '.getBatchLabel()']);
0073 set(handles.listbox2,'String', aux);
0074 set(handles.listbox2,'Value',length(aux));
0075
0076 dad=get(handles.popupmenu1,'String');
0077 dad=dad{get(handles.popupmenu1,'Value')};
0078 if strcmp(dade,dad)
0079 set(handles.listbox1,'String', aux);
0080 set(handles.listbox1,'Value',length(aux));
0081 end
0082 end
0083
0084 function popupmenu2_Callback(~, ~, handles)
0085
0086 dade=get(handles.popupmenu2,'String');
0087 dade=dade{get(handles.popupmenu2,'Value')};
0088
0089
0090
0091 aux=evalin('base',[dade '.getBatchLabel()']);
0092
0093
0094 if(isempty(aux) && (evalin('base',[dade '.getBatchCount()']) > 0))
0095 evalin('base',[dade '.setBatchLabel(num2cell(1:' dade '.getBatchCount))']);
0096 warndlg('Selected object had no batch names. Automatic ones ware assigned.','Attention!')
0097
0098 aux=evalin('base',[dade '.getBatchLabel()']);
0099 end
0100
0101 set(handles.listbox2,'String',aux);
0102 set(handles.listbox2,'Value',1);
0103 set(handles.listbox2,'ListboxTop', 1);
0104
0105 function popupmenu1_Callback(~, ~, handles)
0106
0107 dade=get(handles.popupmenu1,'String');
0108 dade=dade{get(handles.popupmenu1,'Value')};
0109
0110
0111
0112 aux=evalin('base',[dade '.getBatchLabel()']);
0113
0114
0115 if(isempty(aux) && (evalin('base',[dade '.getBatchCount()']) > 0))
0116 evalin('base',[dade '.setBatchLabel(num2cell(1:' dade '.getBatchCount))']);
0117 warndlg('Selected object had no batch names. Automatic ones ware assigned.','Attention!')
0118
0119 aux=evalin('base',[dade '.getBatchLabel()']);
0120 end
0121 set(handles.listbox1,'String',aux);
0122 set(handles.listbox1,'Value',1);
0123 set(handles.listbox1,'ListboxTop', 1);
0124
0125 function pushbutton4_Callback(~, ~, handles)
0126
0127 if isempty(get(handles.listbox1,'String'))
0128 errordlg('Select one object!','Error');
0129
0130 else
0131
0132
0133 dade=get(handles.popupmenu1,'String');
0134 dade=dade{get(handles.popupmenu1,'Value')};
0135
0136
0137
0138 inst=[ dade '.deleteBatch( 1:' num2str(evalin('base',[dade '.getBatchCount()'])) ' );'];
0139 evalin('base',inst);
0140
0141
0142 aux=evalin('base',[dade '.getBatchLabel()']);
0143 set(handles.listbox1,'String', aux);
0144 set(handles.listbox1,'Value',length(aux));
0145
0146 dad=get(handles.popupmenu2,'String');
0147 dad=dad{get(handles.popupmenu2,'Value')};
0148 if strcmp(dade,dad)
0149 set(handles.listbox2,'String', aux);
0150 set(handles.listbox2,'Value',length(aux));
0151 end
0152 end
0153
0154 function pushbutton5_Callback(~, ~, ~)
0155 uiwait(Menu_Load_Dades());
0156
0157 function Update(hObject, ~, handles)
0158 handles.output = hObject;
0159 handles=menu(handles);
0160
0161
0162 x=evalin('base','whos();');
0163 list=[];
0164 for i=1:length(x)
0165 if strcmp(x(i).class,'DATA') ~=0
0166 list=[list; {x(i).name}];
0167 end
0168 end
0169 if isempty(list)
0170 list={'No DATA obsects in workspace'};
0171 end
0172
0173
0174 nom=get(handles.popupmenu1,'String');
0175 nom=nom{get(handles.popupmenu1,'Value')};
0176
0177 nom2=get(handles.popupmenu2,'String');
0178 nom2=nom2{get(handles.popupmenu2,'Value')};
0179
0180
0181 val=find(strcmp(nom,list));
0182
0183
0184 set(handles.popupmenu1,'String',list);
0185 set(handles.popupmenu2,'String',list);
0186 if isempty(val)
0187 set(handles.popupmenu1,'Value',1);
0188
0189 set(handles.listbox1,'String',[]);
0190 set(handles.listbox1,'value',1);
0191
0192 else
0193 set(handles.popupmenu1,'Value',val);
0194 end
0195
0196
0197
0198 val=find(strcmp(nom2,list));
0199 if isempty(val)
0200 set(handles.popupmenu2,'Value',1);
0201
0202 set(handles.listbox2,'String',[]);
0203 set(handles.listbox2,'value',1);
0204
0205 else
0206 set(handles.popupmenu2,'Value',val);
0207 end
0208
0209 guidata(hObject, handles);
0210
0211 function pushbutton7_Callback(~, ~, handles)
0212
0213 if isempty(get(handles.listbox2,'String')) || isempty(get(handles.listbox1,'String'))
0214 errordlg('Select at least one object!','Error');
0215
0216 else
0217
0218
0219 dade=get(handles.popupmenu2,'String');
0220 dade1=dade{get(handles.popupmenu2,'Value')};
0221
0222
0223
0224 dade=get(handles.popupmenu1,'String');
0225 dade2=dade{get(handles.popupmenu1,'Value')};
0226
0227
0228
0229
0230 lot=get(handles.listbox2,'Value');
0231 inst=[ dade1 '.getBatch([' num2str(lot) ']);'];
0232 [dades , ~, nom] = evalin('base',inst);
0233
0234
0235
0236 lot=get(handles.listbox1,'Value');
0237 inst=[ dade2 '.getBatch([' num2str(lot) ']);'];
0238 [dades2 , ~, nom2] = evalin('base',inst);
0239
0240
0241
0242 m=floor(size(dades,2)/2);
0243 n=floor( (size(dades,2)+1)/2 );
0244
0245 figure;
0246
0247 tit = evalin('base',[dade1 '.getVariableLabel()']);
0248 if isempty(tit)
0249 tit = 1:size(dades,2);
0250 end
0251
0252 hold on;
0253 color_table=[winter(size(dades,3)); autumn(size(dades2,3))];
0254
0255
0256 if(m == 0)
0257 m=1;
0258 end
0259 for i = 1:size(dades,2)
0260 subplot(m,n,i)
0261
0262 hold on
0263 ti = {};
0264 for j= 1:size(dades,3)
0265 plot(1:size(dades,1),dades(:,i,j),'color',color_table(j,:))
0266 ti = {ti{:} ['Batch:' num2str(nom{j}) ' -- Object:' dade1]};
0267 end
0268 for j= 1:size(dades2,3)
0269 plot(1:size(dades2,1),dades2(:,i,j),'color',color_table(j+size(dades,3),:))
0270 ti = {ti{:} ['Batch:' num2str(nom2{j}) ' -- Object:' dade2]};
0271 end
0272
0273 title(tit(i))
0274
0275 legend(ti);
0276 legend('off');
0277
0278 hold off
0279 end
0280 hold off;
0281 end
0282
0283 function listbox2_Callback(~, ~, handles)
0284
0285 dade=get(handles.popupmenu2,'String');
0286 dade=dade{get(handles.popupmenu2,'Value')};
0287
0288
0289
0290 lot=get(handles.listbox2,'Value');
0291 if isempty(lot) || length(lot) ~=1
0292 set(handles.edit2,'String','');
0293 else
0294 inst=[ dade '.getBatch(' num2str(lot) ');'];
0295 [~, class ,~] = evalin('base',inst);
0296 set(handles.edit2,'String',num2str(class));
0297 end
0298
0299 function listbox1_Callback(~, ~, handles)
0300
0301 dade=get(handles.popupmenu1,'String');
0302 dade=dade{get(handles.popupmenu1,'Value')};
0303
0304
0305
0306 lot=get(handles.listbox1,'Value');
0307 if isempty(lot) || length(lot) ~=1
0308 set(handles.edit1,'String','');
0309 else
0310 inst=[ dade '.getBatch(' num2str(lot) ');'];
0311 [~, class, ~] = evalin('base',inst);
0312 set(handles.edit1,'String',num2str(class));
0313 end
0314
0315
0316
0317 function contextm_Callback(~, ~, handles)
0318
0319
0320 if length(get(handles.listbox1,'Value')) <= 1
0321 R=java.awt.Robot;
0322 R.setAutoWaitForIdle(1);
0323 R.mousePress(java.awt.event.InputEvent.BUTTON1_MASK);
0324 R.mouseRelease(java.awt.event.InputEvent.BUTTON1_MASK);
0325 end
0326 function cuntextmd_Callback(~, ~, handles)
0327
0328 if length(get(handles.listbox2,'Value')) <= 1
0329 R=java.awt.Robot;
0330 R.setAutoWaitForIdle(1);
0331 R.mousePress(java.awt.event.InputEvent.BUTTON1_MASK);
0332 R.mouseRelease(java.awt.event.InputEvent.BUTTON1_MASK);
0333 end
0334
0335
0336
0337 function EliminaDre_Callback(~, ~, handles)
0338
0339 dade=get(handles.popupmenu2,'String');
0340 dade1=dade{get(handles.popupmenu2,'Value')};
0341
0342
0343
0344 lot1=num2str(get(handles.listbox2,'Value'));
0345
0346
0347 if isempty(get(handles.listbox2,'String'))
0348 errordlg('Select one object!','Error');
0349
0350 else
0351
0352
0353 inst=[ dade1 '.deleteBatch([' num2str(lot1) ']);'];
0354 evalin('base',inst);
0355
0356
0357 aux=evalin('base',[dade1 '.getBatchLabel()']);
0358 set(handles.listbox2,'String', aux);
0359 set(handles.listbox2,'Value',length(aux));
0360
0361 dad=get(handles.popupmenu1,'String');
0362 dad=dad{get(handles.popupmenu1,'Value')};
0363 if strcmp(dade,dad)
0364 set(handles.listbox1,'String', aux);
0365 set(handles.listbox1,'Value',length(aux));
0366 end
0367 end
0368
0369 function MouDre_Callback(~, ~, handles)
0370
0371
0372 if isempty(get(handles.listbox2,'String'))
0373 errordlg('Select one object!','Error');
0374
0375 else
0376
0377
0378 dade=get(handles.popupmenu1,'String');
0379 dade1=dade{get(handles.popupmenu1,'Value')};
0380
0381
0382
0383 dade=get(handles.popupmenu2,'String');
0384 dade2=dade{get(handles.popupmenu2,'Value')};
0385
0386
0387 if strcmp(dade1,dade2)
0388 errordlg('Selected objects are the same. Invalid action!','Error')
0389
0390 else
0391 lot=get(handles.listbox2,'Value');
0392 inst=[ '[Temp_a1 Temp_a2 Temp_a3] =' dade2 '.getBatch([' num2str(lot) ']);'];
0393 evalin('base',inst);
0394
0395 inst=[dade1 '.addBatch( Temp_a1, Temp_a2 ,Temp_a3 );'];
0396 evalin('base',inst);
0397
0398 inst='clear Temp_a1 Temp_a2 Temp_a3 ';
0399 evalin('base',inst);
0400
0401 inst=[ dade2 '.deleteBatch([' num2str(lot) ']);'];
0402 evalin('base',inst);
0403
0404
0405 aux=evalin('base',[dade1 '.getBatchLabel()']);
0406 set(handles.listbox1,'String', aux);
0407 set(handles.listbox1,'Value',length(aux));
0408
0409 aux=evalin('base',[dade2 '.getBatchLabel()']);
0410 set(handles.listbox2,'String', aux);
0411 set(handles.listbox2,'Value',length(aux));
0412 end
0413 end
0414
0415 function CopyDre_Callback(~, ~, handles)
0416
0417
0418 if isempty(get(handles.listbox2,'String'))
0419 errordlg('Select one object!','Error');
0420
0421 else
0422
0423
0424 dade=get(handles.popupmenu1,'String');
0425 dade1=dade{get(handles.popupmenu1,'Value')};
0426
0427
0428
0429 dade=get(handles.popupmenu2,'String');
0430 dade2=dade{get(handles.popupmenu2,'Value')};
0431
0432
0433 if strcmp(dade1,dade2)
0434 errordlg('Selected objects are the same. Invalid action!','Error')
0435
0436 else
0437 lot=get(handles.listbox2,'Value');
0438 inst=[ '[Temp_a1 Temp_a2 Temp_a3] =' dade2 '.getBatch([' num2str(lot) ']);'];
0439 evalin('base',inst);
0440
0441 inst=[dade1 '.addBatch( Temp_a1, Temp_a2 ,Temp_a3 );'];
0442 evalin('base',inst);
0443
0444 inst='clear Temp_a1 Temp_a2 Temp_a3 ';
0445 evalin('base',inst);
0446
0447
0448
0449
0450
0451
0452 aux=evalin('base',[dade1 '.getBatchLabel()']);
0453 set(handles.listbox1,'String', aux);
0454 set(handles.listbox1,'Value',length(aux));
0455
0456
0457
0458
0459 end
0460 end
0461
0462 function PlotVarsDre_Callback(~, ~, handles)
0463
0464 if isempty(get(handles.listbox2,'String'))
0465 errordlg('Select one object!','Error');
0466
0467 else
0468
0469
0470 dade=get(handles.popupmenu2,'String');
0471 dade1=dade{get(handles.popupmenu2,'Value')};
0472
0473
0474
0475 lot=get(handles.listbox2,'Value');
0476 inst=[ dade1 '.getBatch([' num2str(lot) ']);'];
0477 [dades , ~, nom] = evalin('base',inst);
0478
0479
0480 m=floor(size(dades,2)/2);
0481 n=floor( (size(dades,2)+1)/2 );
0482
0483 figure;
0484
0485 tit = evalin('base',[dade1 '.getVariableLabel()']);
0486 if isempty(tit)
0487 tit = 1:size(dades,2);
0488 end
0489
0490 color_table = jet(size(dades,3));
0491 hold on;
0492 if(m == 0)
0493 m=1;
0494 end
0495 for i = 1:size(dades,2)
0496 subplot(m,n,i)
0497 if i == 1
0498 ti = {};
0499 hold on;
0500 for j= 1:size(dades,3)
0501 plot(1:size(dades,1),dades(:,i,j),'color',color_table(j,:))
0502 ti = {ti{:} ['Batch:' num2str(nom{j}) ' -- Object:' dade1]};
0503 end
0504 hold off;
0505 else
0506
0507 hold on;
0508 for j= 1:size(dades,3)
0509 plot(1:size(dades,1),dades(:,i,j),'color',color_table(j,:))
0510 end
0511 hold off;
0512 end
0513
0514 title(tit(i))
0515
0516 legend(ti)
0517 legend('off')
0518 end
0519 hold off;
0520 end
0521
0522 function CanviaClasseDre_Callback(~, ~, handles)
0523 if isempty(get(handles.listbox2,'String'))
0524 errordlg('Select one object!','Error');
0525
0526 else
0527
0528 dade=get(handles.popupmenu2,'String');
0529 dade2=dade{get(handles.popupmenu2,'Value')};
0530
0531
0532 class = evalin('base',[dade2 '.getClass()']);
0533 index = get(handles.listbox2,'Value');
0534
0535 answer = inputdlg('Wich class should have?');
0536 answer = str2double(answer);
0537
0538 while isnan(answer)
0539 errordlg('Classes must be Integer!','Error')
0540
0541 uiwait(gcf);
0542 answer = inputdlg('Wich class should have?');
0543 answer = str2double(answer);
0544 end
0545
0546 if ~isempty(answer)
0547 class(index) = answer;
0548 evalin('base',[dade2 '.setClass([' num2str(class) ']);']);
0549 set(handles.edit2,'String',num2str(answer));
0550 if (get(handles.popupmenu2,'Value')== get(handles.popupmenu1,'Value')) && (get(handles.listbox2,'Value') == get(handles.listbox1,'Value'))
0551 set(handles.edit1,'String',num2str(answer));
0552 end
0553 end
0554 end
0555
0556 function CanviaNomDre_Callback(~, ~, handles)
0557 if isempty(get(handles.listbox2,'String'))
0558 errordlg('select one object!','Error');
0559
0560 else
0561
0562 dade=get(handles.popupmenu2,'String');
0563 dade2=dade{get(handles.popupmenu2,'Value')};
0564
0565
0566 class = evalin('base',[dade2 '.getBatchLabel()']);
0567 index = get(handles.listbox2,'Value');
0568
0569 answer = inputdlg('Which name should have?');
0570
0571 if ~isempty(answer)
0572 class(index) = answer;
0573 aux = evalin('base',[dade2 '.copy();']);
0574 aux.setBatchLabel(class);
0575
0576
0577 assignin('base',dade2, aux);
0578
0579 set(handles.listbox2,'String', class)
0580
0581 if (get(handles.popupmenu2,'Value')== get(handles.popupmenu1,'Value'))
0582 set(handles.listbox1,'String', class)
0583 end
0584 end
0585 end
0586
0587
0588
0589
0590 function EliminaEsq_Callback(~, ~, handles)
0591
0592 dade=get(handles.popupmenu1,'String');
0593 dade1=dade{get(handles.popupmenu1,'Value')};
0594
0595
0596
0597 lot1=num2str(get(handles.listbox1,'Value'));
0598
0599
0600 if isempty(get(handles.listbox1,'String'))
0601 errordlg('Select one object!','Error');
0602
0603 else
0604
0605
0606 inst=[ dade1 '.deleteBatch([' num2str(lot1) ']);'];
0607 evalin('base',inst);
0608
0609
0610 aux=evalin('base',[dade1 '.getBatchLabel()']);
0611 set(handles.listbox1,'String', aux);
0612 set(handles.listbox1,'Value',length(aux));
0613
0614 dad=get(handles.popupmenu2,'String');
0615 dad=dad{get(handles.popupmenu2,'Value')};
0616 if strcmp(dade1,dad)
0617 set(handles.listbox2,'String', aux);
0618 set(handles.listbox2,'Value',length(aux));
0619 end
0620 end
0621
0622 function MouEsq_Callback(~, ~, handles)
0623
0624
0625
0626 if isempty(get(handles.listbox1,'String'))
0627 errordlg('Select one object!','Error');
0628 else
0629
0630
0631 dade=get(handles.popupmenu1,'String');
0632 dade1=dade{get(handles.popupmenu1,'Value')};
0633
0634
0635
0636 dade=get(handles.popupmenu2,'String');
0637 dade2=dade{get(handles.popupmenu2,'Value')};
0638
0639
0640 if strcmp(dade1,dade2)
0641 errordlg('Selected objects are the same. Invalid action!','Error')
0642
0643 else
0644 lot=get(handles.listbox1,'Value');
0645 inst=[ '[Temp_a1 Temp_a2 Temp_a3] =' dade1 '.getBatch([' num2str(lot) ']);'];
0646 evalin('base',inst);
0647
0648 inst=[dade2 '.addBatch( Temp_a1, Temp_a2 ,Temp_a3 );'];
0649 evalin('base',inst);
0650
0651 inst='clear Temp_a1 Temp_a2 Temp_a3 ';
0652 evalin('base',inst);
0653
0654 inst=[ dade1 '.deleteBatch([' num2str(lot) ']);'];
0655 evalin('base',inst);
0656
0657
0658 aux=evalin('base',[dade1 '.getBatchLabel()']);
0659 set(handles.listbox1,'String', aux);
0660 set(handles.listbox1,'Value',length(aux));
0661
0662 aux=evalin('base',[dade2 '.getBatchLabel()']);
0663 set(handles.listbox2,'String', aux);
0664 set(handles.listbox2,'Value',length(aux));
0665 end
0666 end
0667
0668 function CopyEsq_Callback(~, ~, handles)
0669
0670
0671
0672 if isempty(get(handles.listbox1,'String'))
0673 errordlg('Select one object!','Error');
0674
0675 else
0676
0677
0678 dade=get(handles.popupmenu1,'String');
0679 dade1=dade{get(handles.popupmenu1,'Value')};
0680
0681
0682
0683 dade=get(handles.popupmenu2,'String');
0684 dade2=dade{get(handles.popupmenu2,'Value')};
0685
0686
0687 if strcmp(dade1,dade2)
0688 errordlg('Selected objects are the same. Invalid action!','Error')
0689
0690 else
0691 lot=get(handles.listbox1,'Value');
0692 inst=[ '[Temp_a1 Temp_a2 Temp_a3] =' dade1 '.getBatch([' num2str(lot) ']);'];
0693 evalin('base',inst);
0694
0695 inst=[dade2 '.addBatch( Temp_a1, Temp_a2 ,Temp_a3 );'];
0696 evalin('base',inst);
0697
0698 inst='clear Temp_a1 Temp_a2 Temp_a3 ';
0699 evalin('base',inst);
0700
0701
0702
0703
0704
0705
0706 aux=evalin('base',[dade2 '.getBatchLabel()']);
0707 set(handles.listbox2,'String', aux);
0708 set(handles.listbox2,'Value',length(aux));
0709 end
0710 end
0711
0712 function PlotVarsEsq_Callback(~, ~, handles)
0713
0714 if isempty(get(handles.listbox1,'String'))
0715 errordlg('Select one object!','Error');
0716
0717 else
0718
0719
0720 dade=get(handles.popupmenu1,'String');
0721 dade1=dade{get(handles.popupmenu1,'Value')};
0722
0723
0724
0725 lot=get(handles.listbox1,'Value');
0726 inst=[ dade1 '.getBatch([' num2str(lot) ']);'];
0727 [dades , ~, nom] = evalin('base',inst);
0728
0729
0730 m=floor(size(dades,2)/2);
0731 n=floor( (size(dades,2)+1)/2 );
0732
0733 figure;
0734
0735
0736 tit = evalin('base',[dade1 '.getVariableLabel()']);
0737 if isempty(tit)
0738 tit = 1:size(dades,2);
0739 end
0740 color_table = jet(size(dades,3));
0741 hold on;
0742 if(m == 0)
0743 m=1;
0744 end
0745 for i = 1:size(dades,2)
0746 subplot(m,n,i)
0747
0748 if i == 1
0749 ti = {};
0750 hold on;
0751 for j= 1:size(dades,3)
0752 plot(1:size(dades,1),dades(:,i,j),'color',color_table(j,:))
0753 ti = {ti{:} ['Batch:' num2str(nom{j}) ' -- Object:' dade1]};
0754 end
0755 hold off;
0756 else
0757
0758 hold on;
0759 for j= 1:size(dades,3)
0760 plot(1:size(dades,1),dades(:,i,j),'color',color_table(j,:))
0761 end
0762 hold off;
0763 end
0764
0765
0766 title(tit(i))
0767
0768 legend(ti)
0769 legend('off')
0770 end
0771 hold off;
0772 end
0773
0774 function CanviaClasseEsq_Callback(~, ~, handles)
0775 if isempty(get(handles.listbox1,'String'))
0776 errordlg('Select one object!','Error');
0777
0778 else
0779
0780 dade=get(handles.popupmenu1,'String');
0781 dade2=dade{get(handles.popupmenu1,'Value')};
0782
0783
0784 class = evalin('base',[dade2 '.getClass()']);
0785 index = get(handles.listbox1,'Value');
0786
0787 answer = inputdlg('Which class should have?');
0788 answer = str2double(answer);
0789
0790 while isnan(answer)
0791 errordlg('Classes must be Integers!','Error')
0792
0793 uiwait(gcf);
0794 answer = inputdlg('Wich class should have?');
0795 answer = str2double(answer);
0796 end
0797
0798 if ~isempty(answer)
0799 class(index) = answer;
0800 evalin('base',[dade2 '.setClass([' num2str(class) ']);']);
0801 set(handles.edit1,'String',num2str(answer));
0802 if (get(handles.popupmenu2,'Value')== get(handles.popupmenu1,'Value')) && (get(handles.listbox2,'Value') == get(handles.listbox1,'Value'))
0803 set(handles.edit2,'String',num2str(answer));
0804 end
0805 end
0806 end
0807
0808
0809 function CanviaNomEsq_Callback(~, ~, handles)
0810 if isempty(get(handles.listbox1,'String'))
0811 errordlg('Select one object!','Error');
0812 else
0813
0814 dade=get(handles.popupmenu1,'String');
0815 dade2=dade{get(handles.popupmenu1,'Value')};
0816
0817
0818 class = evalin('base',[dade2 '.getBatchLabel()']);
0819 index = get(handles.listbox1,'Value');
0820
0821 answer = inputdlg('which name should have?');
0822
0823 if ~isempty(answer)
0824 class(index) = answer;
0825 aux = evalin('base',[dade2 '.copy();']);
0826 aux.setBatchLabel(class);
0827
0828 assignin('base',dade2, aux);
0829
0830 set(handles.listbox1,'String', class)
0831
0832 if (get(handles.popupmenu2,'Value')== get(handles.popupmenu1,'Value'))
0833 set(handles.listbox2,'String', class)
0834 end
0835 end
0836 end
0837
0838
0839
0840 function popupmenu1_CreateFcn(hObject, ~, ~)
0841 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0842 set(hObject,'BackgroundColor','white');
0843 end
0844 function listbox1_CreateFcn(hObject, ~, ~)
0845 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0846 set(hObject,'BackgroundColor','white');
0847 end
0848 function popupmenu2_CreateFcn(hObject, ~, ~)
0849 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0850 set(hObject,'BackgroundColor','white');
0851 end
0852 function listbox2_CreateFcn(hObject, ~, ~)
0853 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0854 set(hObject,'BackgroundColor','white');
0855 end
0856 function varargout = Menu_Canvia_Lots_OutputFcn(~, ~, handles)
0857 varargout{1} = handles.output;
0858 function edit2_Callback(~, ~, ~)
0859 function edit2_CreateFcn(hObject, ~, ~)
0860 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0861 set(hObject,'BackgroundColor','white');
0862 end
0863 function edit1_Callback(~, ~, ~)
0864 function edit1_CreateFcn(hObject, ~, ~)
0865 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0866 set(hObject,'BackgroundColor','white');
0867 end
0868
0869
0870
0871 function Untitled_1_Callback(~, ~, ~)