GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4ComAutosave.cxx
Go to the documentation of this file.
1// $Id$
2//-----------------------------------------------------------------------
3// The GSI Online Offline Object Oriented (Go4) Project
4// Experiment Data Processing at EE department, GSI
5//-----------------------------------------------------------------------
6// Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7// Planckstr. 1, 64291 Darmstadt, Germany
8// Contact: http://go4.gsi.de
9//-----------------------------------------------------------------------
10// This software can be used under the license agreements as stated
11// in Go4License.txt file which is part of the distribution.
12//-----------------------------------------------------------------------
13
14#include "TGo4ComAutosave.h"
15
16#include "TGo4Log.h"
18#include "TGo4AnalysisImp.h"
19#include "TGo4RemoteCommand.h"
20
22 TGo4AnalysisCommand("ANAutosave","Do immediate autosave"),
24{
25 GO4TRACE((12,"TGo4ComAutosave::TGo4ComAutosave() ctor",__LINE__, __FILE__));
26 SetReceiverName("AnalysisClient"); // this command needs client as receiver
27 // override default receiver
29}
30
31
33{
34 if(!remcom) return;
37 SetAutoFileName(remcom->GetString(0));
38}
39
41{
42 GO4TRACE((12, "TGo4ComAutosave::ExeCom()", __LINE__, __FILE__));
43
45 if (cli) {
47 if (ana) {
48 Bool_t autoenab = ana->IsAutoSaveOn();
49 cli->SendStatusMessage(1, kTRUE, "Autosaving now...");
50 ana->SetAutoSave(kTRUE);
52 ana->AutoSave();
53 ana->SetAutoSave(autoenab); // recover old autosave state
54 }
55
56 } else {
57 GO4TRACE((11, "TGo4ComAutosave::ExeCom() - no receiver specified ERROR!", __LINE__, __FILE__));
58 TGo4Log::Debug(" !!! ComAutosave ''%s'': NO RECEIVER ERROR!!!", GetName());
59 return 1;
60 }
61
62 return -1;
63}
@ kGo4ComModeController
Definition TGo4Command.h:30
#define GO4TRACE(X)
Definition TGo4Log.h:25
void SendStatusMessage(Int_t level, Bool_t printout, const TString &text) override
Send message to gui.
The mother of all go4 analysis.
static TGo4Analysis * Instance()
return analysis instance
void SetAutoSave(Bool_t on=kTRUE)
Enable/disable functionality of AutoSave method.
void AutoSave()
Perform autosave of all active stores, save existing calibration objects, write known objects into us...
void SetAutoSaveFile(const char *filename=nullptr, Bool_t overwrite=kFALSE, Int_t compression=5)
Set file for autosave action.
Bool_t IsAutoSaveOn() const
True if autosaving is enabled.
void SetAutoSaveOverwrite(Bool_t over=kTRUE)
Int_t ExeCom() override
Do the command action.
void SetAutoSaveCompression(Int_t i=5)
void Set(TGo4RemoteCommand *remcon) override
Set internals of this command from specification of external remote command (command container).
Int_t fbAutoSaveOverwrite
overwrite mode for autosave (true) or append mode (false).
const char * GetAutoFileName() const
void SetAutoFileName(const char *name)
Int_t fiAutoSaveCompression
compression level for autosave file
void SetProtection(Go4CommandMode_t m)
TGo4CommandReceiver * fxReceiverBase
void SetReceiverName(const char *)
static void Debug(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 0.
Definition TGo4Log.cxx:281
This command is a container for commands to be send from master to slave via inter-process transport.
const char * GetString(Int_t i) const
Int_t GetValue(Int_t i) const