Aerospace Blockset for Xcos  

Aerospace Blockset for Xcos Commit Details

Date:2012-06-19 23:30:10 (6 years 2 months ago)
Author:Paweł Zagórski
Branch:master
Commit:caa6f48afc91d25b2d36c1e72b638c5992eebb41
Parents: 1c90c1653699662211450bbab2900763de05b015
Message:Modified keplerian_input block to use rpar rather than opar for passing parameters. Added proper safeguards.

Changes:
Mmacros/KEPLERIAN_INPUT.sci (3 diffs)
Mmacros/keplerian_input.sci (2 diffs)

File differences

macros/KEPLERIAN_INPUT.sci
3737
3838
3939
40
40
4141
4242
4343
......
6262
6363
6464
65
65
6666
6767
6868
......
7676
7777
7878
79
79
8080
8181
8282
//clkin,clkout,in_implicit,out_implicit)
//...
if ok then
model.opar = list(sma, ecc, incl, periapsis, raan, manom);
model.rpar = [sma ecc incl periapsis raan manom];
graphics.exprs=exprs;
x.graphics=graphics;
x.model=model
model.outtyp=[1;1;1;1;1;1]
model.blocktype='c'
model.dep_ut=[%f %f]
model.dep_ut=[%f %t]
exprs=[
string(sma);
gr_i=['txt=[''KEPLERIAN_INPUT''];';
'xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'')']
x=standard_define([2 6],model,exprs,gr_i)
x=standard_define([2 2],model,exprs,gr_i)
end
endfunction
macros/keplerian_input.sci
2020
2121
2222
23
24
25
26
27
28
23
24
25
26
27
28
2929
3030
3131
......
3939
4040
4141
42
43
44
42
43
44
45
46
47
48
49
50
4551
4652
4753
case 1 then
mprintf('\n');
mprintf(msprintf(gettext("\t%s : Output computation (flag==1)\n"), block_name));
block.outptr(1) = block.opar(1);
block.outptr(2) = block.opar(2);
block.outptr(3) = block.opar(3);
block.outptr(4) = block.opar(4);
block.outptr(5) = block.opar(5);
block.outptr(6) = block.opar(6);
block.outptr(1) = block.rpar(1);
block.outptr(2) = block.rpar(2);
block.outptr(3) = block.rpar(3);
block.outptr(4) = block.rpar(4);
block.outptr(5) = block.rpar(5);
block.outptr(6) = block.rpar(6);
case 2 then
mprintf('\n');
mprintf(msprintf(gettext("\t%s : Discrete state computation (flag==2)\n"), block_name));
error(msprintf(gettext("\t%s : Incorrect value of model.nipar\n"),..
block_name));
end
if block.nopar <> 1 then
error(msprintf(gettext("\t%s : Incorrect value of model.nopar\n"),..
block_name));
if block.nopar <> 0 then
pause;
error(msprintf(gettext("\t%s : Incorrect value of model.nopar: nopar = %d\n"),..
block_name, block.nopar));
end
if block.nrpar <> 8 then
pause;
error(msprintf(gettext("\t%s : Incorrect value of model.nrpar: nrpar = %d\n"),..
block_name, block.nrpar));
end
case 5 then
mprintf('\n');

Archive Download the corresponding diff file

Branches