$treeview $search $mathjax $extrastylesheet
otsdaq_utilities
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #ifndef _ots_MacroMakerSupervisor_h_ 00002 #define _ots_MacroMakerSupervisor_h_ 00003 00004 #include "otsdaq-core/CoreSupervisors/CoreSupervisorBase.h" 00005 00006 namespace ots 00007 { 00008 // MacroMakerSupervisor 00009 // This class handles the user interface to the web desktop MacroMaker. MacroMaker 00010 // is a tool to conduct read and write commands with front-end interfaces and to manage 00011 // sequence of commands on a per user basis. 00012 class MacroMakerSupervisor : public CoreSupervisorBase 00013 { 00014 public: 00015 XDAQ_INSTANTIATOR(); 00016 00017 MacroMakerSupervisor(xdaq::ApplicationStub* s); 00018 virtual ~MacroMakerSupervisor(void); 00019 00020 void init(void); 00021 void destroy(void); 00022 00023 virtual void request(const std::string& requestType, 00024 cgicc::Cgicc& cgiIn, 00025 HttpXmlDocument& xmlOut, 00026 const WebUsers::RequestUserInfo& userInfo) override; 00027 00028 virtual void forceSupervisorPropertyValues(void) override; // override to force 00029 // supervisor property 00030 // values (and ignore user 00031 // settings) 00032 00033 private: 00034 void handleRequest(const std::string Command, 00035 HttpXmlDocument& xmldoc, 00036 cgicc::Cgicc& cgi, 00037 const std::string& username); 00038 00039 xoap::MessageReference frontEndCommunicationRequest(xoap::MessageReference message); 00040 00041 void getFElist(HttpXmlDocument& xmldoc); 00042 void getFEMacroList(HttpXmlDocument& xmldoc, const std::string& username); 00043 00044 void writeData(HttpXmlDocument& xmldoc, 00045 cgicc::Cgicc& cgi, 00046 const std::string& username); 00047 void readData(HttpXmlDocument& xmldoc, 00048 cgicc::Cgicc& cgi, 00049 const std::string& username); 00050 void createMacro(HttpXmlDocument& xmldoc, 00051 cgicc::Cgicc& cgi, 00052 const std::string& username); 00053 void loadMacro(const std::string& macroName, 00054 std::string& macroString, 00055 const std::string& username = ""); 00056 void loadMacros(HttpXmlDocument& xmldoc, const std::string& username); 00057 void loadMacroNames( 00058 const std::string& username, 00059 std::pair<std::vector<std::string> /*public macros*/, 00060 std::vector<std::string> /*private macros*/>& returnMacroNames); 00061 void appendCommandToHistory(std::string command, 00062 std::string Format, 00063 std::string time, 00064 std::string interfaces, 00065 const std::string& username); 00066 void loadHistory(HttpXmlDocument& xmldoc, const std::string& username); 00067 void deleteMacro(HttpXmlDocument& xmldoc, 00068 cgicc::Cgicc& cgi, 00069 const std::string& username); 00070 void editMacro(HttpXmlDocument& xmldoc, 00071 cgicc::Cgicc& cgi, 00072 const std::string& username); 00073 void clearHistory(const std::string& username); 00074 void exportMacro(HttpXmlDocument& xmldoc, 00075 cgicc::Cgicc& cgi, 00076 const std::string& username); 00077 void exportFEMacro(HttpXmlDocument& xmldoc, 00078 cgicc::Cgicc& cgi, 00079 const std::string& username); 00080 void runFEMacro(HttpXmlDocument& xmldoc, cgicc::Cgicc& cgi, const std::string& username); 00081 00082 std::string generateHexArray(const std::string& sourceHexString, int& numOfBytes); 00083 bool isArgumentVariable(const std::string& argumentString); 00084 void createCode(std::ostream& out, 00085 const std::vector<std::string>& commands, 00086 const std::string& tabOffset = "", 00087 bool forFeMacro = false, 00088 std::set<std::string>* inArgNames = 0, 00089 std::set<std::string>* outArgNames = 0); 00090 00091 SupervisorInfoMap allFESupervisorInfo_; 00092 std::map<std::string /*FE UID*/, unsigned int /*superivisor index*/> 00093 FEtoSupervisorMap_; 00094 std::map<std::string /*FE Type*/, std::set<std::string> /*FE UIDs*/> 00095 FEPluginTypetoFEsMap_; 00096 std::map<std::string /*FE UID*/, std::string /*FE Type*/> 00097 FEtoPluginTypeMap_; 00098 00099 }; // end MacroMakerSupervisor declaration 00100 00101 } // end ots namespace 00102 00103 #endif