Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
82fdbde6
Commit
82fdbde6
authored
6 years ago
by
Yurov, Dmitry
Browse files
Options
Downloads
Patches
Plain Diff
Introduced Plot1DCanvas (SpecularPlotCanvas copy)
Redmine: #2106
parent
769cb893
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/coregui/Views/SpecularDataWidgets/Plot1DCanvas.cpp
+66
-0
66 additions, 0 deletions
GUI/coregui/Views/SpecularDataWidgets/Plot1DCanvas.cpp
GUI/coregui/Views/SpecularDataWidgets/Plot1DCanvas.h
+52
-0
52 additions, 0 deletions
GUI/coregui/Views/SpecularDataWidgets/Plot1DCanvas.h
with
118 additions
and
0 deletions
GUI/coregui/Views/SpecularDataWidgets/Plot1DCanvas.cpp
0 → 100644
+
66
−
0
View file @
82fdbde6
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file GUI/coregui/Views/SpecularDataWidgets/Plot1DCanvas.cpp
//! @brief Implements class Plot1DCanvas
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************** //
#include
"Plot1DCanvas.h"
#include
"FontScalingEvent.h"
#include
"PlotStatusLabel.h"
#include
"SpecularPlot.h"
#include
"SpecularDataItem.h"
#include
<QVBoxLayout>
Plot1DCanvas
::
Plot1DCanvas
(
QWidget
*
parent
)
:
SessionItemWidget
(
parent
)
,
m_plot
(
new
SpecularPlot
)
,
m_canvasEvent
(
new
FontScalingEvent
(
m_plot
,
this
))
,
m_statusLabel
(
new
PlotStatusLabel
(
m_plot
,
this
))
{
this
->
installEventFilter
(
m_canvasEvent
);
QVBoxLayout
*
layout
=
new
QVBoxLayout
;
layout
->
setMargin
(
0
);
layout
->
setSpacing
(
0
);
layout
->
addWidget
(
m_plot
);
layout
->
addWidget
(
m_statusLabel
);
setLayout
(
layout
);
setStatusLabelEnabled
(
false
);
}
void
Plot1DCanvas
::
setItem
(
SessionItem
*
specularDataItem
)
{
SessionItemWidget
::
setItem
(
specularDataItem
);
m_plot
->
setItem
(
dynamic_cast
<
SpecularDataItem
*>
(
specularDataItem
));
}
SpecularPlot
*
Plot1DCanvas
::
specularPlot
()
{
return
m_plot
;
}
QCustomPlot
*
Plot1DCanvas
::
customPlot
()
{
return
m_plot
->
customPlot
();
}
void
Plot1DCanvas
::
setStatusLabelEnabled
(
bool
flag
)
{
m_statusLabel
->
setLabelEnabled
(
flag
);
m_statusLabel
->
setHidden
(
!
flag
);
}
void
Plot1DCanvas
::
onStatusString
(
const
QString
&
name
)
{
m_statusLabel
->
setText
(
name
);
}
This diff is collapsed.
Click to expand it.
GUI/coregui/Views/SpecularDataWidgets/Plot1DCanvas.h
0 → 100644
+
52
−
0
View file @
82fdbde6
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file GUI/coregui/Views/SpecularDataWidgets/Plot1DCanvas.h
//! @brief Defines class Plot1DCanvas
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************** //
#ifndef PLOT1DCANVAS_H
#define PLOT1DCANVAS_H
#include
"SessionItemWidget.h"
class
FontScalingEvent
;
class
PlotStatusLabel
;
class
QCustomPlot
;
class
SpecularPlot
;
//! The Plot1DCanvas class contains SpecularPlotWithDataView
//! for specular data presentation, and provides
//! status string appearance.
class
BA_CORE_API_
Plot1DCanvas
:
public
SessionItemWidget
{
Q_OBJECT
public:
explicit
Plot1DCanvas
(
QWidget
*
parent
=
nullptr
);
void
setItem
(
SessionItem
*
specularDataItem
)
override
;
SpecularPlot
*
specularPlot
();
QCustomPlot
*
customPlot
();
void
setStatusLabelEnabled
(
bool
flag
);
public
slots
:
void
onStatusString
(
const
QString
&
name
);
private:
SpecularPlot
*
m_plot
;
FontScalingEvent
*
m_canvasEvent
;
PlotStatusLabel
*
m_statusLabel
;
};
#endif // PLOT1DCANVAS_H
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