Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MamboArchivingGUI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Control System
Tango controls archiving
MamboArchivingGUI
Commits
c48110d6
Commit
c48110d6
authored
5 months ago
by
Raphael GIRARDOT
Browse files
Options
Downloads
Patches
Plain Diff
restore X autoscale when there is some data on X (
TANGOARCH-938
)
parent
ae9dcbd7
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/fr/soleil/mambo/data/view/ViewConfiguration.java
+54
-0
54 additions, 0 deletions
...ain/java/fr/soleil/mambo/data/view/ViewConfiguration.java
with
54 additions
and
0 deletions
src/main/java/fr/soleil/mambo/data/view/ViewConfiguration.java
+
54
−
0
View file @
c48110d6
...
...
@@ -29,7 +29,9 @@ import fr.soleil.archiving.hdbtdb.api.tools.SamplingType;
import
fr.soleil.comete.definition.event.ChartViewerEvent
;
import
fr.soleil.comete.definition.listener.IChartViewerListener
;
import
fr.soleil.comete.definition.widget.IChartViewer
;
import
fr.soleil.comete.definition.widget.properties.AxisProperties
;
import
fr.soleil.comete.definition.widget.properties.ChartProperties
;
import
fr.soleil.comete.definition.widget.properties.PlotProperties
;
import
fr.soleil.comete.swing.Chart
;
import
fr.soleil.comete.tango.data.service.helper.TangoExceptionHelper
;
import
fr.soleil.lib.project.ObjectUtils
;
...
...
@@ -249,11 +251,63 @@ public class ViewConfiguration implements IConfiguration {
}
}
protected
boolean
isOnX
(
PlotProperties
properties
)
{
return
(
properties
!=
null
&&
properties
.
getAxisChoice
()
==
IChartViewer
.
X
);
}
protected
boolean
isOnX
(
ViewConfigurationAttributeProperties
attrProperties
)
{
boolean
hasX
=
false
;
if
(
attrProperties
!=
null
)
{
hasX
=
isOnX
(
attrProperties
.
getPlotProperties
());
}
return
hasX
;
}
public
void
configureChart
(
Chart
chart
)
{
if
(
chart
!=
null
)
{
cleanChart
(
chart
);
data
.
configureChart
(
chart
);
chart
.
setDataDirectory
(
Mambo
.
getPathToResources
());
// Chart is configured.
// Now check whether there is some data on X (TANGOARCH-938).
ViewConfigurationAttributes
attributes
=
this
.
attributes
;
Map
<
String
,
ExpressionAttribute
>
expressions
=
this
.
expressions
;
boolean
hasX
=
false
;
if
(
attributes
!=
null
)
{
Collection
<
ViewConfigurationAttribute
>
vcAttributes
=
attributes
.
getAttributeList
();
if
(
vcAttributes
!=
null
)
{
for
(
ViewConfigurationAttribute
attribute
:
vcAttributes
)
{
if
(
attribute
!=
null
)
{
hasX
=
isOnX
(
attribute
.
getProperties
());
if
(
hasX
)
{
break
;
}
}
}
}
}
if
((!
hasX
)
&&
(
expressions
!=
null
))
{
for
(
ExpressionAttribute
expr
:
expressions
.
values
())
{
if
(
expr
!=
null
)
{
hasX
=
isOnX
(
expr
.
getProperties
());
if
(
hasX
)
{
break
;
}
}
}
}
// If there is some data on X, restore X autoscale (TANGOARCH-938).
if
(
hasX
)
{
ChartProperties
chartProperties
=
data
.
getChartProperties
();
if
(
chartProperties
!=
null
)
{
AxisProperties
xProperties
=
chartProperties
.
getXAxisProperties
();
if
(
xProperties
!=
null
&&
xProperties
.
isAutoScale
())
{
if
(!
chart
.
isAutoScale
(
IChartViewer
.
X
))
{
chart
.
setAutoScale
(
true
,
IChartViewer
.
X
);
}
}
}
}
chart
.
addChartViewerListener
(
chartListener
);
}
}
...
...
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