Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F28202962
relationChecker.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
relationChecker.cpp
View Options
#include
"relationChecker.h"
#include
<stdio.h>
//DATE18
float
deviationValueReferenceValue
(
float
sampleValue
,
float
historyValue
)
{
float
diff
;
diff
=
historyValue
-
sampleValue
;
if
(
diff
==
0
)
{
return
0
;
}
else
{
diff
=
diff
/
sampleValue
;
if
(
diff
<
0
)
diff
=
diff
*
(
-1
);
return
(
diff
);
}
}
bool
valueIsRelatedToReferenceValue
(
float
referenceValue
,
float
value
,
float
threshold
)
{
float
diff
;
if
(
referenceValue
>
value
)
diff
=
referenceValue
-
value
;
else
diff
=
value
-
referenceValue
;
//printf("referenceValue %f, value %f, diff %f, threshold %f\n", referenceValue, value, diff, threshold);
if
(
diff
==
0
||
(
diff
/
referenceValue
<=
threshold
))
{
return
true
;
}
printf
(
"
\n
Related Calculation:
\n
Average: %f
\n
ActualValue: %f
\n
Diff: %f
\n
deviation: %f
\n
threshold: %f
\n
"
,
referenceValue
,
value
,
diff
,
diff
/
referenceValue
,
threshold
);
return
false
;
}
bool
valueIsRelatedToReferenceValueOrBetweenMinAndMax
(
float
referenceValue
,
float
minimumValue
,
float
maximumValue
,
float
value
,
float
threshold
)
{
if
(
value
>=
minimumValue
&&
value
<=
maximumValue
)
{
return
true
;
}
return
valueIsRelatedToReferenceValue
(
referenceValue
,
value
,
threshold
);
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Fri, Nov 20, 9:45 PM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
424481
Default Alt Text
relationChecker.cpp (1 KB)
Attached To
Mode
R20 SoC_Rosa_repo
Attached
Detach File
Event Timeline