From be9f32c23ef04b74ad1b07a09f0663015dc98993 Mon Sep 17 00:00:00 2001
From: Sunil Shetye
Date: Fri, 15 Jun 2018 00:48:55 +0530
Subject: identify the job blocks

---
 js/Misc/DEADBAND.js | 406 +++++++---------------------------------------------
 1 file changed, 53 insertions(+), 353 deletions(-)

(limited to 'js/Misc/DEADBAND.js')

diff --git a/js/Misc/DEADBAND.js b/js/Misc/DEADBAND.js
index ce2a4140..8ffdab65 100644
--- a/js/Misc/DEADBAND.js
+++ b/js/Misc/DEADBAND.js
@@ -1,353 +1,53 @@
-LexToken(EOL,'\n',1,10)
-LexToken(EOL,'\n',1,13)
-LexToken(EOL,'\n',1,73)
-LexToken(EOL,'\n',1,76)
-LexToken(EOL,'\n',1,148)
-LexToken(EOL,'\n',1,220)
-LexToken(EOL,'\n',1,289)
-LexToken(EOL,'\n',1,328)
-LexToken(EOL,'\n',1,331)
-LexToken(EOL,'\n',1,398)
-LexToken(EOL,'\n',1,464)
-LexToken(EOL,'\n',1,529)
-LexToken(EOL,'\n',1,577)
-LexToken(EOL,'\n',1,580)
-LexToken(EOL,'\n',1,649)
-LexToken(EOL,'\n',1,712)
-LexToken(EOL,'\n',1,794)
-LexToken(EOL,'\n',1,797)
-LexToken(EOL,'\n',1,828)
-LexToken(EOL,'\n',1,831)
-LexToken(EOL,'\n',1,832)
-LexToken(FUNCTION,'function',1,833)
-LexToken(OPENSQBRACKET,'[',1,842)
-LexToken(VAR,'x',1,843)
-LexToken(COMMA,',',1,844)
-LexToken(VAR,'y',1,845)
-LexToken(COMMA,',',1,846)
-LexToken(VAR,'typ',1,847)
-LexToken(CLOSESQBRACKET,']',1,850)
-LexToken(ASSIGNMENT,'=',1,851)
-LexToken(VAR,'DEADBAND',1,852)
-LexToken(OPENBRACKET,'(',1,860)
-LexToken(VAR,'job',1,861)
-LexToken(COMMA,',',1,864)
-LexToken(VAR,'arg1',1,865)
-LexToken(COMMA,',',1,869)
-LexToken(VAR,'arg2',1,870)
-LexToken(CLOSEBRACKET,')',1,874)
-LexToken(EOL,'\n',1,875)
-LexToken(VAR,'x',1,880)
-LexToken(ASSIGNMENT,'=',1,881)
-LexToken(OPENSQBRACKET,'[',1,882)
-LexToken(CLOSESQBRACKET,']',1,883)
-LexToken(EOL,'\n',1,884)
-LexToken(VAR,'y',1,890)
-LexToken(ASSIGNMENT,'=',1,891)
-LexToken(OPENSQBRACKET,'[',1,892)
-LexToken(CLOSESQBRACKET,']',1,893)
-LexToken(EOL,'\n',1,894)
-LexToken(VAR,'typ',1,900)
-LexToken(ASSIGNMENT,'=',1,903)
-LexToken(OPENSQBRACKET,'[',1,904)
-LexToken(CLOSESQBRACKET,']',1,905)
-LexToken(EOL,'\n',1,906)
-LexToken(SELECT,'select',1,912)
-LexToken(VAR,'job',1,919)
-LexToken(EOL,'\n',1,922)
-LexToken(CASE,'case',1,927)
-LexToken(DQSTRING,'"set"',1,936)
-LexToken(THEN,'then',1,938)
-LexToken(EOL,'\n',1,942)
-LexToken(VAR,'x',1,951)
-LexToken(ASSIGNMENT,'=',1,952)
-LexToken(VAR,'arg1',1,953)
-LexToken(EOL,'\n',1,957)
-LexToken(VAR,'graphics',1,967)
-LexToken(ASSIGNMENT,'=',1,975)
-LexToken(VAR,'arg1',1,976)
-LexToken(DOT,'.',1,980)
-LexToken(VAR,'graphics',1,981)
-LexToken(EOL,'\n',1,989)
-LexToken(VAR,'exprs',1,999)
-LexToken(ASSIGNMENT,'=',1,1004)
-LexToken(VAR,'graphics',1,1005)
-LexToken(DOT,'.',1,1013)
-LexToken(VAR,'exprs',1,1014)
-LexToken(EOL,'\n',1,1019)
-LexToken(VAR,'model',1,1028)
-LexToken(ASSIGNMENT,'=',1,1033)
-LexToken(VAR,'arg1',1,1034)
-LexToken(DOT,'.',1,1038)
-LexToken(VAR,'model',1,1039)
-LexToken(EOL,'\n',1,1044)
-LexToken(WHILE,'while',1,1054)
-LexToken(PREVAR_BOOLEAN,'%t',1,1060)
-LexToken(DO,'do',1,1063)
-LexToken(EOL,'\n',1,1065)
-LexToken(OPENSQBRACKET,'[',1,1078)
-LexToken(VAR,'ok',1,1079)
-LexToken(COMMA,',',1,1081)
-LexToken(VAR,'maxp',1,1082)
-LexToken(COMMA,',',1,1086)
-LexToken(VAR,'minp',1,1087)
-LexToken(COMMA,',',1,1091)
-LexToken(VAR,'zeroc',1,1092)
-LexToken(COMMA,',',1,1097)
-LexToken(VAR,'exprs',1,1098)
-LexToken(CLOSESQBRACKET,']',1,1103)
-LexToken(ASSIGNMENT,'=',1,1104)
-LexToken(SCICOS_GETVALUE,'scicos_getvalue',1,1105)
-LexToken(OPENBRACKET,'(',1,1120)
-LexToken(DQSTRING,'"Set Deadband parameters"',1,1145)
-LexToken(COMMA,',',1,1146)
-LexToken(OPENSQBRACKET,'[',1,1162)
-LexToken(DQSTRING,'"End of dead band"',1,1180)
-LexToken(SEMICOLON,';',1,1181)
-LexToken(DQSTRING,'"Start of dead band"',1,1201)
-LexToken(SEMICOLON,';',1,1202)
-LexToken(DQSTRING,'"zero crossing (0:no, 1:yes)"',1,1231)
-LexToken(CLOSESQBRACKET,']',1,1232)
-LexToken(COMMA,',',1,1233)
-LexToken(VAR,'list',1,1234)
-LexToken(OPENBRACKET,'(',1,1238)
-LexToken(DQSTRING,'"vec"',1,1243)
-LexToken(COMMA,',',1,1244)
-LexToken(NUMBER,'1',1,1245)
-LexToken(COMMA,',',1,1246)
-LexToken(DQSTRING,'"vec"',1,1251)
-LexToken(COMMA,',',1,1252)
-LexToken(NUMBER,'1',1,1253)
-LexToken(COMMA,',',1,1254)
-LexToken(DQSTRING,'"vec"',1,1259)
-LexToken(COMMA,',',1,1260)
-LexToken(NUMBER,'1',1,1261)
-LexToken(CLOSEBRACKET,')',1,1262)
-LexToken(COMMA,',',1,1263)
-LexToken(VAR,'exprs',1,1264)
-LexToken(CLOSEBRACKET,')',1,1269)
-LexToken(EOL,'\n',1,1270)
-LexToken(IF,'if',1,1283)
-LexToken(NOT,'~',1,1286)
-LexToken(VAR,'ok',1,1287)
-LexToken(THEN,'then',1,1290)
-LexToken(EOL,'\n',1,1294)
-LexToken(BREAK,'break',1,1311)
-LexToken(EOL,'\n',1,1316)
-LexToken(END,'end',1,1330)
-LexToken(EOL,'\n',1,1333)
-LexToken(IF,'if',1,1346)
-LexToken(VAR,'maxp',1,1349)
-LexToken(COMPARISON,'<=',1,1353)
-LexToken(VAR,'minp',1,1355)
-LexToken(THEN,'then',1,1361)
-LexToken(EOL,'\n',1,1365)
-LexToken(VAR,'message',1,1382)
-LexToken(OPENBRACKET,'(',1,1389)
-LexToken(DQSTRING,'"Upper limit must be > Lower limit"',1,1424)
-LexToken(CLOSEBRACKET,')',1,1425)
-LexToken(EOL,'\n',1,1426)
-LexToken(ELSE,'else',1,1439)
-LexToken(EOL,'\n',1,1443)
-LexToken(VAR,'rpar',1,1460)
-LexToken(ASSIGNMENT,'=',1,1464)
-LexToken(OPENSQBRACKET,'[',1,1465)
-LexToken(VAR,'maxp',1,1466)
-LexToken(SEMICOLON,';',1,1470)
-LexToken(VAR,'minp',1,1471)
-LexToken(CLOSESQBRACKET,']',1,1475)
-LexToken(EOL,'\n',1,1476)
-LexToken(VAR,'model',1,1493)
-LexToken(DOT,'.',1,1498)
-LexToken(VAR,'rpar',1,1499)
-LexToken(ASSIGNMENT,'=',1,1503)
-LexToken(VAR,'rpar',1,1504)
-LexToken(EOL,'\n',1,1508)
-LexToken(IF,'if',1,1525)
-LexToken(VAR,'zeroc',1,1528)
-LexToken(COMPARISON,'<>',1,1533)
-LexToken(NUMBER,'0',1,1535)
-LexToken(THEN,'then',1,1537)
-LexToken(EOL,'\n',1,1541)
-LexToken(VAR,'model',1,1562)
-LexToken(DOT,'.',1,1567)
-LexToken(VAR,'nzcross',1,1568)
-LexToken(ASSIGNMENT,'=',1,1575)
-LexToken(NUMBER,'2',1,1576)
-LexToken(EOL,'\n',1,1577)
-LexToken(VAR,'model',1,1598)
-LexToken(DOT,'.',1,1603)
-LexToken(VAR,'nmode',1,1604)
-LexToken(ASSIGNMENT,'=',1,1609)
-LexToken(NUMBER,'1',1,1610)
-LexToken(EOL,'\n',1,1611)
-LexToken(ELSE,'else',1,1628)
-LexToken(EOL,'\n',1,1632)
-LexToken(VAR,'model',1,1653)
-LexToken(DOT,'.',1,1658)
-LexToken(VAR,'nzcross',1,1659)
-LexToken(ASSIGNMENT,'=',1,1666)
-LexToken(NUMBER,'0',1,1667)
-LexToken(EOL,'\n',1,1668)
-LexToken(VAR,'model',1,1689)
-LexToken(DOT,'.',1,1694)
-LexToken(VAR,'nmode',1,1695)
-LexToken(ASSIGNMENT,'=',1,1700)
-LexToken(NUMBER,'0',1,1701)
-LexToken(EOL,'\n',1,1702)
-LexToken(END,'end',1,1719)
-LexToken(EOL,'\n',1,1722)
-LexToken(VAR,'graphics',1,1739)
-LexToken(DOT,'.',1,1747)
-LexToken(VAR,'exprs',1,1748)
-LexToken(ASSIGNMENT,'=',1,1753)
-LexToken(VAR,'exprs',1,1754)
-LexToken(EOL,'\n',1,1759)
-LexToken(VAR,'x',1,1776)
-LexToken(DOT,'.',1,1777)
-LexToken(VAR,'graphics',1,1778)
-LexToken(ASSIGNMENT,'=',1,1786)
-LexToken(VAR,'graphics',1,1787)
-LexToken(EOL,'\n',1,1795)
-LexToken(VAR,'x',1,1813)
-LexToken(DOT,'.',1,1814)
-LexToken(VAR,'model',1,1815)
-LexToken(ASSIGNMENT,'=',1,1820)
-LexToken(VAR,'model',1,1821)
-LexToken(EOL,'\n',1,1826)
-LexToken(BREAK,'break',1,1843)
-LexToken(EOL,'\n',1,1848)
-LexToken(END,'end',1,1861)
-LexToken(EOL,'\n',1,1864)
-LexToken(END,'end',1,1873)
-LexToken(EOL,'\n',1,1876)
-LexToken(CASE,'case',1,1881)
-LexToken(DQSTRING,'"define"',1,1893)
-LexToken(THEN,'then',1,1895)
-LexToken(EOL,'\n',1,1899)
-LexToken(VAR,'minp',1,1908)
-LexToken(ASSIGNMENT,'=',1,1912)
-LexToken(ADDITION,'-',1,1913)
-LexToken(NUMBER,'.5',1,1914)
-LexToken(EOL,'\n',1,1916)
-LexToken(VAR,'maxp',1,1926)
-LexToken(ASSIGNMENT,'=',1,1930)
-LexToken(NUMBER,'.5',1,1931)
-LexToken(EOL,'\n',1,1933)
-LexToken(VAR,'rpar',1,1943)
-LexToken(ASSIGNMENT,'=',1,1947)
-LexToken(OPENSQBRACKET,'[',1,1948)
-LexToken(VAR,'maxp',1,1949)
-LexToken(SEMICOLON,';',1,1953)
-LexToken(VAR,'minp',1,1954)
-LexToken(CLOSESQBRACKET,']',1,1958)
-LexToken(EOL,'\n',1,1959)
-LexToken(VAR,'model',1,1968)
-LexToken(ASSIGNMENT,'=',1,1973)
-LexToken(SCICOS_MODEL,'scicos_model',1,1974)
-LexToken(OPENBRACKET,'(',1,1986)
-LexToken(CLOSEBRACKET,')',1,1987)
-LexToken(EOL,'\n',1,1988)
-LexToken(VAR,'model',1,1997)
-LexToken(DOT,'.',1,2002)
-LexToken(VAR,'sim',1,2003)
-LexToken(ASSIGNMENT,'=',1,2006)
-LexToken(VAR,'list',1,2007)
-LexToken(OPENBRACKET,'(',1,2011)
-LexToken(DQSTRING,'"deadband"',1,2021)
-LexToken(COMMA,',',1,2022)
-LexToken(NUMBER,'4',1,2023)
-LexToken(CLOSEBRACKET,')',1,2024)
-LexToken(EOL,'\n',1,2025)
-LexToken(VAR,'model',1,2034)
-LexToken(DOT,'.',1,2039)
-LexToken(VAR,'in',1,2040)
-LexToken(ASSIGNMENT,'=',1,2042)
-LexToken(NUMBER,'1',1,2043)
-LexToken(EOL,'\n',1,2044)
-LexToken(VAR,'model',1,2053)
-LexToken(DOT,'.',1,2058)
-LexToken(VAR,'nzcross',1,2059)
-LexToken(ASSIGNMENT,'=',1,2066)
-LexToken(NUMBER,'2',1,2067)
-LexToken(EOL,'\n',1,2068)
-LexToken(VAR,'model',1,2077)
-LexToken(DOT,'.',1,2082)
-LexToken(VAR,'nmode',1,2083)
-LexToken(ASSIGNMENT,'=',1,2088)
-LexToken(NUMBER,'1',1,2089)
-LexToken(EOL,'\n',1,2090)
-LexToken(VAR,'model',1,2099)
-LexToken(DOT,'.',1,2104)
-LexToken(VAR,'out',1,2105)
-LexToken(ASSIGNMENT,'=',1,2108)
-LexToken(NUMBER,'1',1,2109)
-LexToken(EOL,'\n',1,2110)
-LexToken(VAR,'model',1,2119)
-LexToken(DOT,'.',1,2124)
-LexToken(VAR,'rpar',1,2125)
-LexToken(ASSIGNMENT,'=',1,2129)
-LexToken(VAR,'rpar',1,2130)
-LexToken(EOL,'\n',1,2134)
-LexToken(VAR,'model',1,2143)
-LexToken(DOT,'.',1,2148)
-LexToken(VAR,'blocktype',1,2149)
-LexToken(ASSIGNMENT,'=',1,2158)
-LexToken(DQSTRING,'"c"',1,2161)
-LexToken(EOL,'\n',1,2162)
-LexToken(VAR,'model',1,2171)
-LexToken(DOT,'.',1,2176)
-LexToken(VAR,'dep_ut',1,2177)
-LexToken(ASSIGNMENT,'=',1,2183)
-LexToken(OPENSQBRACKET,'[',1,2184)
-LexToken(PREVAR_BOOLEAN,'%t',1,2185)
-LexToken(PREVAR_BOOLEAN,'%f',1,2188)
-LexToken(CLOSESQBRACKET,']',1,2190)
-LexToken(EOL,'\n',1,2191)
-LexToken(EOL,'\n',1,2192)
-LexToken(VAR,'exprs',1,2201)
-LexToken(ASSIGNMENT,'=',1,2206)
-LexToken(OPENSQBRACKET,'[',1,2207)
-LexToken(VAR,'string',1,2208)
-LexToken(OPENBRACKET,'(',1,2214)
-LexToken(VAR,'maxp',1,2215)
-LexToken(CLOSEBRACKET,')',1,2219)
-LexToken(SEMICOLON,';',1,2220)
-LexToken(VAR,'string',1,2221)
-LexToken(OPENBRACKET,'(',1,2227)
-LexToken(VAR,'minp',1,2228)
-LexToken(CLOSEBRACKET,')',1,2232)
-LexToken(SEMICOLON,';',1,2233)
-LexToken(VAR,'string',1,2234)
-LexToken(OPENBRACKET,'(',1,2240)
-LexToken(VAR,'model',1,2241)
-LexToken(DOT,'.',1,2246)
-LexToken(VAR,'nmode',1,2247)
-LexToken(CLOSEBRACKET,')',1,2252)
-LexToken(CLOSESQBRACKET,']',1,2253)
-LexToken(EOL,'\n',1,2254)
-LexToken(VAR,'gr_i',1,2263)
-LexToken(ASSIGNMENT,'=',1,2267)
-LexToken(OPENSQBRACKET,'[',1,2268)
-LexToken(CLOSESQBRACKET,']',1,2269)
-LexToken(EOL,'\n',1,2270)
-LexToken(VAR,'x',1,2279)
-LexToken(ASSIGNMENT,'=',1,2280)
-LexToken(VAR,'standard_define',1,2281)
-LexToken(OPENBRACKET,'(',1,2296)
-LexToken(OPENSQBRACKET,'[',1,2297)
-LexToken(NUMBER,'2',1,2298)
-LexToken(NUMBER,'2',1,2300)
-LexToken(CLOSESQBRACKET,']',1,2301)
-LexToken(COMMA,',',1,2302)
-LexToken(VAR,'model',1,2303)
-LexToken(COMMA,',',1,2308)
-LexToken(VAR,'exprs',1,2309)
-LexToken(COMMA,',',1,2314)
-LexToken(VAR,'gr_i',1,2315)
-LexToken(CLOSEBRACKET,')',1,2319)
-LexToken(EOL,'\n',1,2320)
-LexToken(END,'end',1,2325)
-LexToken(EOL,'\n',1,2328)
-LexToken(ENDFUNCTION,'endfunction',1,2329)
-LexToken(EOL,'\n',1,2340)
+/* autogenerated from "macros/Misc/DEADBAND.sci" */
+function DEADBAND() {
+DEADBAND.prototype.get = function DEADBAND() {
+}
+DEADBAND.prototype.set = function DEADBAND() {
+x=arg1;
+graphics=arg1.graphics;
+exprs=graphics.exprs;
+model=arg1.model;
+while (true) {
+[ok,maxp,minp,zeroc,exprs]=scicos_getvalue("Set Deadband parameters",["End of dead band","Start of dead band","zero crossing (0:no, 1:yes)"],list("vec",1,"vec",1,"vec",1),exprs);
+if (!ok) {
+break
+}
+if (maxp<=minp) {
+message("Upper limit must be > Lower limit");
+} else {
+rpar=[maxp,minp];
+model.rpar=rpar;
+if (zeroc!=0) {
+model.nzcross=2;
+model.nmode=1;
+} else {
+model.nzcross=0;
+model.nmode=0;
+}
+graphics.exprs=exprs;
+x.graphics=graphics;
+x.model=model;
+break
+}
+}
+}
+DEADBAND.prototype.define = function DEADBAND() {
+minp=-.5;
+maxp=.5;
+rpar=[maxp,minp];
+model=scicos_model();
+model.sim=list("deadband",4);
+model.in=1;
+model.nzcross=2;
+model.nmode=1;
+model.out=1;
+model.rpar=rpar;
+model.blocktype="c";
+model.dep_ut=[true,None];
+exprs=[string(maxp),string(minp),string(model.nmode)];
+gr_i=[];
+x=standard_define([2,2],model,exprs,gr_i);
+}
+DEADBAND.prototype.details = function DEADBAND() {
+}
+}
-- 
cgit