Create a project from source control
If a .p4config file is present, it is automatically loaded and your Simulink project is connected to the P4 Server.
Create a project from source control and connect to the P4 Server:
- Go to the Simulink Start Page and select the New tab. From the Projects section of the sidebar, select From Source Control > P4 2016b.
- Set the Sandbox path to your P4 Server Workspace root, this is the location on your local machine you want to populate with the versioned files.
- The Repository path needs to be entered as a URI for the P4 Server.
- From the New Project From Source Control dialog, click Change to open the P4 Connection dialog.
- Enter your P4 Server, Username, and Workspace details and click Connect.
- Click OK to close the dialog and return to the New Project From Source Control dialog. The URI is automatically added to the Repository path of the New Project From Source Control dialog.
- Click Retrieve to fetch the files from the P4 Server. If you are prompted to create the Sandbox directory, click Yes.
- If you do not have a valid ticket session for the P4 Server, you will be prompted for your password.
- If the Workspace specified in your connection does not exist, you are prompted to create one.
- AllWrite: select to leave all files writable on the client workspace. By default, only files opened by p4 edit are writable. If set, files might be clobbered as a result of ignoring the Clobber option (see below).
- Clobber: select to permit p4 sync to overwrite writable files on the client workspace. noclobber is ignored if allwrite is set.
- Compress: select to compress data sent between the client workspace and P4 Server. This is used to speed up slow connections.
- Locked: select to allow only the client workspace owner to use or change the client spec. Prevents the client spec from being deleted or unloaded.
- Modtime: select to make p4 sync and p4 submit preserve file modification times, as with files with the +m type modifier. For more information about Modtime, see p4 help filetypes. With nomodtime, file timestamps are updated by sync and submit operations.
- RmDir: select to delete a workspace folder if all the files contained in the folder are removed.
- Stream: if using streams, specify the full P4 Server depot path for the stream that you want to populate your workspace from.
Stream at change (optional): enter a changelist number to populate your workspace based on the point in time that is represented by that changelist.
- View Mapping: map files in the depot to your client workspace. This defines the files that you want in your client workspace and specifies where you want them to reside. The left-hand side specifies one or more files in the depot. The right-hand side specifies one or more files in the client workspace. For details about client view syntax, see the Specify mappings chapter in the P4 CLI Documentation.
- The P4 for MATLAB and Simulink plugin displays the P4 Server depot path and prompts you to specify how the workspace should be populated.
- Get Latest revision: populates the workspace with the most recent revision of the files in the P4 Server. Typically this is the option you would select.
- Specify a revision: populates the workspace with the revision of the files you specify from the P4 Server.
- Advanced Sync Options, these options are only used if you are updating an existing client workspace:
- Force Operation (p4 sync -f): forces the sync even if the workspace already contains the file at the specified revision.
- Safe Update (p4 sync -s): performs a safe sync by comparing the content in your client workspace against what was last synced. If the file was modified outside of the control of P4 Server, an error message is displayed and the file is not overwritten.
- When you are prompted to create the project, enter your project name and click OK.
- Simulink displays the Let's get started dialog. To set up your project, click Set Up Project.
- to add all of the files in a folder, click Add Folder..., select the folder, and click Open to move on to the next step.
- to add the files in a folder and all of the files in its subfolders, click Add with Subfolders..., select the folder, and click Open to move on to the next step.
- Specify any startup and shutdown files for the project if they are required.
- Click Finish to complete you project setup.
- To commit the project files to the P4 Server, open the Current Folder view, right-click, and click View and Commit Changes....
- Add a change description to the Comment text box and click Commit to commit the changes.
- Your project is now connected to the P4 Server. For details of the P4 Server file and folder operations available to you, see File management.
Alternatively, you can select the Project from P4 R2016b Simulink template on the New tab.
The URI is automatically generated and verified when Simulink successfully connects to the P4 Server.
If P4 AS is configured for your P4 Server a web page will open and you will be directed to the sign in process used by your Identity Provider (IdP) when you connect to the P4 Server.
Set your P4 Server Workspace settings, options are:
If you are connecting to a Stream A special type of branch with built-in rules that determine which changes to propagate to files in a stream depot, and in what order. A stream specification defines a stream. In P4V, stream specs are visible in the Streams Graph and the Streams tab. depot enter your stream details, if you are connecting to a classic depot enter your View Mapping A single line in a view definition, consisting of a left side, a blank space, and a right side. The mappings specify the correspondences between files in the depot and files in a client, label, or branch. See also 'workspace view', 'branch view', and 'label view'. details.
Click OK.
Options are:
Click OK to populate your workspace.
The Set up Project (Step 1 of 2) dialog is displayed.
To add folders and files to your Simulink project, do one of the following:
or
The Set up Project (Step 2 of 2) dialog is displayed.
Simulink creates/updates the project files because of the change and they are displayed in the Modified tab.
You can add further files and folders to your project after you have created your project with the Simulink P4 Server menu. For instructions on adding files to your project, see Simulink P4 Server menu.