Changeset 7451 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
12/12/05 12:25:48 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7450 r7451  
    3434     - simplified reading the catlog file by using TString::Tokenize
    3535
     36   * mtools/MCalendar.[h,cc]:
     37     - added
     38
    3639
    3740
     
    8083     - replaced the nonsense TArrayS by TArrayC because the contents is
    8184       just a byte
     85
     86   * mreport/MReportCC.cc:
     87     - fixed the
    8288
    8389   * ganymed.cc:
  • trunk/MagicSoft/Mars/mjobs/MDataSet.cc

    r7413 r7451  
    6868//     in time, but it is not necessary.
    6969//
    70 // MISSING (27/01/04): The default name and paths cannot be used yet, because
    71 //                     they have to be defined soon.
    72 //
    7370/////////////////////////////////////////////////////////////////////////////
    7471#include "MDataSet.h"
     
    425422        n++;
    426423
    427         // Strip all spaces from line
    428         for (int i=0; i<line.Length(); i++)
    429             if (line[i]==' ')
    430                 line.Remove(i--, 1);
    431 
    432         const Ssiz_t s = line.First(',');
    433         if (s<0 || fNameSource!=line(0, s))
    434             continue;
    435 
    436         // CrabNebula,f|L|K0,5:34:32.0,22:0:52,-1.0,2000
    437 
    438         for (int i=0; i<6; i++)
     424        TObjArray *arr = line.Tokenize(",");
     425
     426        if (arr->GetEntries()<6)
    439427        {
    440             const Ssiz_t p = line.First(',');
    441             if (p<0 && i<5)
    442             {
    443                 gLog << err << "ERROR - Not enough arguments in line #" << n << " of " << catalog << endl;
    444                 return kFALSE;;
    445             }
    446 
    447             switch (i)
    448             {
    449             case 0:
    450             case 1:
    451             case 4:
    452                 break;
    453             case 2:
    454                 ra = line(0, p);
    455                 break;
    456             case 3:
    457                 dec = line(0, p);
    458                 break;
    459             case 5:
    460                 epoch = line;
    461                 break;
    462             }
    463             line.Remove(0, p+1);
     428            gLog << err << "ERROR - Not enough arguments in line #" << n << " of " << catalog << endl;
     429            delete arr;
     430            return kFALSE;;
    464431        }
    465432
    466         if (line.First(',')>=0)
    467         {
    468             gLog << err << "ERROR - Too much arguments in line #" << n << " of " << catalog << endl;
    469             return kFALSE;
    470         }
    471 
    472         break;
    473     }
    474 
    475     if (epoch.IsNull())
    476     {
    477         gLog << err << "ERROR - No entry " << fNameSource << " in " << catalog << endl;
    478         return kFALSE;
    479     }
    480 
    481     if (epoch!=(TString)"2000")
     433        const TString name = (*arr)[0]->GetName();
     434
     435        ra    = (*arr)[2]->GetName();
     436        dec   = (*arr)[3]->GetName();
     437        epoch = (*arr)[5]->GetName();
     438
     439        delete arr;
     440
     441        if (name.Strip(TString::kBoth)==fNameSource)
     442            break;
     443    }
     444
     445    if (epoch.Strip(TString::kBoth)!=(TString)"2000")
    482446    {
    483447        gLog << err << "ERROR - Epoch not 2000... not supported." << endl;
Note: See TracChangeset for help on using the changeset viewer.