IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5288


Ignore:
Timestamp:
Oct 12, 2005, 8:17:23 AM (21 years ago)
Author:
eugene
Message:

added Stars and Images to client/server comms

Location:
trunk/Ohana/src/addstar/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/NewImage.c

    r5271 r5288  
    33int NewImage (int BindSocket) {
    44
    5   int i, Nstars, Noptions;
     5  int i, Nstars, Noptions, Nimage;
    66  Stars *stars;
     7  Image *image;
    78  AddstarClientOptions *options;
    89
     
    1314  }
    1415
    15 # if (0)
    16   if (!Recv_Image (BindSocket, &image)) {
     16  if (!Recv_Image (BindSocket, &image, &Nimage)) {
    1717    close (BindSocket);
    1818    return (FALSE);
    1919  }
    20 # endif
    2120
    2221  if (!Recv_Stars (BindSocket, &stars, &Nstars)) {
     
    2423    return (FALSE);
    2524  }
     25  /* XXX EAM : error check : 1 option, 1 image */
    2626
    2727  /* add to db */
     
    3333           options[0].skip_missed);
    3434
    35   for (i = 0; i < Nstars; i++) {
    36     fprintf (stderr, "R, D: %f, %f\n", stars[i].R, stars[i].D);
     35//  for (i = 0; i < Nstars; i++) {
     36//    fprintf (stderr, "R, D: %f, %f\n", stars[i].R, stars[i].D);
     37//  }
     38
     39  for (i = 0; i < Nimage; i++) {
     40    fprintf (stderr, "name: %s\n", image[i].name);
    3741  }
    3842
  • trunk/Ohana/src/addstar/src/addstarc.c

    r5271 r5288  
    33int main (int argc, char **argv) {
    44
    5   int Nstars;
     5  int Nstars, Nimage;
    66  int BindSocket;
    77  AddstarClientOptions options;
    88  Stars *stars;
     9  Image image;
    910
    1011  /* load config and options */
     
    1213  options = args_client (argc, argv);
    1314
    14 # if (0)
    1515  /* load data */
    1616  stars = gstars (argv[1], &Nstars, &image);
    17 # endif
    1817
    1918  /* set up server connection */
     
    2120  SendCommand (BindSocket, strlen(PASSWORD), PASSWORD);
    2221
    23   ALLOCATE (stars, Stars, 2);
    24   Nstars = 2;
    25 
    26   stars[0].R = 10.0;
    27   stars[0].D = 40.0;
    28 
    29   stars[1].R = 25.0;
    30   stars[1].D = 60.0;
    31 
    3222  /* send new data to server */
    3323  SendCommand (BindSocket, 5, "IMAGE");
    3424  Send_AddstarClientOptions (BindSocket, &options, 1, TRUE);
     25  Send_Image (BindSocket, &image, 1, FALSE);
    3526  Send_Stars (BindSocket, stars, Nstars, FALSE);
    36 
    37 # if (0)
    38   SendImage (BindSocket, &image);
    39 # endif
    4027
    4128  exit (0);
Note: See TracChangeset for help on using the changeset viewer.