2 // Author: Matevz Tadel 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 #include "AliEveMacro.h"
12 //______________________________________________________________________________
14 // Member fSources is a bitfield, but we do not have a widget
15 // that can show/edit this (a combo-box with a check-box for each
16 // entry). So ... use a single value for now,
20 //______________________________________________________________________________
21 AliEveMacro::AliEveMacro(Int_t src, const TString& tags, const TString& mac,
22 const TString& foo, const TString& args, Bool_t act) :
24 fSources(src), fTags(tags), fMacro (mac),
25 fFunc (foo), fArgs(args), fActive(act),
26 fExecStatus(kNotRun), fExecExcString(), fExecResult(0)
31 /******************************************************************************/
33 void AliEveMacro::ResetExecState()
35 // Reset exec variables into state as if the macro has not been run.
37 fExecStatus = kNotRun;
42 void AliEveMacro::SetExecNoData()
44 // Set last execution state to 'NoData'.
46 fExecStatus = kNoData;
50 void AliEveMacro::SetExecOK(TEveElement* result)
52 // Set last execution state to 'OK' and register result.
59 void AliEveMacro::SetExecException(const TString& exception)
61 // Set last execution state to 'Exception' and store the exception string.
63 fExecStatus = kException;
64 fExecExcString = exception;
67 void AliEveMacro::SetExecError()
69 // Set last execution state to 'Error'.
74 /******************************************************************************/
76 TString AliEveMacro::FormForExec() const
78 // Return string suitable for execution.
80 return fFunc + "(" + fArgs + ");";
83 TString AliEveMacro::FormForDisplay() const
85 // Return string suitable for display.
87 return TString::Format
88 (" %c %-22s %-30s %-30s %-s", fActive ? 'x' : ' ',
89 fMacro.Data(), fFunc.Data(), fArgs.Data(), fTags.Data());