00001 #ifndef _QIGUI_DIANA_SESSION_HANDLER__H_
00002 #define _QIGUI_DIANA_SESSION_HANDLER__H_
00003
00004 #include <QGDInclude.hh>
00005 #include <string>
00006 #include <vector>
00007 #include <queue>
00008 #include "QGDMessageHandler.hh"
00009
00010
00011 class QIGUISession;
00012 class QIGUIPulseWindow;
00013 class QObject;
00014 class TThread;
00015 class TMutex;
00016
00017 class QIGUIDianaSessionHandler: public QGDMessageHandler
00018 {
00019
00020 private:
00021
00023 QGDModuleList fModulesList;
00024
00026 std::vector <QGDModuleParameterList> fParameterList;
00027
00029 QIGUISession * fSession;
00030
00032 std::queue<QGDCommand> fCommandList;
00033
00035 std::queue<QIGUIPulseWindow*> fSenders;
00036
00038 std::queue<QGDCommand> fParamsToModify;
00039
00041 int fCurrentModule;
00042
00043
00044 TThread * fDianaThread;
00045 std::string fFileListName;
00046 TMutex * fGUIActionMutex;
00047 QGDReceiver::Status fDianaStatus;
00048
00049 public:
00050
00051 QIGUIDianaSessionHandler (QObject * parent=0);
00052 virtual ~QIGUIDianaSessionHandler();
00053 void Init();
00054
00055
00056 QGDCommand GetCommand(const QGDCommandList& cmdList) ;
00057 void Display(TObject * obj);
00058 void DisplayModuleList(const QGDModuleList& modList);
00059 void DisplayModuleParameters(const QGDModuleParameterList& paramList);
00060 void NotifyReceiverStatus(QGDReceiver::Status status);
00061
00062
00063 void RefreshModulesParameters();
00064 void RerunDiana();
00065
00066 std::string GetModule(int index) ;
00067 int GetNModules();
00068 int GetCurrentModule() {return fCurrentModule;}
00069 void SetModules(const QGDModuleList & modList);
00070 void ClearModules();
00071 QGDModuleParameterList GetParameterList (int index);
00072 int AddModParameterList(const QGDModuleParameterList& parList);
00073
00074
00075
00076 QGDParameter ModifyParameter (int modIndex, int parIndex, std::string newVal);
00077
00078 void PushBackCommand(QGDCommand cmd);
00079 QGDCommand PopFrontCommand();
00080
00081 void PushBackSender(QIGUIPulseWindow * sender);
00082
00083 void AddParameterToModify(int modIndex, int paramIndex, std::string newVal);
00084 void QueueParametersToModify();
00085
00086 void StartDianaThread();
00087 void StopDiana();
00088 static void *LaunchDiana(void * dianaSessionHandler);
00089 void GenerateFileList();
00090
00091
00092 void InitGUIAction();
00093 void EndGUIAction();
00094 void ClearCommandQueue();
00095
00096
00097
00098 };
00099
00100 #endif