Skip to content

Commit

Permalink
qsrv: avoid sending 0 precision w/ integer value
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Nov 20, 2023
1 parent 6291b0c commit 382dd29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 3 additions & 4 deletions ioc/iocsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,6 @@ void getProperties(dbChannel* pChannel, db_field_log *pfl, Value& node)
if(auto units = node["display.units"])
units = meta.units;
}
if(options & DBR_PRECISION) {
// TODO: add in nt.cpp?
}
if(options & DBR_ENUM_STRS) {
if(auto choices = node["value.choices"]) {
shared_array<std::string> arr(meta.no_str);
Expand All @@ -331,7 +328,9 @@ void getProperties(dbChannel* pChannel, db_field_log *pfl, Value& node)
if(options & DBR_GR_DOUBLE) {
dlL = meta.lower_disp_limit;
node["display.limitHigh"] = meta.upper_disp_limit;
node["display.precision"] = meta.precision.dp;
if(options & DBR_PRECISION) {
node["display.precision"] = int32_t(meta.precision.dp);
}
}
if(options & DBR_CTRL_DOUBLE) {
node["control.limitLow"] = meta.lower_ctrl_limit;
Expand Down
3 changes: 0 additions & 3 deletions test/testqsingle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ void testGetScalar()
"display.limitHigh int32_t = 0\n"
"display.description string = \"\"\n"
"display.units string = \"\"\n"
"display.precision int32_t = 0\n"
"display.form.index int32_t = 0\n"
"display.form.choices string[] = {7}[\"Default\", \"String\", \"Binary\", \"Decimal\", \"Hex\", \"Exponential\", \"Engineering\"]\n"
"control.limitLow int32_t = 0\n"
Expand Down Expand Up @@ -404,7 +403,6 @@ void testGetArray()
"display.limitHigh int32_t = 0\n"
"display.description string = \"\"\n"
"display.units string = \"\"\n"
"display.precision int32_t = 0\n"
"display.form.index int32_t = 0\n"
"display.form.choices string[] = {7}[\"Default\", \"String\", \"Binary\", \"Decimal\", \"Hex\", \"Exponential\", \"Engineering\"]\n"
"control.limitLow int32_t = 0\n"
Expand Down Expand Up @@ -536,7 +534,6 @@ void testGetPut64()
"display.limitHigh uint64_t = 0\n"
"display.description string = \"\"\n"
"display.units string = \"\"\n"
"display.precision int32_t = 0\n"
"display.form.index int32_t = 0\n"
"display.form.choices string[] = {7}[\"Default\", \"String\", \"Binary\", \"Decimal\", \"Hex\", \"Exponential\", \"Engineering\"]\n"
"control.limitLow uint64_t = 0\n"
Expand Down

0 comments on commit 382dd29

Please sign in to comment.