From ea79a520cde7875c025285f7a1bcda4d0739feea Mon Sep 17 00:00:00 2001
From: tzhang74 <tzhang74@illinois.edu>
Date: Mon, 17 Jun 2019 10:50:47 -0500
Subject: [PATCH] version 1.0 -- debug 10

---
 MyDaq/include/MyMainFrame.h |  1 +
 MyDaq/src/MyMainFrame.cpp   |  2 +-
 README                      | 25 +++++++++++++++++++++++++
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/MyDaq/include/MyMainFrame.h b/MyDaq/include/MyMainFrame.h
index 4c940a0..6591dd9 100644
--- a/MyDaq/include/MyMainFrame.h
+++ b/MyDaq/include/MyMainFrame.h
@@ -69,6 +69,7 @@ class MyMainFrame : public TGMainFrame {
   int daq_set_eloghandler( const char *host, const int port, const char *logname);
   char* GetHostName();
   int GetPort(){return 8082;};
+  char* GetLogName(){return "FermilabDAQ";}
 
  public:
   ClassDef(MyMainFrame,0)
diff --git a/MyDaq/src/MyMainFrame.cpp b/MyDaq/src/MyMainFrame.cpp
index 42b34b5..1526d2b 100644
--- a/MyDaq/src/MyMainFrame.cpp
+++ b/MyDaq/src/MyMainFrame.cpp
@@ -163,7 +163,7 @@ void MyMainFrame::DoStart() {
 
   //elog
   std::cout<<"Set ElogHandler"<<std::endl;
-  daq_set_eloghandler(GetHostName(), GetPort(), "testBeamElog");
+  daq_set_eloghandler(GetHostName(), GetPort(), GetLogName());
 
   if(ElogH){
     ElogH->BegrunLog( GetRunNumber(),"MyMainFrame", GetFileName());
diff --git a/README b/README
index 7d7104f..82a87fe 100644
--- a/README
+++ b/README
@@ -121,3 +121,28 @@ Device not xxusb
 4) If during setup you get something about usb.h not found. You probably dont have libusb-devel
 
 	     sudo yum install libusb*
+------------------------------------------------------
+------------------------------------------------------
+ELOG
+
+1) Add logbook "FermilabDAQ" to elog config file before using elogd to setup server
+    (config is possibly at /usr/local/elog/elogd.cfg )
+    Example:
+
+    [global]
+    port = 8082
+    logbook tabs = 0
+    Welcome title = ZDC Prototype Logbook for 2019
+
+    [FermilabDAQ]
+    Theme = default
+    Comment = ZDC DAQ Logbook for Test Beam at Fermilab
+    Data dir = /home/elog/FermilabDAQ
+    Attributes = Author, Subject
+    Reverse sort = 1
+    Required Attributes = Subject, Author
+    Page Title = ZDC DAQ Logbook for Test Beam at Fermilab
+    Display mode = full
+    Thumbnail size = 100
+2) setup server with
+    elogd [-D for daemon] -c /path/to/config/elogd.cfg -v
-- 
GitLab