Skip to content

Commit aaef0b8

Browse files
authored
Merge pull request #17 from epics-modules/issue16
Allow the vs record's precision to be specified by the PREC field
2 parents caca4fc + 7b19578 commit aaef0b8

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

vacApp/Db/vs_settings.req

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
$(P)$(GAUGE).PREC
2+

vacApp/src/vsRecord.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,19 +270,20 @@ static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble * pcd)
270270
******************************************************************************/
271271
static long get_precision(const DBADDR *paddr, long *precision)
272272
{
273+
vsRecord *pvs = (vsRecord *)paddr->precord;
273274
int fieldIndex = dbGetFieldIndex(paddr);
274275

276+
*precision = pvs->prec;
275277
if (fieldIndex == vsRecordVAL || fieldIndex == vsRecordPRES
276278
|| fieldIndex == vsRecordCGAP || fieldIndex == vsRecordCGBP
277279
|| fieldIndex == vsRecordSP1R || fieldIndex == vsRecordSP2R
278280
|| fieldIndex == vsRecordSP3R || fieldIndex == vsRecordSP4R) {
279-
*precision = 1;
280281
return 0;
281282
}
282283
if (fieldIndex == vsRecordLPRS
283284
|| fieldIndex == vsRecordLCAP
284285
|| fieldIndex == vsRecordLCBP) {
285-
*precision = 2;
286+
*precision = pvs->prec + 1;
286287
return 0;
287288
}
288289
*precision = 0;

vacApp/src/vsRecord.dbd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ recordtype(vs) {
3939
initial("5")
4040
interest(1)
4141
}
42+
field(PREC,DBF_SHORT) {
43+
prompt("Display Precision")
44+
promptgroup(GUI_DISPLAY)
45+
interest(1)
46+
initial("1")
47+
}
4248
field(IG1S,DBF_MENU) {
4349
prompt("Ion Gauge 1 Set")
4450
promptgroup(GUI_ALARMS)

0 commit comments

Comments
 (0)