wxString CRemoteProtocolHandler::readStarNetGroup()
{
	if (m_type != RPHT_STARNET)
		return wxEmptyString;

	wxString callsign((char*)(m_inBuffer + 3U), wxConvLocal, LONG_CALLSIGN_LENGTH);

	return callsign;
}
wxString CRemoteProtocolHandler::readRepeater()
{
	if (m_type != RPHT_REPEATER)
		return wxEmptyString;

	wxString callsign((char*)(m_inBuffer + 3U), wxConvLocal, LONG_CALLSIGN_LENGTH);

	return callsign;
}
Ejemplo n.º 3
0
//====================================================================
bool reg1test::parseQSO( String line )
{
   // break line at semicolons
   //060701;1408;M3MQR;;59;001;59;001;;IO80OU;24;;;;
   char * a[ 20 ];
   char buff[ 1024 ];
   strncpy( buff, line.c_str(), 1023 );
   buff[ 1023 ] = 0;
   bool sep2seen;
   int scnt = parseLine( buff, ';', a, 20, 0, sep2seen );   // BAD - parseLine writes to buffer
   if ( scnt >= 14 )
   {
      DisplayContestContact * aqso = 0;
      ct->makeContact( false, ( BaseContact * ) aqso );
      /*
       0  Date(6);
       1  Time(4);
       2  Call(3 - 14);
       3  Mode code(1 below);
       4  Sent-RST(0 or 2 or 3);
       5  Sent QSO number(0 or 3 or 4, with leading zeroes);
       6  Received-RST(0 or 2 or 3);
       7  Received QSO number(0 or 3 or 4, with leading zeroes);
       8  Received exchange(0 or 1-6);
       9  Received-WWL(0 or 4 or 6);
       10  QSO-Points(1-6 inc band mult);
       11  New-Exchange-(N)(0 or 1);
       12  New-WWL-(N)(0 or 1);
       13  New-DXCC-(N)(0 or 1);
       14  Duplicate-QSO-(D)(0 or 1)

         (N) says either "N;" or ";"
      */
      aqso->time.setDate( a[ 0 ], DTGReg1Test );
      aqso->time.setTime( a[ 1 ], DTGReg1Test );
      aqso->cs = callsign( strupr( a[ 2 ] ) );
      aqso->cs.valRes = CS_NOT_VALIDATED;
      // a[3] mode
      aqso->reps.setValue( a[ 4 ] );
      aqso->serials.setValue( a[ 5 ] ); // not string, int

      int maxct = atoi( aqso->serials.getValue().c_str() );
      if ( maxct > ct->maxSerial )
         ct->maxSerial = maxct;

      aqso->repr.setValue( a[ 6 ] );
      aqso->serialr.setValue( a[ 7 ] ); // not string, int
      aqso->extraText.setValue( a[ 8 ] );     // or district code if postcode mults
      aqso->loc.loc.setValue( a[ 9 ] );

      aqso->loc.valRes = LOC_NOT_VALIDATED;
      aqso->contactScore.setValue( atoi( a[ 10 ] ) );

      if ( atoi( a[ 10 ] ) == 0 || stricmp( a[ 14 ], "D" ) == 0 )
         aqso->contactFlags.setValue( NON_SCORING );

      nextBlock++;
      aqso->setLogSequence( nextBlock << 16 );
      ct->ctList.insert( aqso );
      return true;
   }
   return false;
}
Ejemplo n.º 4
0
//====================================================================
bool reg1test::parseHeader( String line )
{
   // break line at semicolons
   char buff[ 1024 ];
   strncpy( buff, line.c_str(), 1023 );
   buff[ 1023 ] = 0;
   bool sep2seen;
   char *a[ 2 ];
   char *b[ 3 ];
   int scnt = parseLine( buff, '=', a, 2, 0, sep2seen );   // BAD - parseLine writes to buffer

   if ( scnt != 1 )
   {
      return false;
   }

   // now work through the possible header strings
   String code = String( a[ 0 ] ).Trim().UpperCase();
   if ( code == "TNAME" )
   {
      //TName=VHFNFD
      ct->name.setValue( a[ 1 ] );
   }
   else
      if ( code == "PCALL" )
      {
         //PCall=G4RFR/P
         ct->mycall = callsign( strupr( a[ 1 ] ) );
         ct->mycall.valRes = CS_NOT_VALIDATED;
         ct->mycall.validate();
      }
      else
         if ( code == "PWWLO" )
         {
            //PWWLo=IO80ST
            ct->myloc.loc.setValue( a[ 1 ] );
            ct->validateLoc();
         }
         else
            if ( code == "PEXCH" )
            {
               //PExch=
               ct->location.setValue( a[ 1 ] );
            }
            else
               if ( code == "PADR1" )
               {
                  //PAdr1=Little Minterne Hill
                  ct->sqth1.setValue( a[ 1 ] );
               }
               else
                  if ( code == "PADR2" )
                  {
                     //PAdr2=Near Cerne Abbas
                     ct->sqth2.setValue( a[ 1 ] );
                  }
                  else
                     if ( code == "PSECT" )
                     {
                        //PSect=OPEN
                        ct->entSect.setValue( a[ 1 ] );
                     }
                     else
                        if ( code == "PBAND" )
                        {
                           //PBand=145 MHz
                           ct->band.setValue( a[ 1 ] );
                        }
                        else
                           if ( code == "PCLUB" )
                           {
                              //PClub=Bracknell and Flight Refuelling
                              ct->entrant.setValue( a[ 1 ] );
                           }
                           else
                              if ( code == "RNAME" )
                              {
                                 //RName=M. J. Goodey
                                 ct->entName.setValue( a[ 1 ] );
                              }
                              else
                                 if ( code == "RCALL" )
                                 {
                                    //RCall=G0GJV
                                    ct->entCall.setValue( a[ 1 ] );
                                 }
                                 else
                                    if ( code == "RADR1" )
                                    {
                                       //RAdr1=62, Rose Hill
                                       ct->entAddr1.setValue( a[ 1 ] );
                                    }
                                    else
                                       if ( code == "RADR2" )
                                       {
                                          //RAdr2=Binfield
                                          ct->entAddr2.setValue( a[ 1 ] );
                                       }
                                       else
                                          if ( code == "RPOCO" )
                                          {
                                             //RPoCo=RG42 5LG
                                             ct->entPostCode.setValue( a[ 1 ] );
                                          }
                                          else
                                             if ( code == "RCITY" )
                                             {
                                                //RCity=Bracknell
                                                ct->entCity.setValue( a[ 1 ] );
                                             }
                                             else
                                                if ( code == "RCOUN" )
                                                {
                                                   //RCoun=UK
                                                   ct->entCountry.setValue( a[ 1 ] );
                                                }
                                                else
                                                   if ( code == "RPHON" )
                                                   {
                                                      //RPhon=01344 428614
                                                      ct->entPhone.setValue( a[ 1 ] );
                                                   }
                                                   else
                                                      if ( code == "RHBBS" )
                                                      {
                                                         //[email protected]
                                                         ct->entEMail.setValue( a[ 1 ] );
                                                      }
                                                      else
                                                         if ( code == "MOPE1" )
                                                         {
                                                            //MOpe1=J.Smith (G0NZO); A.J.Baker (G3PFM); J.Fell (G0API); J. Hart (G4POF)
                                                            ct->ops1.setValue( a[ 1 ] );
                                                         }
                                                         else
                                                            if ( code == "MOPE2" )
                                                            {
                                                               //MOpe2=
                                                               ct->ops2.setValue( a[ 1 ] );
                                                            }
                                                            else
                                                               if ( code == "STXEQ" )
                                                               {
                                                                  //STXEq=IC202 + 2x4CX250 PA
                                                                  ct->entTx.setValue( a[ 1 ] );
                                                               }
                                                               else
                                                                  if ( code == "SPOWE" )
                                                                  {
                                                                     //SPowe=350
                                                                     ct->power.setValue( a[ 1 ] );
                                                                  }
                                                                  else
                                                                     if ( code == "SRXEQ" )
                                                                     {
                                                                        //SRXEq=IC202
                                                                        ct->entRx.setValue( a[ 1 ] );
                                                                     }
                                                                     else
                                                                        if ( code == "SANTE" )
                                                                        {
                                                                           //SAnte=2 X 14 ele
                                                                           ct->entAnt.setValue( a[ 1 ] );
                                                                        }
                                                                        else
                                                                           if ( code == "SANTH" )
                                                                           {
                                                                              //SAntH=16;250
                                                                              scnt = parseLine( a[ 1 ], ';', b, 3, 0, sep2seen );   // BAD - parseLine writes to buffer
                                                                              if ( scnt == 2 )
                                                                              {
                                                                                 ct->entAGL.setValue( b[ 0 ] );
                                                                                 ct->entASL.setValue( b[ 1 ] );
                                                                              }
                                                                           }

   // These could be useful as  across-check?

                                                                           else
                                                                              if ( code == "CQSOS" )
                                                                              {
                                                                                 // Claimed no. of valid QSOs;Band multiplier
                                                                                 //CQSOs=354;1
                                                                              }
                                                                              else
                                                                                 if ( code == "CQSOP" )
                                                                                 {
                                                                                    // Claimed no. of QSO points
                                                                                    //CQSOP=93471
                                                                                 }
                                                                                 else
                                                                                    if ( code == "CWWLS" )
                                                                                    {
                                                                                       // Claimed no. of WWLs;Bonus per new WWL;WWL multiplier
                                                                                       //CWWLs=0;0;1
                                                                                       if ( atoi( b[ 0 ] ) != 0 )
                                                                                       {
                                                                                          ct->locMult.setValue( true );
                                                                                       }
                                                                                    }
                                                                                    else
                                                                                       if ( code == "CWWLB" )
                                                                                       {
                                                                                          // Claimed no. of WWL bonus points
                                                                                          //CWWLB=0
                                                                                       }
                                                                                       else
                                                                                          if ( code == "CEXCS" )
                                                                                          {
                                                                                             // Claimed no. of exchanges; Bonus for each new exchange; Exchange Multiplier
                                                                                             //CExcs=0;0;1
                                                                                             if ( atoi( b[ 0 ] ) != 0 )
                                                                                             {
                                                                                                ct->districtMult.setValue( true );
                                                                                             }
                                                                                          }
                                                                                          else
                                                                                             if ( code == "CEXCB" )
                                                                                             {
                                                                                                // Claimed no. of exchange bonus points
                                                                                                //CExcB=0
                                                                                             }
                                                                                             else
                                                                                                if ( code == "CDXCS" )
                                                                                                {
                                                                                                   // Claimed no. of DXCCs; Bonus for each new DXCC;DXCC multiplier
                                                                                                   //CDXCs=0;0;1
                                                                                                   if ( atoi( b[ 0 ] ) != 0 )
                                                                                                   {
                                                                                                      ct->countryMult.setValue( true );
                                                                                                   }
                                                                                                }
                                                                                                else
                                                                                                   if ( code == "CDXCB" )
                                                                                                   {
                                                                                                      // Claimed no of DXCC bonus points
                                                                                                      //CDXCB=0
                                                                                                   }
                                                                                                   else
                                                                                                      if ( code == "CTOSC" )
                                                                                                      {
                                                                                                         // Claimed total score
                                                                                                         //CToSc=93471
                                                                                                      }
                                                                                                      else
                                                                                                         if ( code == "CODXC" )
                                                                                                         {
                                                                                                            // (Best DX) Callsign; Locator; Distance
                                                                                                            //CODXC=HB9CC;JN47RJ;946
                                                                                                         }
                                                                                                         else
                                                                                                            if ( code == "TDATE" )
                                                                                                            {
                                                                                                               // Start Date;End Date
                                                                                                               // derived
                                                                                                               //TDate=20060701;20060702
                                                                                                            }
                                                                                                            else
                                                                                                            {
                                                                                                               // unknown
                                                                                                               return false;
                                                                                                            }
   return true;
}
Ejemplo n.º 5
0
bool LoggerContestLog::GJVload( void )
{
   std::string temp;
   logCount = 0;

   // load the LoggerContestLog details from file_desc
   clearBuffer();
   readBlock( 0 );
   buffpt = 0;
   buftostr( temp );
   if ( atoi( temp.c_str() ) != 0 )
   {
      MinosParameters::getMinosParameters() ->mshowMessage( "Invalid block 0 in LoggerContestLog file" );
      return false;
   }

   buftostr( temp );
   if ( strnicmp( temp, GJVVERSION, VERLENGTH ) != 0 )
   {
      MinosParameters::getMinosParameters() ->mshowMessage( String( "Invalid LoggerContestLog file format (" ) + temp.c_str() + ", " + GJVVERSION + " expected)" );
      return false;
   }

   buftostr( band );
   buftostr( name );
   buftostr( temp );
   mycall = callsign( strupr( temp ) );
   buftostr( myloc.loc );
   buftostr( location );

   otherExchange.setValue( inyn() );
   /*bool CC_mult =*/
   inyn();
   /*
   if ( CC_mult )
   {
      Country_mult = true;
      County_mult = true;
      //      District_mult = true;
   }
   */
   locMult.setValue( inyn() );

   buftostr( temp );
   logCount = atoi( temp.c_str() );

   buftostr( power );

   buftostr( temp );
   //   buftostr( mainOpNow );

   buftostr( temp );
   //   buftostr( secondOpNow );

   buftostr( mode );
   inyn();
   scoreMode.setValue( PPKM );			// don't take any notice of radial flag!

   setPostEntry( inyn() );
   if ( inyn() )
   {
      scoreMode.setValue( PPQSO );
   }
   countryMult.setValue( inyn() );
   if ( inyn() )
   {
      //      County_mult = true;
      //      District_mult = true;
   }
   districtMult.setValue( inyn() );

   powerWatts.setValue( inyn() );

   if ( inyn() )
   {
      //      scoreMode = GSPECIAL;
   }

   allowLoc8.setValue( inyn() );
   RSTField.setValue( !inyn() );
   serialField.setValue( !inyn() );
   locatorField.setValue( !inyn() );

   QTHField.setValue( !inyn() );

   return true;

}
Ejemplo n.º 6
0
bool LoggerContestLog::importLOG( HANDLE hLogFile )
{
   THandleStream * hs = new THandleStream( ( int ) hLogFile );
   TStringList *ls = new TStringList();
   ls->LoadFromStream( hs );

   TEMPBUFF( temp, 100 );
   // Import from LOG format
   // Needs modification for "new" log format

   locValid = false;
   //   save();
   // read remainder of lines; write each line as we go

   long next_block = 1;

   bool started = false;

   DisplayContestContact *ct = 0;
   int lineNo = -1;
   while ( ++lineNo < ls->Count )
   {
      // skip new format header information, until we can cope
      // properly with it
      std::string stemp = trimr( ls->Strings[ lineNo ].c_str() );
      if ( stemp.length() == 0 || ( !started && !isdigit( ls->Strings[ lineNo ][ 1 ] ) ) )
      {
         // GJV.LOG

         /*
         Contest Title                        : VHFNFD
         Band in MHz                          : 432
         Section Entered                      : Multi Operator
         Name of Entrant/Club/Contest Group   : Bracknell Amateur Radio Club
         Band in MHz                          : %band%
         Section Entered                      : %section%
         Callsign Used                        : %call%
         QRH Locator Sent                     : %locator%
         Location as sent(District or QTH)    : %QTH%
         Brief Details of Transmitter Used    : %Transmitter%
         Brief Details of Receiver Used       : %Receiver%
         Power Output (Watts)                 : %power%
         Antenna Type                         : %Antenna%
         Antenna Height AGL(metres)           : %AGL%
         QTH Height ASL(metres)               : %ASL%

         Difficult ones:
         Name and Callsign of all Operators   :
         G0GJV  G4AUC  G0FCT  G0HVS
         Name, Callsign, Telephone Number, Address for Correspondence :
                                     : M. J. Goodey
                                     : G0GJV
                                     : 62, Rose Hill
                                     : Binfield
                                     : Berkshire
                                     : RG42 5LG
                               Phone : 01344 428614
                               Email : [email protected]

         */
         unsigned int spos = stemp.find( ":" );
         if ( spos != std::string::npos )
         {
            std::string text = trim( stemp.substr( spos + 1, stemp.size() ) );

            if ( strupr( stemp ).find( "CONTEST TITLE" ) == 0 )
            {
               name.setValue( text );
            }
            else
               if ( strupr( stemp ).find( "BAND IN MHZ" ) == 0 )
               {
                  band.setValue( text );
               }
               else
                  if ( strupr( stemp ).find( "SECTION ENTERED" ) == 0 )
                  {
                     entSect.setValue( text );
                  }
                  else
                     if ( strupr( stemp ).find( "NAME OF ENTRANT/CLUB/CONTEST GROUP" ) == 0 )
                     {
                        entrant.setValue( text );
                     }
                     else
                        if ( strupr( stemp ).find( "CALLSIGN USED" ) == 0 )
                        {
                           // we need to tail clip the callsign - or we end up with things like
                           // M1DUD/QRP        CLASS : SO  /   50MHZ FIXED
                           unsigned int spos = text.find( " " );
                           if ( spos != std::string::npos )
                           {
                              text = trim( text.substr( 0, spos ) );
                           }
                           mycall.fullCall.setValue( strupr( text ) );
                           mycall.valRes = CS_NOT_VALIDATED;
                           mycall.validate();

                        }
                        else
                           if ( strupr( stemp ).find( "QRH LOCATOR SENT" ) == 0 ||
                                strupr( stemp ).find( "QTH LOCATOR SENT" ) == 0 )
                           {
                              // yes, contestx DOES say QRH!
                              myloc.loc.setValue( strupr( text ) );
                              validateLoc();
                           }
                           else
                              if ( strupr( stemp ).find( "POWER OUTPUT" ) == 0 )
                              {
                                 power.setValue( text );
                              }
                              else
                                 if ( strupr( stemp ).find( "LOCATION AS SENT" ) == 0 )
                                 {
                                    location.setValue( text );
                                 }
                                 else
                                    if ( strupr( stemp ).find( "ANTENNA TYPE" ) == 0 )
                                    {
                                       entAnt.setValue( text );
                                    }
                                    else
                                       if ( strupr( stemp ).find( "ANTENNA HEIGHT" ) == 0 )
                                       {
                                          entAGL.setValue( text );
                                       }
                                       else
                                          if ( strupr( stemp ).find( "QTH HEIGHT" ) == 0 )
                                          {
                                             entASL.setValue( text );
                                          }
                                          else
                                             if ( strupr( stemp ).find( "BRIEF DETAILS OF TRANSMITTER USED" ) == 0 )
                                             {
                                                entTx.setValue( text );
                                             }
                                             else
                                                if ( strupr( stemp ).find( "BRIEF DETAILS OF RECEIVER USED" ) == 0 )
                                                {
                                                   entRx.setValue( text );
                                                }
         }
         continue;
      }
      started = true;

      makeContact( false, ( BaseContact * ) ct );
      ct->setLogSequence( 0 );

      stemp += std::string( 200, ' ' );   // make sure there is plenty more...
      const char *lbuff = stemp.c_str();
      // parse contact line in

      strcpysp( temp, &lbuff[ 0 ], 6 );
      ct->time.setDate( temp, DTGLOG );
      strcpysp( temp, &lbuff[ 7 ], 4 );
      ct->time.setTime( temp, DTGLOG );
      strcpysp( temp, &lbuff[ 21 ], 15 );
      ct->cs = callsign( strupr( temp ) );
      ct->cs.valRes = CS_NOT_VALIDATED;
      strcpysp( temp, &lbuff[ 37 ], 3 );
      ct->reps.setValue( temp );
      strcpysp( temp, &lbuff[ 41 ], 4 );
      ct->serials.setValue( temp );

      int maxct = atoi( ct->serials.getValue().c_str() );
      if ( maxct > maxSerial )
         maxSerial = maxct;

      strcpysp( temp, &lbuff[ 46 ], 3 );
      ct->repr.setValue( temp );
      strcpysp( temp, &lbuff[ 51 ], 4 );
      ct->serialr.setValue( temp );

      // here is the score field
      strcpysp( temp, &lbuff[ 59 ], 5 );
      if ( atoi( temp ) == 0 )
         ct->contactFlags.setValue( NON_SCORING );

      strcpysp( temp, &lbuff[ 65 ], 6 );
      ct->op1.setValue( temp );

      strcpysp( temp, &lbuff[ 72 ], 6 );
      ct->loc.loc.setValue( temp );
      ct->loc.valRes = LOC_NOT_VALIDATED;

      //ct->comments = "";

      TEMPBUFF( extra, EXTRALENGTH + 1 );
      TEMPBUFF( comments, COMMENTLENGTH + 1 );

      strcpysp( extra, &lbuff[ 81 ], 2 );          // 81 is district code
      if ( extra[ 0 ] && extra[ 1 ] && ( extra[ 0 ] != ' ' && extra[ 1 ] != ' ' ) )
      {
         // we always attempt to import the district mult field
         strcpysp( comments, &lbuff[ 93 ], COMMENTLENGTH );
         ct->comments.setValue( comments );

      }
      else
      {
         strcpysp( extra, &lbuff[ 93 ], EXTRALENGTH );
      }
      ct->extraText.setValue( extra );

      //	   strcpysp(ct->power, power, 7);
      //      ct->PowerWatts = PowerWatts;
      // save contact

      // we have to have logSequence set before we insert - or it will cause
      // duplicates

      next_block++ ;
      ct->setLogSequence( next_block << 16 );

      ctList.insert( ct );
   }
   delete ls;
   delete hs;
   return true;
}