Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
3ec6ad95
Commit
3ec6ad95
authored
Apr 17, 2019
by
Michael Ott
Browse files
Only allow units to be configured UnitConv knows about
parent
72ebad22
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/dcdbconfig/sensoraction.cpp
View file @
3ec6ad95
...
...
@@ -32,6 +32,7 @@
#include <cinttypes>
#include <dcdb/sensorconfig.h>
#include <dcdb/unitconv.h>
#include "cassandra.h"
#include "sensoraction.h"
...
...
@@ -375,7 +376,11 @@ void SensorAction::doUnit(const char* publicName, const char* unit)
switch
(
err
)
{
case
DCDB
::
SC_OK
:
sensorConfig
.
setSensorUnit
(
publicName
,
unit
);
if
(
DCDB
::
UnitConv
::
fromString
(
unit
)
!=
DCDB
::
Unit_None
)
{
sensorConfig
.
setSensorUnit
(
publicName
,
unit
);
}
else
{
std
::
cout
<<
"Unknown unit: "
<<
unit
<<
std
::
endl
;
}
break
;
case
DCDB
::
SC_UNKNOWNSENSOR
:
std
::
cout
<<
"Unknown sensor name: "
<<
publicName
<<
std
::
endl
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment