ROOT logo
// $Id: AEVDistAnRep.h 2088 2008-11-23 20:26:46Z matevz $

// Copyright (C) 1999-2008, Matevz Tadel. All rights reserved.
// This file is part of GLED, released under GNU General Public License version 2.
// For the licensing terms see $GLEDSYS/LICENSE or http://www.gnu.org/.

#ifndef AliEnViz_AEVDistAnRep_H
#define AliEnViz_AEVDistAnRep_H

#include <Glasses/ZNode.h>

#include "AEVDemoDriver.h"

#include "AEVMlClient.h"
#include "AEVMapViz.h"
#include <Stones/AEVProofFeedback.h>

#include <Glasses/Amphitheatre.h>
#include <Stones/SEvTaskState.h>

#include <Gled/GCondition.h>

class AEVEventBatch;
class AEVJobRep;
class AEVProcessViz;
class AEVDemoDriver;

class AEVDistAnRep : public ZNode
{
  MAC_RNR_FRIENDS(AEVDistAnRep);
  friend class AEVDemoDriver;

private:
  void _init();
  Bool_t	   _first_feedback;

protected:
  typedef list<AEVMlClient::MonaEntry>           lMonaEntry_t;
  typedef list<AEVMlClient::MonaEntry>::iterator lMonaEntry_i;

  ZLink<AEVDemoDriver>     mDemoDriver; //  X{GS} L{}

  ZLink<AList>             mSites;      //  X{GS} L{}
  ZLink<AList>             mEvBatches;  //  X{GS} L{}
  ZLink<AList>             mProcVizes;  //  X{GS} L{} RnrBits{0,0,0,0, 0,0,0,5}

  TString	   mJobId;      // X{GS} 7 Textor(-width=>24, -join=>1)
  TString	   mJobName;    // X{GS} 7 Textor(-width=>8)
  GTime            mQueryTime;  // X{GS}

  Float_t       mConnectTime;	// X{GS} 7 Value(-range=>[0,10,1,100], -join=>1)
  Float_t       mRotTime;	// X{GS} 7 Value(-range=>[0,10,1,100])
  Float_t       mTravelTime;	// X{GS} 7 Value(-range=>[0,10,1,100], -join=>1)
  Float_t       mWaitTime;      // X{GS} 7 Value(-range=>[0,10,1,100])

  lMonaEntry_t     mHistory;        //
  GTime            mProcStart;      // X{GS}
  GTime            mProcEnd;        // X{GS}
  Double_t         mProcDuration;   // X{GS} 7 ValOut(-join=>1)

  Double_t         mReplayDuration; // X{GS} 7 Value(-range=>[0,1000, 1,100], -join=>1)
  Double_t         mReplayMaxWait;  // X{GS} 7 Value(-range=>[0,1000, 1,100])

  Bool_t           bInReplay;       // X{GS} 7 BoolOut(-join=>1)
  Double_t         mReplayPos;      // X{GS} 7 ValOut()
  GTime            mReplayTime;     // X{GS}
  GCondition       mReplayCond;     // X{GS}


  SEvTaskState     mBatchState;	// X{GSR} 7 StoneOutput(Fmt=>"%c: %d [ %d | %d | %d ]", Args=>[State, NAll, NOK, NFail, NProc])
  SEvTaskState     mEventState;	// X{GSR} 7 StoneOutput(Fmt=>"%c: %d [ %d | %d | %d ]", Args=>[State, NAll, NOK, NFail, NProc])

  Int_t  create_evbatches(map<string, int>& cmap);
  void   fix_evbatches();
  Bool_t place_evbatch_on_map(AEVEventBatch* eb);

  AEVProcessViz* find_or_crete_procviz(const TString& proc, const TString& site);

public:
  AEVDistAnRep(const Text_t* n="AEVDistAnRep", const Text_t* t=0) :
    ZNode(n,t) { _init(); }

  virtual void AdEnlightenment();
  void AddEventBatch(AEVEventBatch* evb); // X{E} C{1}

  void ResetJob();       // X{E} 7 MButt(-join=>1);
  void ResetDistAn();    // X{E} 7 MButt();

  void InitJob(AEVJobRep* job=0);           // X{ED} C{1} 7 MCWButt()
  void FakeInitJob(AEVJobRep* job=0);       // X{ED} C{1}
  void StudyJobHistory(Bool_t dump_p=true); // X{ED} 7 MCWButt()

  Int_t ReplayJobFromHistory();     // X{ED} 7 MButt(-join=>1)
  Int_t FakeReplayJobFromHistory(); // X{ED}
  void  StopReplay();               // X{E}  7 MButt()
  void  FinalizeJob();		    // X{E}  7 MButt()

  void  FollowJob();            // X{ED} 7 MButt()

  void SendEvBatchesToTheatre(Amphitheatre* amph=0); // X{E} C{1} 7 MButt()


  void Process();       // X{Ed} 7 MButt()
  void UpdateProcStatus(TList* siteinfos, map<string,int>* siteevmap=0);


  void StartProc();     // X{E} 7 MButt()
  void FakeProc();      // X{E} 7 MButt()
  void FakeProc(map<string, int>& changes);

#include "AEVDistAnRep.h7"
  ClassDef(AEVDistAnRep, 1);
}; // endclass AEVDistAnRep


#endif
 AEVDistAnRep.h:1
 AEVDistAnRep.h:2
 AEVDistAnRep.h:3
 AEVDistAnRep.h:4
 AEVDistAnRep.h:5
 AEVDistAnRep.h:6
 AEVDistAnRep.h:7
 AEVDistAnRep.h:8
 AEVDistAnRep.h:9
 AEVDistAnRep.h:10
 AEVDistAnRep.h:11
 AEVDistAnRep.h:12
 AEVDistAnRep.h:13
 AEVDistAnRep.h:14
 AEVDistAnRep.h:15
 AEVDistAnRep.h:16
 AEVDistAnRep.h:17
 AEVDistAnRep.h:18
 AEVDistAnRep.h:19
 AEVDistAnRep.h:20
 AEVDistAnRep.h:21
 AEVDistAnRep.h:22
 AEVDistAnRep.h:23
 AEVDistAnRep.h:24
 AEVDistAnRep.h:25
 AEVDistAnRep.h:26
 AEVDistAnRep.h:27
 AEVDistAnRep.h:28
 AEVDistAnRep.h:29
 AEVDistAnRep.h:30
 AEVDistAnRep.h:31
 AEVDistAnRep.h:32
 AEVDistAnRep.h:33
 AEVDistAnRep.h:34
 AEVDistAnRep.h:35
 AEVDistAnRep.h:36
 AEVDistAnRep.h:37
 AEVDistAnRep.h:38
 AEVDistAnRep.h:39
 AEVDistAnRep.h:40
 AEVDistAnRep.h:41
 AEVDistAnRep.h:42
 AEVDistAnRep.h:43
 AEVDistAnRep.h:44
 AEVDistAnRep.h:45
 AEVDistAnRep.h:46
 AEVDistAnRep.h:47
 AEVDistAnRep.h:48
 AEVDistAnRep.h:49
 AEVDistAnRep.h:50
 AEVDistAnRep.h:51
 AEVDistAnRep.h:52
 AEVDistAnRep.h:53
 AEVDistAnRep.h:54
 AEVDistAnRep.h:55
 AEVDistAnRep.h:56
 AEVDistAnRep.h:57
 AEVDistAnRep.h:58
 AEVDistAnRep.h:59
 AEVDistAnRep.h:60
 AEVDistAnRep.h:61
 AEVDistAnRep.h:62
 AEVDistAnRep.h:63
 AEVDistAnRep.h:64
 AEVDistAnRep.h:65
 AEVDistAnRep.h:66
 AEVDistAnRep.h:67
 AEVDistAnRep.h:68
 AEVDistAnRep.h:69
 AEVDistAnRep.h:70
 AEVDistAnRep.h:71
 AEVDistAnRep.h:72
 AEVDistAnRep.h:73
 AEVDistAnRep.h:74
 AEVDistAnRep.h:75
 AEVDistAnRep.h:76
 AEVDistAnRep.h:77
 AEVDistAnRep.h:78
 AEVDistAnRep.h:79
 AEVDistAnRep.h:80
 AEVDistAnRep.h:81
 AEVDistAnRep.h:82
 AEVDistAnRep.h:83
 AEVDistAnRep.h:84
 AEVDistAnRep.h:85
 AEVDistAnRep.h:86
 AEVDistAnRep.h:87
 AEVDistAnRep.h:88
 AEVDistAnRep.h:89
 AEVDistAnRep.h:90
 AEVDistAnRep.h:91
 AEVDistAnRep.h:92
 AEVDistAnRep.h:93
 AEVDistAnRep.h:94
 AEVDistAnRep.h:95
 AEVDistAnRep.h:96
 AEVDistAnRep.h:97
 AEVDistAnRep.h:98
 AEVDistAnRep.h:99
 AEVDistAnRep.h:100
 AEVDistAnRep.h:101
 AEVDistAnRep.h:102
 AEVDistAnRep.h:103
 AEVDistAnRep.h:104
 AEVDistAnRep.h:105
 AEVDistAnRep.h:106
 AEVDistAnRep.h:107
 AEVDistAnRep.h:108
 AEVDistAnRep.h:109
 AEVDistAnRep.h:110
 AEVDistAnRep.h:111
 AEVDistAnRep.h:112
 AEVDistAnRep.h:113
 AEVDistAnRep.h:114
 AEVDistAnRep.h:115
 AEVDistAnRep.h:116