Changeset 13890 for trunk/FACT++


Ignore:
Timestamp:
05/25/12 20:22:26 (12 years ago)
Author:
tbretz
Message:
New extensions for files; added runtime to status page
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/smartfact.cc

    r13878 r13890  
    307307{
    308308private:
     309    const Time fRunTime;
     310
    309311    enum states_t
    310312    {
     
    511513        out << '\n';
    512514
    513         ofstream(fPath+"/scriptlog.txt") << out.str();
     515        ofstream(fPath+"/scriptlog.data") << out.str();
    514516    }
    515517
     
    573575        out << "#ffffff\t" << stat.max << '\n';
    574576
    575         ofstream(fPath+"/"+name+".txt") << out.str();
     577        ofstream(fPath+"/"+name+".data") << out.str();
    576578
    577579        WriteBinary(d, "magicweather-"+name+"-hist", fMagicWeatherHist[i], max-min, min);
     
    621623            out << "\t\n";
    622624
    623         ofstream(fPath+"/weather.txt") << out.str();
     625        ofstream(fPath+"/weather.data") << out.str();
    624626
    625627        out.str("");
     
    640642        out << kHtmlWhite << '\t';
    641643
    642         ofstream(fPath+"/astro.txt") << out.str();
     644        ofstream(fPath+"/astro.data") << out.str();
    643645
    644646        WriteWeather(d, "temp",  kTemp,   -5,   35);
     
    672674        out << d.GetJavaDate() << '\n';
    673675
    674         ofstream(fPath+"/tngdust.txt") << out.str();
     676        ofstream(fPath+"/tngdust.data") << out.str();
    675677
    676678        return GetCurrentState();
     
    704706        out << az << '\n';
    705707
    706         ofstream(fPath+"/drive-pointing.txt") << out.str();
     708        ofstream(fPath+"/drive-pointing.data") << out.str();
    707709
    708710        return GetCurrentState();
     
    763765            out << kHtmlWhite << "\t&mdash; \n";
    764766
    765         ofstream(fPath+"/tracking.txt") << out.str();
     767        ofstream(fPath+"/tracking.data") << out.str();
    766768
    767769        return GetCurrentState();
     
    793795        out << "#ffffff\t" << wang << '\n';
    794796
    795         ofstream(fPath+"/source.txt") << out.str();
     797        ofstream(fPath+"/source.data") << out.str();
    796798
    797799        return GetCurrentState();
     
    840842        out << kHtmlWhite << '\t' << stat.avg << '\n';
    841843        out << kHtmlWhite << '\t' << stat.max << '\n';
    842         ofstream(fPath+"/feedback.txt") << out.str();
     844        ofstream(fPath+"/feedback.data") << out.str();
    843845
    844846        return GetCurrentState();
     
    878880        out << kHtmlWhite << '\t' << stat.avg << '\n';
    879881        out << kHtmlWhite << '\t' << stat.max << '\n';
    880         ofstream(fPath+"/voltage.txt") << out.str();
     882        ofstream(fPath+"/voltage.data") << out.str();
    881883
    882884        return GetCurrentState();
     
    993995        out << col4 << '\t' << stat.max << '\n';
    994996        out << kHtmlWhite << '\t' << power_tot << "W [" << power_apd << "mW]\n";
    995         ofstream(fPath+"/current.txt") << out.str();
     997        ofstream(fPath+"/current.data") << out.str();
    996998
    997999        return GetCurrentState();
     
    10571059        out << col[2] << '\t' << rc.substr(20, 10) << '\n';
    10581060        out << col[3] << '\t' << rc.substr(30, 10) << '\n';
    1059         ofstream(fPath+"/fad.txt") << out.str();
     1061        ofstream(fPath+"/fad.data") << out.str();
    10601062
    10611063        return GetCurrentState();
     
    10951097        out << "#ffffff\t" << fFtmControlTriggerRateCam << '\n';
    10961098
    1097         ofstream(fPath+"/trigger.txt") << out.str();
     1099        ofstream(fPath+"/trigger.data") << out.str();
    10981100
    10991101        const Statistics bstat(vector<float>(brates, brates+40));
     
    11061108        out << kHtmlWhite << '\t' << bstat.avg << '\n';
    11071109        out << kHtmlWhite << '\t' << bstat.max << '\n';
    1108         ofstream(fPath+"/boardrates.txt") << out.str();
     1110        ofstream(fPath+"/boardrates.data") << out.str();
    11091111
    11101112        out.str("");
     
    11141116        out << kHtmlWhite << '\t' << pstat.avg << '\n';
    11151117        out << kHtmlWhite << '\t' << pstat.max << '\n';
    1116         ofstream(fPath+"/patchrates.txt") << out.str();
     1118        ofstream(fPath+"/patchrates.data") << out.str();
    11171119
    11181120        return GetCurrentState();
     
    11481150        //out << kHtmlWhite << '\t' << statp.avg << '\n';
    11491151        out << kHtmlWhite << '\t' << statp.max << '\n';
    1150         ofstream(fPath+"/thresholds.txt") << out.str();
     1152        ofstream(fPath+"/thresholds.data") << out.str();
    11511153
    11521154        out.str("");
     
    11871189            out << kHtmlWhite  << "\t" << 0.5*vp << "\n";
    11881190
    1189         ofstream(fPath+"/ftm.txt") << out.str();
     1191        ofstream(fPath+"/ftm.data") << out.str();
    11901192
    11911193        // Active FTUs: IsActive(i)
     
    12271229        fFtmControlFtuOk = cnt==40;
    12281230
    1229         ofstream(fPath+"/ftu.txt") << out.str();
     1231        ofstream(fPath+"/ftu.data") << out.str();
    12301232
    12311233        return GetCurrentState();
     
    13171319        out << "#ffffff\t" << stat.max << '\n';
    13181320
    1319         ofstream(fPath+"/fsc.txt") << out.str();
     1321        ofstream(fPath+"/fsc.data") << out.str();
    13201322
    13211323        WriteBinary(d, "fsccontrol-temperature-hist",
     
    13861388        out << "#ffffff\t" << max << '\n';
    13871389
    1388         ofstream(fPath+"/ratescan.txt") << out.str();
     1390        ofstream(fPath+"/ratescan.data") << out.str();
    13891391
    13901392        out.str("");
     
    13931395        out << "#ffffff\t" << pow(10, fRateScanDataHist[fRateScanBoard+1].back()) << '\n';
    13941396
    1395         ofstream(fPath+"/ratescan_board.txt") << out.str();
     1397        ofstream(fPath+"/ratescan_board.data") << out.str();
    13961398
    13971399        return GetCurrentState();
     
    14121414        }
    14131415
    1414         ofstream(fPath+"/dotest.txt") << out.str();
     1416        ofstream(fPath+"/dotest.data") << out.str();
    14151417    }
    14161418
     
    15251527            msg << "dimctrl offline<br/>";
    15261528
     1529        // FTM in Connected instead of Idle --> power cyclen
     1530
    15271531        /* // Check offline and disconnected status?
    15281532          Out() << fDimMcp          << endl;
     
    15491553
    15501554        ostringstream out;
    1551         out << now.JavaDate() << '\t' << haserror << '\n';
     1555        out << now.JavaDate() << '\t' << haserror << '\t' << (fDimControl.state()>-3) << '\n';
    15521556        out << setprecision(3);
    15531557        out << kHtmlWhite << '\t' << msg.str() << '\n';
    15541558
    15551559        if (haserror || fHasError)
    1556             ofstream(fPath+"/error.txt") << out.str();
     1560            ofstream(fPath+"/error.data") << out.str();
    15571561
    15581562        fHasError = haserror;
     
    15611565
    15621566        out.str("");
    1563         out << now.JavaDate() << '\t' << fHasError << '\n';
     1567        out << now.JavaDate() << '\t' << fHasError << '\t' << (fDimControl.state()>-3) << '\n';
    15641568        out << setprecision(3);
    15651569
     
    17911795            out << kHtmlWhite << '\n';
    17921796
    1793         ofstream(fPath+"/fact.txt") << out.str();
     1797        ofstream(fPath+"/fact.data") << out.str();
    17941798
    17951799        // ==============================================================
    17961800
    17971801        out.str("");
    1798         out << now.JavaDate() << '\t' << fHasError << '\n';
     1802        out << now.JavaDate() << '\t' << fHasError << '\t' << (fDimControl.state()>-3) << '\n';
    17991803
    18001804        if (!fDimDNS.online())
    1801             out << kHtmlWhite << "\tOffline\n\n\n\n\n\n\n\n\n\n\n\n";
     1805            out << kHtmlWhite << "\tOffline\n\n\n\n\n\n\n\n\n\n\n\n\n";
    18021806        else
    18031807        {
     1808            ostringstream dt;
     1809            dt << (Time()-fRunTime);
     1810
    18041811            out << kHtmlGreen << '\t' << fDimDNS.version() << '\n';
    18051812
     
    18181825            out << GetStateHtml(fDimRateScan,     4);
    18191826            out << GetStateHtml(fDimChatServer,   1);
    1820         }
    1821 
    1822         ofstream(fPath+"/status.txt") << out.str();
     1827
     1828            out << kHtmlGreen << '\t' << dt.str().substr(0, dt.str().length()-7) << '\n';
     1829        }
     1830
     1831        ofstream(fPath+"/status.data") << out.str();
    18231832
    18241833        return kStateRunning;
Note: See TracChangeset for help on using the changeset viewer.