15.9.2. Creating a new Scripted Profile Package
A new Scripted Profile Package can be created from APpro, this package can be subsequently opened in the SPP editor to allow additional files to be added or updated.
With the ‘Scripted Profile’ pattern is chosen in the Project Profile dialog, selecting New from the button bar at the top will open the ‘Create scripted profiles’ dialog. This is similar to the import SPP described previously. To create a new script package a name can be provided and the Create button clicked.
Provided the name is unique in the <VE> project a new SPP file will be created and registered with the model. By default, the new Scripted Profile Package will have a modulating profile call AlwaysOff defined. A scripted profile package should not be empty.
A scripted profile in the <VE> will always be named in two parts. Each part separated by a ‘.’. The first part identifies the scripted profile package to which it belongs. The second part, following the ‘.’, gives the name of the profile class as defined in the Python source file. This naming convention forces a unique readable name for each scripted profile in the model.
Selecting the scripted profile in the list and selecting “Edit” from the button bar will launch the “Edit” profile dialog as shown below.
The edit dialog allows the user to select assignment categories and specify an Associated profile. An associated profile is used in preference to the Scripted Profile when the scripted profile feature is not available, for example during a Compliance simulation.
Selecting the “Editor” button will launch the Scripted Profile editor tool, shown below. This tool allows files to added and removed from the package. It also provides an extract option to write the contents of a package to user selected directory.
The editor allows files to be imported and if required removed from the package. This is done using the ‘+’ and ‘-‘ icons in the lower right hand corner of the Content view in the dialog.
Once files have been imported into the SPP clicking Save will package up the contents and write the SPP to file.
A py file in a package can be updated if the Python code needs to be changed. The editor can be used to re-import the py source file into the SPP, when the SPP is saved the updated py file will be included in the package.
If a new profile is added to the package, via the editor, the SPP must be reloaded into APpro. Selecting any profile in the package to be updated and selecting ‘Reload’ on the button bar of the Project Profiles dialog will refresh the list of profiles in APpro for the selected scripted profile package.