Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
testbeamDaq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chad Lantz
testbeamDaq
Commits
ca717bc2
Commit
ca717bc2
authored
5 years ago
by
tzhang74
Browse files
Options
Downloads
Patches
Plain Diff
elog src imported
parent
84a2adbe
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
MyDaq/Makefile
+7
-7
7 additions, 7 deletions
MyDaq/Makefile
MyDaq/include/eloghandler.h
+38
-0
38 additions, 0 deletions
MyDaq/include/eloghandler.h
MyDaq/src/eloghandler.cc
+52
-0
52 additions, 0 deletions
MyDaq/src/eloghandler.cc
README
+1
-1
1 addition, 1 deletion
README
with
98 additions
and
8 deletions
MyDaq/Makefile
+
7
−
7
View file @
ca717bc2
...
...
@@ -8,12 +8,12 @@ INCLUDEDIRS = -I$(XXUSBDIR)/include -I./include
LIBDIRS
=
-L
$(
XXUSBDIR
)
/lib
LIBS
=
-lxx_usb
-lm
-lusb
CXXFLAGS
=
-g
-O2
-Wall
`
root-config
--cflags
`
CXXFLAGS
=
-g
-O2
-Wall
`
root-config
--cflags
`
LDFLAGS
=
-O2
`
root-config
--glibs
`
-Wl
,-rpath
=
$(
XXUSBDIR
)
/lib
SOURCES
=
MyDaq.cpp MyMainFrame.cpp GenericModule.cpp Phillips2249W.cpp SharedData.cpp CC-DAQ.cpp
INCLUDES
=
MyDaq.h MyMainFrame.h GenericModule.h Phillips2249W.h SharedData.h Module.h Common.h LinkDef.h
SOURCES
=
MyDaq.cpp MyMainFrame.cpp GenericModule.cpp Phillips2249W.cpp SharedData.cpp CC-DAQ.cpp
eloghandler.cc
INCLUDES
=
MyDaq.h MyMainFrame.h GenericModule.h Phillips2249W.h SharedData.h Module.h Common.h LinkDef.h
eloghandler.h
OBJ
=
runMyDaq
SOURCEDIR
=
src/
...
...
@@ -24,17 +24,17 @@ CINCLUDES = $(addprefix $(INCLUDEDIR),$(INCLUDES))
RUNDIR
=
run/
all
:
$(CSOURCES) $(CINCLUDES) $(SOURCEDIR)MyMainFrameDict.cpp
all
:
$(CSOURCES) $(CINCLUDES) $(SOURCEDIR)MyMainFrameDict.cpp
$(
CXX
)
$(
CXXFLAGS
)
$(
INCLUDEDIRS
)
$(
CSOURCES
)
$(
SOURCEDIR
)
MyMainFrameDict.cpp
\
$(
LIBDIRS
)
$(
LIBS
)
$(
LDFLAGS
)
-o
$(
OBJ
)
[
-d
$(
RUNDIR
)
]
||
mkdir
$(
RUNDIR
)
$(
LIBDIRS
)
$(
LIBS
)
$(
LDFLAGS
)
-o
$(
OBJ
)
[
-d
$(
RUNDIR
)
]
||
mkdir
$(
RUNDIR
)
mv
$(
OBJ
)
$(
RUNDIR
)
[
-f
$(
RUNDIR
)
env.sh
]
||
echo
"export XXUSBDIR="
$(
XXUSBDIR
)
>>
$(
RUNDIR
)
env.sh
@
echo
"Done"
$(SOURCEDIR)MyMainFrameDict.cpp
:
$(SOURCEDIR)MyMainFrame.cpp $(INCLUDEDIR)MyMainFrame.h
rootcling
-f
$(
SOURCEDIR
)
MyMainFrameDict.cpp
-c
$(
INCLUDEDIRS
)
MyMainFrame.h
$(
INCLUDEDIR
)
LinkDef.h
[
-d
$(
RUNDIR
)
]
||
mkdir
$(
RUNDIR
)
[
-d
$(
RUNDIR
)
]
||
mkdir
$(
RUNDIR
)
cp
$(
SOURCEDIR
)
MyMainFrameDict
*
$(
RUNDIR
)
clean
:
...
...
This diff is collapsed.
Click to expand it.
MyDaq/include/eloghandler.h
0 → 100644
+
38
−
0
View file @
ca717bc2
#ifndef __ELOGHANDLER_H
#define __ELOGHANDLER_H
#include
<string>
class
ElogHandler
{
public:
//** Constructors
ElogHandler
(
const
std
::
string
h
,
const
int
p
,
const
std
::
string
name
);
virtual
~
ElogHandler
()
{};
virtual
int
BegrunLog
(
const
int
run
,
std
::
string
who
,
std
::
string
filename
);
virtual
int
EndrunLog
(
const
int
run
,
std
::
string
who
,
const
int
events
,
const
double
volume
=
0
,
time_t
starttime
=
0
);
virtual
std
::
string
getHost
()
const
{
return
hostname
;};
virtual
int
getPort
()
const
{
return
port
;};
virtual
std
::
string
getLogbookName
()
const
{
return
logbookname
;};
protected
:
std
::
string
hostname
;
std
::
string
logbookname
;
int
port
;
};
#endif
This diff is collapsed.
Click to expand it.
MyDaq/src/eloghandler.cc
0 → 100644
+
52
−
0
View file @
ca717bc2
#include
<eloghandler.h>
#include
<iostream>
#include
<stdlib.h>
#include
<sstream>
using
namespace
std
;
ElogHandler
::
ElogHandler
(
const
std
::
string
h
,
const
int
p
,
const
std
::
string
name
)
{
hostname
=
h
;
port
=
p
;
logbookname
=
name
;
}
int
ElogHandler
::
BegrunLog
(
const
int
run
,
std
::
string
who
,
std
::
string
filename
)
{
ostringstream
command
;
command
<<
"elog -h "
<<
hostname
<<
" -p "
<<
port
<<
" -l "
<<
logbookname
<<
" -a
\"
Author="
<<
who
<<
"
\"
"
<<
" -a
\"
Subject=Run "
<<
run
<<
" started
\"
"
<<
"
\"
Run "
<<
run
<<
" started with file "
<<
filename
<<
"
\"
"
<<
" >/dev/null 2<&1"
<<
endl
;
// cout << command.str() << endl;
system
(
command
.
str
().
c_str
()
);
return
0
;
}
int
ElogHandler
::
EndrunLog
(
const
int
run
,
std
::
string
who
,
const
int
events
,
const
double
volume
,
time_t
starttime
)
{
ostringstream
command
;
command
<<
"elog -h "
<<
hostname
<<
" -p "
<<
port
<<
" -l "
<<
logbookname
<<
" -a
\"
Author="
<<
who
<<
"
\"
"
<<
" -a
\"
Subject=Run "
<<
run
<<
" ended
\"
"
<<
"
\"
Run "
<<
run
<<
" ended with "
<<
events
<<
" events, size is "
<<
volume
<<
" MB"
<<
" duration "
<<
time
(
0
)
-
starttime
<<
" s
\"
"
<<
" >/dev/null 2<&1"
<<
endl
;
// cout << command.str() << endl;
system
(
command
.
str
().
c_str
()
);
return
0
;
}
This diff is collapsed.
Click to expand it.
README
+
1
−
1
View file @
ca717bc2
README FOR MUON LAB USING CC-USB CRATE CONTROLLER
WRITTEN BY YAKOV KULINICH SPRING 2016
MODIFIED BY TIANSU ZHANG 2019
------------------------------------------------------
------------------------------------------------------
Simple Installation Instructions
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment