# Configuration Files

This is about creating new PACE configuration files or editing existing PACE configuration files. To use the configuration files, see Starting the PACE Editor.

PACE Editor configuration files are in XML format and have a .pace file extension. To edit them, select Open With..., Text Editor from the Navigator context menu of the file. To create new files, use New..., Other, General, File in the Navigator context menu and make sure to use a .pace file extension for the new file.

When done editing, open the file via Open With..., PACE in the Navigator context menu to re-establish PACE as the default tool for opening the file.

## XML Tags

The configuration files expect certain tags to define the column headers and the rows.

- Root Element Opening and Closing Tags

       <paceconfig> ...  </paceconfig>

- Fill ... with the title tag

       <title> Your Title goes here  </title>

- Then column Tags

      <columns>
         <column>
           <name>Column Header</name>
      	  <access>rw</access>
      	  <pv>${S}_RCCS:CV${N}02:PID_KP</pv>
         </column>
         <!-- There can be more columns -->
       </columns>

  Where the cell access can be rw for read-write or ro for read-only.

  The PV name for the cell contains macros either written as `$(macro)` or `${macro}`. Replacement values for the macro variables are defined below under instances.

  The column definition can have meta-PVs in addition to the main PV. These are meant to contain the data, user name and comment associated to the last change of the main PV. They are defined via tags similar to the main PV:

            # .. As before, including a main PV:
            <pv>${S}_RCCS:CV${N}02:PID_KP</pv>
            <name_pv>${S}_RCCS:CV${N}02:PID_Name</name_pv>
            <date_pv>${S}_RCCS:CV${N}02:PID_Time</date_pv>
            <comment_pv>${S}_RCCS:CV${N}02:PID_Txt</comment_pv>

  The current values of these meta PVs will be displayed in the tool-tip of the cell. The name and date meta PVs will be updated with the user name and current date when writing to the main PV. The comment PV can be edited by providing access to it in a separate column.
- And finally the instance or Row Tags.

      <instances>
           <instance>
             <name>DTL 1</name>
             <macros>S=DTL,N=1</macros>
           </instance>
         <!--  Many more...: DTL 1..6, CCL 1..4. -->
      </instances>

  Where instance is a row definition and name is put in the first cell of the row. The macro definitions are used to turn the macro-ized PV names of the column definitions into specific PV instances.

  A macro can be set to empty like this:

      <macros>PV=""</macros>

  If the PV name for a cell evaluates to an empty string, that cell will not have a PV.

## Configuration File Example

    <!-- Example config file -->
    <paceconfig>
        <title> Title </title>
        <columns>
            <column>
                <name>PID Gain</name>
                <access>rw</access>
                <pv>${S}_RCCS:CV${N}02:PID_KP</pv>
                <name_pv>${S}_RCCS:CV${N}02:PID_Name</name_pv>
                <date_pv>${S}_RCCS:CV${N}02:PID_Time</date_pv>
                <comment_pv>${S}_RCCS:CV${N}02:PID_Txt</comment_pv>
            </column>
            <column>
                <name>Comment</name>
                <access>rw</access>
                <pv>${S}_RCCS:CV${N}02:PID_Txt</pv>
            </column>
           <!-- There can be more columns -->
        </columns>
        <instances>
            <instance>
                <name>DTL 1</name>
                <macros>S=DTL,N=1</macros>
            </instance>
            <!--  Many more...: DTL 1..6, CCL 1..4. -->
        </instances>
    </paceconfig>

The above config file would create a PACE table somewhat like this:

System | PID Gain | Comment
--- | --- | ---
DTL 1 | <Value of DTL_RCCS:CV102:PID_KP > | <Value of DTL_RCCS:CV102:PID_Txt >
DTL 2 | ... | ...