Ignore:
Timestamp:
07/11/05 10:34:49 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mastro
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mastro/MAstro.cc

    r6277 r7179  
    3636
    3737#include "MTime.h"    // MTime::GetGmst
     38#include "MString.h"
    3839
    3940#include "MAstroCatalog.h" // FIXME: replace by MVector3!
     
    191192{
    192193    Day2Hm(h/24, sgn, deg, min);
     194}
     195
     196TString MAstro::GetStringDeg(Double_t deg, const char *fmt)
     197{
     198    Char_t sgn;
     199    UShort_t d, m, s;
     200    Deg2Dms(deg, sgn, d, m, s);
     201
     202    MString str;
     203    str.Print(fmt, sgn, d, m ,s);
     204    return str;
     205}
     206
     207TString MAstro::GetStringHor(Double_t deg, const char *fmt)
     208{
     209    Char_t sgn;
     210    UShort_t h, m, s;
     211    Hor2Hms(deg, sgn, h, m, s);
     212
     213    MString str;
     214    str.Print(fmt, sgn, h, m ,s);
     215    return str;
    193216}
    194217
  • trunk/MagicSoft/Mars/mastro/MAstro.h

    r6277 r7179  
    4545    static void Hor2Hm(Double_t rad, Char_t &sgn, UShort_t &hor, Double_t &min);
    4646
     47    // Print funtions
     48    static TString GetStringDeg(Double_t deg, const char *fmt="%c%d:%02d:%02d");
     49    static TString GetStringHor(Double_t deg, const char *fmt="%c%d:%02d:%02d");
     50
    4751    // Angle treatment functions
    4852    static Bool_t  String2Angle(TString &str, Double_t &ret);
  • trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc

    r4977 r7179  
    733733    const Double_t mag = -2.5*log10(v.Mag());
    734734
    735     MString str;
    736     str.Print("%s:  Ra=%.2fh  Dec=%.1fd  Mag=%.1f", v.GetName(), ra, dec, mag);
     735    TString str(v.GetName());
     736    if (!str.IsNull())
     737        str += ":  ";
     738    str += MString::Form("Ra=%.2fh  Dec=%.1fd  Mag=%.1f", ra, dec, mag);
    737739    if (txt)
    738740    {
Note: See TracChangeset for help on using the changeset viewer.