// This GUI file is generated by guibuilder version 3.0 ////////// function disable_all(handles) for cnt = 2:13 cmd_str = "set(handles.d" + string(cnt) + ",''Enable'',''off'')"; eval(cmd_str); end for cnt = 0:5 cmd_str = "set(handles.a" + string(cnt) + ",''Enable'',''off'')"; eval(cmd_str); end endfunction f=figure('figure_position',[128,41],'figure_size',[1024,645],'auto_resize','on','background',[33],'figure_name','Graphic window number %d',"visible", "off",... "dockable", "off", ... "infobar_visible", "off", ... "toolbar_visible", "off", ... "menubar_visible", "off", ... "default_axes", "off"); ////////// //delmenu(f.figure_id,gettext('File')) //delmenu(f.figure_id,gettext('?')) //delmenu(f.figure_id,gettext('Tools')) //toolbar(f.figure_id,'off') //f = figure( ... //"dockable", "off", ... //"infobar_visible", "off", ... //"toolbar_visible", "off", ... //"menubar_visible", "off", ... //"default_axes", "off",... //"visible", "off"); //f.tag = "scilab550video"; //f.figure_size = [717,669]; //f.layout = "border"; //f.figure_name = "Scilab 5.5.0 new features"; //f.icon = "applications-system"; //f.background = -2; //tab = uicontrol("parent", f, "style", "tab"); handles.dummy = 0; handles.obj1=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2571875,0.0233333,0.38625,0.9316667],'Relief','default','SliderStep',[0.01,0.1],'String','ArduinoUnoR3.png','Style','image','Value',[1,1,0,0,0],'VerticalAlignment','middle','Visible','on','Tag','obj1','Callback','obj1_callback(handles)') //handles.fr_d2 = uicontrol(f,"style", "frame",'unit','normalized',"layout", "gridbag",'Position',[0.7742857,0.1214789,0.0642857,0.0352113], ... // "border", createBorder("titled", createBorder("etched", "lowered"), "Figure size"), ... // "constraints", createConstraints("gridbag", [1, 2, 1, 1], [1 1], "horizontal")); // // handles.rd_d2a=uicontrol(handles.fr_d2,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.7742857,0.1214789,0.0342857,0.0352113],'Relief','default','SliderStep',[0.01,0.1],'String','UnName2','Style','radiobutton','Value',[1],'VerticalAlignment','middle','Visible','on','Tag','rd_d2a','Callback','rd_d2a_callback(handles)') // handles.rd_d2b=uicontrol(handles.fr_d2,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.81,0.1197183,0.0328571,0.0352113],'Relief','default','SliderStep',[0.01,0.1],'String','UnName3','Style','radiobutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','rd_d2b','Callback','rd_d2b_callback(handles)') // //handles.rd_d3a=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.7757143,0.1619718,0.0257143,0.0264085],'Relief','default','SliderStep',[0.01,0.1],'String','UnName4','Style','radiobutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','rd_d3a','Callback','rd_d3a_callback(handles)') // x_pos = 0.65; y_pos = 0.155; width = 0.25; height = 0.03; y_offset = 0.029; d2 = 2; d3 = 3; d4 = 4; d5 = 5; d6 = 6; d7 = 7; d8 = 9; d9 = 10; d10 = 11; d11 = 12; d12 = 13; d13 = 14; dlabel = 15; handles.d2 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [6, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos,y_pos + y_offset*(d2-2),width,height],... "border", createBorder("line", 'blue')); handles.d2a = uicontrol("parent", handles.d2,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d2", ... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.1 1], "both"), ... "callback", "da_callback(handles,d2)"); handles.d2b = uicontrol("parent", handles.d2,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d2", ... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [0.1 1], "both"), ... "callback", "db_callback(handles,d2)"); handles.d2c = uicontrol("parent", handles.d2,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d2",... "constraints", createConstraints("gridbag", [3, 1, 1, 1], [0.1 1], "both"), ... "callback", "dc_callback(handles,d2)"); handles.d2d = uicontrol("parent", handles.d2,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d2","enable","off",... "constraints", createConstraints("gridbag", [4, 1, 1, 1], [0.1 1], "both"), ... "callback", "dd_callback(handles,d2)"); handles.d2a.value = 1; handles.d2edit = uicontrol("parent", handles.d2,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "d2","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [5, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.d2btn = uicontrol("parent", handles.d2,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "d2",... 'String','Run',... "constraints", createConstraints("gridbag", [6, 1, 1, 1], [0.5 1], "both"), ... "callback", "dbtn_callback(handles,d2)"); handles.d4 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [6, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos,y_pos + y_offset*(d4-2),width,height],... "border", createBorder("line", 'blue')); handles.d4a = uicontrol("parent", handles.d4,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d4", ... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.1 1], "both"), ... "callback", "da_callback(handles,d4)"); handles.d4b = uicontrol("parent", handles.d4,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d4", ... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [0.1 1], "both"), ... "callback", "db_callback(handles,d4)"); handles.d4c = uicontrol("parent", handles.d4,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d4",... "constraints", createConstraints("gridbag", [3, 1, 1, 1], [0.1 1], "both"), ... "callback", "dc_callback(handles,d4)"); handles.d4d = uicontrol("parent", handles.d4,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d4","enable","off",... "constraints", createConstraints("gridbag", [4, 1, 1, 1], [0.1 1], "both"), ... "callback", "dd_callback(handles,d4)"); handles.d4a.value = 1; handles.d4edit = uicontrol("parent", handles.d4,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "d4","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [5, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.d4btn = uicontrol("parent", handles.d4,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "d4",... 'String','Run',... "constraints", createConstraints("gridbag", [6, 1, 1, 1], [0.5 1], "both"), ... "callback", "dbtn_callback(handles,d4)"); handles.d7 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [6, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos,y_pos + y_offset*(d7-2),width,height],... "border", createBorder("line", 'blue')); handles.d7a = uicontrol("parent", handles.d7,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d7", ... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.1 1], "both"), ... "callback", "da_callback(handles,d7)"); handles.d7b = uicontrol("parent", handles.d7,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d7", ... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [0.1 1], "both"), ... "callback", "db_callback(handles,d7)"); handles.d7c = uicontrol("parent", handles.d7,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d7",... "constraints", createConstraints("gridbag", [3, 1, 1, 1], [0.1 1], "both"), ... "callback", "dc_callback(handles,d7)"); handles.d7d = uicontrol("parent", handles.d7,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d7","enable","off",... "constraints", createConstraints("gridbag", [4, 1, 1, 1], [0.1 1], "both"), ... "callback", "dd_callback(handles,d7)"); handles.d7a.value = 1; handles.d7edit = uicontrol("parent", handles.d7,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "d7","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [5, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.d7btn = uicontrol("parent", handles.d7,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "d7",... 'String','Run',... "constraints", createConstraints("gridbag", [6, 1, 1, 1], [0.5 1], "both"), ... "callback", "dbtn_callback(handles,d7)"); handles.d8 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [6, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos,y_pos + y_offset*(d8-2),width,height],... "border", createBorder("line", 'blue')); handles.d8a = uicontrol("parent", handles.d8,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d8", ... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.1 1], "both"), ... "callback", "da_callback(handles,d8)"); handles.d8b = uicontrol("parent", handles.d8,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d8", ... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [0.1 1], "both"), ... "callback", "db_callback(handles,d8)"); handles.d8c = uicontrol("parent", handles.d8,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d8",... "constraints", createConstraints("gridbag", [3, 1, 1, 1], [0.1 1], "both"), ... "callback", "dc_callback(handles,d8)"); handles.d8d = uicontrol("parent", handles.d8,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d8","enable","off",... "constraints", createConstraints("gridbag", [4, 1, 1, 1], [0.1 1], "both"), ... "callback", "dd_callback(handles,d8)"); handles.d8a.value = 1; handles.d8edit = uicontrol("parent", handles.d8,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "d8","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [5, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.d8btn = uicontrol("parent", handles.d8,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "d8",... 'String','Run',... "constraints", createConstraints("gridbag", [6, 1, 1, 1], [0.5 1], "both"), ... "callback", "dbtn_callback(handles,d8)"); handles.d12 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [6, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos,y_pos + y_offset*(d12-2),width,height],... "border", createBorder("line", 'blue')); handles.d12a = uicontrol("parent", handles.d12,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d12", ... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.1 1], "both"), ... "callback", "da_callback(handles,d12)"); handles.d12b = uicontrol("parent", handles.d12,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d12", ... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [0.1 1], "both"), ... "callback", "db_callback(handles,d12)"); handles.d12c = uicontrol("parent", handles.d12,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d12",... "constraints", createConstraints("gridbag", [3, 1, 1, 1], [0.1 1], "both"), ... "callback", "dc_callback(handles,d12)"); handles.d12d = uicontrol("parent", handles.d12,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d12","enable","off",... "constraints", createConstraints("gridbag", [4, 1, 1, 1], [0.1 1], "both"), ... "callback", "dd_callback(handles,d12)"); handles.d12a.value = 1; handles.d12edit = uicontrol("parent", handles.d12,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "d12","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [5, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.d12btn = uicontrol("parent", handles.d12,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "d12",... 'String','Run',... "constraints", createConstraints("gridbag", [6, 1, 1, 1], [0.5 1], "both"), ... "callback", "dbtn_callback(handles,d12)"); handles.d13 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [6, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos,y_pos + y_offset*(d13-2),width,height],... "border", createBorder("line", 'blue')); handles.d13a = uicontrol("parent", handles.d13,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d13", ... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.1 1], "both"), ... "callback", "da_callback(handles,d13)"); handles.d13b = uicontrol("parent", handles.d13,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d13", ... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [0.1 1], "both"), ... "callback", "db_callback(handles,d13)"); handles.d13c = uicontrol("parent", handles.d13,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d13",... "constraints", createConstraints("gridbag", [3, 1, 1, 1], [0.1 1], "both"), ... "callback", "dc_callback(handles,d13)"); handles.d13d = uicontrol("parent", handles.d13,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d13","enable","off",... "constraints", createConstraints("gridbag", [4, 1, 1, 1], [0.1 1], "both"), ... "callback", "dd_callback(handles,d13)"); handles.d13a.value = 1; handles.d13edit = uicontrol("parent", handles.d13,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "d13","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [5, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.d13btn = uicontrol("parent", handles.d13,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "d13",... 'String','Run',... "constraints", createConstraints("gridbag", [6, 1, 1, 1], [0.5 1], "both"), ... "callback", "dbtn_callback(handles,d13)"); handles.d3 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [6, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos,y_pos + y_offset*(d3-2),width,height],... "border", createBorder("line", 'blue')); handles.d3a = uicontrol("parent", handles.d3,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d3", ... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.1 1], "both"), ... "callback", "da_callback(handles,d3)"); handles.d3b = uicontrol("parent", handles.d3,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d3", ... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [0.1 1], "both"), ... "callback", "db_callback(handles,d3)"); handles.d3c = uicontrol("parent", handles.d3,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d3",... "constraints", createConstraints("gridbag", [3, 1, 1, 1], [0.1 1], "both"), ... "callback", "dc_callback(handles,d3)"); handles.d3d = uicontrol("parent", handles.d3,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d3","enable","on",... "constraints", createConstraints("gridbag", [4, 1, 1, 1], [0.1 1], "both"), ... "callback", "dd_callback(handles,d3)"); handles.d3a.value = 1; handles.d3edit = uicontrol("parent", handles.d3,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "d3","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [5, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.d3btn = uicontrol("parent", handles.d3,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "d3",... 'String','Run',... "constraints", createConstraints("gridbag", [6, 1, 1, 1], [0.5 1], "both"), ... "callback", "dbtn_callback(handles,d3)"); handles.d5 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [6, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos,y_pos + y_offset*(d5-2),width,height],... "border", createBorder("line", 'blue')); handles.d5a = uicontrol("parent", handles.d5,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d5", ... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.1 1], "both"), ... "callback", "da_callback(handles,d5)"); handles.d5b = uicontrol("parent", handles.d5,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d5", ... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [0.1 1], "both"), ... "callback", "db_callback(handles,d5)"); handles.d5c = uicontrol("parent", handles.d5,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d5",... "constraints", createConstraints("gridbag", [3, 1, 1, 1], [0.1 1], "both"), ... "callback", "dc_callback(handles,d5)"); handles.d5d = uicontrol("parent", handles.d5,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d5","enable","on",... "constraints", createConstraints("gridbag", [4, 1, 1, 1], [0.1 1], "both"), ... "callback", "dd_callback(handles,d5)"); handles.d5a.value = 1; handles.d5edit = uicontrol("parent", handles.d5,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "d5","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [5, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.d5btn = uicontrol("parent", handles.d5,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "d5",... 'String','Run',... "constraints", createConstraints("gridbag", [6, 1, 1, 1], [0.5 1], "both"), ... "callback", "dbtn_callback(handles,d5)"); handles.d6 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [6, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos,y_pos + y_offset*(d6-2),width,height],... "border", createBorder("line", 'blue')); handles.d6a = uicontrol("parent", handles.d6,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d6", ... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.1 1], "both"), ... "callback", "da_callback(handles,d6)"); handles.d6b = uicontrol("parent", handles.d6,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d6", ... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [0.1 1], "both"), ... "callback", "db_callback(handles,d6)"); handles.d6c = uicontrol("parent", handles.d6,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d6",... "constraints", createConstraints("gridbag", [3, 1, 1, 1], [0.1 1], "both"), ... "callback", "dc_callback(handles,d6)"); handles.d6d = uicontrol("parent", handles.d6,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d6","enable","on",... "constraints", createConstraints("gridbag", [4, 1, 1, 1], [0.1 1], "both"), ... "callback", "dd_callback(handles,d6)"); handles.d6a.value = 1; handles.d6edit = uicontrol("parent", handles.d6,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "d6","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [5, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.d6btn = uicontrol("parent", handles.d6,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "d6",... 'String','Run',... "constraints", createConstraints("gridbag", [6, 1, 1, 1], [0.5 1], "both"), ... "callback", "dbtn_callback(handles,d6)"); handles.d9 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [6, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos,y_pos + y_offset*(d9-2),width,height],... "border", createBorder("line", 'blue')); handles.d9a = uicontrol("parent", handles.d9,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d9", ... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.1 1], "both"), ... "callback", "da_callback(handles,d9)"); handles.d9b = uicontrol("parent", handles.d9,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d9", ... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [0.1 1], "both"), ... "callback", "db_callback(handles,d9)"); handles.d9c = uicontrol("parent", handles.d9,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d9",... "constraints", createConstraints("gridbag", [3, 1, 1, 1], [0.1 1], "both"), ... "callback", "dc_callback(handles,d9)"); handles.d9d = uicontrol("parent", handles.d9,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d9","enable","on",... "constraints", createConstraints("gridbag", [4, 1, 1, 1], [0.1 1], "both"), ... "callback", "dd_callback(handles,d9)"); handles.d9a.value = 1; handles.d9edit = uicontrol("parent", handles.d9,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "d9","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [5, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.d9btn = uicontrol("parent", handles.d9,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "d9",... 'String','Run',... "constraints", createConstraints("gridbag", [6, 1, 1, 1], [0.5 1], "both"), ... "callback", "dbtn_callback(handles,d9)"); handles.d10 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [6, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos,y_pos + y_offset*(d10-2),width,height],... "border", createBorder("line", 'blue')); handles.d10a = uicontrol("parent", handles.d10,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d10", ... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.1 1], "both"), ... "callback", "da_callback(handles,d10)"); handles.d10b = uicontrol("parent", handles.d10,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d10", ... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [0.1 1], "both"), ... "callback", "db_callback(handles,d10)"); handles.d10c = uicontrol("parent", handles.d10,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d10",... "constraints", createConstraints("gridbag", [3, 1, 1, 1], [0.1 1], "both"), ... "callback", "dc_callback(handles,d10)"); handles.d10d = uicontrol("parent", handles.d10,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d10","enable","on",... "constraints", createConstraints("gridbag", [4, 1, 1, 1], [0.1 1], "both"), ... "callback", "dd_callback(handles,d10)"); handles.d10a.value = 1; handles.d10edit = uicontrol("parent", handles.d10,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "d10","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [5, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.d10btn = uicontrol("parent", handles.d10,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "d10",... 'String','Run',... "constraints", createConstraints("gridbag", [6, 1, 1, 1], [0.5 1], "both"), ... "callback", "dbtn_callback(handles,d10)"); handles.d11 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [6, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos,y_pos + y_offset*(d11-2),width,height],... "border", createBorder("line", 'blue')); handles.d11a = uicontrol("parent", handles.d11,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d11", ... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.1 1], "both"), ... "callback", "da_callback(handles,d11)"); handles.d11b = uicontrol("parent", handles.d11,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d11", ... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [0.1 1], "both"), ... "callback", "db_callback(handles,d11)"); handles.d11c = uicontrol("parent", handles.d11,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d11",... "constraints", createConstraints("gridbag", [3, 1, 1, 1], [0.1 1], "both"), ... "callback", "dc_callback(handles,d11)"); handles.d11d = uicontrol("parent", handles.d11,'unit','normalized',"style", "radiobutton","horizontalalignment", "left","group", "d11","enable","on",... "constraints", createConstraints("gridbag", [4, 1, 1, 1], [0.1 1], "both"), ... "callback", "dd_callback(handles,d11)"); handles.d11a.value = 1; handles.d11edit = uicontrol("parent", handles.d11,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "d11","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [5, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.d11btn = uicontrol("parent", handles.d11,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "d11",... 'String','Run',... "constraints", createConstraints("gridbag", [6, 1, 1, 1], [0.5 1], "both"), ... "callback", "dbtn_callback(handles,d11)"); handles.dlabel = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [4, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos,y_pos + y_offset*(dlabel-2),width-0.147,height],... "border", createBorder("line", 'blue')); handles.dlabela = uicontrol("parent", handles.dlabel,'unit','normalized',"style", "text","horizontalalignment", "center","group", "dlabel", ... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.1 1], "both"), ... "string","Off",... "callback", "da_callback(handles,dlabel)"); handles.dlabelb = uicontrol("parent", handles.dlabel,'unit','normalized',"style", "text","horizontalalignment", "center","group", "dlabel", ... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [0.1 1], "both"), ... "string","Din",... "callback", "db_callback(handles,dlabel)"); handles.dlabelc = uicontrol("parent", handles.dlabel,'unit','normalized',"style", "text","horizontalalignment", "center","group", "dlabel",... "constraints", createConstraints("gridbag", [3, 1, 1, 1], [0.1 1], "both"), ... "string","Dout",... "callback", "dc_callback(handles,dlabel)"); handles.dlabeld = uicontrol("parent", handles.dlabel,'unit','normalized',"style", "text","horizontalalignment", "center","group", "dlabel","enable","on",... "constraints", createConstraints("gridbag", [4, 1, 1, 1], [0.1 1], "both"), ... "string","Aout",... "callback", "dd_callback(handles,dlabel)"); // Analog In a0 = 0; a1 = 1; a2 = 2; a3 = 3; a4 = 4; a5 = 5; handles.a0 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [2, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos-0.53,y_pos - y_offset*(a0-3),width-0.12,height],... "border", createBorder("line", 'blue')); handles.a0btn = uicontrol("parent", handles.a0,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "a0",... 'String','Run',... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.5 1], "both"), ... "callback", "abtn_callback(handles,a0)"); handles.a0edit = uicontrol("parent", handles.a0,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "a0","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.a1 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [2, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos-0.53,y_pos - y_offset*(a1-3),width-0.12,height],... "border", createBorder("line", 'blue')); handles.a1btn = uicontrol("parent", handles.a1,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "a1",... 'String','Run',... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.5 1], "both"), ... "callback", "abtn_callback(handles,a1)"); handles.a1edit = uicontrol("parent", handles.a1,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "a1","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.a2 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [2, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos-0.53,y_pos - y_offset*(a2-3),width-0.12,height],... "border", createBorder("line", 'blue')); handles.a2btn = uicontrol("parent", handles.a2,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "a2",... 'String','Run',... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.5 1], "both"), ... "callback", "abtn_callback(handles,a2)"); handles.a2edit = uicontrol("parent", handles.a2,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "a2","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.a3 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [2, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos-0.53,y_pos - y_offset*(a3-3),width-0.12,height],... "border", createBorder("line", 'blue')); handles.a3btn = uicontrol("parent", handles.a3,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "a3",... 'String','Run',... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.5 1], "both"), ... "callback", "abtn_callback(handles,a3)"); handles.a3edit = uicontrol("parent", handles.a3,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "a3","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.a4 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [2, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos-0.53,y_pos - y_offset*(a4-3),width-0.12,height],... "border", createBorder("line", 'blue')); handles.a4btn = uicontrol("parent", handles.a4,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "a4",... 'String','Run',... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.5 1], "both"), ... "callback", "abtn_callback(handles,a4)"); handles.a4edit = uicontrol("parent", handles.a4,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "a4","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); handles.a5 = uicontrol("parent", f, 'unit','normalized',"style", "frame","layout", "gridbag","constraints", createConstraints("gridbag", [2, 1, 1, 1], [1 1], "horizontal"),... 'Position',[x_pos-0.53,y_pos - y_offset*(a5-3),width-0.12,height],... "border", createBorder("line", 'blue')); handles.a5btn = uicontrol("parent", handles.a5,'unit','normalized',"style", "pushbutton","horizontalalignment", "center","group", "a5",... 'String','Run',... "constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.5 1], "both"), ... "callback", "abtn_callback(handles,a5)"); handles.a5edit = uicontrol("parent", handles.a5,'unit','normalized',"style", "edit","horizontalalignment", "center","VerticalAlignment","top","group", "a5","Enable", "off",... 'String','0',... "constraints", createConstraints("gridbag", [2, 1, 1, 1], [1.5 1], "both"), ... "callback", ""); // End of Analog In // Control Panel handles.comport = uicontrol("parent", f,'unit','normalized',"style", "popupmenu","horizontalalignment", "center",... 'Position',[x_pos+0.08,y_pos + y_offset*(d13-2+14),width/2,height*2],... 'String',['com1','com2','com3','com4','com5','com6','com7','com8','com9'],... 'value',1,... "callback", ""); handles.connect = uicontrol("parent", f,'unit','normalized',"style", "pushbutton","horizontalalignment", "center",... 'Position',[x_pos+0.08,y_pos + y_offset*(d13-2+12),width/2,height*2],... 'String','Connect',... "callback", "connect_callback(handles)"); handles.disconnect = uicontrol("parent", f,'unit','normalized',"style", "pushbutton","horizontalalignment", "center",... 'Position',[x_pos+0.08,y_pos + y_offset*(d13-2+10),width/2,height*2],... 'String','Disconnect','enable','off',... "callback", "disconnect_callback(handles)"); // End of Control Panel disable_all(handles) ////////// // Callbacks are defined as below. Please do not delete the comments as it will be used in coming version ////////// function da_callback(handles,val) if val>=2 & val <= 7 then cmd_str = "set(handles.d" + string(val) + "edit,''Enable'',''off'')"; eval(cmd_str); else cmd_str = "set(handles.d" + string(val-1) + "edit,''Enable'',''off'')"; eval(cmd_str); end endfunction function db_callback(handles,val) if val>=2 & val <= 7 then cmd_str = "set(handles.d" + string(val) + "edit,''Enable'',''off'')"; eval(cmd_str); else cmd_str = "set(handles.d" + string(val-1) + "edit,''Enable'',''off'')"; eval(cmd_str); end endfunction function dc_callback(handles,val) if val>=2 & val <= 7 then cmd_str = "set(handles.d" + string(val) + "edit,''Enable'',''on'')"; eval(cmd_str); else cmd_str = "set(handles.d" + string(val-1) + "edit,''Enable'',''on'')"; eval(cmd_str); end endfunction function dd_callback(handles,val) if val>=2 & val <= 7 then cmd_str = "set(handles.d" + string(val) + "edit,''Enable'',''on'')"; eval(cmd_str); else cmd_str = "set(handles.d" + string(val-1) + "edit,''Enable'',''on'')"; eval(cmd_str); end endfunction function enable_all(handles) for cnt = 2:13 cmd_str = "set(handles.d" + string(cnt) + ",''Enable'',''on'')"; eval(cmd_str); end for cnt = 0:5 cmd_str = "set(handles.a" + string(cnt) + ",''Enable'',''on'')"; eval(cmd_str); end endfunction function connect_callback(handles) ok = open_serial(1,handles.comport.value,115200); if ok == 0 then handles.connect.enable = 'off'; handles.disconnect.enable = 'on'; enable_all(handles); else messagebox('aa','aa'); end endfunction function disconnect_callback(handles) close_serial(1); handles.connect.enable = 'on'; handles.disconnect.enable = 'off'; disable_all(handles); endfunction function dbtn_callback(handles,val) //Write your callback for rd_d2b here if val>=8 then val = val - 1; end cmd_str = "get(handles.d" + string(val) +".children,""value"");" sel = find(evstr(cmd_str)); if sel == 1 then cmd_str = "get(handles.d" + string(val) +"edit,""string"");" out = strtod(evstr(cmd_str)); cmd_analog_out(1,val,out); elseif sel == 2 cmd_str = "get(handles.d" + string(val) +"edit,""string"");" out = strtod(evstr(cmd_str)); cmd_digital_out(1,val,out); elseif sel == 3 in = cmd_digital_in(1,val); cmd_str = "set(handles.d" + string(val) +"edit,""string"",""" + string(in) + """);" eval(cmd_str); end endfunction function abtn_callback(handles,val) in = cmd_analog_in(1,val); cmd_str = "set(handles.a" + string(val) +"edit,""string"",""" + string(in) + """);" eval(cmd_str); endfunction f.visible = "on";