From 3ff491aa5d39774d2d57ea49b5b0d078ff0e0119 Mon Sep 17 00:00:00 2001 From: Patrick Chevalley Date: Sun, 19 Apr 2020 13:05:25 +0200 Subject: [PATCH] Allow simulation for a single asteroid and comet --- skychart/cu_planet.pas | 16 +++- skychart/cu_skychart.pas | 8 +- skychart/fu_config_time.lfm | 155 ++++++++++++++++++++++++++++-------- skychart/fu_config_time.pas | 104 ++++++++++++++++++++++++ skychart/pu_config.lfm | 87 +++++++++++++++++++- skychart/pu_config.pas | 1 + skychart/pu_main.pas | 15 ++++ skychart/u_constant.pas | 5 ++ 8 files changed, 351 insertions(+), 40 deletions(-) diff --git a/skychart/cu_planet.pas b/skychart/cu_planet.pas index eaf4b3e77..4705d9af1 100644 --- a/skychart/cu_planet.pas +++ b/skychart/cu_planet.pas @@ -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 @@ -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; @@ -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 @@ -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; diff --git a/skychart/cu_skychart.pas b/skychart/cu_skychart.pas index 33d039c91..860d34e7c 100644 --- a/skychart/cu_skychart.pas +++ b/skychart/cu_skychart.pas @@ -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]; @@ -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; @@ -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 @@ -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; @@ -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 @@ -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 diff --git a/skychart/fu_config_time.lfm b/skychart/fu_config_time.lfm index a7ee2eafe..1ad242560 100644 --- a/skychart/fu_config_time.lfm +++ b/skychart/fu_config_time.lfm @@ -656,9 +656,9 @@ object f_config_time: Tf_config_time ClientWidth = 495 ParentFont = False object stepreset: TSpeedButton - Left = 222 + Left = 377 Height = 25 - Top = 215 + Top = 136 Width = 82 Caption = 'Reset ' Layout = blGlyphTop @@ -667,18 +667,18 @@ object f_config_time: Tf_config_time ParentFont = False end object Label178: TLabel - Left = 362 + Left = 316 Height = 19 - Top = 46 + Top = 23 Width = 42 Caption = 'every ' ParentColor = False ParentFont = False end object Label179: TLabel - Left = 222 + Left = 176 Height = 19 - Top = 46 + Top = 23 Width = 104 Caption = 'Number of steps' ParentColor = False @@ -694,10 +694,10 @@ object f_config_time: Tf_config_time ParentFont = False end object stepunit: TRadioGroup - Left = 321 - Height = 137 - Top = 103 - Width = 138 + Left = 176 + Height = 62 + Top = 72 + Width = 304 AutoFill = True Caption = 'Step unit' ChildSizing.LeftRightSpacing = 6 @@ -707,9 +707,10 @@ object f_config_time: Tf_config_time ChildSizing.ShrinkHorizontal = crsScaleChilds ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.Layout = cclLeftToRightThenTopToBottom - ChildSizing.ControlsPerLine = 1 - ClientHeight = 117 - ClientWidth = 136 + ChildSizing.ControlsPerLine = 4 + ClientHeight = 42 + ClientWidth = 302 + Columns = 4 Items.Strings = ( 'Days' 'Hours' @@ -732,9 +733,9 @@ object f_config_time: Tf_config_time end object SimObj: TCheckListBox Left = 8 - Height = 217 + Height = 225 Top = 23 - Width = 192 + Width = 160 Items.Strings = ( 'Sun' 'Mercury ' @@ -758,9 +759,9 @@ object f_config_time: Tf_config_time } end object AllSim: TButton - Left = 222 + Left = 176 Height = 25 - Top = 119 + Top = 136 Width = 76 BorderSpacing.InnerBorder = 4 Caption = 'All' @@ -769,9 +770,9 @@ object f_config_time: Tf_config_time TabOrder = 5 end object NoSim: TButton - Left = 222 + Left = 280 Height = 25 - Top = 168 + Top = 136 Width = 76 BorderSpacing.InnerBorder = 4 Caption = 'None' @@ -783,7 +784,7 @@ object f_config_time: Tf_config_time Left = 8 Height = 85 Top = 283 - Width = 443 + Width = 472 AutoFill = True Caption = 'Show Labels' ChildSizing.LeftRightSpacing = 6 @@ -795,7 +796,7 @@ object f_config_time: Tf_config_time ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 3 ClientHeight = 65 - ClientWidth = 441 + ClientWidth = 470 Columns = 3 Items.Strings = ( 'None' @@ -808,11 +809,11 @@ object f_config_time: Tf_config_time ParentFont = False TabOrder = 9 object LongEdit1: TLongEdit - Left = 297 + Left = 317 Height = 28 Hint = '2..500' Top = 29 - Width = 138 + Width = 147 Constraints.MaxHeight = 28 ParentFont = False ParentShowHint = False @@ -828,7 +829,7 @@ object f_config_time: Tf_config_time Left = 8 Height = 51 Top = 372 - Width = 443 + Width = 472 AutoFill = True Caption = 'Label Text' ChildSizing.LeftRightSpacing = 6 @@ -840,7 +841,7 @@ object f_config_time: Tf_config_time ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 3 ClientHeight = 31 - ClientWidth = 441 + ClientWidth = 470 Columns = 3 Items.Strings = ( 'Object Name' @@ -858,7 +859,7 @@ object f_config_time: Tf_config_time Left = 8 Height = 51 Top = 428 - Width = 443 + Width = 472 AutoFill = True Caption = 'Date Format' ChildSizing.LeftRightSpacing = 6 @@ -870,7 +871,7 @@ object f_config_time: Tf_config_time ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 6 ClientHeight = 31 - ClientWidth = 441 + ClientWidth = 470 Columns = 6 Items.Strings = ( 'Year' @@ -888,10 +889,10 @@ object f_config_time: Tf_config_time } end object nbstep: TLongEdit - Left = 222 + Left = 176 Height = 28 Hint = '1..100' - Top = 71 + Top = 47 Width = 76 Constraints.MaxHeight = 28 ParentFont = False @@ -904,10 +905,10 @@ object f_config_time: Tf_config_time MaxValue = 100 end object stepsize: TLongEdit - Left = 362 + Left = 316 Height = 28 Hint = '1..999' - Top = 71 + Top = 47 Width = 76 Constraints.MaxHeight = 28 ParentFont = False @@ -920,9 +921,9 @@ object f_config_time: Tf_config_time MaxValue = 999 end object UpDown1: TMouseUpDown - Left = 298 + Left = 252 Height = 28 - Top = 71 + Top = 47 Width = 17 Associate = nbstep Min = 1 @@ -931,9 +932,9 @@ object f_config_time: Tf_config_time TabOrder = 2 end object UpDown2: TMouseUpDown - Left = 438 + Left = 392 Height = 28 - Top = 71 + Top = 47 Width = 17 Associate = stepsize Max = 999 @@ -952,6 +953,90 @@ object f_config_time: Tf_config_time ParentFont = False TabOrder = 12 end + object PanelAst: TPanel + Left = 176 + Height = 34 + Top = 176 + Width = 304 + BevelOuter = bvNone + ClientHeight = 34 + ClientWidth = 304 + TabOrder = 13 + object AsteroidFilter: TEdit + Left = 0 + Height = 28 + Top = 4 + Width = 80 + Constraints.MaxHeight = 28 + ParentFont = False + TabOrder = 0 + end + object btnAstFilter: TButton + Left = 80 + Height = 24 + Top = 4 + Width = 76 + BorderSpacing.InnerBorder = 4 + Caption = 'Filter ->' + OnClick = btnAstFilterClick + ParentFont = False + TabOrder = 1 + end + object AsteroidList: TComboBox + Left = 160 + Height = 28 + Top = 4 + Width = 144 + Constraints.MaxHeight = 28 + ItemHeight = 0 + OnChange = AsteroidListChange + ParentFont = False + Style = csDropDownList + TabOrder = 2 + end + end + object PanelCom: TPanel + Left = 176 + Height = 34 + Top = 214 + Width = 304 + BevelOuter = bvNone + ClientHeight = 34 + ClientWidth = 304 + TabOrder = 14 + object CometFilter: TEdit + Left = 0 + Height = 28 + Top = 4 + Width = 80 + Constraints.MaxHeight = 28 + ParentFont = False + TabOrder = 0 + end + object btnCometFilter: TButton + Left = 80 + Height = 24 + Top = 4 + Width = 76 + BorderSpacing.InnerBorder = 4 + Caption = 'Filter ->' + OnClick = btnCometFilterClick + ParentFont = False + TabOrder = 1 + end + object CometList: TComboBox + Left = 160 + Height = 28 + Top = 4 + Width = 144 + Constraints.MaxHeight = 28 + ItemHeight = 0 + OnChange = CometListChange + ParentFont = False + Style = csDropDownList + TabOrder = 2 + end + end end object Page3: TTabSheet Caption = 'Animation' diff --git a/skychart/fu_config_time.pas b/skychart/fu_config_time.pas index 66e746012..de0a78a9c 100644 --- a/skychart/fu_config_time.pas +++ b/skychart/fu_config_time.pas @@ -27,16 +27,24 @@ interface uses u_help, u_translation, u_constant, u_util, u_projection, cu_tz, cu_radec, + cu_database, LCLIntf, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Math, StdCtrls, CheckLst, Buttons, ExtCtrls, enhedits, ComCtrls, LResources, ButtonPanel, jdcalendar, LazHelpHTML_fix, EditBtn, SpinEx; +const + maxcombo = 500; + type { Tf_config_time } Tf_config_time = class(TFrame) + AsteroidFilter: TEdit; + AsteroidList: TComboBox; BitBtn1: TBitBtn; + btnAstFilter: TButton; + btnCometFilter: TButton; ButtonDefGreg: TButton; Button4: TButton; Button5: TButton; @@ -45,12 +53,16 @@ Tf_config_time = class(TFrame) Button8: TButton; Button9: TButton; CheckBox3: TCheckBox; + CometFilter: TEdit; + CometList: TComboBox; dt_ut: TFloatEdit; JDEdit: TFloatSpinEditEx; Label12: TLabel; GregY: TLongEdit; GregM: TLongEdit; GregD: TLongEdit; + PanelAst: TPanel; + PanelCom: TPanel; stepmark: TCheckBox; CheckGroup1: TCheckGroup; CheckGroup2: TCheckGroup; @@ -134,7 +146,10 @@ Tf_config_time = class(TFrame) t_sec: TMouseUpDown; t_minEdit: TEdit; t_secEdit: TEdit; + procedure AsteroidListChange(Sender: TObject); procedure BitBtn1Click(Sender: TObject); + procedure btnAstFilterClick(Sender: TObject); + procedure btnCometFilterClick(Sender: TObject); procedure Button4Click(Sender: TObject); procedure Button5Click(Sender: TObject); procedure Button6Click(Sender: TObject); @@ -147,6 +162,7 @@ Tf_config_time = class(TFrame) procedure CheckGroup1ItemClick(Sender: TObject; Index: integer); procedure CheckGroup2ItemClick(Sender: TObject; Index: integer); procedure ComboBox1Change(Sender: TObject); + procedure CometListChange(Sender: TObject); procedure DateEditChange(Sender: TObject); procedure DateClick(Sender: TObject; Button: TUDBtnType); procedure DirectoryEdit1Change(Sender: TObject); @@ -186,6 +202,7 @@ Tf_config_time = class(TFrame) procedure UpDown3Click(Sender: TObject; Button: TUDBtnType); private { Private declarations } + cometid, astid : array[0..maxcombo] of string; LockChange, LockJD: boolean; FApplyConfig: TNotifyEvent; JDCalendarDialog1: TJDCalendarDialog; @@ -194,6 +211,7 @@ Tf_config_time = class(TFrame) procedure ShowUTTime; public { Public declarations } + cdb: Tcdcdb; mycsc: Tconf_skychart; myccat: Tconf_catalog; mycshr: Tconf_shared; @@ -365,6 +383,14 @@ procedure Tf_config_time.Init; if not csc.ShowPluto then csc.SimObject[9] := False; ShowTime; + if csc.SimAsteroidName<>'' then begin + AsteroidFilter.Text:=csc.SimAsteroidName; + btnAstFilterClick(nil); + end; + if csc.SimCometName<>'' then begin + CometFilter.Text:=csc.SimCometName; + btnCometFilterClick(nil); + end; // fill time zone TZComboBox.Clear; TZComboBox.ItemIndex := -1; @@ -525,6 +551,8 @@ procedure Tf_config_time.ShowTime; nbstep.MaxValue := 500; UpDown1.Max := 500; end; + panelast.Visible:=csc.SimObject[12]; + panelcom.Visible:=csc.SimObject[13]; if csc.SimLabel >= 0 then begin if csc.SimLabel > 3 then @@ -1076,6 +1104,68 @@ procedure Tf_config_time.dt_utChange(Sender: TObject); Tdt_ut.Caption := dt_ut.Text; end; +procedure Tf_config_time.btnAstFilterClick(Sender: TObject); +var + list: TStringList; +begin + list := TStringList.Create; + list.Add(rsAll); + try + Cdb.GetAsteroidList(AsteroidFilter.Text,maxcombo,list,astid); + AsteroidList.Items.Assign(list); + if list.Count>1 then + AsteroidList.ItemIndex:=1 + else + AsteroidList.ItemIndex:=0; + AsteroidListChange(nil); + finally + List.Free + end; +end; + +procedure Tf_config_time.btnCometFilterClick(Sender: TObject); +var + list: TStringList; +begin + list := TStringList.Create; + list.Add(rsAll); + try + Cdb.GetCometList(CometFilter.Text,maxcombo,list,cometid); + CometList.Items.Assign(list); + if list.Count>1 then + CometList.ItemIndex:=1 + else + CometList.ItemIndex:=0; + CometListChange(nil); + finally + list.Free; + end; +end; + +procedure Tf_config_time.AsteroidListChange(Sender: TObject); +begin + if AsteroidList.ItemIndex<=0 then begin + csc.SimAsteroid:=''; + csc.SimAsteroidName:=''; + end + else begin + csc.SimAsteroid:=astid[AsteroidList.ItemIndex-1]; + csc.SimAsteroidName:=AsteroidList.Text; + end; +end; + +procedure Tf_config_time.CometListChange(Sender: TObject); +begin + if CometList.ItemIndex<=0 then begin + csc.SimComet:=''; + csc.SimCometName:=''; + end + else begin + csc.SimComet:=cometid[CometList.ItemIndex-1]; + csc.SimCometName:=CometList.Text; + end; +end; + procedure Tf_config_time.SimObjItemClick(Sender: TObject; Index: longint); var j: integer; @@ -1096,6 +1186,16 @@ procedure Tf_config_time.SimObjItemClick(Sender: TObject; Index: longint); j := index; end; csc.SimObject[j] := SimObj.Checked[index]; + panelast.Visible:=csc.SimObject[12]; + if not csc.SimObject[12] then begin + AsteroidList.Clear; + AsteroidListChange(nil); + end; + panelcom.Visible:=csc.SimObject[13]; + if not csc.SimObject[12] then begin + CometList.Clear; + CometListChange(nil); + end; if csc.SimObject[12] or csc.SimObject[13] then begin nbstep.MaxValue := MaxAstSim; @@ -1185,6 +1285,10 @@ procedure Tf_config_time.stepresetClick(Sender: TObject); stepsize.Value := 1; stepunit.ItemIndex := 0; stepunitClick(Sender); + AsteroidList.Clear; + CometList.Clear; + AsteroidListChange(nil); + CometListChange(nil); end; procedure Tf_config_time.nbstepChanged(Sender: TObject); diff --git a/skychart/pu_config.lfm b/skychart/pu_config.lfm index 9c97e4aeb..d758dd5db 100644 --- a/skychart/pu_config.lfm +++ b/skychart/pu_config.lfm @@ -826,6 +826,8 @@ object f_config: Tf_config inherited PageControl1: TPageControl Height = 553 Width = 491 + ActivePage = f_config_time1.Page2 + TabIndex = 1 inherited Page1: TTabSheet ClientHeight = 549 ClientWidth = 487 @@ -932,6 +934,7 @@ object f_config: Tf_config inherited ADBC: TRadioGroup Left = 276 Width = 139 + ClientHeight = 19 ClientWidth = 137 end inherited Button5: TButton @@ -1055,6 +1058,7 @@ object f_config: Tf_config Height = 219 Width = 194 ItemHeight = 0 + TopIndex = -1 Data = { 0C000000000000000000000000000000 } @@ -1077,7 +1081,6 @@ object f_config: Tf_config ClientWidth = 446 inherited LongEdit1: TLongEdit Left = 299 - Top = 29 Width = 139 end end @@ -1124,6 +1127,88 @@ object f_config: Tf_config Top = 260 Width = 86 end + object Panel1: TPanel[17] + Left = 176 + Height = 34 + Top = 176 + Width = 304 + BevelOuter = bvNone + ClientHeight = 30 + ClientWidth = 300 + TabOrder = 13 + object AsteroidFilter: TEdit + Left = 0 + Height = 28 + Top = 4 + Width = 80 + Constraints.MaxHeight = 28 + ParentFont = False + TabOrder = 0 + end + object btnAstFilter: TButton + Left = 80 + Height = 24 + Top = 4 + Width = 76 + BorderSpacing.InnerBorder = 4 + Caption = 'Filter ->' + OnClick = btnAstFilterClick + ParentFont = False + TabOrder = 1 + end + object AsteroidList: TComboBox + Left = 160 + Height = 28 + Top = 4 + Width = 144 + Constraints.MaxHeight = 28 + ItemHeight = 0 + ParentFont = False + Style = csDropDownList + TabOrder = 2 + end + end + object Panel2: TPanel[18] + Left = 176 + Height = 34 + Top = 214 + Width = 304 + BevelOuter = bvNone + ClientHeight = 30 + ClientWidth = 300 + TabOrder = 14 + object CometFilter: TEdit + Left = 0 + Height = 28 + Top = 4 + Width = 80 + Constraints.MaxHeight = 28 + ParentFont = False + TabOrder = 0 + end + object btnCometFilter: TButton + Left = 80 + Height = 24 + Top = 4 + Width = 76 + BorderSpacing.InnerBorder = 4 + Caption = 'Filter ->' + OnClick = btnCometFilterClick + ParentFont = False + TabOrder = 1 + end + object CometList: TComboBox + Left = 160 + Height = 28 + Top = 4 + Width = 144 + Constraints.MaxHeight = 28 + ItemHeight = 0 + ParentFont = False + Style = csDropDownList + TabOrder = 2 + end + end end inherited Page3: TTabSheet ClientHeight = 549 diff --git a/skychart/pu_config.pas b/skychart/pu_config.pas index b097aac98..2ab17b614 100644 --- a/skychart/pu_config.pas +++ b/skychart/pu_config.pas @@ -568,6 +568,7 @@ procedure Tf_config.SetDB(Value: Tcdcdb); f_config_solsys1.cdb := Value; f_config_pictures1.cdb := Value; f_config_observatory1.cdb := Value; + f_config_time1.cdb := Value; end; procedure Tf_config.SetCcat(Value: Tconf_catalog); diff --git a/skychart/pu_main.pas b/skychart/pu_main.pas index 36f96db6f..73337236e 100644 --- a/skychart/pu_main.pas +++ b/skychart/pu_main.pas @@ -4548,6 +4548,7 @@ procedure Tf_main.SetupTimePage(page: integer); ConfigTime.f_config_time1.cshr.Assign(catalog.cfgshr); ConfigTime.f_config_time1.cplot.Assign(def_cfgplot); ConfigTime.f_config_time1.csc.Assign(def_cfgsc); + ConfigTime.f_config_time1.cdb:=cdcdb; if MultiFrame1.ActiveObject is Tf_chart then with MultiFrame1.ActiveObject as Tf_chart do begin @@ -5460,6 +5461,8 @@ procedure Tf_main.activateconfig(cmain: Tconf_main; csc: Tconf_skychart; catalog.cfgshr.Assign(cshr); if csc <> nil then begin + csc.ShowAsteroid := csc.ShowAsteroid or (csc.SimObject[12] and (csc.SimNb>1)); + csc.ShowComet := csc.ShowComet or (csc.SimObject[13] and (csc.SimNb>1)); showast := csc.ShowAsteroid; if (not csc.SunOnline) or (csc.sunurlname <> def_cfgsc.sunurlname) then DeleteFile(slash(Tempdir) + 'sun.jpg'); @@ -6307,6 +6310,10 @@ procedure Tf_main.SetDefault; def_cfgsc.SimH := 0; def_cfgsc.SimM := 0; def_cfgsc.SimS := 0; + def_cfgsc.SimAsteroid := ''; + def_cfgsc.SimAsteroidName := ''; + def_cfgsc.SimComet := ''; + def_cfgsc.SimCometName := ''; def_cfgsc.SimLine := True; def_cfgsc.SimMark := True; for i := 1 to NumSimObject do @@ -7338,6 +7345,10 @@ procedure Tf_main.ReadChartConfig(filename: string; usecatalog, resizemain: bool csc.SimS := ReadInteger(section, 'SimS', csc.SimS); csc.SimLine := ReadBool(section, 'SimLine', csc.SimLine); csc.SimMark := ReadBool(section, 'SimMark', csc.SimMark); + csc.SimAsteroid := ReadString(section, 'SimAsteroid', csc.SimAsteroid); + csc.SimComet := ReadString(section, 'SimComet', csc.SimComet); + csc.SimAsteroidName := ReadString(section, 'SimAsteroidName', csc.SimAsteroidName); + csc.SimCometName := ReadString(section, 'SimCometName', csc.SimCometName); for i := 1 to NumSimObject do csc.SimObject[i] := ReadBool(section, 'SimObject' + IntToStr(i), csc.SimObject[i]); @@ -8659,6 +8670,10 @@ procedure Tf_main.SaveChartConfig(filename: string; child: TChildFrame; WriteInteger(section, 'SimS', csc.SimS); WriteBool(section, 'SimLine', csc.SimLine); WriteBool(section, 'SimMark', csc.SimMark); + WriteString(section, 'SimAsteroid', csc.SimAsteroid); + WriteString(section, 'SimComet', csc.SimComet); + WriteString(section, 'SimAsteroidName', csc.SimAsteroidName); + WriteString(section, 'SimCometName', csc.SimCometName); for i := 1 to NumSimObject do WriteBool(section, 'SimObject' + IntToStr(i), csc.SimObject[i]); for i := 1 to numlabtype do diff --git a/skychart/u_constant.pas b/skychart/u_constant.pas index 85911fa03..f56e1e565 100644 --- a/skychart/u_constant.pas +++ b/skychart/u_constant.pas @@ -985,6 +985,7 @@ Tconf_skychart = class(TObject) // chart setting projname: array [0..MaxField] of string[3]; FlipX, FlipY, ProjPole, TrackType, TrackObj, AstSymbol, ComSymbol: integer; SimNb, SimD, SimH, SimM, SimS, SimLabel: integer; + SimComet, SimCometName, SimAsteroid, SimAsteroidName: string; SimObject: array[1..NumSimObject] of boolean; SimLine, SimMark, SimDateLabel, SimNameLabel, SimMagLabel, ShowPlanet, PlanetParalaxe, ShowEarthShadow, ShowAsteroid, ShowComet, @@ -2270,6 +2271,10 @@ procedure Tconf_skychart.Assign(Source: Tconf_skychart); SimH := Source.SimH; SimM := Source.SimM; SimS := Source.SimS; + SimComet := Source.SimComet; + SimCometName := Source.SimCometName; + SimAsteroid := Source.SimAsteroid; + SimAsteroidName := Source.SimAsteroidName; SimLabel := Source.SimLabel; SimLine := Source.SimLine; SimMark := Source.SimMark;