Beispiel #1
0
static void flush_path(FILE* stream, char* source, char* signame, char* dest, long color, float delay, char losig_type)
{
   char memo_char;
   long index;

   /*forbid vector for loins*/
   index=vectorindex(source);
   if (index>=0) {
      memo_char=SEPAR;
      SEPAR='_';
      source=nameindex(vectorradical(source),index);
      SEPAR=memo_char;
   }   

   /*forbid vector for loins*/
   index=vectorindex(dest);
   if (index>=0) {
      memo_char=SEPAR;
      SEPAR='_';
      dest=nameindex(vectorradical(dest),index);
      SEPAR=memo_char;
   }   

   /*forbid vector for internal signal*/
   index=vectorindex(signame);
   if (losig_type==INTERNAL && index>=0) {
      memo_char=SEPAR;
      SEPAR='_';
      signame=nameindex(vectorradical(signame),index);
      SEPAR=memo_char;
   }   


   fprintf(stream, XSCH_PATH XSCH_SEPAR "%s" XSCH_SEPAR "%s" XSCH_SEPAR
                  "%s" XSCH_SEPAR "%ld" XSCH_SEPAR "%d ps" XSCH_END ,
                       source, signame, dest, color, (int)delay);
   
}
Beispiel #2
0
   // -------------------------------------------------------------------------------
   // edit data by removing the millisecond adjusts, and optionally a piece-wise
   // linear model of the adjusts. Must be called in time order, as add() was.
   // NB may call repeatedly with the same ttag, however
   // NB ttag gets fixed every call, so don't keep calling with same variable ttag.
   void msecHandler::fix(CommonTime& ttag, SatID sat, string obstype, double& data)
   {
      // define the first linear clock
      if(rmvClk && tref == CommonTime::BEGINNING_OF_TIME) {
         tref = ttag;
         slope = double(nms[1])/(times[1]-times[0]);
         intercept = double(nms[0])-slope*(times[0]-ttag);
      }

      // advance to the next ms adjust?
      if(ims < times.size() && ::fabs(ttag-times[ims]) < 1.e-3) {
         ntot += nms[ims];
         fixMsg += string("\nFixed ") + adjMsgs[ims];
         ims++;
         if(rmvClk && ims < times.size()) {
            tref = times[ims-1];
            slope = double(nms[ims])/(times[ims]-tref);
            intercept = double(ntot);
         }  // else just leave them...extrapolation
      }

      // find index and wavelength for this obstype
      int index = vectorindex(obstypes,obstype);
      if(index == -1)
         GPSTK_THROW(Exception("Invalid obstype, internal error: "+obstype));
      double wl = wavelengths[index];

      // remove adjusts
      if(ims > 0 && ntot != 0) {
         // remove adjust from the time tag
         if(doPR) ttag -= ntot * 0.001;

         // remove adjust from the data
         if(find(ots[ims-1].begin(), ots[ims-1].end(), obstype) != ots[ims-1].end())
            if(data != 0.0) {
               data -= ntot * (wl == 0.0 ? Rfact : Rfact/wl);
            }
      }

      // remove gross (piece-wise linear) clock by adjusting time tags and all data
      if(rmvClk) {
         // compute the model at this time
         double dtot = (intercept + slope*(ttag-tref))*Rfact;
         ttag += dtot/C_MPS;
         if(wl != 0.0) dtot /= wl;
         if(data != 0.0) data += dtot;
      }
   }
Beispiel #3
0
static void flush_loins(FILE* stream, char* name, long color, float delay)
{
   char memo_char;
   long index;

   /*forbid vector*/
   index=vectorindex(name);
   if (index>=0) {
      memo_char=SEPAR;
      SEPAR='_';
      name=nameindex(vectorradical(name),index);
      SEPAR=memo_char;
   }   
   
   fprintf(stream,XSCH_BOX XSCH_SEPAR "%s" XSCH_SEPAR "%ld" XSCH_SEPAR "%d ps" XSCH_END ,
                       name, color, (int)delay);
   
}
Beispiel #4
0
static void flush_losig(FILE* stream, char* name, long color, float delay, char losig_type)
{
   char memo_char;
   long index;

   /*forbid vector for internal signal*/
   index=vectorindex(name);
   if (losig_type==INTERNAL && index>=0) {
      memo_char=SEPAR;
      SEPAR='_';
      name=nameindex(vectorradical(name),index);
      SEPAR=memo_char;
   }   


   fprintf(stream,XSCH_NET XSCH_SEPAR "%s" XSCH_SEPAR "%ld" XSCH_SEPAR "%d ps" XSCH_END ,
                       name, color, (int)delay);
   
}