fesa-evtcp

Copy an event definition (a class events-mapping) from one FESA instance file to other FESA instance files

not yet stable, functionality may be modified without notice

Usage

usage: fesa-evtcp FILE EVT_NAME [-n NODE] [-d] [-D] [-f] [-t]

    Names EVT_NAME, -n NODE may be abbreviated,
    For NODE wildcards (*, ?) are supported, because of
    shell-expansion use quotes (-n "scuxl02*")

    Instance files are expected in
        <DIRECTORY>/src/test/<NODE>/
    where DIRECTORY (option -d) defaults to ./
    and NODE (option -n) defaults to * (all nodes)

    Directory tree for instance files corresponds to FESA
    directory structure, e.g. ~/my_workspace/PowerSupplyRF_DU/
    (use -d ~/my_workspace/PowerSupplyRF_DU)
    

copy an event definition to FESA instance files

positional arguments:
  FILE                  input file name
  EVT_NAME              event name
  THIRD_ARG

optional arguments:
  -h, --help            show this help message and exit
  -f, --force           do not prompt for event insert
  -t, --test            test only, no output of updated files
  -d DIRECTORY, --directory DIRECTORY
                        base Directory for file search
  -D DEPLOY, --Deploy DEPLOY
                        name of Deploy_Unit
  -N DATABASE, --databaseNodes DATABASE
                        only Nodes (FECs) from FESA database, for DATABASE development/integration/production
  -n NODE, --node NODE  limit to front-end Node NODE (e.g. scuxl0815 or 815), multiple options possible
  --version             show version and exit

Introduction

The utility copies an event definition (a class events-mapping, e.g. as defined for VoltageSetEvent , see below) from one FESA instance file and inserts it into other FESA instance files.

The utility supports extending a FESA instance-file by a new event definition, and then copy this event definition to a set of other FESA instance files. This may help to manage FESA classes which run on many front-end nodes, with a great number of instance files.

The XML subtree (in the example, from < VoltageSetEvent ... > to </VoltageSetEvent> ) will be copied and inserted in the destination file(s).
    . . .
    <classes>
        <PowerSupply>
            <rolling-buffer depth="11"/>
            <events-mapping>
                <VoltageSetEvent idref="_150511124306_64">
                    <event-configuration name="setOnSeqStart">
                        <Timing>
                            <hardware-event name="CMD_SEQ_START#257"/>
                        </Timing>
                    </event-configuration>
                    <event-configuration name="setOnDemand">
                       <OnDemand>
                            <on-demand-event-source-ref name="VoltageSetEventSource"/>
                        </OnDemand>
                    </event-configuration>
                    <unused-event-configuration name="NONE"/>
                </VoltageSetEvent>
                <PowerSetEvent idref="_150511124306_65">
                        . . .

The utility is intended to be called in the base directory of the FESA deploy unit file system. It expects the instance files in subdirectories ./src/test/<fe-node>/ . If called in another root directory, the root has to be set by option -d <root-dir>, e.g. -d ~/my_workspace/PowerSupplyHebt_DU .

File Selection

Source File

The input file (from which the event definition is copied) must be given explicitly. That is, with name and directory path.E.g. like
~my_workspace/PowerSupplyHebt_DU/src/test/scuxl0043/DeviceData_PowerSupplyHebt_DU.instance

Destination File(s)

Specification of the destinion file(s), to which the event definition is copied, follows the notation of the utility fesa-instance.

The destination files are expected in the common workspace structure of the FESA development system. They are taken from the directories ./src/test/*/. If called in another working directory, the root of the FESA instance file tree has to be set explicitly by option -d, e.g. .-d ./PowerSupplyHebt_DU. The destination files must be named according to DeviceData_<DEPLOY_UNIT>.instance, e.g. DeviceData_PowerSupplyHebt_DU . File usage can be limited to specific front-end nodes by option -n (-n scuxl0042). Option -n can be specified multiple times.

The base for the FESA file tree structure can be set by option -d <tree-root> . That is, setting the tree root to -d ~/my_workspace , destination files will be taken from directory ~/my_workspace/<DEPLOY_UNIT>/src/test/*/ .

Event Name Specification

If the event definition is defined for several FESA classes in the instance file, the event name must be prefixed with the name of the FESA class: Instead of VoltageSetEvent use PowerSupply.VoltageSetEvent (or any unambigious abbreviation, e.g. Power.VoltageS ).

The names of the event and the FESA class may be abbreviated.

Test Operation (-t)

To check what would happen when using the utility, the option -t (test operation) can be set. When option -t is set, writing of the modified destination files back to disk is suppressed. That is, the utility will work as in normal mode, but the destinations files are not modified.

Examples

Copy event definition for event contextTrackerEvent from FESA instance file
~/my_workspace/PowerSupplyHebt_DU/src/test/scuxl0043/DeviceData_PowerSupplyHebt_DU.instance
to all other FESA instance files in
~/my_workspace/PowerSupplyHebt_DU
(name of event is abbreviated in command).

cd ~/my_workspace/PowerSupplyHebt_DU
fesa-evtcp \
  ./src/test/scuxl0043/DeviceData_PowerSupplyHebt_DU.instance \
  contextTrack 

Same, but only for scuxl0159 and scuxl0168, and with setting instance-file root explicitly:
fesa-evtcp \
  ~/my_workspace/PowerSupplyHebt_DU/src/test/scuxl0043/DeviceData_PowerSupplyHebt_DU.instance \
  contextTrack \
  -d PowerSupplyHebt_DU \
  -n scuxl0159 -n scuxl0168
Topic revision: r8 - 05 Jan 2022, UdoKrause
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