Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
BensikinArchivingGUI
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
BensikinArchivingGUI
Commits
55ed8124
Commit
55ed8124
authored
3 years ago
by
Raphael GIRARDOT
Committed by
Gwenaelle ABEILLE
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Delta value calculation error bug correction (
TANGOARCH-730
)
parent
14fd0c91
No related branches found
No related tags found
1 merge request
!2
Delta value calculation error bug correction (TANGOARCH-730)
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/fr/soleil/bensikin/data/snapshot/SnapshotAttributeDeltaValue.java
+26
-27
26 additions, 27 deletions
...l/bensikin/data/snapshot/SnapshotAttributeDeltaValue.java
with
26 additions
and
27 deletions
src/main/java/fr/soleil/bensikin/data/snapshot/SnapshotAttributeDeltaValue.java
+
26
−
27
View file @
55ed8124
...
...
@@ -69,6 +69,8 @@ import fr.soleil.lib.project.math.NumberArrayUtils;
*/
public
class
SnapshotAttributeDeltaValue
extends
SnapshotAttributeValue
{
private
static
final
String
NULL
=
"null"
;
/**
* Builds a SnapshotAttributeDeltaValue from the difference between a read
* value and a write value.
...
...
@@ -85,7 +87,6 @@ public class SnapshotAttributeDeltaValue extends SnapshotAttributeValue {
public
SnapshotAttributeDeltaValue
(
SnapshotAttributeWriteValue
writeValue
,
SnapshotAttributeReadValue
readValue
,
boolean
manageAllTypes
)
{
super
(
writeValue
.
getDataFormat
(),
writeValue
.
getDataType
(),
null
,
null
);
Object
deltaValue
=
getDeltaValue
(
writeValue
,
readValue
,
manageAllTypes
);
if
(
readValue
==
null
||
writeValue
==
null
)
{
setNotApplicable
(
true
);
...
...
@@ -102,11 +103,9 @@ public class SnapshotAttributeDeltaValue extends SnapshotAttributeValue {
if
(
value
==
null
)
{
setNotApplicable
(
true
);
}
if
((
value
instanceof
String
)
||
(
value
instanceof
String
[]))
{
setDataType
(
TangoConst
.
Tango_DEV_STRING
);
}
this
.
setValue
(
value
,
nullElements
);
}
...
...
@@ -124,7 +123,7 @@ public class SnapshotAttributeDeltaValue extends SnapshotAttributeValue {
private
Object
getDeltaValue
(
SnapshotAttributeWriteValue
writeValue
,
SnapshotAttributeReadValue
readValue
,
boolean
manageAllTypes
)
{
switch
(
this
.
dataFormat
)
{
switch
(
dataFormat
)
{
case
SCALAR_DATA_FORMAT:
return
getScalarDeltaValue
(
writeValue
,
readValue
,
manageAllTypes
);
...
...
@@ -172,13 +171,13 @@ public class SnapshotAttributeDeltaValue extends SnapshotAttributeValue {
Boolean
nullWrite
=
(
Boolean
)
writeValue
.
getNullElements
();
nullElements
=
Boolean
.
valueOf
(((
nullRead
!=
null
)
&&
nullRead
.
booleanValue
())
||
((
nullWrite
!=
null
)
&&
nullWrite
.
booleanValue
()));
Object
write
=
writeValue
.
getScalarValue
(),
read
=
write
Value
.
getScalarValue
();
Object
write
=
writeValue
.
getScalarValue
(),
read
=
read
Value
.
getScalarValue
();
switch
(
this
.
getDataType
())
{
case
TangoConst
.
Tango_DEV_USHORT
:
case
TangoConst
.
Tango_DEV_SHORT
:
try
{
Short
writeDouble
=
(
Short
)
write
;
Short
readDouble
=
(
Short
)
read
;
Number
writeDouble
=
(
Number
)
write
;
Number
readDouble
=
(
Number
)
read
;
if
(
writeDouble
==
null
||
readDouble
==
null
)
{
nullElements
=
Boolean
.
FALSE
;
if
(
manageAllTypes
)
{
...
...
@@ -198,11 +197,11 @@ public class SnapshotAttributeDeltaValue extends SnapshotAttributeValue {
// a file
String
writeDouble_s
=
String
.
valueOf
(
write
);
String
readDouble_s
=
String
.
valueOf
(
read
);
if
(
"null"
.
equals
(
writeDouble_s
)
||
writeDouble_s
.
isEmpty
()
||
"null"
.
equals
(
readDouble_s
)
if
(
NULL
.
equals
(
writeDouble_s
)
||
writeDouble_s
.
isEmpty
()
||
NULL
.
equals
(
readDouble_s
)
||
readDouble_s
.
isEmpty
())
{
nullElements
=
Boolean
.
FALSE
;
if
(
manageAllTypes
)
{
if
(
"null"
.
equals
(
writeDouble_s
)
&&
"null"
.
equals
(
readDouble_s
))
{
if
(
NULL
.
equals
(
writeDouble_s
)
&&
NULL
.
equals
(
readDouble_s
))
{
ret
=
Messages
.
getMessage
(
"SNAPSHOT_COMPARE_VALUE_SAME"
);
}
else
if
(
writeDouble_s
.
isEmpty
()
&&
readDouble_s
.
isEmpty
())
{
ret
=
Messages
.
getMessage
(
"SNAPSHOT_COMPARE_VALUE_SAME"
);
...
...
@@ -228,8 +227,8 @@ public class SnapshotAttributeDeltaValue extends SnapshotAttributeValue {
// --------------------
case
TangoConst
.
Tango_DEV_DOUBLE
:
try
{
Double
writeDouble
=
(
Double
)
write
;
Double
readDouble
=
(
Double
)
read
;
Number
writeDouble
=
(
Number
)
write
;
Number
readDouble
=
(
Number
)
read
;
if
(
writeDouble
==
null
||
readDouble
==
null
)
{
nullElements
=
Boolean
.
FALSE
;
if
(
manageAllTypes
)
{
...
...
@@ -248,11 +247,11 @@ public class SnapshotAttributeDeltaValue extends SnapshotAttributeValue {
// happens when the read/write values are String loaded from a file
String
writeDouble_s
=
String
.
valueOf
(
write
);
String
readDouble_s
=
String
.
valueOf
(
read
);
if
(
"null"
.
equals
(
writeDouble_s
)
||
writeDouble_s
.
isEmpty
()
||
"null"
.
equals
(
readDouble_s
)
if
(
NULL
.
equals
(
writeDouble_s
)
||
writeDouble_s
.
isEmpty
()
||
NULL
.
equals
(
readDouble_s
)
||
readDouble_s
.
isEmpty
())
{
nullElements
=
Boolean
.
FALSE
;
if
(
manageAllTypes
)
{
if
(
"null"
.
equals
(
writeDouble_s
)
&&
"null"
.
equals
(
readDouble_s
))
{
if
(
NULL
.
equals
(
writeDouble_s
)
&&
NULL
.
equals
(
readDouble_s
))
{
ret
=
Messages
.
getMessage
(
"SNAPSHOT_COMPARE_VALUE_SAME"
);
}
else
if
(
writeDouble_s
.
isEmpty
()
&&
readDouble_s
.
isEmpty
())
{
ret
=
Messages
.
getMessage
(
"SNAPSHOT_COMPARE_VALUE_SAME"
);
...
...
@@ -273,8 +272,8 @@ public class SnapshotAttributeDeltaValue extends SnapshotAttributeValue {
case
TangoConst
.
Tango_DEV_ULONG
:
case
TangoConst
.
Tango_DEV_LONG
:
try
{
Integ
er
writeLong
=
(
Integ
er
)
write
;
Integ
er
readLong
=
(
Integ
er
)
read
;
Numb
er
writeLong
=
(
Numb
er
)
write
;
Numb
er
readLong
=
(
Numb
er
)
read
;
if
(
writeLong
==
null
||
readLong
==
null
)
{
nullElements
=
Boolean
.
FALSE
;
if
(
manageAllTypes
)
{
...
...
@@ -293,11 +292,11 @@ public class SnapshotAttributeDeltaValue extends SnapshotAttributeValue {
// happens when the read/write values are String loaded from a file
String
writeLong_s
=
String
.
valueOf
(
write
);
String
readLong_s
=
String
.
valueOf
(
read
);
if
(
"null"
.
equals
(
writeLong_s
)
||
writeLong_s
.
isEmpty
()
||
"null"
.
equals
(
readLong_s
)
if
(
NULL
.
equals
(
writeLong_s
)
||
writeLong_s
.
isEmpty
()
||
NULL
.
equals
(
readLong_s
)
||
readLong_s
.
isEmpty
())
{
nullElements
=
Boolean
.
FALSE
;
if
(
manageAllTypes
)
{
if
(
"null"
.
equals
(
writeLong_s
)
&&
"null"
.
equals
(
readLong_s
))
{
if
(
NULL
.
equals
(
writeLong_s
)
&&
NULL
.
equals
(
readLong_s
))
{
ret
=
Messages
.
getMessage
(
"SNAPSHOT_COMPARE_VALUE_SAME"
);
}
else
if
(
writeLong_s
.
isEmpty
()
&&
readLong_s
.
isEmpty
())
{
ret
=
Messages
.
getMessage
(
"SNAPSHOT_COMPARE_VALUE_SAME"
);
...
...
@@ -317,8 +316,8 @@ public class SnapshotAttributeDeltaValue extends SnapshotAttributeValue {
break
;
case
TangoConst
.
Tango_DEV_FLOAT
:
try
{
Float
writeFloat
=
(
Float
)
write
;
Float
readFloat
=
(
Float
)
read
;
Number
writeFloat
=
(
Number
)
write
;
Number
readFloat
=
(
Number
)
read
;
if
(
writeFloat
==
null
||
readFloat
==
null
)
{
nullElements
=
Boolean
.
FALSE
;
if
(
manageAllTypes
)
{
...
...
@@ -337,11 +336,11 @@ public class SnapshotAttributeDeltaValue extends SnapshotAttributeValue {
// happens when the read/write values are String loaded from a file
String
writeFloat_s
=
String
.
valueOf
(
write
);
String
readFloat_s
=
String
.
valueOf
(
read
);
if
(
"null"
.
equals
(
writeFloat_s
)
||
writeFloat_s
.
isEmpty
()
||
"null"
.
equals
(
readFloat_s
)
if
(
NULL
.
equals
(
writeFloat_s
)
||
writeFloat_s
.
isEmpty
()
||
NULL
.
equals
(
readFloat_s
)
||
readFloat_s
.
isEmpty
())
{
nullElements
=
Boolean
.
FALSE
;
if
(
manageAllTypes
)
{
if
(
"null"
.
equals
(
writeFloat_s
)
&&
"null"
.
equals
(
readFloat_s
))
{
if
(
NULL
.
equals
(
writeFloat_s
)
&&
NULL
.
equals
(
readFloat_s
))
{
ret
=
Messages
.
getMessage
(
"SNAPSHOT_COMPARE_VALUE_SAME"
);
}
else
if
(
writeFloat_s
.
isEmpty
()
&&
readFloat_s
.
isEmpty
())
{
ret
=
Messages
.
getMessage
(
"SNAPSHOT_COMPARE_VALUE_SAME"
);
...
...
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