summaryrefslogtreecommitdiff
path: root/js/NonLinear
diff options
context:
space:
mode:
authorSunil Shetye2018-06-20 16:56:14 +0530
committerSunil Shetye2018-06-20 17:32:26 +0530
commit7b0bf23e7d94df8f3406f5f64926b1131041ba35 (patch)
treebc32a57e0dc994e95f3443b66be9cc8ff1f3cd40 /js/NonLinear
parent459bcaea881aca7f7e3a09a7f8b3c60cf4c3355e (diff)
downloadsci2js-7b0bf23e7d94df8f3406f5f64926b1131041ba35.tar.gz
sci2js-7b0bf23e7d94df8f3406f5f64926b1131041ba35.tar.bz2
sci2js-7b0bf23e7d94df8f3406f5f64926b1131041ba35.zip
substitute some of the predefined variables
Diffstat (limited to 'js/NonLinear')
-rw-r--r--js/NonLinear/TrigFun.js42
1 files changed, 40 insertions, 2 deletions
diff --git a/js/NonLinear/TrigFun.js b/js/NonLinear/TrigFun.js
index 51a2ef27..ea7b3744 100644
--- a/js/NonLinear/TrigFun.js
+++ b/js/NonLinear/TrigFun.js
@@ -1,3 +1,41 @@
-Syntax error in input LexToken(OPENBRACKET,'(',1,1210)
/* autogenerated from "macros/NonLinear/TrigFun.sci" */
-None
+function TrigFun() {
+TrigFun.prototype.define = function TrigFun() {
+model=scicos_model();
+model.sim=list("sin_blk",4);
+model.in1=-1;
+model.out=-1;
+model.blocktype="c";
+model.dep_ut=[true,false];
+exprs="sin";
+gr_i=[];
+x=standard_define([4,2],model,exprs,gr_i);
+}
+TrigFun.prototype.details = function TrigFun() {
+}
+TrigFun.prototype.get = function TrigFun() {
+}
+TrigFun.prototype.set = function TrigFun() {
+x=arg1;
+graphics=arg1.graphics;
+exprs=graphics.exprs;
+model=arg1.model;
+PREVAR_FF=[["sin"],["cos"],["tan"],["asin"],["acos"],["atan"],["sinh"],["cosh"],["tanh"],["asinh"],["acosh"],["atanh"]];
+PREVAR_GG=[["Choose among "+strcat(PREVAR_FF.slice(1-1,4),", ")],[strcat(PREVAR_FF.slice(5-1,$),", ")]];
+while (true) {
+[ok,fun,exprs]=scicos_getvalue(PREVAR_GG,"Function",list("str",1),exprs);
+if (!ok) {
+break;
+}
+if (find(PREVAR_FF==fun)==[]) {
+message("Sorry but "+fun+" is not in the list!");
+} else {
+graphics.exprs=exprs;
+execstr("model.sim=list(\'"+fun+"_blk\',4)");
+x.graphics=graphics;
+x.model=model;
+break;
+}
+}
+}
+}