function comermn(list, f_handle);
%COMERMN Parameter setting for popupmenus in COMMGUI.
%
%WARNING: This is an obsolete function and may be removed in the future.

%  Wes Wang, original design
%  Jun Wu, last update, Mar-07, 1997
%  Copyright 1996-2002 The MathWorks, Inc.
% $Revision: 1.20 $

handle = get(f_handle, 'UserData');
if ~isempty(handle)
   h_axes = handle(1);
   h_plot = handle(2);
   textl  = handle(3:7);
   popmu  = handle(8:12);
   entr_text = handle(13:32);
   entr_valu = handle(33:52);
   exec = handle(53:67);
   load_save = handle(68:69);
   bar_color = handle(70:71);
else
   error('The GUI figure is destroyed. Close the window and restart COMMGUI.');
end;

list_value = get(popmu(list), 'Value');

if list == 1
   % source generating
   tmp  = [...
         'Data Length ';...
         'M-ary Number';...
         'Seed        ';...
         'Parameter 2 ';...
         'Parameter 3 ';...
         'Parameter 4 '...
      ];
   if list_value == 1
      for i = 1:3
         set(entr_text(i+1), 'Visible', 'on',...
            'String', tmp(i,:));            
      end;
      set(entr_valu(2:4), 'Visible','on');
   elseif list_value == 2
      set(entr_valu(4), 'Visible','off');
      set(entr_text(4), 'Visible','off');
      set(entr_valu(2), 'Visible','on');
      set(entr_text(2), 'Visible', 'on',...
         'String', 'Variable Name');
      set(entr_valu(3), 'Visible','on');
      set(entr_text(3), 'Visible', 'on',...
         'String', 'M-ary Number');
   elseif list_value == 3
      for i = 1:3
         set(entr_text(i+1), 'Visible', 'on',...
            'String', tmp(3+i, :));            
      end;
      set(entr_valu(1:4), 'Visible','on');
      %        set(entr_valu(4), 'Visible','off');
      %        set(entr_text(4), 'Visible','off');
   end;
elseif list == 2
   if list_value == 1
      set(entr_text(5:8),...
         'Visible', 'off');
      set(entr_valu(5:8),...
         'Visible', 'off');
   else 
      set(entr_text(5:7),...
         'Visible', 'on');
      set(entr_valu(5:7),...
         'Visible', 'on');
      set(entr_text(8),...
         'Visible', 'off');
      set(entr_valu(8),...
         'Visible', 'off');
      tmp = [...
            'PrimPoly(opt)';...
            'GeneratMatrix';...
            'CyclGenerPoly';...
            'BCHPoly(opt) ';...
            'GF(2^M)(opt) ';...
            'TransFuncMtrx';...
            'Parameter 3  '...
         ];
      set(entr_text(7),...
         'String',tmp(list_value-1, :),...
         'Visible', 'on');
      if list_value == 7
         %convolution code
         set(entr_text(8),...
            'String','MemoryLength',...
            'Visible', 'on');
         set(entr_valu(8),...
            'Visible', 'on');
      elseif list_value == 8
         % My own
         set(entr_text(8),...
            'String','Parameter 4  ',...
            'Visible', 'on');
         set(entr_valu(8),...
            'Visible', 'on');
      end
   end;
elseif list == 3
   if list_value == 1
      set(popmu(5), 'Enable', 'off');
      set([entr_valu(9:12); entr_text(17:20)], 'Visible', 'off');
      set([entr_text(9:12); entr_valu(17:20)], 'Visible', 'off');
   else
      list_value = list_value + 6;
      set(popmu(5), 'Enable', 'on');
      set(entr_text(17:19), 'Visible', 'on');
      set(entr_valu(17:19), 'Visible', 'on');
      if get(popmu(5), 'Value') == 1
         set(entr_text(20), 'Visible', 'on');
         set(entr_valu(20), 'Visible', 'on');
      end;
      set(entr_valu(9),...
         'Visible', 'on'...
         );
      set(entr_text(9),...
         'String',  'Mod Samp Freq',...
         'Visible', 'on'...
         );
      set(entr_valu(10:12), 'Visible', 'off');
      set(entr_text(10:12), 'Visible', 'off');
      if (list_value == 8) | (list_value == 9) | (list_value == 13)
         % ASK QASK/sq
         set(entr_valu(10),...
            'Visible', 'on'...
            );
         set(entr_text(10),...
            'String',  'M-ary Number',...
            'Visible', 'on'...
            );
      elseif (list_value == 10)
         tmp = [...
               'NumOnCircl';...
               'RadiiOnCir';...
               'PhaseOnCir'...
            ];
         for i = 1 : 3
            set(entr_text(9 + i),...
               'String',  tmp(i, :),...
               'Visible', 'on'...
               );
         end;
         set(entr_valu(10:12),...
            'Visible', 'on'...
            );
      elseif (list_value == 11)
         tmp = [...
               'In-Phase  ';...
               'Quadrature'...
            ];
         for i = 1 : 2
            set(entr_text(9 + i),...
               'String',  tmp(i,:),...
               'Visible', 'on'...
               );
         end;
         set(entr_valu(10:11),...
            'Visible', 'on'...
            );
      elseif (list_value == 12)
         tmp = [ ...
               'M-ary Number';...
               'ToneSpace   '...
            ];
         for i = 1 : 2
            set(entr_text(9 + i),...
               'String',  tmp(i, :),...
               'Visible', 'on'...
               );
         end;
         set(entr_valu(10:11),...
            'Visible', 'on'...
            );            
      elseif (list_value == 15)
         tmp = [...
               'Parameter2';...
               'Parameter3';...
               'Parameter4'...
            ];
         for i = 1 : 3
            set(entr_text(9 + i),...
               'String',  tmp(i, :),...
               'Visible', 'on'...
               );
         end;
         set(entr_valu(10:12),...
            'Visible', 'on'...
            );
      end;
   end;
elseif list == 4
   set(entr_text(13:16), 'Visible', 'off');
   set(entr_valu(13:16), 'Visible', 'off');    
   if list_value == 2
      set(entr_text(13),...
         'Visible', 'on',...
         'String',  'Variance'...
         );
      set(entr_text(14),...
         'Visible', 'on',...
         'String',  'Seed'...
         );
      set(entr_valu(13:14),...
         'Visible', 'on'...
         );
   elseif list_value == 3
      set(entr_text(13),...
         'Visible', 'on',...
         'String',  'UpperBound'...
         );
      set(entr_text(14),...
         'Visible', 'on',...
         'String',  'LowerBound'...
         );
      set(entr_text(15),...
         'Visible', 'on',...
         'String',  'Seed'...
         );
      set(entr_valu(13:15),...
         'Visible', 'on'...
         );
   elseif list_value == 4
      set(entr_text(13),...
         'Visible', 'on',...
         'String',  'Error Probability'...
         );
      set(entr_text(14),...
         'Visible', 'on',...
         'String',  'Seed'...
         );
      set(entr_valu(13:14),...
         'Visible', 'on'...
         );
      set(popmu(5), 'Enable', 'off');
      set(popmu(3), 'Value',1);
      set([entr_valu(9:12); entr_text(17:20)], 'Visible', 'off');
      set([entr_text(9:12); entr_valu(17:20)], 'Visible', 'off');
      disp('Binary noise can apply to the case without modulation only.');
		disp('No noise is added to the simulation.');
   elseif list_value == 5
      for i = 1 : 4
         set(entr_text(12+i),...
            'Visible', 'on',...
            'String',  ['Parameter' num2str(i)]...
            );
      end;
      set(entr_valu(13:16),...
         'Visible', 'on'...
         );
   end;
elseif list == 5
   if list_value == 1
      % passband
      set(entr_text(20), 'Visible', 'on');
      set(entr_valu(20), 'Visible', 'on');         
   elseif list_value == 2
      % baseband
      set(entr_text(20), 'Visible', 'off');
      set(entr_valu(20), 'Visible', 'off');
   else
      disp('No such value. something is wrong.')
   end;
end;
