Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Instrument Control
Ploty2
Commits
89709fed
Commit
89709fed
authored
Apr 22, 2020
by
Locatelli
Browse files
Correct some little bugs
parent
d35023d0
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/manager/OffScreenPlotManager.cpp
View file @
89709fed
...
...
@@ -208,6 +208,7 @@ void OffScreenPlotManager::run(std::string pbfilename, std::string path) {
try
{
unique_ptr
<
view
::
mpl
::
MplFigure
>
figure
(
new
view
::
mpl
::
MplFigure
(
*
m_Mpl
,
false
));
// return;
// DBGMSG("pbfilename = " << path << "/" << pbfilename);
boost
::
filesystem
::
path
pbfile
=
path
;
pbfile
/=
pbfilename
;
pbfile
.
replace_extension
(
"pb"
);
...
...
@@ -222,7 +223,6 @@ void OffScreenPlotManager::run(std::string pbfilename, std::string path) {
buffer
::
Data
data
;
data
.
ParseFromArray
(
buffer
,
size
);
// DBGMSG("pbfilename = " << path << "/" << pbfilename);
// DBGMSG("buffer = " << size);
// DBGMSG("numor = " << data.numor());
// DBGMSG("dataxArray = " << data.xdata_size());
...
...
src/plot/offscreen/OffScreenPlot1D.cpp
View file @
89709fed
...
...
@@ -182,11 +182,8 @@ std::string OffScreenPlot1D::getYLabel() {
*/
void
OffScreenPlot1D
::
plot
(
uint32
numplot
,
const
std
::
vector
<
float64
>
&
y
,
const
std
::
string
&
label
,
const
std
::
string
&
color
)
throw
(
Error
)
{
if
(
m_Data
.
errorbars
(
numplot
)
==
true
)
{
if
(
(
m_Data
.
errorbars
(
numplot
)
==
true
)
&&
(
m_Data
.
type
()
!=
buffer
::
Data
::
Spy
))
{
float64
linewidth
=
0.2
;
if
(
m_Data
.
type
()
==
buffer
::
Data
::
Spy
)
{
linewidth
=
1
;
}
m_MplPlot1D
.
errorbar
(
numplot
,
y
,
label
,
color
,
"o"
,
2
,
1
,
3
,
linewidth
);
}
else
{
float64
linewidth
=
0.5
;
...
...
@@ -202,11 +199,8 @@ void OffScreenPlot1D::plot(uint32 numplot, const std::vector<float64> &y, const
*/
void
OffScreenPlot1D
::
plot
(
uint32
numplot
,
const
std
::
vector
<
float64
>
&
x
,
const
std
::
vector
<
float64
>
&
y
,
const
std
::
string
&
label
,
const
std
::
string
&
color
)
throw
(
Error
)
{
if
(
m_Data
.
errorbars
(
numplot
)
==
true
)
{
if
(
(
m_Data
.
errorbars
(
numplot
)
==
true
)
&&
(
m_Data
.
type
()
!=
buffer
::
Data
::
Spy
))
{
float64
linewidth
=
0.2
;
if
(
m_Data
.
type
()
==
buffer
::
Data
::
Spy
)
{
linewidth
=
1
;
}
m_MplPlot1D
.
errorbar
(
numplot
,
x
,
y
,
label
,
color
,
"o"
,
2
,
1
,
3
,
linewidth
);
}
else
{
float64
linewidth
=
0.5
;
...
...
src/plot/property/PropertyPlot2D.cpp
View file @
89709fed
...
...
@@ -294,9 +294,9 @@ void PropertyPlot2D::update(int32 id) {
// Update image on mpl plot
m_MplPlot2D
.
updateimage
((
int32
)
m_datax
.
size
(),
(
int32
)
m_datay
.
size
(),
m_dataz
);
if
(
m_DoProjections
==
true
)
{
updateProjections
();
// Set color limits of color bar
colorLimits
(
m_MinColorLim
,
m_MaxColorLim
);
updateProjections
();
}
// Redraw plots
...
...
@@ -317,10 +317,10 @@ void PropertyPlot2D::update(int32 id) {
void
PropertyPlot2D
::
updateProjections
()
{
vector
<
size_t
>
lims
=
m_MplPlot2D
.
getImageBoxLimits
();
// Compute new box with real of data size (reducing of ploting size view for big one)
lims
[
0
]
=
lims
[
0
]
/
m_XPhysicalSize
*
m_XDataSize
;
lims
[
1
]
=
lims
[
1
]
/
m_XPhysicalSize
*
m_XDataSize
;
lims
[
2
]
=
lims
[
2
]
/
m_YPhysicalSize
*
m_YDataSize
;
lims
[
3
]
=
lims
[
3
]
/
m_YPhysicalSize
*
m_YDataSize
;
lims
[
0
]
=
(
size_t
)
((
float64
)
lims
[
0
]
/
(
float64
)
m_XPhysicalSize
*
(
float64
)
m_XDataSize
)
;
lims
[
1
]
=
(
size_t
)
((
float64
)
lims
[
1
]
/
(
float64
)
m_XPhysicalSize
*
(
float64
)
m_XDataSize
)
;
lims
[
2
]
=
(
size_t
)
((
float64
)
lims
[
2
]
/
(
float64
)
m_YPhysicalSize
*
(
float64
)
m_YDataSize
)
;
lims
[
3
]
=
(
size_t
)
((
float64
)
lims
[
3
]
/
(
float64
)
m_YPhysicalSize
*
(
float64
)
m_YDataSize
)
;
// Compute projections of the image
computeProjections
(
lims
);
// Reset y data limits of X projection
...
...
@@ -411,14 +411,14 @@ void PropertyPlot2D::saveColorLimits(float64 min, float64 max) throw (Error) {
* getXDataSize
*/
uint32
PropertyPlot2D
::
getXDataSize
()
const
{
return
m_XDataSize
;
return
(
uint32
)
m_XDataSize
;
}
/*
* getYDataSize
*/
uint32
PropertyPlot2D
::
getYDataSize
()
const
{
return
m_YDataSize
;
return
(
uint32
)
m_YDataSize
;
}
}
...
...
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