View Issue Details

IDProjectCategoryView StatusLast Update
0002110CCdcielGeneralpublic19-04-10 12:42
Reporterhan Assigned ToPatrick Chevalley  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status resolvedResolutionfixed 
Target Version1.0 
Summary0002110: Proposal to use the internal annotation database in sequence editor
DescriptionSince the annotation deepsky database is available, it requires only a few lines of code to use it in the sequence editor. Attached a proposed implementation in pu_edittarget.pas Only forcing the format is not implemented. I think it is useful to quickly add an object position.

I also cleaned up u_annotation.pas a little.

Probably you could add the position as soon you type an object name in Tstringrid but that's a little more complicated to implement. I have also experimented with Tinputcombo but that doesn't allow more then 10000 object or so and the list isn't sorted.

Steps To ReproduceUse attached code
TagsNo tags attached.



19-04-03 13:01


CCDCIEL internal.png (31,383 bytes)   
CCDCIEL internal.png (31,383 bytes)   


19-04-03 13:22

reporter   ~0005550

Forgot the conversion from radians to hours and degrees:

        TargetList.Cells[colra,n]:=floattostr(12*ra0/pi);{add position}

Attached an update.


19-04-03 14:25

reporter   ~0005552

I moved loading the deepsky database behind the inputbox since it takes one or two seconds.

Patrick Chevalley

19-04-03 16:37

administrator   ~0005555

Very good idea!

I am now working to merge your change because I also do some change to pu_edittargets today.
Please wait I commit this version before to make other changes.

Patrick Chevalley

19-04-03 17:48

administrator   ~0005557

I commit your new function, it work very well!

I make two minor change:
- change the button text from "Internal" to "Search", put the button on the first position, before Planetarium.
- use my ra,dec formatting function to fill the cells instead of floattostr() so the ra/dec is immediately show with the right format.

Tell me if it's OK


19-04-03 20:17

reporter   ~0005558

Perfect. Is a good addition


19-04-03 20:21

reporter   ~0005559

        TargetList.Cells[colra,n]:=RAToStr(12*ra0/pi);{add position}

Maybe this produces a little less code:

        TargetList.Cells[colra,n]:=RAToStr(ra0*12/pi);{add position}


19-04-03 20:42

reporter   ~0005560

There is a little problem with uppercase. It can't find "Sh2-105" Since not all letters are uppercase. This can be fixed with and uppercase in line 681:

    if ((objname=uppercase(naam2)) or (objname=uppercase(naam3)) or (objname=uppercase(naam4))) then

The full prcedure code with some improved comments:
procedure Tf_EditTargets.Btn_coord_internalClick(Sender: TObject);{Retrieve position from deepsky database}
var n: integer;
    ra0,dec0,length0,width0,pa : double;
    objname : string;

  objname:=uppercase(inputbox('Retrieve position from deepsky database','Object:' , ''));
  if length(objname)>1 then {Object name length should be two or longer}
    load_deep;{Load the deepsky database once. If already loaded, no action}
    linepos:=0;{Set pointer to the beginning}
      read_deepsky('T' {full database search} ,0 {ra},0 {dec},1 {cos(telescope_dec)},2*pi{fov},{var} ra0,dec0,length0,width0,pa);{Deepsky database search}
      if ((objname=uppercase(naam2)) or (objname=uppercase(naam3)) or (objname=uppercase(naam4))) then
        TargetList.Cells[colra,n]:=RAToStr(ra0*12/pi);{Add position}

        if naam3='' then TargetList.Cells[colname,n]:=naam2 {Add one object name only}
        TargetList.Cells[colname,n]:=naam2+'_'+naam3;{Add two object names}

        linepos:=$FFFFFF; {Stop searching}
    until linepos>=$FFFFFF;{Found object or end of database}

Patrick Chevalley

19-04-03 21:07

administrator   ~0005561

I do the modification:

When not debugging the program is compiled with -O3 so constant must be grouped by the compiler.

Patrick Chevalley

19-04-10 12:42

administrator   ~0005596

I think this we can close the issue.
This is a very good feature I now use all the time, thank you again!

Issue History

Date Modified Username Field Change
19-04-03 13:01 han New Issue
19-04-03 13:01 han File Added: CCDCIEL internal.png
19-04-03 13:01 han File Added: CCDCiel using internal
19-04-03 13:22 han File Added: CCDCiel using internal
19-04-03 13:22 han Note Added: 0005550
19-04-03 14:25 han File Added: CCDCiel using internal
19-04-03 14:25 han Note Added: 0005552
19-04-03 16:37 Patrick Chevalley Assigned To => Patrick Chevalley
19-04-03 16:37 Patrick Chevalley Status new => assigned
19-04-03 16:37 Patrick Chevalley Target Version => 1.0
19-04-03 16:37 Patrick Chevalley Note Added: 0005555
19-04-03 17:48 Patrick Chevalley Note Added: 0005557
19-04-03 20:17 han Note Added: 0005558
19-04-03 20:21 han Note Added: 0005559
19-04-03 20:42 han Note Added: 0005560
19-04-03 21:07 Patrick Chevalley Note Added: 0005561
19-04-10 12:42 Patrick Chevalley Status assigned => resolved
19-04-10 12:42 Patrick Chevalley Resolution open => fixed
19-04-10 12:42 Patrick Chevalley Note Added: 0005596