Skip to content

Commit

Permalink
Allow simulation for a single asteroid and comet
Browse files Browse the repository at this point in the history
  • Loading branch information
pchev committed Apr 19, 2020
1 parent 94f5476 commit 3ff491a
Show file tree
Hide file tree
Showing 8 changed files with 351 additions and 40 deletions.
16 changes: 14 additions & 2 deletions skychart/cu_planet.pas
Expand Up @@ -2662,7 +2662,8 @@ procedure TPlanet.ComputeAsteroid(cfgsc: Tconf_skychart);
(j * cfgsc.SimD * 24 + j * cfgsc.SimH + j * cfgsc.SimM / 60 + j * cfgsc.SimS / 3600) * 15 * deg2rad, pi2);
for i := 0 to db2.Rowcount - 1 do
begin
id := db2.Results[i][0];
id := db2.Results[i][0];
if (cfgsc.SimAsteroid='')or(cfgsc.SimAsteroid=id) then begin
epoch := strtofloat(strim(db2.Results[i][1]));
if cdb.GetAstElem(id, epoch, h, g, ma, ap, an, ic, ec, sa, eq, ref, nam, elem_id) then
begin
Expand All @@ -2683,6 +2684,11 @@ procedure TPlanet.ComputeAsteroid(cfgsc: Tconf_skychart);
cfgsc.AsteroidLst[j, i + 1, 4] := jdt;
cfgsc.AsteroidLst[j, i + 1, 5] := epoch;
end;
end
else begin
cfgsc.AsteroidName[j, i + 1, 1] := id;
cfgsc.AsteroidLst[j, i + 1, 5] := -1;
end;
end;
end;
end;
Expand Down Expand Up @@ -2763,7 +2769,8 @@ procedure TPlanet.ComputeComet(cfgsc: Tconf_skychart);
(j * cfgsc.SimD * 24 + j * cfgsc.SimH + j * cfgsc.SimM / 60 + j * cfgsc.SimS / 3600) * 15 * deg2rad, pi2);
for i := 0 to db2.Rowcount - 1 do
begin
id := db2.Results[i][0];
id := db2.Results[i][0];
if (cfgsc.SimComet='')or(cfgsc.SimComet=id) then begin
epoch := strtofloat(strim(db2.Results[i][1]));
if cdb.GetComElem(id, epoch, tp, q, ec, ap, an, ic, h, g, eq, nam, elem_id) then
begin
Expand Down Expand Up @@ -2794,6 +2801,11 @@ procedure TPlanet.ComputeComet(cfgsc: Tconf_skychart);
cfgsc.CometLst[j, i + 1, 7] := jdt;
cfgsc.CometLst[j, i + 1, 8] := epoch;
end;
end
else begin
cfgsc.CometName[j, i + 1, 1] := id;
cfgsc.CometLst[j, i + 1, 8] := -1;
end;
end;
end;
end;
Expand Down
8 changes: 6 additions & 2 deletions skychart/cu_skychart.pas
Expand Up @@ -2816,6 +2816,7 @@ function Tskychart.DrawAsteroid: boolean;
break;
for i := 1 to cfgsc.AsteroidNb do
begin
if (cfgsc.AsteroidLst[j, i, 5]>0) then begin
ra := cfgsc.AsteroidLst[j, i, 1];
Dec := cfgsc.AsteroidLst[j, i, 2];
magn := cfgsc.AsteroidLst[j, i, 3];
Expand Down Expand Up @@ -2873,6 +2874,7 @@ function Tskychart.DrawAsteroid: boolean;
SetLabel(lid, xx, yy, 0, 2, 10, ltxt, lalign, lori, 4, lopt);
end;
end;
end;
end;
end;
Result := True;
Expand Down Expand Up @@ -2953,6 +2955,7 @@ function Tskychart.DrawComet: boolean;
break;
for i := 1 to cfgsc.CometNb do
begin
if (cfgsc.CometLst[j, i, 8]>0) then begin
projection(cfgsc.CometLst[j, i, 1], cfgsc.CometLst[j, i, 2], x1, y1, True, cfgsc);
WindowXY(x1, y1, xx, yy, cfgsc);
if (xx > cfgsc.Xmin) and (xx < cfgsc.Xmax) and (yy > cfgsc.Ymin) and (yy < cfgsc.Ymax) then
Expand Down Expand Up @@ -3017,6 +3020,7 @@ function Tskychart.DrawComet: boolean;
cfgsc.CometLst[j, i, 3], cfgsc.CometLst[j, i, 4], abs(cfgsc.BxGlb) * deg2rad / 60);
end;
end;
end;
end;
end;
Result := True;
Expand Down Expand Up @@ -3308,7 +3312,7 @@ function Tskychart.DrawOrbitPath: boolean;
if cfgsc.SimObject[13] then
for i := 1 to cfgsc.CometNb do
for j := 0 to cfgsc.SimNb - 1 do
begin
if cfgsc.CometLst[j, i, 8]>0 then begin
projection(cfgsc.CometLst[j, i, 1], cfgsc.CometLst[j, i, 2], x1, y1, True, cfgsc);
windowxy(x1, y1, xx, yy, cfgsc);
if (j <> 0) and ((xx > -dx) and (yy > -dy) and (xx < dx) and (yy < dy)) and
Expand All @@ -3328,7 +3332,7 @@ function Tskychart.DrawOrbitPath: boolean;
if cfgsc.SimObject[12] then
for i := 1 to cfgsc.AsteroidNb do
for j := 0 to cfgsc.SimNb - 1 do
begin
if cfgsc.AsteroidLst[j, i, 5]>0 then begin
projection(cfgsc.AsteroidLst[j, i, 1], cfgsc.AsteroidLst[j, i, 2], x1, y1, True, cfgsc);
windowxy(x1, y1, xx, yy, cfgsc);
if (j <> 0) and ((xx > -dx) and (yy > -dy) and (xx < dx) and (yy < dy)) and
Expand Down

0 comments on commit 3ff491a

Please sign in to comment.