summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Shetye2025-05-30 13:02:52 +0530
committerSunil Shetye2025-05-30 13:02:52 +0530
commit61d0ce87f1c142522b73a49ba15232f5ac82c60c (patch)
tree904012d46fe9ae30a92b2a97a058ac1287dc3f65
parent243cf969c5a906a307091a73e89c23d2fe524a22 (diff)
downloadCommon-Interface-Project-61d0ce87f1c142522b73a49ba15232f5ac82c60c.tar.gz
Common-Interface-Project-61d0ce87f1c142522b73a49ba15232f5ac82c60c.tar.bz2
Common-Interface-Project-61d0ce87f1c142522b73a49ba15232f5ac82c60c.zip
fix undefined variable error in scilab scripts
-rw-r--r--blocks/Xcos/common/AAAAAA.py2
-rw-r--r--blocks/ajax-scilab/expression-sci-function.sci14
-rw-r--r--blocks/ajax-scilab/get_colormap_values.sci16
-rw-r--r--blocks/ajax-scilab/randfunc.sci14
-rw-r--r--blocks/ajax-scilab/scifunc-cleandata-do_spline.sci52
-rw-r--r--blocks/eda-frontend/src/components/Shared/Graph.js3
-rw-r--r--blocks/saveAPI/fixtures/saveAPI.yaml22
7 files changed, 66 insertions, 57 deletions
diff --git a/blocks/Xcos/common/AAAAAA.py b/blocks/Xcos/common/AAAAAA.py
index 5048cb55..9779cd15 100644
--- a/blocks/Xcos/common/AAAAAA.py
+++ b/blocks/Xcos/common/AAAAAA.py
@@ -955,7 +955,7 @@ def format_real_number(parameter):
try:
parameter = convert_scientific_notation(parameter)
parameter = eval(parameter)
- return "{:.10g}".format(float(parameter)) # Convert numeric strings safely
+ return "{:.17g}".format(float(parameter)) # Convert numeric strings safely
except ValueError:
return parameter # Return original non-numeric string
diff --git a/blocks/ajax-scilab/expression-sci-function.sci b/blocks/ajax-scilab/expression-sci-function.sci
index 076c1eb8..50092f44 100644
--- a/blocks/ajax-scilab/expression-sci-function.sci
+++ b/blocks/ajax-scilab/expression-sci-function.sci
@@ -5,7 +5,7 @@ function callFunctionAcctoMethod(filename,head,exx)
cal_exp=strcat(["deff(""",head,""",""",exx,""")"]);
ok=execstr(cal_exp,'errcatch')
if (ok~=0) then
- mfprintf(f_temp, '{""msg"":""Incorrect expression : %s""}', lasterror());
+ mfprintf(f_temp, '{""msg"":""Incorrect expression : %s""}', lasterror());
else
[ok,%ok1,ipar,rpar,%nz]=compiler_expression(%foo)
writeValueToFileFromVars(ok,%ok1,ipar,rpar,%nz,f_temp)
@@ -30,27 +30,27 @@ function writeValueToFileFromVars(ok,ok1,ipar,rpar,nz,f_temp)
mfprintf(f_temp, ',""ipar"":[');
for i = 1:length(ipar)
if (i == length(ipar)) then
- mfprintf(f_temp, '[%d]', ipar(i));
+ mfprintf(f_temp, '[%d]', ipar(i));
else
- mfprintf(f_temp, '[%d],', ipar(i));
+ mfprintf(f_temp, '[%d],', ipar(i));
end
end
mfprintf(f_temp, ']');
mfprintf(f_temp, ',""rpar"":[');
for i = 1:length(rpar)
if (i == length(rpar)) then
- mfprintf(f_temp, '[%d]', rpar(i));
+ mfprintf(f_temp, '[%d]', rpar(i));
else
- mfprintf(f_temp, '[%d],', rpar(i));
+ mfprintf(f_temp, '[%d],', rpar(i));
end
end
mfprintf(f_temp, ']');
mfprintf(f_temp, ',""nz"":[');
for i = 1:length(nz)
if (i == length(nz)) then
- mfprintf(f_temp, '[%d]', nz(i));
+ mfprintf(f_temp, '[%d]', nz(i));
else
- mfprintf(f_temp, '[%d],', nz(i));
+ mfprintf(f_temp, '[%d],', nz(i));
end
end
mfprintf(f_temp, ']');
diff --git a/blocks/ajax-scilab/get_colormap_values.sci b/blocks/ajax-scilab/get_colormap_values.sci
index 48816522..35182fe3 100644
--- a/blocks/ajax-scilab/get_colormap_values.sci
+++ b/blocks/ajax-scilab/get_colormap_values.sci
@@ -1,19 +1,19 @@
function getvaluesfromcolormap(filename,colormapstring)
- f_temp = mopen(filename, 'wt'); // Creating a text file
- string_to_pass = strcat(["cmp_value_from_script = [",colormapstring,"]"]); //forming string
+ f_temp = mopen(filename, 'wt'); // Creating a text file
+ string_to_pass = strcat(["cmp_value_from_script = [",colormapstring,"]"]); // forming string
ok = execstr(string_to_pass,'errcatch');
if (ok~=0) then
- mfprintf(f_temp, '%s', lasterror()); //catch error message if any
+ mfprintf(f_temp, '%s', lasterror()); // catch error message if any
else
- cmp_array = cmp_value_from_script(:); //converts to one dimensional array
- arry_size = size(cmp_array); // gives array of size eg. 96 1
- arry_length = arry_size(1); //Get size of array eg. 96
+ cmp_array = cmp_value_from_script(:); // converts to one dimensional array
+ arry_size = size(cmp_array); // gives array of size eg. 96 1
+ arry_length = arry_size(1); // Get size of array eg. 96
mfprintf(f_temp, '[');
for i = 1:arry_length
if i == arry_length then
- mfprintf(f_temp, '%.17g', cmp_array(i)); //print values of array
+ mfprintf(f_temp, '%.17g', cmp_array(i)); // print values of array
else
- mfprintf(f_temp, '%.17g,', cmp_array(i)); // print values of array
+ mfprintf(f_temp, '%.17g,', cmp_array(i)); // print values of array
end
end
mfprintf(f_temp, ']');
diff --git a/blocks/ajax-scilab/randfunc.sci b/blocks/ajax-scilab/randfunc.sci
index cdb5eb24..9c0d628a 100644
--- a/blocks/ajax-scilab/randfunc.sci
+++ b/blocks/ajax-scilab/randfunc.sci
@@ -1,18 +1,18 @@
function randfunc(filename,inputvalue)
- f_temp = mopen(filename, 'wt'); // Creating a text file
- string_to_pass = strcat(["cmd_values = ", inputvalue]); //storing value in cmd_values
+ f_temp = mopen(filename, 'wt'); // Creating a text file
+ string_to_pass = strcat(["cmd_values = ", inputvalue]); // storing value in cmd_values
ok = execstr(string_to_pass,'errcatch');
if (ok~=0) then
- mfprintf(f_temp, '%s', lasterror()); //catch error message if any
+ mfprintf(f_temp, '%s', lasterror()); // catch error message if any
else
[m,n] = size(cmd_values)
mfprintf(f_temp, '[[');
- for y = 1:m // no. of rows in variables
- for z = 1:n //no. of columns in variabes
+ for y = 1:m // no. of rows in variables
+ for z = 1:n // no. of columns in variables
if z == n then
- mfprintf(f_temp, '%.17g', cmd_values(y,z)); //Print the variable values
+ mfprintf(f_temp, '%.17g', cmd_values(y,z)); // Print the variable values
else
- mfprintf(f_temp, '%.17g,', cmd_values(y,z)); //Print the variable values
+ mfprintf(f_temp, '%.17g,', cmd_values(y,z)); // Print the variable values
end
end
if y ~= m then
diff --git a/blocks/ajax-scilab/scifunc-cleandata-do_spline.sci b/blocks/ajax-scilab/scifunc-cleandata-do_spline.sci
index 9e42587d..f45f7298 100644
--- a/blocks/ajax-scilab/scifunc-cleandata-do_spline.sci
+++ b/blocks/ajax-scilab/scifunc-cleandata-do_spline.sci
@@ -1,26 +1,26 @@
function callFunctioncleandata(filename,xye)
- f_temp = mopen(filename, 'wt'); // Creating a text file
- xye_split = strsplit(xye,';'); //split string for ';'
+ f_temp = mopen(filename, 'wt'); // Creating a text file
+ xye_split = strsplit(xye,';'); // split string for ';'
ary_size = size(xye_split); // get size of array which will be 6 1
n = ary_size(1); // retrive only size of element ie. 6
arry_xye = [];
for i = 1:n
- comma_split = strsplit(xye_split(i),',');//split string for ','
+ comma_split = strsplit(xye_split(i),','); // split string for ','
comma_ary_size = size(comma_split); // get size of array which will be 6 1
m = comma_ary_size(1);
for j = 1:m
- arry_xye(i)(j) = strtod(comma_split(j)); //convert string to double and add to array
+ arry_xye(i)(j) = strtod(comma_split(j)); // convert string to double and add to array
end
end
- [xy] = cleandata([arry_xye]); //pass new array to cleandata and save return value in xy
- [m,n] = size(xy) // reading the size of variable
+ [xy] = cleandata([arry_xye]); // pass new array to cleandata and save return value in xy
+ [m,n] = size(xy) // reading the size of variable
mfprintf(f_temp, '[[');
- for y = 1:m // no. of rows in variables
- for z = 1:n //no. of columns in variabes
+ for y = 1:m // no. of rows in variables
+ for z = 1:n // no. of columns in variables
if z == n then
- mfprintf(f_temp, '%.17g', xy(y,z)); //Print the variable values
+ mfprintf(f_temp, '%.17g', xy(y,z)); // Print the variable values
else
- mfprintf(f_temp, '%.17g,', xy(y,z)); //Print the variable values
+ mfprintf(f_temp, '%.17g,', xy(y,z)); // Print the variable values
end
end
if y ~= m then
@@ -32,30 +32,30 @@ function callFunctioncleandata(filename,xye)
endfunction
function callFunction_do_Spline(filename,N,order,x,y)
- f_temp = mopen(filename, 'wt'); // Creating a text file
- if ((strindex(x,",")) ~= []) then // if x value is array (0,0) or single value 0
- x_split = strsplit(x,','); //split string for ','
+ f_temp = mopen(filename, 'wt'); // Creating a text file
+ if ((strindex(x,",")) ~= []) then // if x value is array (0,0) or single value 0
+ x_split = strsplit(x,','); // split string for ','
x_size = size(x_split); // get size of array
n = x_size(1); // retrive size
x = [];
for i = 1:n
- x(1)(i) = strtod(x_split(i)); //convert string to double and add to array
+ x(1)(i) = strtod(x_split(i)); // convert string to double and add to array
end
else
- x = strtod(x); // in case x is single value 0 convert it into double
+ x = strtod(x); // in case x is single value 0 convert it into double
end
- if ((strindex(y,",")) ~= []) then // if y value is array (0,0) or single value 0
- y_split = strsplit(y,','); //split string for ','
+ if ((strindex(y,",")) ~= []) then // if y value is array (0,0) or single value 0
+ y_split = strsplit(y,','); // split string for ','
y_size = size(y_split); // get size of array
n = y_size(1); // retrive size
y = [];
for i = 1:n
- y(1)(i) = strtod(y_split(i)); //convert string to double and add to array
+ y(1)(i) = strtod(y_split(i)); // convert string to double and add to array
end
else
- y = strtod(y); // in case y is single value 0 convert it into double
+ y = strtod(y); // in case y is single value 0 convert it into double
end
- [Xdummy,Ydummy,orpar] = Do_Spline(strtod(N),strtod(order),x,y); //pass new array to do_spline and save return value in [Xdummy,Ydummy,orpar]
+ [Xdummy,Ydummy,orpar] = Do_Spline(strtod(N),strtod(order),x,y); // pass new array to do_spline and save return value in [Xdummy,Ydummy,orpar]
Do_Spline_write(Xdummy,Ydummy,orpar,f_temp);
mclose(f_temp)
endfunction
@@ -65,27 +65,27 @@ function Do_Spline_write(Xdummy,Ydummy,orpar,f_temp)
mfprintf(f_temp, '""Xdummy"":[');
for i = 1:length(Xdummy)
if (i == length(Xdummy)) then
- mfprintf(f_temp, '%.17g', Xdummy(i));
+ mfprintf(f_temp, '%.17g', Xdummy(i));
else
- mfprintf(f_temp, '%.17g,', Xdummy(i));
+ mfprintf(f_temp, '%.17g,', Xdummy(i));
end
end
mfprintf(f_temp, ']');
mfprintf(f_temp, ',""Ydummy"":[');
for i = 1:length(Ydummy)
if (i == length(Ydummy)) then
- mfprintf(f_temp, '%.17g', Ydummy(i));
+ mfprintf(f_temp, '%.17g', Ydummy(i));
else
- mfprintf(f_temp, '%.17g,', Ydummy(i));
+ mfprintf(f_temp, '%.17g,', Ydummy(i));
end
end
mfprintf(f_temp, ']');
mfprintf(f_temp, ',""orpar"":[');
for i = 1:length(orpar)
if (i == length(orpar)) then
- mfprintf(f_temp, '%d', orpar(i));
+ mfprintf(f_temp, '%d', orpar(i));
else
- mfprintf(f_temp, '%d,', orpar(i));
+ mfprintf(f_temp, '%d,', orpar(i));
end
end
mfprintf(f_temp, ']');
diff --git a/blocks/eda-frontend/src/components/Shared/Graph.js b/blocks/eda-frontend/src/components/Shared/Graph.js
index f0efd327..b550524d 100644
--- a/blocks/eda-frontend/src/components/Shared/Graph.js
+++ b/blocks/eda-frontend/src/components/Shared/Graph.js
@@ -37,6 +37,9 @@ class Graph extends Component {
let myInterval = null
this.state = {
options: {
+ accessibility: {
+ enabled: false
+ },
chart: {
events: {
load: function () {
diff --git a/blocks/saveAPI/fixtures/saveAPI.yaml b/blocks/saveAPI/fixtures/saveAPI.yaml
index ff3fe94f..f0ee5ee6 100644
--- a/blocks/saveAPI/fixtures/saveAPI.yaml
+++ b/blocks/saveAPI/fixtures/saveAPI.yaml
@@ -31182,7 +31182,7 @@
name: Ex7_6
description: 'Digital Control (Author: K. M. Moudgalya), 7) Structures and Specifications,
7.6) Verification of performance of lead controller on antenna system'
- save_time: 2025-05-08 12:24:26+00:00
+ save_time: 2025-05-30 12:29:41+00:00
book: 2048
data_dump: <?xml version="1.0" encoding="UTF-8"?><XcosDiagram background="-1"
finalIntegrationTime="20.0" title="g_s_cl2"><!--Xcos - 1.0 - scilab-5.5.2 -
@@ -33796,7 +33796,7 @@
st = 1; st1 = 0;
- t_init = 0; t_final = 20;
+ t_init = 0; t_final = 20; t = 0.5;
// u1: -4 to 11
@@ -65157,7 +65157,7 @@
name: Ex9_19
description: 'Digital Control (Author: K. M. Moudgalya), 9) Pole Placement Controllers,
9.19) Demonstration of usefulness of negative PID parameters'
- save_time: 2025-05-08 12:24:26+00:00
+ save_time: 2025-05-30 12:29:41+00:00
book: 2048
data_dump: <?xml version="1.0" encoding="UTF-8"?><XcosDiagram background="-1"
finalIntegrationTime="20.0" title="g_s_cl"><!--Xcos - 1.0 - scilab-5.5.2 - 20150331
@@ -69512,7 +69512,7 @@
C = 0; D = 1; N_var = 0;
- st = 1; t_init = 0; t_final = 20;
+ st = 1; t_init = 0; t_final = 20; t = 0.5;
[Tcp1,Tcp2] = cosfil_ip(Tc,1); // Tc/1
@@ -76427,7 +76427,7 @@
name: Ex9_21_1
description: 'Digital Control (Author: K. M. Moudgalya), 9) Pole Placement Controllers,
9.21) DC motor with PID control tuned through pole placement technique'
- save_time: 2025-05-08 12:24:27+00:00
+ save_time: 2025-05-30 12:29:41+00:00
book: 2048
data_dump: <?xml version="1.0" encoding="UTF-8"?><XcosDiagram background="-1"
finalIntegrationTime="20.0" title="Ex9_21_1"><!--Xcos - 1.0 - scilab-5.5.2 -
@@ -80078,6 +80078,8 @@
t_final = 20; // simulation end time
+ t = 0.5; // sampling time
+
st1 = 0;
@@ -80121,7 +80123,7 @@
name: Ex9_21_2
description: 'Digital Control (Author: K. M. Moudgalya), 9) Pole Placement Controllers,
9.21) DC motor with PID control tuned through pole placement technique'
- save_time: 2025-05-08 12:24:27+00:00
+ save_time: 2025-05-30 12:29:41+00:00
book: 2048
data_dump: <?xml version="1.0" encoding="UTF-8"?><XcosDiagram background="-1"
finalIntegrationTime="20.0" title="Ex9_21_2"><!--Xcos - 1.0 - scilab-5.5.2 -
@@ -83747,6 +83749,8 @@
t_final = 20; // simulation end time
+ t = 0.5; // sampling time
+
st1 = 0;
@@ -167433,7 +167437,7 @@
description: 'Feedback Control of Dynamic Systems (Author: G. F. Franklin, J.
D. Powell and A. Emami-Naeini), 6) The Frequency Response Design Method, 6.14)
Lead compensation for DC motor'
- save_time: 2025-05-08 12:24:29+00:00
+ save_time: 2025-05-30 12:29:42+00:00
book: 3432
data_dump: <?xml version="1.0" encoding="UTF-8"?><XcosDiagram background="-1"
finalIntegrationTime="5.0" title="Ex6_14_model"><!--Xcos - 1.0 - scilab-5.5.2
@@ -168683,7 +168687,9 @@
// for ramp response, set sw to 0
- sw=2'
+ sw=2;
+
+ Ts=1;'
- model: saveAPI.gallery
pk: 125
fields: