There are numerous driver classes in Nomad that would take time to migrate manually to modules. A tool to automate the migration is developed.
The migrated classed are in the legacy directory of the NomadModules project.

In the following, to simplify:
NS = NomadServer/src
NM = NomadModules/src

During the migration transition phase, the concerned directories and files:
  • NS/DeviceContainer/Def copied in NM/drivers/legacy/def
    • must not evolve
  • NS/DeviceContainer/Status/*.h copied in NM/drivers/legacy/status
    • must not evolve
  • NS/DeviceContainer/Status/*.cpp modified to prepare their transfer in NomadModules
    • must not evolve
  • .DeviceProperty.xml analysed
    • must not increment, removal of drivers is ok
  • DeviceDriverCreator.cpp cleaned
    • can be modified

The code migration is based on the project NomadSourceAnalyser.


The driver categories are transformed into classes inheriting DeviceDriver.
  • manual example : class AxisCommon
  • generated example : class Attenuator in NM/drivers/legacy/category/Attenuator.h,cpp

The generation of categories is made with the script

For instance, from the category "attenuator" defined in .DeviceProperty.xml

namespace driver {

class Attenuator : public virtual DeviceDriver {

    static const std::string TYPE;

    Attenuator(const std::string& name);

    Property<std::string> wantedValue;
    Property<std::string> actualValue;
    Property<int32> attenuatorStatus;


Driver Class Migration

The migration of driver P (= parent directory) D (= driver name) is made by the script
  • move the sources from NS/DeviceContainer/Drivers/P/D to NM/drivers/legacy/p/d (lower case)
  • source transformation
  • includes change
  • the categories of the driver (defined in DeviceDriverCreator) become base classes
    • example : IllSec has category "sample_temperature" becomes:
      class IllSec : public driver::SampleTemperature {
    • The class driver::SampleTemperature was previously generated
  • possible multiple inheritance
  • add the TYPE member
  • change the signature of the constructor (only name)
  • add the properties Property<> in the class D
  • status with registerStatus()
  • static_cast<D*> become dynamic_cast<D*>
  • the conversion is made driver by driver
  • conversion rules to be refined for each driver
  • configuration tests

Once the script run and the compilation of the new module successful, the NomadServer project can be cleaned.
The script is used for this. It cleans DeviceDriverCreator.cpp,, removes the driver directory.

Once all the drivers migrated:
  • NS/DeviceContainer/Status/*.cpp moved to NM/drivers/legacy/status
  • NS/DeviceContainer/Def removed
  • .DeviceProperty.xml removed

Controller Properties Migration

Run the script to generate the declaration and initialisation of properties from the .AbstractProperty.xml file.

> ./ peak_scan