View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001724 | SkyChart | 1-Software | public | 17-06-01 01:05 | 17-06-04 15:16 |
| Reporter | Gajowy | Assigned To | Patrick Chevalley | ||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | resolved | Resolution | fixed | ||
| Product Version | 4.0 | ||||
| Target Version | 4.2 | Fixed in Version | 4.1 SVN | ||
| Summary | 0001724: Searching asteroids doesn't match | ||||
| Description | When one try to find an asteroid with a name equal to starting part of another asteroid's name then sometimes system finds the second. It work this way in both cases: filling text field or choosing object using "advanced search". | ||||
| Steps To Reproduce | 1. Fill search field with "2017 CS" and press Enter. (494622) 2017 CS3 is found instead. 2. Go to "Advanced serach", choose "asteroid", fill the field with "2017 CS" and click "Filter->". Choose "2017 CS" from the list and click "Search". (494622) 2017 CS3 is found instead. | ||||
| Tags | No tags attached. | ||||
|
|
|
|
|
If you can recompile executable from source, replace entire TPlanet.FindAsteroidName method in cu_planet.pas by attached patch. Similar may be the case with comet names. |
|
|
TPlanet.FindAsteroidName.patch (2,245 bytes)
function TPlanet.FindAsteroidName(astname: String; var ra,de,mag:double; cfgsc: Tconf_skychart; upddb:boolean; MeanPos:boolean=false):boolean;
var
dist,r,elong,phase,rad,ded : double;
epoch,h,g,ma,ap,an,ic,ec,sa,eq,xc,yc,zc : double;
qry,id,ref,nam,elem_id :string;
ira,idec,imag: integer;
i: integer;
s1,s2: String;
begin
result:=false;
searchid:='';
if (not db1.Active) or (not cfgsc.ephvalid) then exit;
{
qry:='SELECT id FROM cdc_ast_name'
+' where name like "%'+astname+'%"'
+' limit 1';
}
//SZ This will show first similar name, which is not good solution
// Instead, look for similar names, however do not limit to first one.
// Furthermore loop inside results and try to find exact name.
// If not found, then use first one
qry:='SELECT id,name FROM cdc_ast_name' +
' where name like "%'+astname+'%"';
id := '';
db1.Query(qry);
if db1.Rowcount > 0 then
begin
s1 := UpperCase(trim(astname));
for i:=0 to db1.Rowcount-1 do
begin
s2:= UpperCase(Trim( db1.Results[i][1] ) );
if s1 = s2 then
begin
id := db1.Results[i][0];
break
end;
end;
if id='' then
id := db1.Results[0][0];
end
else exit;
//SZ id:=db1.QueryOne(qry);
if id='' then exit;
if cdb.GetAstElemEpoch(id,cfgsc.CurJDTT,epoch,h,g,ma,ap,an,ic,ec,sa,eq,ref,nam,elem_id) then
begin
InitAsteroid(epoch,h,g,ma,ap,an,ic,ec,sa,eq,nam);
Asteroid(cfgsc.CurJDTT,true,ra,de,dist,r,elong,phase,mag,xc,yc,zc);
result:=true;
if MeanPos then exit;
if cfgsc.PlanetParalaxe then
Paralaxe(cfgsc.CurST,dist,ra,de,ra,de,r,cfgsc);
if upddb then
begin
rad:=ra;
ded:=de;
precession(jd2000,cfgsc.jdchart,rad,ded);
ira:=round(rad*1000);
idec:=round(ded*1000);
imag:=round(mag*10);
qry:='INSERT INTO '+cfgsc.ast_daypos+' (id,epoch,ra,de,mag) VALUES ('
+'"'+id+'"'
+',"'+strim(formatfloat(f6s,epoch))+'"'
+',"'+inttostr(ira)+'"'
+',"'+inttostr(idec)+'"'
+',"'+inttostr(imag)+'")';
db1.Query(qry);
db1.flush('tables');
searchid:=id;
end;
end
else
result:=false;
end;
|
|
|
Thank you Sasa, your patch work fine. I do the same for the comet but I not have a test case in the current data. This work directly if you type "2017 CS" in the quick search box. In advanced search it still show "(494622) 2017 CS3" first because it is numbered, but now it work when you select "2017 CS" in the list. Fixed by revision 3600: https://sourceforge.net/p/skychart/code/3600 And in 3601 I add some safety limit to avoid to loop the 700000 asteroids if the search name is null: https://sourceforge.net/p/skychart/code/3601 |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 17-06-01 01:05 | Gajowy | New Issue | |
| 17-06-01 01:05 | Gajowy | File Added: CdC_error2.png | |
| 17-06-01 14:31 | Sasa | Note Added: 0003832 | |
| 17-06-01 14:32 | Sasa | File Added: TPlanet.FindAsteroidName.patch | |
| 17-06-01 14:33 | Sasa | Note Edited: 0003832 | |
| 17-06-01 14:35 | Sasa | Note Edited: 0003832 | |
| 17-06-04 15:16 | Patrick Chevalley | Assigned To | => Patrick Chevalley |
| 17-06-04 15:16 | Patrick Chevalley | Status | new => resolved |
| 17-06-04 15:16 | Patrick Chevalley | Resolution | open => fixed |
| 17-06-04 15:16 | Patrick Chevalley | Fixed in Version | => 4.1 SVN |
| 17-06-04 15:16 | Patrick Chevalley | Target Version | => 4.2 |
| 17-06-04 15:16 | Patrick Chevalley | Note Added: 0003840 |