summaryrefslogtreecommitdiff
path: root/js/Sinks
diff options
context:
space:
mode:
Diffstat (limited to 'js/Sinks')
-rw-r--r--js/Sinks/AFFICH_m.js12
-rw-r--r--js/Sinks/CANIMXY3D.js8
-rw-r--r--js/Sinks/CMAT3D.js2
-rw-r--r--js/Sinks/CMATVIEW.js8
-rw-r--r--js/Sinks/CMSCOPE.js2
-rw-r--r--js/Sinks/CSCOPXY3D.js8
-rw-r--r--js/Sinks/TOWS_c.js4
-rw-r--r--js/Sinks/WFILE_f.js14
-rw-r--r--js/Sinks/WRITEAU_f.js10
-rw-r--r--js/Sinks/WRITEC_f.js12
10 files changed, 40 insertions, 40 deletions
diff --git a/js/Sinks/AFFICH_m.js b/js/Sinks/AFFICH_m.js
index e4348618..64fa7827 100644
--- a/js/Sinks/AFFICH_m.js
+++ b/js/Sinks/AFFICH_m.js
@@ -9,11 +9,11 @@ nd=1;
in1=[1,1];
model=scicos_model();
model.sim=list("affich2",4);
-model.in1=in1(1,1);
-model.in2=in1(1,2);
+model.in1=in1[1-1][1-1];
+model.in2=in1[1-1][2-1];
model.evtin=1;
-model.dstate=[[-1],[0],[0],[1],[1],[0],[zeros(in1(1,1)*in1(1,2),1)]];
-model.ipar=[[font],[fontsize],[colr],[1000],[nt],[nd],[in1(1,1)]];
+model.dstate=[[-1],[0],[0],[1],[1],[0],[zeros(in1[1-1][1-1]*in1[1-1][2-1],1)]];
+model.ipar=[[font],[fontsize],[colr],[1000],[nt],[nd],[in1[1-1][1-1]]];
model.blocktype="c";
model.firing=[];
model.dep_ut=[true,false];
@@ -67,8 +67,8 @@ if (ok) {
[model,graphics,ok]=set_io(model,graphics,list(in1,1),list(),ones(1-herit,1),[]);
}
if (ok) {
-model.ipar=[[font],[fontsize],[colr],[nt],[nd],[in1(1,1)]];
-model.dstate=[[-1],[0],[0],[1],[1],[0],[zeros(in1(1,1)*in1(1,2),1)]];
+model.ipar=[[font],[fontsize],[colr],[nt],[nd],[in1[1-1][1-1]]];
+model.dstate=[[-1],[0],[0],[1],[1],[0],[zeros(in1[1-1][1-1]*in1[1-1][2-1],1)]];
model.evtin=ones(1-herit,1);
graphics.exprs=exprs;
x.graphics=graphics;
diff --git a/js/Sinks/CANIMXY3D.js b/js/Sinks/CANIMXY3D.js
index 9c5caacb..df6166aa 100644
--- a/js/Sinks/CANIMXY3D.js
+++ b/js/Sinks/CANIMXY3D.js
@@ -72,21 +72,21 @@ ok=false;
}
if (N<2) {
for (i=1;i<=nbr_curves;i+=1) {
-if (clrs(i)>0) {
+if (clrs[i-1]>0) {
mess=[[mess],["Buffer size must be at least 2 or Change a color (must be <0)"],[" "]];
ok=false;
}
}
}
-if (vec_y(1)>=vec_y(2)) {
+if (vec_y[1-1]>=vec_y[2-1]) {
mess=[[mess],["Ymax must be higher than Ymin"],[" "]];
ok=false;
}
-if (vec_x(1)>=vec_x(2)) {
+if (vec_x[1-1]>=vec_x[2-1]) {
mess=[[mess],["Xmax must be higher than Xmin"],[" "]];
ok=false;
}
-if (vec_z(1)>=vec_z(2)) {
+if (vec_z[1-1]>=vec_z[2-1]) {
mess=[[mess],["Zmax must be higher than Zmin"],[" "]];
ok=false;
}
diff --git a/js/Sinks/CMAT3D.js b/js/Sinks/CMAT3D.js
index c00b716d..3b35dd9c 100644
--- a/js/Sinks/CMAT3D.js
+++ b/js/Sinks/CMAT3D.js
@@ -3,7 +3,7 @@ function CMAT3D() {
CMAT3D.prototype.define = function CMAT3D() {
cmin=0;
cmax=100;
-colormap=jetcolormap(25);
+colormap=jetcolormap[25-1];
size_c=25;
x=-1;
y=-1;
diff --git a/js/Sinks/CMATVIEW.js b/js/Sinks/CMATVIEW.js
index b7ae62fd..135bbb8d 100644
--- a/js/Sinks/CMATVIEW.js
+++ b/js/Sinks/CMATVIEW.js
@@ -4,7 +4,7 @@ function CMATVIEW() {
cmin=0;
cmax=100;
size_c=25;
-colormap=jetcolormap(size_c);
+colormap=jetcolormap[size_c-1];
alpha_c=0.24;
beta_c=1;
model=scicos_model();
@@ -45,9 +45,9 @@ message([["Some specified values are inconsistent:"],[" "],[mess]]);
}
if (ok) {
size_c=size(colormap.slice(),1);
-sol=inv([[cmin,1],[cmax,1]])*[[1],[size_c/3]];
-alpha_c=sol(1);
-beta_c=sol(2);
+sol=inv[[[cmin,1],[cmax,1]]-1]*[[1],[size_c/3]];
+alpha_c=sol[1-1];
+beta_c=sol[2-1];
ipar=[[cmin],[cmax],[size_c]];
rpar=[[alpha_c],[beta_c],[colormap.slice()]];
model.ipar=ipar;
diff --git a/js/Sinks/CMSCOPE.js b/js/Sinks/CMSCOPE.js
index 65197ee7..b81edfce 100644
--- a/js/Sinks/CMSCOPE.js
+++ b/js/Sinks/CMSCOPE.js
@@ -70,7 +70,7 @@ mess=[[mess],["Size of Refresh Period must equal size of Ymin/Ymax vector"],[" "
ok=false;
}
for (i=1;i<=size(per,"*");i+=1) {
-if ((per(i)<=0)) {
+if ((per[i-1]<=0)) {
mess=[[mess],["Refresh Period must be positive"],[" "]];
ok=false;
}
diff --git a/js/Sinks/CSCOPXY3D.js b/js/Sinks/CSCOPXY3D.js
index 7b7787f7..7c8be672 100644
--- a/js/Sinks/CSCOPXY3D.js
+++ b/js/Sinks/CSCOPXY3D.js
@@ -67,21 +67,21 @@ ok=false;
}
if (N<2) {
for (i=1;i<=size(clrs,"*");i+=1) {
-if (clrs(i)>0) {
+if (clrs[i-1]>0) {
mess=[[mess],["Buffer size must be at least 2 or Change a color (must be >0)"],[" "]];
ok=false;
}
}
}
-if (vec_y(1)>=vec_y(2)) {
+if (vec_y[1-1]>=vec_y[2-1]) {
mess=[[mess],["Ymax must be higher than Ymin"],[" "]];
ok=false;
}
-if (vec_x(1)>=vec_x(2)) {
+if (vec_x[1-1]>=vec_x[2-1]) {
mess=[[mess],["Xmax must be higher than Xmin"],[" "]];
ok=false;
}
-if (vec_z(1)>=vec_z(2)) {
+if (vec_z[1-1]>=vec_z[2-1]) {
mess=[[mess],["Zmax must be higher than Zmin"],[" "]];
ok=false;
}
diff --git a/js/Sinks/TOWS_c.js b/js/Sinks/TOWS_c.js
index 32a8c9e0..90a642d5 100644
--- a/js/Sinks/TOWS_c.js
+++ b/js/Sinks/TOWS_c.js
@@ -14,7 +14,7 @@ model.out=[];
model.evtin=[1];
model.evtout=[];
model.rpar=[];
-model.ipar=[[nz],[length(varnam)],[transpose(ascii(varnam))]];
+model.ipar=[[nz],[length(varnam)],[transpose(ascii[varnam-1])]];
model.blocktype="d";
model.firing=[];
model.dep_ut=[false,false];
@@ -54,7 +54,7 @@ model.blocktype="x";
} else {
model.blocktype="d";
}
-model.ipar=[[nz],[length(varnam)],[transpose(ascii(varnam))]];
+model.ipar=[[nz],[length(varnam)],[transpose(ascii[varnam-1])]];
graphics.exprs=exprs;
x.graphics=graphics;
x.model=model;
diff --git a/js/Sinks/WFILE_f.js b/js/Sinks/WFILE_f.js
index 1f5d0223..df2897ef 100644
--- a/js/Sinks/WFILE_f.js
+++ b/js/Sinks/WFILE_f.js
@@ -12,7 +12,7 @@ model.sim="writef";
model.in1=in1;
model.evtin=1;
model.dstate=[[-1],[lunit],[zeros((nin+1)*N,1)]];
-model.ipar=[[length(fname)],[length(frmt)],[0],[N],[_str2code(fname)],[_str2code(frmt)]];
+model.ipar=[[length(fname)],[length(frmt)],[0],[N],[_str2code[fname-1]],[_str2code[frmt-1]]];
model.blocktype="d";
model.dep_ut=[true,false];
exprs=[[sci2exp(in1)],[fname],[frmt],[string(N)]];
@@ -25,8 +25,8 @@ x=standard_define([3,2],model,exprs,gr_i);
}
WFILE_f.prototype.set = function WFILE_f() {
warnobsolete("WRITEC_f","6.0.0");
-warnMessage=msprintf(_("Feature %s is obsolete."),"WFILE_f");
-warnAdvise=msprintf(_("Please use %s instead."),"WRITEC_f");
+warnMessage=msprintf(_["Feature %s is obsolete."-1],"WFILE_f");
+warnAdvise=msprintf(_["Please use %s instead."-1],"WRITEC_f");
warnXcosMessage=msprintf("%s %s",warnMessage,warnAdvise);
warnBlockByUID(arg1.model.label,warnXcosMessage);
x=arg1;
@@ -34,7 +34,7 @@ graphics=arg1.graphics;
exprs=graphics.exprs;
model=arg1.model;
dstate=model.dstate;
-lunit=dstate(2);
+lunit=dstate[2-1];
fname=exprs[2-1];
frmt=exprs[3-1];
while (true) {
@@ -57,7 +57,7 @@ block_parameter_error(gettext("Wrong value for \'Output File Name\' parameter"),
ok=false;
} else if (fileparts(fname1)!="") {
[pa,fn,ex]=fileparts(fname1);
-if (!isdir(pa)) {
+if (!isdir[pa-1]) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter."),gettext("Output File Name")),msprintf(gettext("Directory \'%s\' does not exist"),pa));
ok=false;
}
@@ -72,8 +72,8 @@ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),
ok=false;
}
if (ok) {
-ipar=[[length(fname1)],[length(frmt1)],[0],[N],[_str2code(fname1)],[_str2code(frmt1)]];
-if (prod(size(dstate))!=(nin+1)*N+2) {
+ipar=[[length(fname1)],[length(frmt1)],[0],[N],[_str2code[fname1-1]],[_str2code[frmt1-1]]];
+if (prod[size(dstate)-1]!=(nin+1)*N+2) {
dstate=[[-1],[lunit],[zeros((nin+1)*N,1)]];
}
model.in1=nin;
diff --git a/js/Sinks/WRITEAU_f.js b/js/Sinks/WRITEAU_f.js
index a574c66f..c91a58ae 100644
--- a/js/Sinks/WRITEAU_f.js
+++ b/js/Sinks/WRITEAU_f.js
@@ -13,7 +13,7 @@ model.sim=list("writeau",2);
model.in1=in1;
model.evtin=1;
model.dstate=[[-1],[lunit],[zeros((nin+1)*N,1)]];
-model.ipar=[[length(fname)],[_str2code(frmt)],[N],[swap],[_str2code(fname)]];
+model.ipar=[[length(fname)],[_str2code[frmt-1]],[N],[swap],[_str2code[fname-1]]];
model.blocktype="d";
model.dep_ut=[true,false];
exprs=[string(N),string(swap)];
@@ -31,7 +31,7 @@ exprs=graphics.exprs;
model=arg1.model;
ipar=model.ipar;
dstate=model.dstate;
-lunit=dstate(2);
+lunit=dstate[2-1];
while (true) {
[ok,N,swap,exprs]=scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"WRITEAU_f")],[" "],[gettext("Write \'.au\' sound file on audio device")]],[[gettext("Buffer Size")],[gettext("Swap Mode (0:No, 1:Yes)")]],list("vec",1,"vec",1),exprs);
if (!ok) {
@@ -40,7 +40,7 @@ break;
nin=1;
fname1="/dev/audio";
frmt1="uc ";
-if (alreadyran&&(N!=ipar(5))) {
+if (alreadyran&&(N!=ipar[5-1])) {
block_parameter_error(msprintf(gettext("You cannot modify \'%s\' when running."),gettext("Buffer Size")),gettext("End current simulation first"));
ok=false;
} else if (N<1) {
@@ -52,8 +52,8 @@ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),
ok=false;
}
if (ok) {
-ipar=[[length(fname1)],[_str2code(frmt1)],[N],[swap],[_str2code(fname1)]];
-if (prod(size(dstate))!=(nin+1)*N+2) {
+ipar=[[length(fname1)],[_str2code[frmt1-1]],[N],[swap],[_str2code[fname1-1]]];
+if (prod[size(dstate)-1]!=(nin+1)*N+2) {
dstate=[[-1],[lunit],[zeros((nin+1)*N,1)]];
}
model.in1=1;
diff --git a/js/Sinks/WRITEC_f.js b/js/Sinks/WRITEC_f.js
index 8ae4b3c8..581d3f02 100644
--- a/js/Sinks/WRITEC_f.js
+++ b/js/Sinks/WRITEC_f.js
@@ -13,7 +13,7 @@ model.sim=list("writec",2);
model.in1=in1;
model.evtin=1;
model.dstate=[[-1],[lunit],[zeros((nin+1)*N,1)]];
-model.ipar=[[length(fname)],[_str2code(frmt)],[N],[swap],[_str2code(fname)]];
+model.ipar=[[length(fname)],[_str2code[frmt-1]],[N],[swap],[_str2code[fname-1]]];
model.blocktype="d";
model.dep_ut=[true,false];
exprs=[[sci2exp(in1)],[fname],[frmt],[string(N),string(swap)]];
@@ -31,7 +31,7 @@ exprs=graphics.exprs;
model=arg1.model;
ipar=model.ipar;
dstate=model.dstate;
-lunit=dstate(2);
+lunit=dstate[2-1];
fname=exprs[2-1];
frmt=exprs[3-1];
while (true) {
@@ -50,14 +50,14 @@ ok=false;
} else if (alreadyran&&fname1!=fname) {
block_parameter_error(msprintf(gettext("You cannot modify \'%s\' when running"),gettext("Input Format")),gettext("End current simulation first."));
ok=false;
-} else if (alreadyran&&N!=ipar(5)) {
+} else if (alreadyran&&N!=ipar[5-1]) {
block_parameter_error(msprintf(gettext("You cannot modify \'Buffer Size\' when running."),gettext("Buffer Size")),gettext("End current simulation first"));
ok=false;
} else if (fname1=="") {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter."),gettext("Output File Name")),gettext("You must provide a filename."));
} else if (fileparts(fname1)!="") {
[pa,fn,ex]=fileparts(fname1);
-if (!isdir(pa)) {
+if (!isdir[pa-1]) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter."),gettext("Output File Name")),msprintf(gettext("Directory \'%s\' does not exist"),pa));
ok=false;
}
@@ -73,8 +73,8 @@ ok=false;
}
frmt1=part(frmt1,1,3);
if (ok) {
-ipar=[[length(fname1)],[_str2code(frmt1)],[N],[swap],[_str2code(fname1)]];
-if (prod(size(dstate))!=(nin+1)*N+2) {
+ipar=[[length(fname1)],[_str2code[frmt1-1]],[N],[swap],[_str2code[fname1-1]]];
+if (prod[size(dstate)-1]!=(nin+1)*N+2) {
dstate=[[-1],[lunit],[zeros((nin+1)*N,1)]];
}
model.in1=nin;