Changeset 1816


Ignore:
Timestamp:
03/12/03 14:05:24 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/Changelog

    r1815 r1816  
    11                                                                  -*-*- END -*-*-
     2 2003/03/12 - Daniela Dorner, Thomas Bretz:
     3
     4   * gui/MGPngReader.cc, gui/MGStarguider.cc, videodev/Writer.[h,cc]:
     5     - changed output file names to contain mjd
     6     - fixed a cast warning
     7
     8
     9
    210 2003/03/11 - Daniela Dorner, Thomas Bretz:
    311
  • trunk/MagicSoft/Cosy/gui/MGPngReader.cc

    r1810 r1816  
    553553    }
    554554
    555     fFile = new TFile("leds.root", "RECREATE");
     555    fFile = new TFile(name, "RECREATE");
    556556
    557557    if (!fFile->IsOpen())
     
    999999    {
    10001000        if (fFileType->IsEntryChecked(IDM_kPNG))
    1001         {
    1002             static int num = 0;
    1003             char name[80];
    1004             sprintf(name, "pix/file%04d.png", num++);
    1005             Writer::Png(name, c, tm);
    1006         }
     1001            Writer::Png("pix/file", c, tm);
    10071002
    10081003        if (fFileType->IsEntryChecked(IDM_kPPM))
    1009         {
    1010             static int num = 0;
    1011             char name[80];
    1012             sprintf(name, "pix/file%04d.ppm", num++);
    1013             Writer::Ppm(name, c);
    1014         }
     1004            Writer::Ppm("pix/file", c, tm);
    10151005
    10161006        if (fWriteType->IsEntryChecked(IDM_kOnce))
     
    11491139void MGPngReader::DrawCircle(byte *img, double r)
    11501140{
    1151     const double rpix = (int)(r*60*60/fSao->GetPixSize()+1);
     1141    const double rpix = r*60*60/fSao->GetPixSize()+1;
    11521142    const int cx = 768/2;
    11531143    const int cy = 576/2;
    1154     for (int dx=-rpix*0.7; dx<rpix*0.7; dx++)
     1144    for (int dx=-(int)(rpix*0.7); dx<(int)(rpix*0.7); dx++)
    11551145    {
    11561146        const int dy = (int)sqrt(rpix*rpix-dx*dx);
  • trunk/MagicSoft/Cosy/gui/MGStarguider.cc

    r1804 r1816  
    572572    {
    573573        if (fFileType->IsEntryChecked(IDM_kPNG))
    574         {
    575             static int num = 0;
    576             char name[80];
    577             sprintf(name, "pix/file%04d.png", num++);
    578             Writer::Png(name, c, tm);
    579         }
     574            Writer::Png("pix/file", c, tm);
    580575
    581576        if (fFileType->IsEntryChecked(IDM_kPPM))
    582         {
    583             static int num = 0;
    584             char name[80];
    585             sprintf(name, "pix/file%04d.ppm", num++);
    586             Writer::Ppm(name, c);
    587         }
     577            Writer::Ppm("pix/file", c, tm);
    588578
    589579        if (fWriteType->IsEntryChecked(IDM_kOnce))
  • trunk/MagicSoft/Cosy/videodev/Writer.cc

    r1804 r1816  
    1414                 struct timeval *date)
    1515{
    16     cout << "Writing PNG '" << fname << "'" << endl;
     16    TString name = fname;
     17
     18    Timer t(date);
     19
     20    name += "_";
     21    name += t.GetMjd()-52000;
     22    name += ".png";
     23
     24    cout << "Writing PNG '" << name << "'" << endl;
    1725
    1826    //
    1927    // open file
    2028    //
    21     FILE *fd = fopen(fname, "w");
     29    FILE *fd = fopen(name, "w");
    2230    if (!fd)
    2331    {
     
    113121}
    114122
    115 void Writer::Ppm(const char *fname, const byte *img)
     123void Writer::Ppm(const char *fname, const byte *img, struct timeval *date)
    116124{
    117     cout << "Writing PPM '" << fname << "'" << endl;
     125    TString name = fname;
     126
     127    Timer t(date);
     128
     129    name += "_";
     130    name += t.GetMjd()-52000;
     131    name += ".ppm";
     132
     133    cout << "Writing PPM '" << name << "'" << endl;
    118134
    119135    //
    120136    // open file for writing
    121137    //
    122     ofstream fout(fname);
     138    ofstream fout(name);
    123139    if (!fout)
    124140    {
  • trunk/MagicSoft/Cosy/videodev/Writer.h

    r1111 r1816  
    1717public:
    1818
    19     static void Ppm(const char *fname, const byte *img);
     19    static void Ppm(const char *fname, const byte *img, struct timeval *date);
    2020    static void Png(const char *fname, const byte *buf, struct timeval *date);
    2121
Note: See TracChangeset for help on using the changeset viewer.