Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
IPNL_GAMMA
gammaware
Commits
7b577d55
Commit
7b577d55
authored
Jul 02, 2019
by
Jérémie Dudouet
Browse files
Add corrections for online reading
parent
307a2be2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
14 deletions
+49
-14
src/root/gui/fipps_spy/src/FIPPSSpy.cpp
src/root/gui/fipps_spy/src/FIPPSSpy.cpp
+6
-1
src/root/gui/fipps_spy/src/FSMainWindow.cpp
src/root/gui/fipps_spy/src/FSMainWindow.cpp
+40
-12
src/root/gui/fipps_spy/src/FSMainWindow.h
src/root/gui/fipps_spy/src/FSMainWindow.h
+3
-1
No files found.
src/root/gui/fipps_spy/src/FIPPSSpy.cpp
View file @
7b577d55
...
...
@@ -39,6 +39,11 @@ int main(int argc, char **argv)
}
gEnv
->
SetValue
(
"Gui.IconPath"
,
Form
(
"%s/icons:%s/icons"
,
getenv
(
"ROOTSYS"
),
getenv
(
"gammaSoftware_DIR"
)));
TString
RunInit
=
""
;
if
(
argc
>
1
){
RunInit
=
argv
[
1
];
}
TInterruptHandler
*
fxInterruptHandler
=
new
TInterruptHandler
();
fxInterruptHandler
->
Add
();
...
...
@@ -55,7 +60,7 @@ int main(int argc, char **argv)
TApplication
::
NeedGraphicsLibs
();
gApplication
->
InitializeGraphics
();
fFSMainWindow
=
new
FSMainWindow
(
gClient
->
GetRoot
(),
800
,
600
);
fFSMainWindow
=
new
FSMainWindow
(
gClient
->
GetRoot
(),
800
,
600
,
RunInit
);
theApp
->
Run
(
false
);
if
(
fFSMainWindow
)
{
...
...
src/root/gui/fipps_spy/src/FSMainWindow.cpp
View file @
7b577d55
...
...
@@ -30,9 +30,12 @@
/// AGAPRO includes
FSMainWindow
::
FSMainWindow
(
const
TGWindow
*
p
,
UInt_t
w
,
UInt_t
h
)
:
FSMainWindow
::
FSMainWindow
(
const
TGWindow
*
p
,
UInt_t
w
,
UInt_t
h
,
TString
RunInit
)
:
TGMainFrame
(
p
,
w
,
h
)
{
fLastRun
=
RunInit
;
if
(
fLastRun
.
Atoi
()
>
0
)
INFO_MESS
<<
"Starting using run "
<<
fLastRun
<<
" as initializer"
<<
ENDL
;
ReadLUT
();
ReadCal
();
InitParameters
();
...
...
@@ -539,31 +542,52 @@ TString FSMainWindow::GetStdoutFromCommand(string cmd)
void
FSMainWindow
::
ReadHistograms
()
{
const
char
*
FIPPSSpy_version
=
(
char
*
)
FIPPSSpy_VERSION
;
TString
DataDir
=
getenv
(
"FSRawDataDir"
);
TString
Command
=
Form
(
"ls -ltr %s | grep ^- | tail -1 | awk '{ print $(NF) }'"
,
DataDir
.
Data
());
TString
Run
=
GetStdoutFromCommand
(
Command
.
Data
());
TString
FileName
=
Form
(
"%s/%s"
,
getenv
(
"FSRawDataDir"
),
Run
.
Data
());
TString
FileName
;
TString
Run
;
if
(
fLastRun
.
Atoi
()
==
0
){
TString
Command
=
Form
(
"ls -ltr %s | grep ^- | tail -1 | awk '{ print $(NF) }'"
,
DataDir
.
Data
());
Run
=
GetStdoutFromCommand
(
Command
.
Data
());
Run
.
ReplaceAll
(
".lst"
,
""
);
FileName
=
Form
(
"%s/%s"
,
getenv
(
"FSRawDataDir"
),
Run
.
Data
());
}
else
{
bool
ok
=
true
;
Int_t
Test
=
fLastRun
.
Atoi
();
while
(
ok
){
Test
++
;
FileName
=
Form
(
"%s/%.06d"
,
getenv
(
"FSRawDataDir"
),
Test
);
ok
=
gSystem
->
IsFileInIncludePath
(
FileName
);
}
Test
=
Test
-
1
;
Run
=
Form
(
"%.06d"
,
Test
);
FileName
=
Form
(
"%s/%s"
,
getenv
(
"FSRawDataDir"
),
Run
.
Data
());
}
ifstream
file
(
FileName
.
Data
());
if
(
!
file
){
ERR_MESS
<<
FileName
<<
" not found"
<<
ENDL
;
return
;
}
else
INFO_MESS
<<
"Reading run: "
<<
Run
<<
":"
<<
ENDL
;
else
INFO_MESS
<<
"Reading run: "
<<
Run
<<
ENDL
;
struct
stat
result
;
if
(
stat
(
FileName
.
Data
(),
&
result
)
==
0
)
{
fCurrentDate
=
Form
(
"%s"
,
asctime
(
localtime
(
&
result
.
st_mtime
)));
INFO_MESS
<<
"Run date: "
<<
fCurrentDate
<<
ENDL
;
TString
date
=
Form
(
"%s"
,
asctime
(
localtime
(
&
result
.
st_mtime
)));
date
.
ReplaceAll
(
"
\n
"
,
""
);
INFO_MESS
<<
"Run date: "
<<
date
<<
ENDL
;
fCurrentDate
=
date
;
}
else
{
WARN_MESS
<<
"Unable to get file time modification"
<<
ENDL
;
fCurrentDate
=
"Undef"
;
SetWindowName
(
Form
(
"FIPPSSpy v%s: Run %s - %s !! Disk not Available !!"
,
FIPPSSpy_version
,
Run
.
Data
(),
fCurrentDate
.
Data
()));
return
;
}
const
char
*
FIPPSSpy_version
=
(
char
*
)
FIPPSSpy_VERSION
;
SetWindowName
(
Form
(
"FIPPSSpy v%s: Run %s - %s"
,
FIPPSSpy_version
,
Run
.
Data
(),
fCurrentDate
.
ReplaceAll
(
"
\n
"
,
""
).
Data
()));
map
<
Int_t
,
TH1I
*>::
iterator
itr
;
for
(
itr
=
fListOfSpectra
.
begin
();
itr
!=
fListOfSpectra
.
end
();
++
itr
)
{
TH1I
*
h
=
itr
->
second
;
...
...
@@ -576,7 +600,7 @@ void FSMainWindow::ReadHistograms()
Buffer
=
line
;
Buffer
.
ReplaceAll
(
"FIPPintern "
,
""
);
while
(
Buffer
.
EndsWith
(
" "
))
Buffer
.
Remove
(
Buffer
.
Length
()
-
1
);
fCurrentDate
=
Buffer
;
//
fCurrentDate = Buffer;
TObjArray
*
arr
;
...
...
@@ -642,6 +666,10 @@ void FSMainWindow::ReadHistograms()
fListOfSpectra
[
id
]
->
SetEntries
(
fListOfSpectra
[
id
]
->
Integral
());
}
file
.
close
();
fLastRun
=
Run
;
SetWindowName
(
Form
(
"FIPPSSpy v%s: Run %s - %s"
,
FIPPSSpy_version
,
fLastRun
.
Data
(),
fCurrentDate
.
Data
()));
}
void
FSMainWindow
::
DoCalMode
(
Bool_t
on
)
...
...
src/root/gui/fipps_spy/src/FSMainWindow.h
View file @
7b577d55
...
...
@@ -88,9 +88,11 @@ private:
Int_t
fCalOrder
=
0
;
Color_t
fColor
[
48
];
TString
fLastRun
=
""
;
public:
FSMainWindow
(
const
TGWindow
*
p
,
UInt_t
w
,
UInt_t
h
);
FSMainWindow
(
const
TGWindow
*
p
,
UInt_t
w
,
UInt_t
h
,
TString
RunInit
=
""
);
~
FSMainWindow
();
void
CloseWindow
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment