From 7b87f3b9b609ee4b070ef2efe0f78e158bd701f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Tue, 4 Dec 2018 10:47:39 +0100 Subject: [PATCH] motorRecord: Handle ACCS != 0.0 in init_record When a database wants to use ACCS from the start, when the record is loaded into the IOC, the init_record() function needs to look at it. The new way is to set ACCS != 0.0 and ACCL == 0.0 and then ACCS takes over. The compatible (call it old ?) way is to have ACCS == 0.0, and then ACCL is used. --- motorApp/MotorSrc/motorRecord.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/motorApp/MotorSrc/motorRecord.cc b/motorApp/MotorSrc/motorRecord.cc index 4ddbeba4..8ae0e92b 100644 --- a/motorApp/MotorSrc/motorRecord.cc +++ b/motorApp/MotorSrc/motorRecord.cc @@ -3999,6 +3999,14 @@ static void check_speed_and_resolution(motorRecord * pmr) db_post_events(pmr, &pmr->sbak, DBE_VAL_LOG); db_post_events(pmr, &pmr->bvel, DBE_VAL_LOG); + if (pmr->accs && !pmr->accl) + { + /* ACCL == 0.0, ACCS is != 0.0 -> Use ACCS + This is a (possible) new way to configure a database. + Existing Db files will have ACCS == 0.0 and this + is backwards compatibleamd behaves as before */ + updateACCLfromACCS(pmr); + } /* Sanity check on acceleration time. */ if (pmr->accl == 0.0) {