27a28 > int get_sat_ids (); 49a51,53 > * Nov 09, 2010 - Check sat label, norad, and ILRS IDs again data base. > * Tests are relative to ILRS ID, since it is in old > * normal point format. rlr. 105a110,112 > int tsic, tnorad, ttarget_type; > int nh3sicerr = 0, nh3noraderr = 0, nh3ttypeerr = 0, nh3nameerr = 0; > int nh3iderr= 0; 114a122 > char ttarget_name[11]; 117c125 < char nvern[5] = "1.01"; --- > char nvern[6] = "1.01a"; 212a221 > h3.target_name[10]= '\0'; 224a234,245 > /* Assume the sic is correct and check everything else */ > nh3iderr= get_sat_ids (0, &h3.ilrs_id, &tnorad, &tsic, &ttarget_name, > &ttarget_type); > if (!nh3iderr) > { > if (strncasecmp (h3.target_name, ttarget_name, 10) != 0 && > strcasestr (h3.target_name, "na") == 0) nh3nameerr = 1; > if (tsic != h3.sic) nh3sicerr = 1; > if (tnorad != h3.norad && h3.norad != -1) nh3noraderr = 1; > if (ttarget_type != h3.target_type) nh3ttypeerr = 1; > } > 733c754 < if (d40.cal_rms < 0 || d40.cal_rms > 1.e8) --- > if (d40.cal_rms < -1 || d40.cal_rms > 1.e8) 865a887,906 > if (nh3iderr == -1) > printf ("Could not open targets.dat file\n"); > if (nh3iderr == 1) > printf ("ILRS ID %7d not found in targets.dat file\n",h3.ilrs_id); > if (nh3nameerr) > printf ("Target name (%s) does not match official target name (%s)\n\ > based on ILRS ID (%07d)\n", > h3.target_name, ttarget_name, h3.ilrs_id); > if (nh3noraderr) > printf ("Target NORAD ID (%05d) does not match official target NORAD ID (%05d)\n\ > based on ILRS ID (%07d)\n", > h3.norad, tnorad, h3.ilrs_id); > if (nh3sicerr) > printf ("Target SIC (%04d) does not match official target SIC (%04d)\n\ > based on ILRS ID (%07d)\n", > h3.sic, tsic, h3.ilrs_id); > if (nh3ttypeerr) > printf ("Target type (%d) does not match official target type (%d)\n\ > based on ILRS ID (%7d)\n", > h3.target_type, ttarget_type, h3.ilrs_id); 1115a1157,1243 > > int > get_sat_ids (int mode, int *cospar_id, int *norad_id, int *sic, char *target, > int *target_type) > { > FILE *sat_id_in; > //char *sat_id_file = "/data/lib/targets.dat"; > char *sat_id_file = "targets.dat"; > char str[256], ttarget[11]; > int status, tcospar_id, tsic, tnorad_id = 0, ttt, trti; > int i, l; > > if (mode != 3) > { > for (i = 0; i < 10; i++) > { > target[i] = ' '; > } > target[10] = '\0'; > } > > if ((sat_id_in = fopen (sat_id_file, "r")) == NULL) > { > return (-1); > //printf ("Could not open file %s\n", sat_id_file); > //exit (1); > } > while ((status = fgets (str, 256, sat_id_in)) != NULL) > { > sscanf (str, "%s %d %d %d %d %d", ttarget, &ttt, &tsic, &tcospar_id, > &tnorad_id, &trti); > if (mode == 0 && tcospar_id == *cospar_id) > { > *norad_id = tnorad_id; > *sic = tsic; > strcpy (target, ttarget); > l = strlen (target); > if (l < 10) > target[l] = ' '; > target[10] = '\0'; > break; > } > else if (mode == 1 && tsic == *sic) > { > *cospar_id = tcospar_id; > *norad_id = tnorad_id; > strcpy (target, ttarget); > l = strlen (target); > if (l < 10) > target[l] = ' '; > target[10] = '\0'; > break; > } > else if (mode == 2 && tnorad_id == *norad_id) /* useless now */ > { > *cospar_id = tcospar_id; > *sic = tsic; > strcpy (target, ttarget); > l = strlen (target); > target[10] = '\0'; > break; > } > else if (mode == 3 && strcmp (ttarget, target) == 0) > { > *cospar_id = tcospar_id; > *norad_id = tnorad_id; > *sic = tsic; > break; > } > } > *target_type= ttt; > /*printf ("%s %d %d %d %d %d\n", ttarget, ttt, tsic, tcospar_id, > tnorad_id, trti);*/ > fclose (sat_id_in); > > if ((mode == 0 && tcospar_id != *cospar_id) || > (mode == 1 && tsic != *sic) || > (mode == 2 && tnorad_id != *norad_id) || > (mode == 3 && strcmp (ttarget, target) != 0)) > { > return (1); > } > else > { > return (0); > } > }