Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ICBM
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
detectors
DSSC
ICBM
Commits
e172202d
Commit
e172202d
authored
2 months ago
by
Cyril Danilevski
Browse files
Options
Downloads
Patches
Plain Diff
Clarify channel ramp status
parent
dd33d35c
No related branches found
No related tags found
No related merge requests found
Pipeline
#162615
passed
2 months ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mpod.cpp
+12
-12
12 additions, 12 deletions
mpod.cpp
mpod.hpp
+4
-4
4 additions, 4 deletions
mpod.hpp
with
16 additions
and
16 deletions
mpod.cpp
+
12
−
12
View file @
e172202d
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
MPOD
::
MPOD
()
{
MPOD
::
MPOD
()
{
bool
_on
=
false
;
bool
_on
=
false
;
bool
_
u
p
=
false
;
bool
_
rampingU
p
=
false
;
bool
_
d
own
=
false
;
bool
_
rampingD
own
=
false
;
float
_measurementSenseVoltage
=
0
;
float
_measurementSenseVoltage
=
0
;
float
_measurementCurrent
=
0
;
float
_measurementCurrent
=
0
;
float
_voltage
=
0
;
float
_voltage
=
0
;
...
@@ -63,8 +63,8 @@ bool MPOD::message(const SNMP::Message *message) {
...
@@ -63,8 +63,8 @@ bool MPOD::message(const SNMP::Message *message) {
// OUTPUTSTATUS is defined in MIB as BITS but encoded as OCTETSTRING by MPOD
// OUTPUTSTATUS is defined in MIB as BITS but encoded as OCTETSTRING by MPOD
OctetStringBER
*
status
=
static_cast
<
OctetStringBER
*>
(
varbind
->
getValue
());
OctetStringBER
*
status
=
static_cast
<
OctetStringBER
*>
(
varbind
->
getValue
());
_on
=
status
->
getBit
(
0
);
_on
=
status
->
getBit
(
0
);
_
u
p
=
status
->
getBit
(
11
);
_
rampingU
p
=
status
->
getBit
(
11
);
_
d
own
=
status
->
getBit
(
12
);
_
rampingD
own
=
status
->
getBit
(
12
);
}
}
found
++
;
found
++
;
break
;
break
;
...
@@ -108,9 +108,9 @@ bool MPOD::message(const SNMP::Message *message) {
...
@@ -108,9 +108,9 @@ bool MPOD::message(const SNMP::Message *message) {
bool
MPOD
::
isOn
()
const
{
return
_on
;
}
bool
MPOD
::
isOn
()
const
{
return
_on
;
}
bool
MPOD
::
isUp
()
const
{
return
_
u
p
;
}
bool
MPOD
::
is
Ramping
Up
()
const
{
return
_
rampingU
p
;
}
bool
MPOD
::
isDown
()
const
{
return
_
d
own
;
}
bool
MPOD
::
is
Ramping
Down
()
const
{
return
_
rampingD
own
;
}
float
MPOD
::
getMeasurementSenseVoltage
()
const
{
return
_measurementSenseVoltage
;
}
float
MPOD
::
getMeasurementSenseVoltage
()
const
{
return
_measurementSenseVoltage
;
}
...
@@ -139,8 +139,8 @@ String MPOD::toJSON() {
...
@@ -139,8 +139,8 @@ String MPOD::toJSON() {
String
json
=
"
\"
status
\"
:{
\n
"
;
String
json
=
"
\"
status
\"
:{
\n
"
;
json
+=
"
\"
channel
\"
:"
+
String
(
getChannel
())
+
","
;
json
+=
"
\"
channel
\"
:"
+
String
(
getChannel
())
+
","
;
json
+=
"
\"
is_on
\"
:"
+
String
(
isOn
())
+
","
;
json
+=
"
\"
is_on
\"
:"
+
String
(
isOn
())
+
","
;
json
+=
"
\"
is
_up
\"
:"
+
String
(
isUp
())
+
","
;
json
+=
"
\"
ramping
_up
\"
:"
+
String
(
is
Ramping
Up
())
+
","
;
json
+=
"
\"
is
_down
\"
:"
+
String
(
isDown
())
+
","
;
json
+=
"
\"
ramping
_down
\"
:"
+
String
(
is
Ramping
Down
())
+
","
;
json
+=
"
\"
sense_voltage
\"
:"
+
String
(
getMeasurementSenseVoltage
())
+
","
;
json
+=
"
\"
sense_voltage
\"
:"
+
String
(
getMeasurementSenseVoltage
())
+
","
;
json
+=
"
\"
set_voltage
\"
:"
+
String
(
getVoltage
())
+
","
;
json
+=
"
\"
set_voltage
\"
:"
+
String
(
getVoltage
())
+
","
;
json
+=
"
\"
sense_current
\"
:"
+
String
(
getMeasurementCurrent
())
+
","
;
json
+=
"
\"
sense_current
\"
:"
+
String
(
getMeasurementCurrent
())
+
","
;
...
@@ -162,11 +162,11 @@ void onMessage(const SNMP::Message *message, const IPAddress remote, const uint1
...
@@ -162,11 +162,11 @@ void onMessage(const SNMP::Message *message, const IPAddress remote, const uint1
Serial
.
print
(
"MPOD status: "
);
Serial
.
print
(
"MPOD status: "
);
Serial
.
print
(
mpod
.
getChannel
());
Serial
.
print
(
mpod
.
getChannel
());
Serial
.
print
(
mpod
.
isOn
()
?
" on"
:
" off"
);
Serial
.
print
(
mpod
.
isOn
()
?
" on"
:
" off"
);
if
(
mpod
.
isUp
())
{
if
(
mpod
.
is
Ramping
Up
())
{
Serial
.
print
(
" up"
);
Serial
.
print
(
"
ramping
up"
);
}
}
if
(
mpod
.
isDown
())
{
if
(
mpod
.
is
Ramping
Down
())
{
Serial
.
print
(
" down"
);
Serial
.
print
(
"
ramping
down"
);
}
}
Serial
.
println
();
Serial
.
println
();
Serial
.
print
(
"HV voltage "
);
Serial
.
print
(
"HV voltage "
);
...
...
This diff is collapsed.
Click to expand it.
mpod.hpp
+
4
−
4
View file @
e172202d
...
@@ -56,8 +56,8 @@ class MPOD {
...
@@ -56,8 +56,8 @@ class MPOD {
SNMP
::
Message
*
output
(
const
uint16_t
,
const
bool
);
SNMP
::
Message
*
output
(
const
uint16_t
,
const
bool
);
bool
message
(
const
SNMP
::
Message
*
);
bool
message
(
const
SNMP
::
Message
*
);
bool
isOn
()
const
;
bool
isOn
()
const
;
bool
isUp
()
const
;
bool
is
Ramping
Up
()
const
;
bool
isDown
()
const
;
bool
is
Ramping
Down
()
const
;
float
getMeasurementSenseVoltage
()
const
;
float
getMeasurementSenseVoltage
()
const
;
float
getMeasurementCurrent
()
const
;
float
getMeasurementCurrent
()
const
;
float
getVoltage
()
const
;
float
getVoltage
()
const
;
...
@@ -71,8 +71,8 @@ class MPOD {
...
@@ -71,8 +71,8 @@ class MPOD {
float
getFloatFromVarBind
(
const
VarBind
*
);
float
getFloatFromVarBind
(
const
VarBind
*
);
uint16_t
_channel
;
uint16_t
_channel
;
bool
_on
;
bool
_on
;
bool
_
u
p
;
bool
_
rampingU
p
;
bool
_
d
own
;
bool
_
rampingD
own
;
float
_measurementSenseVoltage
;
float
_measurementSenseVoltage
;
float
_measurementCurrent
;
float
_measurementCurrent
;
float
_voltage
;
float
_voltage
;
...
...
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