Managing Network Pages

If there are any issues found or someone would like to add a device to the network pages, here is how to go about doing so.

Checking out the files

The PyDM network pages live in the pydm-ntwk repository. To checkout these files, first navigate to your working directory.  Run the command "eco" and at the prompt, enter "pydm-ntwk" as the package to checkout.  Continue through the eco prompts and then cd to pydm-ntwk/pydm-ntwk-git.

Making your changes

Each network page is generated programmatically from a series of files in the pydm-ntwk repository.  The primary way to make changes is to edit a Python dictionary file associated with the area that you would like to make the change, e.g., li24_info.py.  The changes will be picked up automatically in the UI on the next launch.  Note that you may need to start a fresh session of LCLSHome to see the changes take effect.

Network Dictionaries

The network pages are generated from a Python dictionary held in a file of the name <area>_info.py. Each file consists of a Python dictionary per subsystem in that area, and one main dictionary. The subsystem dictionaries are named <area>_<subsystem> and the main dictionary is <area>_info. Each individual entry is itself a dictionary containing the key:value pairs “macros”, “filename”, “alarms”, and “slc”.  A single network entry looks as follows:

  • macros” is a list of macros that will be passed to the EDM file launched by the related display button
  • filename” is a string that holds the EDM filename that the related display should launch
  • alarms” is a list of PV names to be applied to alarm LEDs (green squares on EDM)
  • slc” is a Boolean that determines whether the "SLCNAME" PV should be displayed in a PyDMLabel (e.g., SIOC:SYS0:NW10:SLCNAME)


Example Dictionary Entry

"SIOC:XMPL:ZZ01": {
    "macros": ["iochost=sioc-xmpl-zz01", "ioc=SIOC:XMPL:ZZ01"],
    "filename": "display=ioc_soft.edl",
    "alarms": ["SIOC:XMPL:ZZ01:STATSUMY"],
    "slc": False,
}


Adding a new device

To add a new network device, first locate the relevant subsystem dictionary. Insert a new dictionary item following the format laid out by the other entries. If formatted correctly, the new network device will automatically appear on the interface.

Adding a new subsystem

Creating a new subsystem for an area is more involved, but still a straightforward process. Copy and rename an existing subsystem dictionary into the <area>_info.py file. Fill out the dictionary entries following the steps for adding a new device. Once the dictionary is complete, add it to the main <area>_info dictionary. For example, if you were to add some utilities IOCs to the BYP area network page, you would insert the line “Utilities”: byp_util to the byp_info dictionary in the file byp_info.py.

Once you have created the new subsystem dictionary and added to the <area>_info dictionary, open the associated <area>_main.py file. There is an object called column_content. This is a list of lists that determines the layout of the columns on the interface. Determine where you would like your new subsystem to go and insert it into the appropriate sub-list. If you wanted your Utilities subsystem to display below Vacuum, the list at index [2] would read [“MPS”, “Vacuum”, “Utilities”],

UI Generation

Most of the Python that generates the UI file is found in ntwk_common.py. This file is imported by each individual <area>_main.py file. This means any change to ntwk_common.py will impact every main interface file. Care should be taken when editing this file as it may have unintended consequences!

Committing your changes

The repository is managed in Git.  Once you have made your changes, run the command "git status".  This command will display all changes made in the repository. 

Confirm which changes you would like to commit, and use the command "git add <file1> <file2> <etc>".  After changes are added, commit them using "git commit -m <your message here>".  A final command, git push, will push these changes to the Git repository. 

Pull them into development by moving to $PYDM/ntwk and running the command "git pull" and then repeat this step on production.  Note that when you run "git pull" on production, you will need to authenticate to make changes.


  • No labels