]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/EveBase/AliEveMacro.cxx
Update master to aliroot
[u/mrichter/AliRoot.git] / EVE / EveBase / AliEveMacro.cxx
CommitLineData
f6afd0e1 1// @(#)root/eve:$Id$
2// Author: Matevz Tadel 2007
3
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 **************************************************************************/
9
10#include "AliEveMacro.h"
11
12//______________________________________________________________________________
f6afd0e1 13//
68ca2fe7 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,
f6afd0e1 17
18ClassImp(AliEveMacro)
19
20//______________________________________________________________________________
7b2d546e 21AliEveMacro::AliEveMacro(Int_t src, const TString& tags, const TString& mac,
22 const TString& foo, const TString& args, Bool_t act) :
f6afd0e1 23 TObject(),
7b2d546e 24 fSources(src), fTags(tags), fMacro (mac),
68ca2fe7 25 fFunc (foo), fArgs(args), fActive(act),
7dcdaa40 26 fExecStatus(kNotRun),
27 fExecExcString(),
28 fExecResult(0)
f6afd0e1 29{
30 // Constructor.
31}
32
33/******************************************************************************/
34
68ca2fe7 35void AliEveMacro::ResetExecState()
36{
37 // Reset exec variables into state as if the macro has not been run.
38
39 fExecStatus = kNotRun;
40 fExecExcString = "";
41 fExecResult = 0;
42}
43
44void AliEveMacro::SetExecNoData()
45{
46 // Set last execution state to 'NoData'.
47
48 fExecStatus = kNoData;
49}
50
51
52void AliEveMacro::SetExecOK(TEveElement* result)
53{
54 // Set last execution state to 'OK' and register result.
55
56 fExecStatus = kOK;
57 fExecResult = result;
58}
59
60
61void AliEveMacro::SetExecException(const TString& exception)
62{
63 // Set last execution state to 'Exception' and store the exception string.
64
65 fExecStatus = kException;
66 fExecExcString = exception;
67}
68
69void AliEveMacro::SetExecError()
70{
71 // Set last execution state to 'Error'.
72
73 fExecStatus = kError;
74}
75
76/******************************************************************************/
77
f6afd0e1 78TString AliEveMacro::FormForExec() const
79{
80 // Return string suitable for execution.
81
82 return fFunc + "(" + fArgs + ");";
83}
84
85TString AliEveMacro::FormForDisplay() const
86{
87 // Return string suitable for display.
88
4578afcb 89 return TString::Format
ad5abc55 90 (" %c %-22s %-30s %-30s %-s", fActive ? 'x' : ' ',
4578afcb 91 fMacro.Data(), fFunc.Data(), fArgs.Data(), fTags.Data());
f6afd0e1 92}