diff options
author | Abhinav Dronamraju | 2017-09-29 22:00:40 +0530 |
---|---|---|
committer | Abhinav Dronamraju | 2017-09-29 22:00:40 +0530 |
commit | 9bc7ad78e8d7d7acc4b9387aa592542832e80b31 (patch) | |
tree | 7fce060665a91de5e5adb12d02003351c3d1fdfc /macros/sci2c_gui.sci | |
parent | 33755eb085a3ca8154cf83773b23fbb8aac4ba3e (diff) | |
parent | ac0045f12ad3d0938758e9742f4107a334e1afaa (diff) | |
download | scilab2c-9bc7ad78e8d7d7acc4b9387aa592542832e80b31.tar.gz scilab2c-9bc7ad78e8d7d7acc4b9387aa592542832e80b31.tar.bz2 scilab2c-9bc7ad78e8d7d7acc4b9387aa592542832e80b31.zip |
NEW FEATURES AND NEW FUNCTIONS
Diffstat (limited to 'macros/sci2c_gui.sci')
-rw-r--r-- | macros/sci2c_gui.sci | 117 |
1 files changed, 108 insertions, 9 deletions
diff --git a/macros/sci2c_gui.sci b/macros/sci2c_gui.sci index e6b0530c..cad8b247 100644 --- a/macros/sci2c_gui.sci +++ b/macros/sci2c_gui.sci @@ -21,7 +21,7 @@ margin = 13; radiow = 85; // Figure creation -sci2cfig = figure("figure_name", gettext("Scilab to C conversion tool"),"tag","sci2cfig", "visible", "off"); +sci2cfig = figure("figure_name", gettext("Scilab to C conversion tool"),"tag","sci2cfig"); // Remove Scilab graphics menus & toolbar delmenu(sci2cfig.figure_id, gettext("&File")); @@ -38,8 +38,10 @@ uimenu("parent", h, "label", gettext("Sci2c help page"), "callback", "cb_sci2c_g uimenu("parent", h, "label", gettext("About SCI2C tools..."), "callback", "cb_sci2c_gui", "tag", "about_sci2c_menu"); figw = 800; -figh = 15*margin + btnh + 7*widgeth; +figh = 16*margin + btnh + 10*widgeth; sci2cfig.axes_size = [figw figh]; +sci2cfig.auto_resize = "on"; +//sci2cfig.visible = "off"; // to be sure that no plot can appear in the window //------------------- // --- Validation --- @@ -74,9 +76,10 @@ cancelbtn = uicontrol("parent", sci2cfig,... //---------------- // Frame optframe = uicontrol("parent", sci2cfig,... + "relief", "groove",... "style", "frame",... "units", "pixels",... - "position", [margin 2*margin+btnh figw-2*margin 4*margin+4*widgeth],... + "position", [margin 2*margin+btnh figw-2*margin 7*margin+6*widgeth],... "fontname", defaultfont,... "fontunits", "points",... "fontsize", 12,... @@ -87,7 +90,7 @@ opttitle = uicontrol("parent", sci2cfig,... "style", "text",... "string", gettext("Options"),... "units", "pixels",... - "position", [2*margin 2*margin+btnh+4*margin+4*widgeth-8 50 14],... + "position", [2*margin 5*margin+btnh+4*margin+6*widgeth-8 50 18],... "fontname", defaultfont,... "fontunits", "points",... "fontsize", 11,... @@ -172,8 +175,103 @@ sciintocradiono = uicontrol("parent", sci2cfig,... "callback", "cb_sci2c_gui",... "tag", "sciintocradiono"); +// --- Board Name ---- +brdnmy = sciintocy + margin + btnh ; +brdnmlabel = uicontrol("parent", sci2cfig,... + "style", "text",... + "string", gettext("Board Name: "),... + "position",[2*margin brdnmy widgetLabelWidth widgeth],... + "horizontalalignment", "left",... + "fontname", defaultfont,... + "fontunits", "points",... + "fontsize", 12); + +brdnmType = uicontrol("parent", sci2cfig,... + "style", "popupmenu",... + "string", ["";"Uno";"Mega-ATmega1280";"Mega-2560 or Mega ADK";"Nano - ATmega168";"Nano - ATmega328";"Micro";"Mini - Atmega168";"Mini - Atmega328";"Pro Mini (3.3V, 8MHz) - ATmega328";"Pro Mini (3.3V, 8MHz) - ATmega168";"Pro Mini (5V, 16MHz) - ATmega328";"Pro Mini (5V, 16MHz) - ATmega168";"NG or older - ATmega168";"NG or older - ATmega8";"Duemilanove - ATmega328";"BT - ATmega328";"BT - ATmega 168";"Diecimila/Duemilanove - ATmega168";"Esplora";"Ethernet";"Fio";"Leonardo";"Robot Control";"Robot Motor";"LilyPad Arduino - ATmega328";"LilyPad Arduino - ATmega168";"LilyPad Arduino USB"],... + "position",[2*margin+widgetLabelWidth brdnmy 3*radiow widgeth],... + "horizontalalignment", "left",... + "fontname", defaultfont,... + "enable", "off",... + "fontunits", "points",... + "fontsize", 12,... + "min", 0, ... + "max", 1, ... + "value", [1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0],... + "callback", "cb_sci2c_gui",... + "tag", "brdnmType"); + +sciintocy = brdnmy +// --- Output format: Standalone or Arduino +outformaty = sciintocy + margin + btnh ; +outformatlabel = uicontrol("parent", sci2cfig,... + "style", "text",... + "string", gettext("Type of output format: "),... + "position",[2*margin outformaty widgetLabelWidth widgeth],... + "horizontalalignment", "left",... + "fontname", defaultfont,... + "fontunits", "points",... + "fontsize", 12); + +outformatradiostalone = uicontrol("parent", sci2cfig,... + "style", "radiobutton",... + "string", gettext("Stand-alone"),... + "position",[2*margin+widgetLabelWidth outformaty 2*radiow-10 widgeth],... + "horizontalalignment", "left",... + "fontname", defaultfont,... + "fontunits", "points",... + "fontsize", 12,... + "min", 0, ... + "max", 1, ... + "value", 1,... + "callback", "cb_sci2c_gui",... + "tag", "outformatradiostalone"); + +outformatradioarduino = uicontrol("parent", sci2cfig,... + "style", "radiobutton",... + "string", gettext("Arduino"),... + "position",[margin+widgetLabelWidth+2*radiow outformaty radiow widgeth],... + "horizontalalignment", "left",... + "fontname", defaultfont,... + "fontunits", "points",... + "fontsize", 12,... + "min", 0, ... + "max", 1, ... + "value", 0,... + "callback", "cb_sci2c_gui",... + "tag", "outformatradioarduino"); + +outformatradioavr = uicontrol("parent", sci2cfig,... + "style", "radiobutton",... + "string", gettext("AVR"),... + "position",[margin+widgetLabelWidth+3*radiow outformaty radiow widgeth],... + "horizontalalignment", "left",... + "fontname", defaultfont,... + "fontunits", "points",... + "fontsize", 12,... + "min", 0, ... + "max", 1, ... + "value", 0,... + "callback", "cb_sci2c_gui",... + "tag", "outformatradioavr"); + +outformatradiorpi = uicontrol("parent", sci2cfig,... + "style", "radiobutton",... + "string", gettext("Rpi"),... + "position",[margin+widgetLabelWidth+4*radiow outformaty radiow widgeth],... + "horizontalalignment", "left",... + "fontname", defaultfont,... + "fontunits", "points",... + "fontsize", 12,... + "min", 0, ... + "max", 1, ... + "value", 0,... + "callback", "cb_sci2c_gui",... + "tag", "outformatradiorpi"); + + // --- Run mode option --- -runy = sciintocy + margin + widgeth; +runy = outformaty + margin + widgeth; runlabel = uicontrol("parent", sci2cfig,... "style", "text",... "string", gettext("Run mode: "),... @@ -211,7 +309,7 @@ runradiotranslate = uicontrol("parent", sci2cfig,... runradiogenlib = uicontrol("parent", sci2cfig,... "style", "radiobutton",... "string", gettext("Generate library"),... - "position",[2*margin+widgetLabelWidth+2*radiow runy 120 widgeth],... + "position",[2*margin+widgetLabelWidth+2*radiow+20 runy 150 widgeth],... "horizontalalignment", "left",... "fontname", defaultfont,... "fontunits", "points",... @@ -226,8 +324,9 @@ runradiogenlib = uicontrol("parent", sci2cfig,... // --- Output directory --- // ------------------------ // Frame -optframemaxy = 2*margin+btnh + 4*margin+4*widgeth; +optframemaxy = 5*margin+btnh + 4*margin+6*widgeth; outframe = uicontrol("parent", sci2cfig,... + "relief", "groove",... "style", "frame",... "units", "pixels",... "position", [margin optframemaxy+margin figw-2*margin widgeth+2*margin],... @@ -280,6 +379,7 @@ outbtn = uicontrol("parent", sci2cfig,... // Frame outframemaxy = optframemaxy + 2*margin + widgeth + margin; // headerframe = uicontrol("parent", sci2cfig,... +// "relief", "groove",... // "style", "frame",... // "units", "pixels",... // "position", [margin outframemaxy+margin figw-2*margin widgeth+2*margin],... @@ -332,6 +432,7 @@ outframemaxy = optframemaxy + 2*margin + widgeth + margin; // Frame headerframemaxy = outframemaxy //+ 2*margin + widgeth + margin; selframe = uicontrol("parent", sci2cfig,... + "relief", "groove",... "style", "frame",... "units", "pixels",... "position", [margin headerframemaxy+margin figw-2*margin 3*margin+2*widgeth],... @@ -412,6 +513,4 @@ filebtn = uicontrol("parent", sci2cfig,... "callback", "cb_sci2c_gui",... "tag", "filebtn"); -sci2cfig.visible = "on"; - endfunction |