Skip to content

EPICS Code Debugging

Javier Lührs edited this page Jun 21, 2018 · 5 revisions

Introduction

The package that deals with EPICS connections in Seqexec is edu.gemini.epics.acm. This package uses epics-service, provided by GIAPI. The actual EPICS network protocol is provided by CAJ (Channel Access for Java), which is used by epics-service. CAJ is in turn an implementation of JCA (Java Channel Access).

The JCA and CAJ classes are provided by two JAR files. GIAPI uses a copy of the files stored in our own repository, under the group names edu.gemini.external.osgi.com.cosylab.epics.caj and edu.gemini.external.osgi.com.cosylab.epics.jca. The GIAPI packages themselves are accessed by ocs3 through the same repository.

Build Environment for Debugging CAJ

The way the packages are accessed makes difficult to implement changes to debug a problem that involves CAJ. Here there is the procedure to create a build environment that involves using a local repository.

Build JCA-CAJ

The latest version of JCA, available in Github, integrates CAJ in the same package.

  • Retrieve the JCA code.
    git clone https://github.com/epics-base/jca
    cd jca
    
  • Build the JCA package locally.
    mvn install
    

That procedure will put the JCA jar file in the local Maven repository, usually located in ~/.m2/repository

Build GIAPI

  • First, retrieve the code
    svn checkout http://source.gemini.edu/software/giapi/giapi-osgi/branches/gmp-ng giapi
    cd giapi
    
  • Edit the POM files to use the local copy of JCA-CAJ. The following files must be edited: ** cas/pom.xml ** casdb/pom.xml ** epics-api/pom.xml ** epics-service/pom.xml ** integration-tests/pom.xml ** pom.xml Remove all dependencies on caj, and change the groupId for jca to org.epics. Also, the version must be changed to the latest snapshot.
  • Build the packages
    mvn install
    

Modify OCS3 settings

OCS3 build settings must be modified to use the local GIAPI and JCA-CAJ packages.

  • Modify the package versions in project/Settings.sbt to use the snapshots. They versions to change are: ** epicsService ** gmpCommandRecords ** giapi ** giapiJmsUtil ** giapiJmsProvider ** giapiCommandsClient ** giapiStatusService
  • Enable the use of the local Maven repository. Uncomment the following line in build.sbt:
    resolvers in ThisBuild += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository
    

If necessary, modify it to point to your local repository.

Testing Changes

To test changes made in CAJ, all the packages have to be rebuilt:

  1. Build JCA
  2. Build GIAPI
  3. Build OCS3

Clone this wiki locally