Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TXXXControl.cxx

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "TXXXControl.h"
00017 
00018 #include <stdio.h>
00019 #include "Riostream.h"
00020 
00021 //***********************************************************
00022 TXXXControl::TXXXControl() :
00023    TGo4Parameter("Control"),
00024    fill(kTRUE)
00025 {
00026 }
00027 //***********************************************************
00028 TXXXControl::TXXXControl(const char* name) :
00029    TGo4Parameter(name),
00030    fill(kTRUE)
00031 {
00032 }
00033 //***********************************************************
00034 TXXXControl::~TXXXControl() {}
00035 //***********************************************************
00036 
00037 //-----------------------------------------------------------
00038 Int_t TXXXControl::PrintParameter(Text_t * n, Int_t){
00039   cout << "**** TXXXControl: ";
00040   cout << "Histogram filling ";
00041   if(fill == kFALSE) cout << "disabled " << endl;
00042   else               cout << "enabled " << endl;
00043   return 0;
00044 
00045 }
00046 //-----------------------------------------------------------
00047 Bool_t TXXXControl::UpdateFrom(TGo4Parameter *pp)
00048 {
00049   cout << "**** TXXXControl " << GetName() << " updated from auto save file" << endl;
00050   if(pp->InheritsFrom(TXXXControl::Class()))
00051     {
00052       TXXXControl * from = (TXXXControl *) pp;
00053       fill=from->fill;
00054     }
00055   else
00056     cout << "Wrong parameter object: " << pp->ClassName() << endl;
00057 
00058   SaveMacro();
00059   PrintParameter(0,0);
00060   return kTRUE;
00061 }
00062 //-----------------------------------------------------------
00063 void TXXXControl::SaveMacro()
00064 {
00065   FILE *pf;
00066   pf=fopen("histofill.C","w+");
00067   if(pf)
00068     {
00069       fputs("// written by setfill.C macro\n",pf);
00070       fputs("// executed in TXXXProc\n",pf);
00071       fputs("{\n",pf);
00072       fputs("TXXXControl * fCtl;\n",pf);
00073       fputs("fCtl = (TXXXControl *)(TGo4Analysis::Instance()->GetParameter(\"Control\"));\n",pf);
00074       if(fill)fputs("fCtl->fill=kTRUE;\n",pf);
00075       else    fputs("fCtl->fill=kFALSE;\n",pf);
00076       fputs("}\n",pf);
00077       fclose(pf);
00078       cout << "**** TXXXControl: new histofill.C written" << endl;
00079     }
00080   else cout << "**** TXXXControl: Error writing histofill.C!" << endl;
00081 
00082   PrintParameter(0,0);
00083 }
00084 
00085 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:10 2008 for Go4-v3.04-1 by  doxygen 1.4.2