Creating Extensions
Third-party developers are free to build any type of SMath Studio extension on their own — and, most importantly, custom Plugins written to a customer's specific requirements. A Plugin can extend the application with new functions, new data types, new interface elements or integration with external systems, which makes it the most powerful way to adapt SMath Studio to a particular workflow. As a starting point, you can study the Plugins whose source code is publicly available.
Creating Custom Plugin¶
To work with the custom plugin code on Windows, please follow these steps:
- Install the current version of SMath Studio.
- Install the current version of Visual Studio Community.
- Create a Class Library (.NET Framework) project by specifying .NET Framework 2.0 in the Framework field in the project creation dialogue.
- Implement one or more SMath Studio interfaces inherited from IPlugin:
- IPluginLowLevelEvaluationFast - interception of operators and functions.
- IPluginMathNumericEvaluation - interception of numerical computing.
- IPluginCustomRegion - interception of a sheet item type creation.
- IPluginRegionDrawing - interception of a formula element in a mathematical formula drawing.
- IPluginSaveFileTypes - interception of calculation saving to the file.
- IPluginOpenFileTypes - interception of calculation file opening.
- IPluginDataInputOutput - customizing format for setting initial data and calculation results for automation and integration with other applications.
- IPluginMenuExtender - extension of the program's main menu.
- Please note that, to ensure maximum compatibility of your plugin across different platforms, it is recommended to use the SMath Studio Drawing library wherever any graphics need to be rendered.
Debugging Custom Plugin¶
During development it may be necessary to check the functionality of the generated source code. In order to execute the code of your plugin in the context of the SMath Studio process follow these steps:
- Build your plugin in Visual Studio in Debug mode (this will also generate debug *.pdb files).
- Copy the output results to the plugins folder in the SMath Studio installation directory.
- Run the SMath Studio program.
- When you need to debug your code use the following Visual Studio function: Attach to Process... available in the Debug menu.
- In the dialog box that opens select SMath Studio (usually presented there as Solver.exe) from the list of available processes and click the Attach button.
Please note that after any code changes you need to repeat all the described actions.
Custom Plugin Delivery¶
To make your Custom Plugin a part of the standard process for delivering to other users you need to follow these steps:
- Upload plugin source code to the public SVN repository.
- Open the project's Release Manager at https://smath.com/ReleaseManager/ — you need to be signed in with your SMath account first — and create a new plugin there, specifying the path to its source code in the public SVN repository.
- Build (click Build) the plugin in the Release Manager, check that there are no warnings or errors in the log. If warnings or errors were found fix them and repeat the build.
- After the build stage has been successfully completed publish (click Publish) the plugin in the plugin registry.
- The first result of publishing the plugin may require verification and confirmation by the SMath team. To speed up this procedure you need to contact the developers at the following e-mail address: support@smath.com.
- As a result the plugin will be added to the plugin registry and will be available to all users of the SMath Studio program via the Extensions Manager embedded in the program.