Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Instrument Control
Ploty2
Commits
3c1325e9
Commit
3c1325e9
authored
Feb 25, 2020
by
Locatelli
Browse files
Add simple fit Gaussian
parent
b060829b
Changes
54
Expand all
Hide whitespace changes
Inline
Side-by-side
Makefile.am
View file @
3c1325e9
...
...
@@ -6,6 +6,7 @@ PROTO_GEN_PATH=$(top_srcdir)/src/protobuf/generated
proto
:
mkdir
-p
$(PROTO_GEN_PATH)
protoc
-I
=
$(NOMADSERVER_PROTO_PATH)
--cpp_out
=
$(PROTO_GEN_PATH)
$(NOMADSERVER_PROTO_PATH)
/AnalysisRequests.proto
protoc
-I
=
$(NOMADSERVER_PROTO_PATH)
--cpp_out
=
$(PROTO_GEN_PATH)
$(NOMADSERVER_PROTO_PATH)
/DatabaseRequests.proto
protoc
-I
=
$(NOMADSERVER_PROTO_PATH)
--cpp_out
=
$(PROTO_GEN_PATH)
$(NOMADSERVER_PROTO_PATH)
/CommonResponses.proto
protoc
-I
=
$(NOMADSERVER_PROTO_PATH)
--cpp_out
=
$(PROTO_GEN_PATH)
$(NOMADSERVER_PROTO_PATH)
/NotificationMessages.proto
...
...
icons/fit.png
0 → 100644
View file @
3c1325e9
460 Bytes
src/Global.h
View file @
3c1325e9
...
...
@@ -42,12 +42,29 @@ struct RoiRectangle {
float64
sum
;
};
struct
Stats
{
class
Stats
{
public:
Stats
(
const
std
::
string
&
aName
,
float64
aMin
,
float64
aMax
,
float64
anIntegral
)
:
name
(
aName
),
min
(
aMin
),
max
(
aMax
),
integral
(
anIntegral
){
}
Stats
()
{
min
=
0
;
max
=
0
;
integral
=
0
;
}
std
::
string
name
;
float64
min
;
float64
max
;
float64
integral
;
};
class
FitGaussianStats
:
public
Stats
{
public:
bool
converged
;
float64
position
;
float64
amplitude
;
float64
fwhm
;
};
#endif
src/Makefile.am
View file @
3c1325e9
...
...
@@ -44,6 +44,7 @@ PLOT = \
plot/property/PropertyPlot2D.cpp
PROTOBUF
=
\
protobuf/generated/AnalysisRequests.pb.cc
\
protobuf/generated/AcquisitionSerializer.pb.cc
\
protobuf/generated/CommonResponses.pb.cc
\
protobuf/generated/DatabaseRequests.pb.cc
\
...
...
@@ -77,6 +78,7 @@ ploty2_SOURCES = \
manager/ThreadPoolManager.cpp
\
manager/RequestDealerManager.cpp
\
manager/ServerSubscriberManager.cpp
\
manager/AnalysisRequesterManager.cpp
\
manager/ServerRequesterManager.cpp
\
manager/PlotManager.cpp
\
manager/InterfaceManager.cpp
\
...
...
@@ -98,6 +100,7 @@ ploty2_LDADD = $(LIBS) $(RM_LIBS) \
mplplot_SOURCES
=
\
mainplot.cpp
\
manager/AnalysisRequesterManager.cpp
\
manager/ServerRequesterManager.cpp
\
manager/ServerSubscriberManager.cpp
\
manager/InterfaceManager.cpp
\
...
...
@@ -120,6 +123,7 @@ test_SOURCES = \
manager/ThreadPoolManager.cpp
\
manager/RequestDealerManager.cpp
\
manager/ServerSubscriberManager.cpp
\
manager/AnalysisRequesterManager.cpp
\
manager/ServerRequesterManager.cpp
\
manager/InterfaceManager.cpp
\
manager/PlotManager.cpp
\
...
...
@@ -145,6 +149,7 @@ test2_SOURCES = \
manager/RequestDealerManager.cpp
\
manager/ServerSubscriberManager.cpp
\
manager/InterfaceManager.cpp
\
manager/AnalysisRequesterManager.cpp
\
manager/ServerRequesterManager.cpp
\
manager/PlotManager.cpp
\
manager/OffScreenPlotManager.cpp
\
...
...
src/Makefile.in
View file @
3c1325e9
This diff is collapsed.
Click to expand it.
src/datacontainer/PropertyPlotDataContainer.cpp
View file @
3c1325e9
...
...
@@ -31,7 +31,7 @@ namespace datacontainer {
/*
* constructor
*/
PropertyPlotDataContainer
::
PropertyPlotDataContainer
(
const
p
r
ot
o
::
PlotPropertyDataMessage
&
plotMessage
)
{
PropertyPlotDataContainer
::
PropertyPlotDataContainer
(
const
p
l
ot
y
::
PlotPropertyDataMessage
&
plotMessage
)
{
plotKey
=
plotMessage
.
plotkey
();
for
(
string
key
:
plotMessage
.
keys
())
{
keys
.
push_back
(
key
);
...
...
src/datacontainer/PropertyPlotDataContainer.h
View file @
3c1325e9
...
...
@@ -22,7 +22,7 @@
#include
"datacontainer/PlotDataContainer.h"
namespace
p
r
ot
o
{
namespace
p
l
ot
y
{
class
PlotPropertyDataMessage
;
}
...
...
@@ -39,7 +39,7 @@ public:
* \brief constructor
* \param[in] plotMessage The plot message container for constructing this one
*/
PropertyPlotDataContainer
(
const
p
r
ot
o
::
PlotPropertyDataMessage
&
plotMessage
);
PropertyPlotDataContainer
(
const
p
l
ot
y
::
PlotPropertyDataMessage
&
plotMessage
);
/*!
* \brief destructor
...
...
src/mainoffscreenplot.cpp
View file @
3c1325e9
...
...
@@ -108,7 +108,7 @@ int32 main(int32 argc, char* argv[]) {
DBGMSG
(
"file : "
<<
pbfile
.
string
().
c_str
());
ifstream
inputMessage
(
pbfile
.
string
().
c_str
(),
fstream
::
binary
);
if
(
inputMessage
.
is_open
()
==
false
)
{
Error
(
"mainoffscreenplot"
,
"Failed to open temporary file wich contains p
r
ot
o
::PlotPropertyDataMessage"
,
argv
[
2
]);
Error
(
"mainoffscreenplot"
,
"Failed to open temporary file wich contains p
l
ot
y
::PlotPropertyDataMessage"
,
argv
[
2
]);
err
=
EXIT_FAILURE
;
}
else
{
uint32
size
=
boost
::
filesystem
::
file_size
(
pbfile
);
...
...
src/mainplot.cpp
View file @
3c1325e9
...
...
@@ -40,6 +40,7 @@
#include
"manager/RequestDealerManager.h"
#include
"manager/ServerRequesterManager.h"
#include
"manager/AnalysisRequesterManager.h"
#include
"view/qt/QtUpdateContainer.h"
#include
"view/qt/QtUpdateThread.h"
#include
"manager/mpl/MplEventManager.h"
...
...
@@ -130,6 +131,15 @@ int32 main(int32 argc, char* argv[]) {
}
DBGMSG
(
"Created requester "
<<
*
requesterdb
);
// create a requester on the nomad server database
shared_ptr
<
application
::
Requester
>
requesteranalysis
=
application
::
Requester
::
create
(
*
nomadserver
,
"analysis"
);
if
(
requesteranalysis
.
get
()
==
0
)
{
Error
(
"mainplot"
,
"Connection problem on analysis"
);
err
=
EXIT_FAILURE
;
goto
exit
;
}
DBGMSG
(
"Created requester "
<<
*
requesteranalysis
);
// Manage application signal
// signal(SIGABRT, crash_handler);
signal
(
SIGHUP
,
crash_handler
);
...
...
@@ -141,11 +151,14 @@ int32 main(int32 argc, char* argv[]) {
// Init the nomad server requester manager
manager
::
ServerRequesterManager
::
getInstance
()
->
init
(
requesterdb
);
// Init the nomad analysis requester manager
manager
::
AnalysisRequesterManager
::
getInstance
()
->
init
(
requesteranalysis
);
// Set cameo application running
application
::
This
::
setRunning
();
// Read temporary file created by ploty2 process with new plot info
// Open file contained p
r
ot
o
::message
// Open file contained p
l
ot
y
::message
ifstream
file1
(
argv
[
2
],
ios
::
binary
);
if
(
file1
.
is_open
()
==
true
)
{
char
c
;
...
...
@@ -154,7 +167,7 @@ int32 main(int32 argc, char* argv[]) {
part1
<<
c
;
}
file1
.
close
();
// Open file contained p
r
ot
o
::PlotPropertyDataMessage
// Open file contained p
l
ot
y
::PlotPropertyDataMessage
ifstream
file2
(
argv
[
3
],
ios
::
binary
);
if
(
file2
.
is_open
()
==
true
)
{
ostringstream
part2
;
...
...
@@ -164,13 +177,13 @@ int32 main(int32 argc, char* argv[]) {
file2
.
close
();
// Get the request type.
p
r
ot
o
::
Message
message
;
p
l
ot
y
::
Message
message
;
message
.
ParseFromString
(
part1
.
str
());
DBGMSG
(
"receive : "
<<
message
.
type
());
// Switch between message type
if
(
message
.
type
()
==
p
r
ot
o
::
Message
::
PlotPropertyData
)
{
if
(
message
.
type
()
==
p
l
ot
y
::
Message
::
PlotPropertyData
)
{
// Property plot
p
r
ot
o
::
PlotPropertyDataMessage
plotMessage
;
p
l
ot
y
::
PlotPropertyDataMessage
plotMessage
;
plotMessage
.
ParseFromString
(
part2
.
str
());
DBGMSG
(
"key : "
<<
plotMessage
.
plotkey
());
...
...
@@ -195,22 +208,26 @@ int32 main(int32 argc, char* argv[]) {
}
}
else
{
Error
(
"mainplot"
,
"Failed to open temporary file wich contains p
r
ot
o
::PlotPropertyDataMessage"
,
argv
[
3
]);
Error
(
"mainplot"
,
"Failed to open temporary file wich contains p
l
ot
y
::PlotPropertyDataMessage"
,
argv
[
3
]);
err
=
EXIT_FAILURE
;
}
}
else
{
Error
(
"mainplot"
,
"Failed to open temporary file wich contains p
r
ot
o
::Message"
,
argv
[
2
]);
Error
(
"mainplot"
,
"Failed to open temporary file wich contains p
l
ot
y
::Message"
,
argv
[
2
]);
err
=
EXIT_FAILURE
;
}
// Clean manager
manager
::
ServerRequesterManager
::
resetInstance
();
// Clean manager
manager
::
AnalysisRequesterManager
::
resetInstance
();
// Cancel subscriber
datachangesubscriber
->
cancel
();
requesterdb
.
reset
();
requesteranalysis
.
reset
();
}
exit:
...
...
src/manager/AnalysisRequesterManager.cpp
0 → 100644
View file @
3c1325e9
/*
* Nomad Instrument Control Software
*
* Copyright 2011 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
#include
"AnalysisRequesterManager.h"
using
namespace
std
;
using
namespace
cameo
;
namespace
manager
{
AnalysisRequesterManager
*
AnalysisRequesterManager
::
m_Instance
=
nullptr
;
/*
* constructor
*/
AnalysisRequesterManager
::
AnalysisRequesterManager
()
{
}
/*
* getInstance
*/
AnalysisRequesterManager
*
AnalysisRequesterManager
::
getInstance
()
{
if
(
m_Instance
==
nullptr
)
{
m_Instance
=
new
AnalysisRequesterManager
();
}
return
m_Instance
;
}
/*
* init
*/
void
AnalysisRequesterManager
::
init
(
std
::
shared_ptr
<
cameo
::
application
::
Requester
>
requester
)
{
m_AnalysisRequester
=
requester
;
}
/*
* resetInstance
*/
void
AnalysisRequesterManager
::
resetInstance
()
{
if
(
m_Instance
!=
nullptr
)
{
m_Instance
->
reset
();
delete
m_Instance
;
m_Instance
=
nullptr
;
}
}
/*
* reset
*/
void
AnalysisRequesterManager
::
reset
()
{
}
/*
* getSimpleGaussianFitValue
*/
analysis
::
FitDataMessage
AnalysisRequesterManager
::
getSimpleGaussianFitValue
(
const
std
::
vector
<
float64
>&
x
,
const
std
::
vector
<
float64
>&
y
)
throw
(
Error
)
{
analysis
::
Message
message
;
message
.
set_type
(
analysis
::
Message
::
GetFit
);
analysis
::
DataToFitMessage
dataToFit
;
dataToFit
.
set_type
(
analysis
::
GaussianFit
);
for
(
auto
val
:
x
)
{
dataToFit
.
add_xdata
(
val
);
}
for
(
auto
val
:
y
)
{
dataToFit
.
add_ydata
(
val
);
}
std
::
string
part1
,
part2
;
message
.
SerializeToString
(
&
part1
);
dataToFit
.
SerializeToString
(
&
part2
);
m_AnalysisRequester
->
sendTwoBinaryParts
(
part1
,
part2
);
std
::
string
responseMessage
;
m_AnalysisRequester
->
receiveBinary
(
responseMessage
);
analysis
::
FitDataMessage
fitData
;
fitData
.
ParseFromString
(
responseMessage
);
return
fitData
;
}
}
src/manager/AnalysisRequesterManager.h
0 → 100644
View file @
3c1325e9
/*
* Nomad Instrument Control Software
*
* Copyright 2011 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
#ifndef ANALYSISREQUESTERMANAGER_H
#define ANALYSISREQUESTERMANAGER_H
#include
<cameo/cameo.h>
#include
<common/base/BaseTypes.h>
#include
"common/protobuf/generated/AnalysisRequests.pb.h"
#include
"Error.h"
namespace
manager
{
/*!
* \brief This class manage request to nomad server data base
*/
class
AnalysisRequesterManager
{
public:
/*!
* \brief Singleton instance getter
* \return Singleton instance
*/
static
AnalysisRequesterManager
*
getInstance
();
/*!
* \brief reset instance
*/
static
void
resetInstance
();
/*!
* \brief init the singleton
* \param[in] requester Pointer to the cameo requester on analysis responder
*/
void
init
(
std
::
shared_ptr
<
cameo
::
application
::
Requester
>
requester
);
/*!
* \brief Get simple gaussian fit values
* \param[in] x The data of x to fit
* \param[in] y The data of y to fit
* \return Fit y data and stats values
* \throws Error
*/
analysis
::
FitDataMessage
getSimpleGaussianFitValue
(
const
std
::
vector
<
float64
>&
x
,
const
std
::
vector
<
float64
>&
y
)
throw
(
Error
);
private:
/*!
* \brief constructor
*/
AnalysisRequesterManager
();
/*!
* \brief reset instance
*/
void
reset
();
static
AnalysisRequesterManager
*
m_Instance
;
//! Singleton instannce
std
::
shared_ptr
<
cameo
::
application
::
Requester
>
m_AnalysisRequester
;
//! Analysis requester pointer
};
}
#endif // ANALYSISREQUESTERMANAGER_H
src/manager/InterfaceManager.cpp
View file @
3c1325e9
...
...
@@ -255,9 +255,9 @@ void InterfaceManager::updateRoi(int32 n, const RectangleCoord& rect) {
/*
* updateSum
*/
void
InterfaceManager
::
updateSum
(
uint32
id
,
float64
sum
)
{
void
InterfaceManager
::
update
Roi
Sum
(
uint32
id
,
float64
sum
)
{
if
(
m_QtWindow
)
{
m_QtWindow
->
updateSum
(
id
,
sum
);
m_QtWindow
->
update
Roi
Sum
(
id
,
sum
);
}
}
...
...
@@ -292,4 +292,45 @@ void InterfaceManager::showStatsCoord(const RectangleCoord& rect) {
}
}
/*
* gaussianFitStatistic
*/
void
InterfaceManager
::
gaussianFitStatistic
(
const
std
::
string
&
color
)
throw
(
Error
)
{
if
(
m_PropertyPlot
)
{
m_PropertyPlot
->
gaussianFitStatistic
(
color
);
}
}
/*
* dismissGaussianFitStats
*/
void
InterfaceManager
::
dismissGaussianFitStats
()
throw
(
Error
)
{
if
(
m_PropertyPlot
)
{
m_PropertyPlot
->
dismissGaussianFitStats
();
}
}
/*
* showGaussianFitStatsCoord
*/
void
InterfaceManager
::
showGaussianFitStatsCoord
(
const
RectangleCoord
&
rect
)
{
vector
<
FitGaussianStats
>
stats
;
if
(
m_PropertyPlot
)
{
stats
=
m_PropertyPlot
->
updateGaussianFitStats
(
rect
);
}
if
(
m_QtWindow
)
{
m_QtWindow
->
showGaussianFitCoord
(
rect
,
stats
);
}
}
/*
* closeStatsWindow
*/
void
InterfaceManager
::
closeStatsWindow
()
{
if
(
m_QtWindow
)
{
m_QtWindow
->
closeStatsWindow
();
}
}
}
src/manager/InterfaceManager.h
View file @
3c1325e9
...
...
@@ -28,6 +28,7 @@
namespace
plot
{
class
PlotWindow
;
class
Plot
;
namespace
property
{
class
PropertyPlot
;
}
...
...
@@ -243,32 +244,53 @@ public:
* \param[in] id The roi indice
* \param[in] sum The detector sum value
*/
void
updateSum
(
uint32
id
,
float64
sum
);
void
update
Roi
Sum
(
uint32
id
,
float64
sum
);
/*!
* \brief S
tart of sequence add a roi
* \brief S
how simple stats of the plot
* \param[in] color The color of the roi box
* \throws Error
*/
void
statistic
(
const
std
::
string
&
color
)
throw
(
Error
);
/*!
* \brief Delete a roi
* \param[in] id The id of the roi
* \brief Dismiss Stats
* \throws Error
*/
void
dismissStats
()
throw
(
Error
);
/*!
* \brief Show roi coordinates
* \param[in] x0 The x0 roi coordinate
* \param[in] y0 The x1 roi coordinate
* \param[in] x1 The y0 roi coordinate
* \param[in] y1 The y1 roi coordinate
* \param[in] rects The box coordinates
* \throws Error
*/
void
showStatsCoord
(
const
RectangleCoord
&
rect
);
/*!
* \brief Show simple gaussian fit
* \param[in] color The color of the fit
* \throws Error
*/
void
gaussianFitStatistic
(
const
std
::
string
&
color
)
throw
(
Error
);
/*!
* \brief Dissimiss the gaussian fit a roi
* \param[in] id The id of the roi
* \throws Error
*/
void
dismissGaussianFitStats
()
throw
(
Error
);
/*!
* \brief Show fit box coordinates
* \param[in] rect The rectangle coordinate
*/
void
showGaussianFitStatsCoord
(
const
RectangleCoord
&
rect
);
/*!
* \brief Close stats windows
*/
void
closeStatsWindow
();
private:
/*!
...
...
src/manager/OffScreenPlotManager.cpp
View file @
3c1325e9
...
...
@@ -157,7 +157,7 @@ void OffScreenPlotManager::run(std::string pbfilename, std::string path) {
ifstream
inputMessage
(
pbfile
.
string
().
c_str
(),
fstream
::
binary
);
if
(
inputMessage
.
is_open
()
==
false
)
{
Error
(
"OffScreenPlotManager"
,
"savePlot"
,
"Failed to open temporary file which contains p
r
ot
o
::PlotPropertyDataMessage"
,
pbfilename
);
"Failed to open temporary file which contains p
l
ot
y
::PlotPropertyDataMessage"
,
pbfilename
);
}
else
{
char
buffer
[
size
];
inputMessage
.
read
(
buffer
,
size
);
...
...
@@ -231,7 +231,7 @@ void OffScreenPlotManager::run(std::string pbfilename, std::string path) {
}
}
catch
(
boost
::
filesystem
::
filesystem_error
&
e
)
{
Error
(
"OffScreenPlotManager"
,
"savePlot"
,
"Failed to open temporary file which contains p
r
ot
o
::PlotPropertyDataMessage"
,
pbfilename
);
"Failed to open temporary file which contains p
l
ot
y
::PlotPropertyDataMessage"
,
pbfilename
);
}
}
...
...
src/manager/PlotManager.cpp
View file @
3c1325e9
...
...
@@ -126,9 +126,9 @@ void PlotManager::restore() {
part2
<<
c
;
}
file2
.
close
();
p
r
ot
o
::
Message
message
;
p
l
ot
y
::
Message
message
;
message
.
ParseFromString
(
part1
.
str
());
p
r
ot
o
::
PlotPropertyDataMessage
plotMessage
;
p
l
ot
y
::
PlotPropertyDataMessage
plotMessage
;
plotMessage
.
ParseFromString
(
part2
.
str
());
// Display plot
...
...
@@ -152,7 +152,7 @@ PlotManager * PlotManager::getInstance() {
/*
* displayPlot
*/
void
PlotManager
::
displayPropertyPlot
(
const
p
r
ot
o
::
Message
&
message
,
const
p
r
ot
o
::
PlotPropertyDataMessage
&
plotMessage
)
{
void
PlotManager
::
displayPropertyPlot
(
const
p
l
ot
y
::
Message
&
message
,
const
p
l
ot
y
::
PlotPropertyDataMessage
&
plotMessage
)
{
unique_lock
<
recursive_mutex
>
lock
(
m_PlotsMutex
);
///////////////////////////////////////////////////////////////////////////////////////
//// Check if this plot key is already open or was closed
...
...
@@ -197,7 +197,7 @@ void PlotManager::displayPropertyPlot(const proto::Message& message, const proto
string
part2
;
plotMessage
.
SerializeToString
(
&
part2
);
// Create temporary file 1 which contains p
r
ot
o
::Message info
// Create temporary file 1 which contains p
l
ot
y
::Message info
ostringstream
filename1
;
filename1
<<
"/tmp/mplplot-"
<<
plotMessage
.
plotkey
()
<<
".message1"
;
ofstream
file1
(
filename1
.
str
().
c_str
(),
ios
::
binary
);
...
...
@@ -206,7 +206,7 @@ void PlotManager::displayPropertyPlot(const proto::Message& message, const proto
file1
.
write
(
part1
.
c_str
(),
part1
.
size
());
file1
.
close
();
// Create temporary file 2 which contains p
r
ot
o
::PlotPropertyDataMessage info
// Create temporary file 2 which contains p
l
ot
y
::PlotPropertyDataMessage info
ostringstream
filename2
;
filename2
<<
"/tmp/mplplot-"
<<
plotMessage
.
plotkey
()
<<
".message2"
;
ofstream
file2
(
filename2
.
str
().
c_str
(),
ios
::
binary
);
...
...
src/manager/PlotManager.h
View file @
3c1325e9
...
...
@@ -25,7 +25,7 @@
#include
<cameo/cameo.h>
#include
<common/base/BaseTypes.h>
namespace
p
r
ot
o
{
namespace
p
l
ot
y
{
class
Message
;
class
PlotPropertyDataMessage
;
}
...
...
@@ -51,7 +51,7 @@ public:
* \brief display a plot
* \param[in] plotRequest plot info
*/
void
displayPropertyPlot
(
const
p
r
ot
o
::
Message
&
message
,
const
p
r
ot
o
::
PlotPropertyDataMessage
&
plotMessage
);
void
displayPropertyPlot
(
const
p
l
ot
y
::
Message
&
message
,
const
p
l
ot
y
::
PlotPropertyDataMessage
&
plotMessage
);
/*!
* \brief reset instance
...
...
@@ -73,7 +73,7 @@ private:
static
PlotManager
*
m_Instance
;
//! Pointer of singleton instance
std
::
map
<
std
::
string
,
std
::
shared_ptr
<
cameo
::
application
::
Instance
>
>
m_PlotsProcesses
;
//! Map of open display plots
std
::
map
<
std
::
string
,
std
::
pair
<
p
r
ot
o
::
Message
,
p
r
ot
o
::
PlotPropertyDataMessage
>
>
m_PropertyPlotsData
;
//! Map of open display plots properties
std
::
map
<
std
::
string
,
std
::
pair
<
p
l
ot
y
::
Message
,
p
l
ot
y
::
PlotPropertyDataMessage
>
>
m_PropertyPlotsData
;
//! Map of open display plots properties
std
::
recursive_mutex
m_PlotsMutex
;
//! Mutex on plots map
//! Configuration cache files
...
...
src/manager/RequestDealerManager.cpp
View file @
3c1325e9
...
...
@@ -76,21 +76,21 @@ void RequestDealerManager::loop(std::shared_ptr<cameo::application::Responder> r
if
(
responder
->
isCanceled
()
==
false
)
{
// Get the request type.
string
firstPart
=
request
->
getBinary
();
p
r
ot
o
::
Message
message
;
p
l
ot
y
::
Message
message
;
message
.
ParseFromString
(
firstPart
);
// Property plot
if
(
message
.
type
()
==
p
r
ot
o
::
Message
::
PlotPropertyData
)
{
if
(
message
.
type
()
==
p
l
ot
y
::
Message
::
PlotPropertyData
)
{
string
secondPart
=
request
->
getSecondBinaryPart
();
p
r
ot
o
::
PlotPropertyDataMessage
dataMessage
;
p
l
ot
y
::
PlotPropertyDataMessage
dataMessage
;