This topic explains how to clone FLAMES content source code repositories and build the source code to create a FLAMES-compatible component plugin. The steps below use the repositories for the FLAMES Tutorial Content (ftutorial) and the Component Interface (finterface) source code as examples, but the steps to clone and build are identical or very similar for the other FLAMES repositories.
Install Content in a FLAMES Project
If you have not done so already, follow all the steps in Getting Started to install the FLAMES Launcher, install the FLAMES Developer, create a FLAMES project, and install the Tutorial Content in the project.
As a general rule, before you clone a FLAMES repository in a FLAMES project, you should install the corresponding FLAMES content item in the project (if such content exists). This is important because the FLAMES content item often includes scenario data and other files that are helpful or required to execute the plugin in FLAMES.
Join the FLAMESFramework GitHub organization
The FLAMESFramework GitHub includes several GitHub repositories that contain the source code to many FLAMES-compatible component classes, component plugins, and example applications. Follow these steps to become a member of this organization and get access to the repositories.
Create Forks of FLAMES Repositories
You must create your own copy (a fork) of FLAMES repositories before you clone them, because you do not have write access to the repositories. Follow the steps below to create a fork of the ftutorial and finterface repositories.
- In a browser, sign in to GitHub with the GitHub account you used to join the FLAMESFramework GitHub organization.
- Go to the Create a new fork page of the FLAMESFramework/ftutorial repository.
- Uncheck Copy the main branch only so your fork will include a copy of all the branches of the repository.
- Click Create fork to create your fork.
- The source code in the ftutorial repository depends on the source code in the finterface repository. Browse to the Create a new fork page of FLAMESFramework/finterface repository and create a fork of this repository. Again, be sure to copy all the branches.
Clone FLAMES Repositories
Follow the steps below to clone your forks of the FLAMES repositories to create local copies of the ftutorial and finterface repositories. You will place your local copies in folders within the build folder of your FLAMES project folder. These steps use the GitHub Desktop application, which can be downloaded here. Feel free to use a different Git client application if you prefer.
- Start the GitHub Desktop application on your computer.
- In the GitHub Desktop main window, Select the File | Clone repository menu. (If prompted, sign in using your GitHub account.)
- In the Clone a repository dialog, click GitHub.com. Then, click your fork of the ftutorial repository. (Your GitHub account will be displayed rather than Coder8904.)
- In the Local path field, enter the path to a folder named ftutorial in your FLAMES project build folder. The ftutorial folder will not exist yet; it will be created when the repository is cloned. (If you don’t know the path to your FLAMES project folder, you can find it by opening the Settings for your project in the FLAMES Launcher.)
- Click Clone.
- In the toolbar, there is a button to select the Current branch for the repository:
Click this button to switch the Current branch to the branch that corresponds to the FLAMES release version you are using in your FLAMES project. For example, if you are using FLAMES version 21.0, switch to the 21.0 (or origin/21.0) branch. This is very important! The source code will not build properly if the branch and the FLAMES version do not correspond.
- Repeat the steps in this section to clone your fork of the finterface repository into a folder named finterface in your FLAMES project build folder. (Both repositories are needed, because the source code in the ftutorial repository depends on the source code in the finterface repository.)
Create a FLAMES Plugin
Follow the steps below to compile and link the source code in your local copies of the ftutorial and finterface repositories to create your own copy of the FLAMES ftutorial plugin.
- On the page for your project In the FLAMES Launcher, click the FLAMES Solution icon to open the Visual Studio flames.sln solution file that was created automatically by the Launcher.
- In Visual Studio, select the View | Solution Explorer menu to open the Solution Explorer window.
- Right-click the flames solution and select the Add | Existing Project menu item. The Add Existing Project file browser window opens.
- Add the Visual Studio project file named finterface.vcxproj located in the folder named finterface in your FLAMES project build folder.
- Select the Add | Existing Project menu item again, and add the project file named ftutorial.vcxproj located in the folder named ftutorial in your FLAMES project build folder. You should now have two projects in your flames solution.
- In the Solution Explorer window, right-click the ftutorial project and select the Build Dependencies | Project Dependencies menu item.
- Check the box next to finterface to specify that ftutorial depends on finterface.
- In the Visual Studio toolbar, set the Configuration to Debug, and set the Platform to match the architecture of the FLAMES release you are using in your FLAMES project. For example:
- Select the Build | Build Solution menu to build the entire solution. If everything goes well, the solution will build successfully, and your own copy of the ftutorial plugin (ftutorial.dll) will be created in the bin\components folder of your FLAMES project folder. This plugin will replace the plugin that was installed when the Tutorial Content was installed in your FLAMES project.
Execute FORGE with Your New PlugIn
The final step in the process is to execute FORGE with your new plugin to verify that it built correctly. You can execute FORGE from the FLAMES Launcher or from within Visual Studio.
To execute FORGE from the Launcher, go to the page for your project In the Launcher, click the FORGE icon.
Executing FORGE from within Visual Studio allows you to use the Visual Studio debugger during execution (if your build Configuration is set to Debug). Follow the steps below to execute FORGE from within Visual Studio.
- In the Solution Explorer window in Visual Studio, right-click the ftutorial project and select the Properties menu item.
- In the Debugging properties, set Command to $(FLAMES_RELEASE)\bin\forge, and set Working Directory to $(FLAMES_PROJECT)\work.
- In the Solution Explorer window, right-click the ftutorial project and select the Set as Startup Project menu item.
- In Visual Studio, select the Debug | Start Debugging menu to execute FORGE.
After FORGE starts, there will be a message in the FORGE Status window indicating that ftutorial.dll was loaded. This message is a great indication that the plugin built correctly. As an additional test, you can open one of the Tutorial scenarios that was included with the Tutorial content to be sure it opens without any errors.
You are now ready to watch the training videos to learn how make changes to component classes to create new component classes to develop your own custom, FLAMES-based simulation.