You are here: Foswiki>FESA Web>HowTo>CloneCompleteFESAClass (05 Feb 2009, HaraldBraeuning)Edit Attach

Clone a complete FESA class

In case a complete FESA class is the base of another new FESA class one may want to create a clone of the source class with its design and c++ source code under a new class name. There currently exists no real procedure for this, only a workaround, which is explained here:

  • from the design tool save the design using the new className/version
  • execute Fesa Setup NewClass 0 scratch
  • execute Fesa Synchronize NewClass 0
  • Then run the attached script renameFesaClass.sh. This script goes through the RT, SERVER and COMMON directories and in each directory performs the following steps:
    • cp *.h *.cpp Make.specific from the source class to the destination class
    • rename (OldClass)Interface.* (NewClass)Interface.* in SERVER directory
    • rename (OldClass)Realtime.* (NewClass)Realtime.* in RT directory
    • for each *.h and *.cpp performs the following substitutions
      • namespace (OldClass) -> namespace (NewClass)
      • (OldClass)Device -> (NewClass)Device
      • (OldClass)EquipmentDefault -> (NewClass)EquipmentDefault
      • (OldClass)GlobalStore -> (NewClass)GlobalStore
      • (OldClass)Interface -> (NewClass)Interface
      • (OldClass)Realtime -> (NewClass)Realtime
      • (OldClass)RT -> (NewClass)RT
      • (OldClass)TypeDefinition -> (NewClass)TypeDefinition
  • This script needs to be launched from the root path of the newly created class (i.e. ..../NewClass/version/). If run without any arguments, it asks for three entries: root path of the source class, source class Name and new class Name. These may also be specified on the command line in exctly the same order. The script prints out the parameters and asks for confirmation before actually modifiyng the files.
  • renameFesaClass.sh: Script for Clone procedure
Topic revision: r1 - 05 Feb 2009, HaraldBraeuning
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback