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
12dbde3a
Commit
12dbde3a
authored
Apr 17, 2020
by
Locatelli
Browse files
Remove unused stuff
parent
d48d9064
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/view/mpl/Mpl.cpp
View file @
12dbde3a
...
...
@@ -60,9 +60,8 @@ Mpl::Mpl() throw (Error) {
PyEval_InitThreads
();
// Import the matplotlib module
PythonObject
matplotlib
;
try
{
matplotlib
=
bp
::
import
(
bp
::
str
(
"matplotlib"
));
m
_M
atplotlib
=
bp
::
import
(
bp
::
str
(
"matplotlib"
));
}
catch
(...)
{
throw
Error
(
"Mpl"
,
"constructor"
,
"Error when importing the module matplotlib"
);
}
...
...
@@ -113,17 +112,17 @@ Mpl::Mpl() throw (Error) {
// Use Qt5Agg for toolbar look and feel
auto
args
=
bp
::
make_tuple
(
"Qt5Agg"
);
try
{
matplotlib
.
attr
(
"use"
)(
*
args
);
m
_M
atplotlib
.
attr
(
"use"
)(
*
args
);
}
catch
(...)
{
throw
Error
(
"Mpl"
,
"constructor"
,
"Error when activating QT5Agg"
);
}
// Get Py QT5 for forcine QT5
try
{
auto
qt5Module
=
bp
::
import
(
bp
::
str
(
"PyQt5"
));
}
catch
(...)
{
throw
Error
(
"Mpl"
,
"Mpl"
,
"Error when getting PyQt5"
);
}
//
// Get Py QT5 for forcine QT5
//
try {
//
auto qt5Module = bp::import(bp::str("PyQt5"));
//
} catch (...) {
//
throw Error("Mpl", "Mpl", "Error when getting PyQt5");
//
}
// Get matplotlib BackEnd for qt5
try
{
...
...
@@ -148,17 +147,16 @@ Mpl::Mpl() throw (Error) {
* destructor
*/
Mpl
::~
Mpl
()
{
{
m_PyPlot
.
reset
();
m_FigureModule
.
reset
();
m_LinesModule
.
reset
();
m_TextModule
.
reset
();
m_ColorsModule
.
reset
();
m_BackendsModule
.
reset
();
m_WidgetsModule
.
reset
();
m_PatchesModule
.
reset
();
m_GarbageCollector
.
reset
();
}
m_GarbageCollector
.
reset
();
m_BackendsModule
.
reset
();
m_ColorsModule
.
reset
();
m_PatchesModule
.
reset
();
m_WidgetsModule
.
reset
();
m_TextModule
.
reset
();
m_LinesModule
.
reset
();
m_FigureModule
.
reset
();
m_PyPlot
.
reset
();
m_Matplotlib
.
reset
();
Py_Finalize
();
}
...
...
src/view/mpl/Mpl.h
View file @
12dbde3a
...
...
@@ -216,6 +216,7 @@ public:
private:
PythonObject
m_Matplotlib
;
PythonObject
m_PyPlot
;
//! Matplotlib pyplot Python module object
PythonObject
m_FigureModule
;
//! Matplotlib figure module
PythonObject
m_LinesModule
;
//! Matplotlib lines module
...
...
src/view/mpl/MplFigure.cpp
View file @
12dbde3a
...
...
@@ -75,6 +75,7 @@ MplFigure::~MplFigure() {
m_Figure
.
reset
();
m_Canvas
.
reset
();
m_Toolbar
.
reset
();
m_MainAxis
.
reset
();
// try {
// m_Mpl.garbageCollect();
...
...
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