Skip to content

Commit

Permalink
ioc: fill in display.precision
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Aug 22, 2023
1 parent 09a3f01 commit b0c7c8f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions ioc/iocsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ 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_CTRL_DOUBLE) {
node["control.limitLow"] = meta.lower_ctrl_limit;
Expand Down
4 changes: 4 additions & 0 deletions test/testqgroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ void testIQ()
"I.display.limitHigh double = 0\n"
"I.display.description string = \"\"\n"
"I.display.units string = \"\"\n"
"I.display.precision int32_t = 0\n"
"I.display.form.index int32_t = 6\n"
"I.display.form.choices string[] = {7}[\"Default\", \"String\", \"Binary\", \"Decimal\", \"Hex\", ...]\n"
"I.control.limitLow double = 0\n"
Expand All @@ -571,6 +572,7 @@ void testIQ()
"Q.display.limitHigh double = 0\n"
"Q.display.description string = \"\"\n"
"Q.display.units string = \"\"\n"
"Q.display.precision int32_t = 0\n"
"Q.display.form.index int32_t = 6\n"
"Q.display.form.choices string[] = {7}[\"Default\", \"String\", \"Binary\", \"Decimal\", \"Hex\", ...]\n"
"Q.control.limitLow double = 0\n"
Expand All @@ -595,6 +597,7 @@ void testIQ()
"I.display.limitHigh double = 0\n"
"I.display.description string = \"\"\n"
"I.display.units string = \"\"\n"
"I.display.precision int32_t = 0\n"
"I.display.form.index int32_t = 6\n"
"I.display.form.choices string[] = {7}[\"Default\", \"String\", \"Binary\", \"Decimal\", \"Hex\", ...]\n"
"I.control.limitLow double = 0\n"
Expand All @@ -609,6 +612,7 @@ void testIQ()
"Q.display.limitHigh double = 0\n"
"Q.display.description string = \"\"\n"
"Q.display.units string = \"\"\n"
"Q.display.precision int32_t = 0\n"
"Q.display.form.index int32_t = 6\n"
"Q.display.form.choices string[] = {7}[\"Default\", \"String\", \"Binary\", \"Decimal\", \"Hex\", ...]\n"
"Q.control.limitLow double = 0\n"
Expand Down
9 changes: 8 additions & 1 deletion test/testqsingle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void testGetScalar()
" double limitHigh = 100\n"
" string description = \"Analog input\"\n"
" string units = \"arb\"\n"
" int32_t precision = 0\n"
" int32_t precision = 1\n"
" struct \"enum_t\" {\n"
" int32_t index = 6\n"
" string[] choices = {7}[\"Default\", \"String\", \"Binary\", \"Decimal\", \"Hex\", \"Exponential\", \"Engineering\"]\n"
Expand Down Expand Up @@ -131,6 +131,7 @@ void testGetScalar()
"display.limitHigh double = 100\n"
"display.description string = \"Analog input\"\n"
"display.units string = \"arb\"\n"
"display.precision int32_t = 1\n"
"display.form.index int32_t = 6\n"
"display.form.choices string[] = {7}[\"Default\", \"String\", \"Binary\", \"Decimal\", \"Hex\", \"Exponential\", \"Engineering\"]\n"
"control.limitLow double = 0\n"
Expand Down Expand Up @@ -288,6 +289,7 @@ 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 @@ -402,6 +404,7 @@ 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 @@ -533,6 +536,7 @@ 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 Expand Up @@ -701,6 +705,7 @@ void testMonitorAI(TestClient& ctxt)
"display.limitHigh double = 100\n"
"display.description string = \"testing\"\n"
"display.units string = \"arb\"\n"
"display.precision int32_t = 1\n"
"display.form.index int32_t = 6\n"
"display.form.choices string[] = {7}[\"Default\", \"String\", \"Binary\", \"Decimal\", \"Hex\", \"Exponential\", \"Engineering\"]\n"
"control.limitLow double = 0\n"
Expand Down Expand Up @@ -749,6 +754,7 @@ void testMonitorAI(TestClient& ctxt)
"display.limitHigh double = 100\n"
"display.description string = \"testing\"\n"
"display.units string = \"arb\"\n"
"display.precision int32_t = 1\n"
"control.limitLow double = 0\n"
"control.limitHigh double = 100\n"
"valueAlarm.lowAlarmLimit double = 0\n"
Expand Down Expand Up @@ -828,6 +834,7 @@ void testMonitorAIFilt(TestClient& ctxt)
"display.limitHigh double = 100\n"
"display.description string = \"testing\"\n"
"display.units string = \"arb\"\n"
"display.precision int32_t = 1\n"
"display.form.index int32_t = 6\n"
"display.form.choices string[] = {7}[\"Default\", \"String\", \"Binary\", \"Decimal\", \"Hex\", \"Exponential\", \"Engineering\"]\n"
"control.limitLow double = 0\n"
Expand Down
1 change: 1 addition & 0 deletions test/testqsingle.db
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
record(ai, "test:ai") {
field(DESC, "Analog input")
field(EGU , "arb")
field(PREC, "1")
field(HHSV, "INVALID")
field(HSV, "MAJOR")
field(HIHI, "100")
Expand Down

0 comments on commit b0c7c8f

Please sign in to comment.