Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
comete
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
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
Libraries
java
comete
Commits
1a8e6bd5
Commit
1a8e6bd5
authored
Apr 10, 2024
by
Raphael GIRARDOT
Browse files
Options
Downloads
Patches
Plain Diff
take account of double error margin
parent
3c431148
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
CometeSwing/src/main/java/fr/soleil/comete/swing/chart/util/ChartUtils.java
+9
-4
9 additions, 4 deletions
...in/java/fr/soleil/comete/swing/chart/util/ChartUtils.java
with
9 additions
and
4 deletions
CometeSwing/src/main/java/fr/soleil/comete/swing/chart/util/ChartUtils.java
+
9
−
4
View file @
1a8e6bd5
...
@@ -69,6 +69,7 @@ import fr.soleil.lib.project.file.FileUtils;
...
@@ -69,6 +69,7 @@ import fr.soleil.lib.project.file.FileUtils;
import
fr.soleil.lib.project.file.log.CsvLogFileWriter
;
import
fr.soleil.lib.project.file.log.CsvLogFileWriter
;
import
fr.soleil.lib.project.math.MathConst
;
import
fr.soleil.lib.project.math.MathConst
;
import
fr.soleil.lib.project.math.NumberArrayUtils
;
import
fr.soleil.lib.project.math.NumberArrayUtils
;
import
fr.soleil.lib.project.math.NumberUtils
;
import
fr.soleil.lib.project.resource.Utf8PropertyResourceBundle
;
import
fr.soleil.lib.project.resource.Utf8PropertyResourceBundle
;
import
fr.soleil.lib.project.swing.WindowSwingUtils
;
import
fr.soleil.lib.project.swing.WindowSwingUtils
;
...
@@ -208,11 +209,14 @@ public class ChartUtils implements CometeConstants {
...
@@ -208,11 +209,14 @@ public class ChartUtils implements CometeConstants {
String
formattedValue
;
String
formattedValue
;
if
(
Double
.
isNaN
(
valueToFormat
))
{
if
(
Double
.
isNaN
(
valueToFormat
))
{
formattedValue
=
NAN
;
formattedValue
=
NAN
;
}
else
if
(
Format
.
isNumberFormatOK
(
valueFormat
))
{
}
else
{
valueToFormat
=
NumberUtils
.
getDouble
(
valueToFormat
,
true
);
if
(
Format
.
isNumberFormatOK
(
valueFormat
))
{
formattedValue
=
Format
.
formatValue
(
valueToFormat
,
valueFormat
);
formattedValue
=
Format
.
formatValue
(
valueToFormat
,
valueFormat
);
}
else
{
}
else
{
formattedValue
=
null
;
formattedValue
=
null
;
}
}
}
if
((
formattedValue
==
null
)
||
(
formattedValue
.
trim
().
isEmpty
()))
{
if
((
formattedValue
==
null
)
||
(
formattedValue
.
trim
().
isEmpty
()))
{
// Round value to nearest multiple of precision
// Round value to nearest multiple of precision
if
(
precision
!=
0
)
{
if
(
precision
!=
0
)
{
...
@@ -223,6 +227,7 @@ public class ChartUtils implements CometeConstants {
...
@@ -223,6 +227,7 @@ public class ChartUtils implements CometeConstants {
// Find multiple
// Find multiple
double
i
=
Math
.
floor
(
0.5d
+
valueToFormat
/
precision
);
double
i
=
Math
.
floor
(
0.5d
+
valueToFormat
/
precision
);
valueToFormat
=
i
*
precision
;
valueToFormat
=
i
*
precision
;
valueToFormat
=
NumberUtils
.
getDouble
(
valueToFormat
,
true
);
if
(
isNegative
)
{
if
(
isNegative
)
{
valueToFormat
=
-
valueToFormat
;
valueToFormat
=
-
valueToFormat
;
}
}
...
@@ -235,7 +240,7 @@ public class ChartUtils implements CometeConstants {
...
@@ -235,7 +240,7 @@ public class ChartUtils implements CometeConstants {
formattedValue
=
toScientificInt
(
valueToFormat
);
formattedValue
=
toScientificInt
(
valueToFormat
);
break
;
break
;
case
IChartViewer
.
BININT_FORMAT
:
case
IChartViewer
.
BININT_FORMAT
:
formattedValue
=
Integer
.
toBinaryString
(
Double
.
valueOf
(
valueToFormat
)
.
intValue
())
;
formattedValue
=
Integer
.
toBinaryString
(
(
int
)
valueToFormat
);
break
;
break
;
case
IChartViewer
.
DECINT_FORMAT
:
case
IChartViewer
.
DECINT_FORMAT
:
case
IChartViewer
.
HEXINT_FORMAT
:
case
IChartViewer
.
HEXINT_FORMAT
:
...
...
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