mp49 / parker6k

EPICS support for the Parker 6K controller
1 stars 2 forks source link

‘setStringParam’ was not declared in this scope #2

Closed mark0n closed 9 years ago

mark0n commented 9 years ago

I'm running into problems compiling the code:

$ make
make -C ./configure install 
make[1]: Entering directory '/home/marko/work/stripperFoilPlatter/src/parker6k/configure'
perl /usr/lib/epics/bin/linux-x86_64-debug/makeMakefile.pl O.linux-x86_64-debug ../..
mkdir O.Common
make -C O.linux-x86_64-debug -f ../Makefile TOP=../.. T_A=linux-x86_64-debug install
make[2]: Entering directory '/home/marko/work/stripperFoilPlatter/src/parker6k/configure/O.linux-x86_64-debug'
perl /usr/lib/epics/bin/linux-x86_64-debug/convertRelease.pl checkRelease
make[2]: Leaving directory '/home/marko/work/stripperFoilPlatter/src/parker6k/configure/O.linux-x86_64-debug'
make[1]: Leaving directory '/home/marko/work/stripperFoilPlatter/src/parker6k/configure'
make -C ./parker6kApp install 
make[1]: Entering directory '/home/marko/work/stripperFoilPlatter/src/parker6k/parker6kApp'
make -C ./src install 
make[2]: Entering directory '/home/marko/work/stripperFoilPlatter/src/parker6k/parker6kApp/src'
perl /usr/lib/epics/bin/linux-x86_64-debug/makeMakefile.pl O.linux-x86_64-debug ../../..
mkdir O.Common
make -C O.linux-x86_64-debug -f ../Makefile TOP=../../.. T_A=linux-x86_64-debug install
make[3]: Entering directory '/home/marko/work/stripperFoilPlatter/src/parker6k/parker6kApp/src/O.linux-x86_64-debug'

/usr/bin/g++ -c  -D_POSIX_C_SOURCE=199506L -D_POSIX_THREADS -D_XOPEN_SOURCE=500           -D_X86_64_  -DUNIX  -D_BSD_SOURCE -Dlinux  -D_REENTRANT   -g   -Wall      -m64     -fPIC -MMD -I. -I../O.Common -I. -I.. -I../../../include/os/Linux -I../../../include -I/usr/lib/epics/include/os/Linux -I/usr/lib/epics/include -I/usr/lib/epics/include/os/Linux -I/usr/lib/epics/include  -I/home/marko/work/stripperFoilPlatter/src/asyn4-22/include  -I/home/marko/work/stripperFoilPlatter/src/motorR6-8-upstream/include -I/usr/lib/epics/include/os/Linux -I/usr/lib/epics/include       ../parker6kController.cpp 
../parker6kController.cpp: In member function ‘asynStatus p6kController::lowLevelWriteRead(const char*, char*)’:
../parker6kController.cpp:350:29: warning: argument to ‘sizeof’ in ‘void* memset(void*, int, size_t)’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
   memset(response, 0, sizeof(response));
                             ^
../parker6kController.cpp: In member function ‘virtual asynStatus p6kController::poll()’:
../parker6kController.cpp:859:11: warning: variable ‘nvals’ set but not used [-Wunused-but-set-variable]
   int32_t nvals = 0;
           ^
../parker6kController.cpp: In function ‘asynStatus p6kCreateController(const char*, const char*, int, int, int, int)’:
../parker6kController.cpp:1141:20: warning: variable ‘pp6kController’ set but not used [-Wunused-but-set-variable]
     p6kController *pp6kController
                    ^
../parker6kController.cpp: In function ‘asynStatus p6kCreateAxis(const char*, int)’:
../parker6kController.cpp:1158:12: warning: variable ‘pAxis’ set but not used [-Wunused-but-set-variable]
   p6kAxis *pAxis;
            ^
../parker6kController.cpp: In function ‘asynStatus p6kCreateAxes(const char*, int)’:
../parker6kController.cpp:1195:12: warning: variable ‘pAxis’ set but not used [-Wunused-but-set-variable]
   p6kAxis *pAxis;
            ^

/usr/bin/g++ -c  -D_POSIX_C_SOURCE=199506L -D_POSIX_THREADS -D_XOPEN_SOURCE=500           -D_X86_64_  -DUNIX  -D_BSD_SOURCE -Dlinux  -D_REENTRANT   -g   -Wall      -m64     -fPIC -MMD -I. -I../O.Common -I. -I.. -I../../../include/os/Linux -I../../../include -I/usr/lib/epics/include/os/Linux -I/usr/lib/epics/include -I/usr/lib/epics/include/os/Linux -I/usr/lib/epics/include  -I/home/marko/work/stripperFoilPlatter/src/asyn4-22/include  -I/home/marko/work/stripperFoilPlatter/src/motorR6-8-upstream/include -I/usr/lib/epics/include/os/Linux -I/usr/lib/epics/include       ../parker6kAxis.cpp 
../parker6kAxis.cpp: In constructor ‘p6kAxis::p6kAxis(p6kController*, int32_t)’:
../parker6kAxis.cpp:124:58: error: ‘setStringParam’ was not declared in this scope
   paramStatus = ((setStringParam(pC_->P6K_A_Command_, " ") == asynSuccess) && paramStatus);
                                                          ^
../parker6kAxis.cpp: In member function ‘virtual asynStatus p6kAxis::move(double, int32_t, double, double, double)’:
../parker6kAxis.cpp:433:51: error: ‘setStringParam’ was not declared in this scope
     setStringParam(pC_->P6K_A_MoveError_, response);
                                                   ^
../parker6kAxis.cpp:436:46: error: ‘setStringParam’ was not declared in this scope
     setStringParam(pC_->P6K_A_MoveError_, " ");
                                              ^
../parker6kAxis.cpp: In member function ‘asynStatus p6kAxis::autoDriveEnable()’:
../parker6kAxis.cpp:491:76: error: ‘setStringParam’ was not declared in this scope
       setStringParam(pC_->P6K_A_MoveError_, "ERROR: Failed to enable drive");
                                                                            ^
../parker6kAxis.cpp: In member function ‘virtual asynStatus p6kAxis::poll(bool*)’:
../parker6kAxis.cpp:834:70: error: ‘setStringParam’ was not declared in this scope
       setStringParam(pC_->P6K_A_Error_, "Problem reading axis status");
                                                                      ^
../parker6kAxis.cpp:838:39: error: ‘setStringParam’ was not declared in this scope
  setStringParam(pC_->P6K_A_Error_, " ");
                                       ^
../parker6kAxis.cpp: In member function ‘asynStatus p6kAxis::getAxisStatus(bool*)’:
../parker6kAxis.cpp:1016:55: error: ‘setStringParam’ was not declared in this scope
  setStringParam(pC_->P6K_A_Error_, "ERROR: High Limit");
                                                       ^
../parker6kAxis.cpp:1021:54: error: ‘setStringParam’ was not declared in this scope
  setStringParam(pC_->P6K_A_Error_, "ERROR: Low Limit");
                                                      ^
../parker6kAxis.cpp:1034:59: error: ‘setStringParam’ was not declared in this scope
  setStringParam(pC_->P6K_A_Error_, "ERROR: Stall Detected");
                                                           ^
../parker6kAxis.cpp:1078:57: error: ‘setStringParam’ was not declared in this scope
  setStringParam(pC_->P6K_A_Error_, "ERROR: Moved Failed");
                                                         ^
/etc/epics/configure/RULES_BUILD:209: recipe for target 'parker6kAxis.o' failed
make[3]: *** [parker6kAxis.o] Error 1
make[3]: Leaving directory '/home/marko/work/stripperFoilPlatter/src/parker6k/parker6kApp/src/O.linux-x86_64-debug'
/etc/epics/configure/RULES_ARCHS:63: recipe for target 'install.linux-x86_64-debug' failed
make[2]: *** [install.linux-x86_64-debug] Error 2
make[2]: Leaving directory '/home/marko/work/stripperFoilPlatter/src/parker6k/parker6kApp/src'
/etc/epics/configure/RULES_DIRS:70: recipe for target 'src.install' failed
make[1]: *** [src.install] Error 2
make[1]: Leaving directory '/home/marko/work/stripperFoilPlatter/src/parker6k/parker6kApp'
/etc/epics/configure/RULES_DIRS:70: recipe for target 'parker6kApp.install' failed
make: *** [parker6kApp.install] Error 2

Note that setIntegerParam works because it got inherited from class asynMotorAxis. I don't know if p6kAxis also (or instead?) needs to inherit from asynPortDriver...

mp49 commented 9 years ago

Hi Martin,

The setStringParam problem is my fault. I've been developing against a newer version of the motor module. The R6-8 (and R6-8-1, which is only a bug fix version) are too old for this driver. I've been told R6-9 should be out soon. The change required is to asynMotorAxis.h and .cpp:

[mkp@bl99-dassrv1 MotorSrc]$ git diff 7519318a947a94cfe4afece0ea6bfcbeda2b42ad fc0d5679a8f9eb92c411c97f8a182e6ecf4a9301
diff --git a/motorApp/MotorSrc/asynMotorAxis.cpp b/motorApp/MotorSrc/asynMotorAxis.cpp
index f83bf20..eacf63e 100644
--- a/motorApp/MotorSrc/asynMotorAxis.cpp
+++ b/motorApp/MotorSrc/asynMotorAxis.cpp
@@ -282,6 +282,16 @@ asynStatus asynMotorAxis::setDoubleParam(int function, double value)
   return pC_->setDoubleParam(axisNo_, function, value);
 }   

+/**
+  * Sets the value for a string for this axis in the parameter library.
+  * \param[in] function The function (parameter) number 
+  * \param[in] value Value to set */
+asynStatus asynMotorAxis::setStringParam(int function, const char *value)
+{
+  // Call the base class method
+  return pC_->setStringParam(axisNo_, function, value);
+}
+

 /** Calls the callbacks for any parameters that have changed for this axis in the parameter library.
diff --git a/motorApp/MotorSrc/asynMotorAxis.h b/motorApp/MotorSrc/asynMotorAxis.h
index 4b22e85..7cc2c62 100644
--- a/motorApp/MotorSrc/asynMotorAxis.h
+++ b/motorApp/MotorSrc/asynMotorAxis.h
@@ -25,6 +25,7 @@ class epicsShareFunc asynMotorAxis {

   virtual asynStatus setIntegerParam(int index, int value);
   virtual asynStatus setDoubleParam(int index, double value);
+  virtual asynStatus setStringParam(int index, const char *value);
   virtual void report(FILE *fp, int details);
   virtual asynStatus callParamCallbacks();

motor R6-9 will also contain a bug fix to asyn motor device support. Doing a set position was failing in some cases, due to the encoder ratio not always being set properly.

I also see some 'set but not used' warnings in the above printout. I've fixed those. I suspect you saw a few similar warnings from a lot of the motor support module?

Are you able to apply the patch to asynMotorAxis? If not, I can modify this driver to work with motor 6-8.