summaryrefslogtreecommitdiff
path: root/macros/cb_sci2c_gui.sci
diff options
context:
space:
mode:
authorAbhinav Dronamraju2017-09-29 22:00:40 +0530
committerAbhinav Dronamraju2017-09-29 22:00:40 +0530
commit9bc7ad78e8d7d7acc4b9387aa592542832e80b31 (patch)
tree7fce060665a91de5e5adb12d02003351c3d1fdfc /macros/cb_sci2c_gui.sci
parent33755eb085a3ca8154cf83773b23fbb8aac4ba3e (diff)
parentac0045f12ad3d0938758e9742f4107a334e1afaa (diff)
downloadscilab2c-9bc7ad78e8d7d7acc4b9387aa592542832e80b31.tar.gz
scilab2c-9bc7ad78e8d7d7acc4b9387aa592542832e80b31.tar.bz2
scilab2c-9bc7ad78e8d7d7acc4b9387aa592542832e80b31.zip
NEW FEATURES AND NEW FUNCTIONS
Diffstat (limited to 'macros/cb_sci2c_gui.sci')
-rw-r--r--macros/cb_sci2c_gui.sci111
1 files changed, 102 insertions, 9 deletions
diff --git a/macros/cb_sci2c_gui.sci b/macros/cb_sci2c_gui.sci
index 935c0e6f..bf77c25f 100644
--- a/macros/cb_sci2c_gui.sci
+++ b/macros/cb_sci2c_gui.sci
@@ -54,6 +54,23 @@ elseif or(get(gcbo, "tag")==["runradioall","runradiotranslate","runradiogenlib"]
set(gcbo, "value", 1);
+
+// --- Output format option ---
+
+elseif or(get(gcbo, "tag")==["outformatradiostalone","outformatradioarduino","outformatradioavr","outformatradiorpi"]) then
+
+ set(findobj("tag", "outformatradiostalone"), "value", 0);
+ set(findobj("tag", "outformatradioarduino"), "value", 0);
+ set(findobj("tag", "outformatradioavr"), "value", 0);
+ set(findobj("tag", "outformatradiorpi"), "value", 0);
+ set(gcbo, "value", 1);
+ if get(findobj("tag", "outformatradioarduino"), "value") == 1 then
+ set(findobj("tag", "brdnmType"), "enable", "on");
+ else
+ set(findobj("tag", "brdnmType"), "enable", "off");
+ end
+ //disp("YES")
+ //disp(get(findobj("tag", "brdnmType"), "value"))
//
// --- Copy Scilab code into C option ---
//
@@ -86,7 +103,7 @@ elseif get(gcbo, "tag")=="cancelbtn" | get(gcbo, "tag")=="close_menu" then
elseif get(gcbo, "tag")=="convertbtn" then
UserScilabMainFile = get(findobj("tag", "fileedit"), "string");
- UserSciFilesPaths = get(findobj("tag", "subfunsedit"), "string");
+ UserSciFilesPaths = get(findobj("tag", "subfunsedit"), "string");
// Sci2CLibMainHeaderFName = get(findobj("tag", "headeredit"), "string");
@@ -100,6 +117,76 @@ elseif get(gcbo, "tag")=="convertbtn" then
RunMode = "GenLibraryStructure";
end
+ if get(findobj("tag", "outformatradiostalone"), "value") == 1 then
+ Target = "StandAlone";
+ elseif get(findobj("tag", "outformatradioarduino"), "value") == 1 then
+ Target = "Arduino";
+ elseif get(findobj("tag", "outformatradioavr"), "value") == 1 then
+ Target = "AVR";
+ elseif get(findobj("tag", "outformatradiorpi"), "value") == 1 then
+ Target = "RPi";
+ end
+ if get(findobj("tag", "brdnmType"), "value") == 2 then
+ Board_name = "uno"
+ elseif get(findobj("tag", "brdnmType"), "value") == 3 then
+ Board_name = "mega"
+ elseif get(findobj("tag", "brdnmType"), "value") == 4 then
+ Board_name = "mega2560"
+ elseif get(findobj("tag", "brdnmType"), "value") == 5 then
+ Board_name = "nano"
+ elseif get(findobj("tag", "brdnmType"), "value") == 6 then
+ Board_name = "nano328"
+ elseif get(findobj("tag", "brdnmType"), "value") == 7 then
+ Board_name = "micro"
+ elseif get(findobj("tag", "brdnmType"), "value") == 8 then
+ Board_name = "mini"
+ elseif get(findobj("tag", "brdnmType"), "value") == 9 then
+ Board_name = "mini328"
+ elseif get(findobj("tag", "brdnmType"), "value") == 10 then
+ Board_name = "pro328"
+ elseif get(findobj("tag", "brdnmType"), "value") == 11 then
+ Board_name = "pro"
+ elseif get(findobj("tag", "brdnmType"), "value") == 12 then
+ Board_name = "pro5v328"
+ elseif get(findobj("tag", "brdnmType"), "value") == 13 then
+ Board_name = "pro5v"
+ elseif get(findobj("tag", "brdnmType"), "value") == 14 then
+ Board_name = "atmega168"
+ elseif get(findobj("tag", "brdnmType"), "value") == 15 then
+ Board_name = "atmega8"
+ elseif get(findobj("tag", "brdnmType"), "value") == 16 then
+ Board_name = "atmega328"
+ elseif get(findobj("tag", "brdnmType"), "value") == 17 then
+ Board_name = "bt328"
+ elseif get(findobj("tag", "brdnmType"), "value") == 18 then
+ Board_name = "bt"
+ elseif get(findobj("tag", "brdnmType"), "value") == 19 then
+ Board_name = "diecimila"
+ elseif get(findobj("tag", "brdnmType"), "value") == 20 then
+ Board_name = "esplora"
+ elseif get(findobj("tag", "brdnmType"), "value") == 21 then
+ Board_name = "ethernet"
+ elseif get(findobj("tag", "brdnmType"), "value") == 22 then
+ Board_name = "fio"
+ elseif get(findobj("tag", "brdnmType"), "value") == 23 then
+ Board_name = "leonardo"
+ elseif get(findobj("tag", "brdnmType"), "value") == 24 then
+ Board_name = "robotControl"
+ elseif get(findobj("tag", "brdnmType"), "value") == 25 then
+ Board_name = "robotMotor"
+ elseif get(findobj("tag", "brdnmType"), "value") == 26 then
+ Board_name = "lilypad328"
+ elseif get(findobj("tag", "brdnmType"), "value") == 27 then
+ Board_name = "lilypad"
+ elseif get(findobj("tag", "brdnmType"), "value") == 28 then
+ Board_name = "lilyPadUSB"
+ else
+ Board_name = "uno"
+
+ //elseif get(findobj("tag", "brdnmType"), "value") == [1 0 0 0 0 0] then
+ //Board_name = "none"
+ end
+
CopySciCodeIntoCCode = get(findobj("tag", "sciintocradioyes"), "value") == 1;
if get(findobj("tag", "buildtoolradiowin"), "value") == 1 then
@@ -110,15 +197,21 @@ elseif get(gcbo, "tag")=="convertbtn" then
// CCompilerPathStyle = "cygwin";
end
+
// -*- DEBUG ONLY -*-
-
-// mprintf("UserScilabMainFile = {%s}\n", UserScilabMainFile);
-// mprintf("UserSciFilesPaths = {%s}\n", UserSciFilesPaths);
-// mprintf("UserSciCodeMainDir = {%s}\n", UserSciCodeMainDir);
-// mprintf("RunMode = {%s}\n", RunMode);
-// mprintf("CopySciCodeIntoCCode = {%d}\n", bool2s(CopySciCodeIntoCCode));
-// mprintf("NativeBuild = {%s}\n", NativeBuild);
- scilab2c(UserScilabMainFile, UserSciCodeMainDir, UserSciFilesPaths, RunMode, NativeBuild);
+
+ mprintf("UserScilabMainFile = {%s}\n", UserScilabMainFile);
+ mprintf("UserSciFilesPaths = {%s}\n", UserSciFilesPaths);
+ mprintf("UserSciCodeMainDir = {%s}\n", UserSciCodeMainDir);
+ mprintf("RunMode = {%s}\n", RunMode);
+ mprintf("CopySciCodeIntoCCode = {%d}\n", bool2s(CopySciCodeIntoCCode));
+ mprintf("NativeBuild = {%s}\n", NativeBuild);
+ mprintf("Target = {%s}\n", Target);
+ mprintf("Board Name = {%s}\n", Board_name);
+// disp("Variable Names:")
+// disp(UserScilabMainFile, UserSciCodeMainDir, UserSciFilesPaths, RunMode, NativeBuild,Target,Board_name)
+// disp("Done")
+ scilab2c(UserScilabMainFile, UserSciCodeMainDir, UserSciFilesPaths, RunMode, NativeBuild,Target,Board_name);
//
// --- sci2c help ---
//