1 Pages (20 items)
How to create plugins for SMath Studio - Messages
#1 Posted: 2/13/2010 1:35:43 AM
Summary
SMath Project now provides a shared SVN repository for open source plugins for SMath Studio program. This repository can contains plugins from SMath Studio developers on a par with third-party projects.
Repository preferences
Url: https://smath.info/svn/public
Permissions: anonymous read access (no login and password needed)
How to get available sources
How to upload your sources
Repository is readable for every user, but write permissions you should request on support[at]smath[dot]info if you want to upload you plugin or make improvements for existed ones.
SMath Project now provides a shared SVN repository for open source plugins for SMath Studio program. This repository can contains plugins from SMath Studio developers on a par with third-party projects.
Repository preferences
Url: https://smath.info/svn/public
Permissions: anonymous read access (no login and password needed)
How to get available sources
- Download SVN client program: TortoiseSVN.
- Install it (reboot can be required).
- Create a folder on your PC where you want to store the sources.
- Right click on created folder and choose "SVN Checkout..." item from the folders context menu.
- Fill in text areas into appeared dialog (usually you need to specify only URL of repository) and press OK button.
- Available sources will be downloaded.
How to upload your sources
Repository is readable for every user, but write permissions you should request on support[at]smath[dot]info if you want to upload you plugin or make improvements for existed ones.
#2 Posted: 2/13/2010 1:37:30 AM
Three types of plugins supported by SMath Studio 0.87 (new types will be available in the future).
Tutorial in progress... please, be patience.
- Low-level expression evaluations (IPluginLowLevelEvaluation interface).
See demo video (temporary one). - Numeric expression evaluations (IPluginMathNumericEvaluation interface).
- Symbolic expression evaluations (IPluginMathSymbolicEvaluation interface).
Tutorial in progress... please, be patience.
#3 Posted: 5/5/2010 4:16:59 PM
WroteThree types of plugins supported by SMath Studio 0.87 (new types will be available in the future).
- Low-level expression evaluations (IPluginLowLevelEvaluation interface).
See demo video (temporary one).- Numeric expression evaluations (IPluginMathNumericEvaluation interface).
- Symbolic expression evaluations (IPluginMathSymbolicEvaluation interface).
Tutorial in progress... please, be patience.
Andrey,
Could you explain a little about the difference between "low-level expression evaluations" and "numeric expression evaluations". I think that the "symbolic expression evaluations" seems self-explanatory, but if you like, you could tell us a little about that as well.
I reviewed the video that you posted above and will take some time to study it more closely in the coming days. Of course, any other videos or tutorials on this topic would also be welcome.
I hope to eventually be able to write my own plugins.

Will Massie
Mechanical Engineer
Oregon, USA
#4 Posted: 5/5/2010 6:46:30 PM
Let's try.
Here is a simple diagram:

When user inputs some data for evaluation SMath Studio stores this data within a simple array of primitives (operands, operators, brackets, functions - that's all). There is a type of data to store this primitives - Class Term. Before transferring input data to the Numeric Library (NuLib.dll) or to the Symbolic Library (SyLib.dll) SMath Studio needs to substitute all available variables (commonly - operands) and functions (all the built-in, user-defined or defined in plugins). There is a place for the low-level expression evaluation. Plugins of this level can extend it in the most non-abstracted way. Array of Term elements represented in Reverse Polish notation (RPN - please be sure, that you understand how it works before creating such kind of plugins). Note, that here you can create the most powerful functions with the smallest CPU & RAM usage, but it is rather hard.
Note, that all the functions that are placed inside plugins delivered in standard Setup (talk is about plugins\SpecialFunctions.dll) created using low-level expression evaluation. Even := operator is also part of this level (but it is built-in to the canvas.dll - not a plugin).
The most abstracted levels of evaluation are: Symbolic expression evaluation and Numeric expression evaluation. They are used depending on the user request to calculate with symbols or not.
Full symbolic expression can be stored in MItem Class. You can operate with instances of this class using standard operators + - * / and it has several methods to make it easy to operate with expressions. Actually, MItem is very interesting Class
It was fully designed by me and it is not used anywhere before. Fer example: it doesn't support - and / operators at all (I mean it cannot store and work with them), instead of it every part of MItem Class expression has boolean fields: Negative (means -a) and Inverse (means 1/a). So, you should respect this fact in order to avoid some errors.
Numeric expression evaluation has no any strange facts. You must know, that it is represented by TNumber class with several constructors for any kind of type you want to work with: Double (TDouble), Fraction (TFraction), Complex number (TComplex), Matrix (TMatrix), Algebraic system (TSystem) or number with infinities (TInfinity - obsolete one - will be merged with TFraction later).
Plugins has a higher priority then any built-in behavior, but smaller then any user-defined one (behavior = defined function, operator or operand).
We have some articles for developers in the wiki. In Russian, but, there is just a little text, but the biggest part is the code - so, I hope, you will have no problems there:
IPluginMathNumericEvaluation
There are some implemented methods for conversions between arrays of Term, MItem and TNumber classes:
SMath.Manager.Converter.ToTerms(string) - Converts String to Term[]
SMath.Manager.Converter.ToString(Term[]) - Converts Term[] to String
SMath.Math.Symbolic.Converter.ToMItem(string) - Converts String to MItem
SMath.Math.Symbolic.Converter.ToMItem(Term[]) - Converts Term[] to MItem
SMath.Math.Symbolic.Converter.ToString(MItem) - Converts MItem to String
SMath.Math.Numeric.Expression.Calculate(Term[]) - Numeric expression calculation
SMath.Math.Symbolic.Expression.SimplifyEx(MItem) - Symbolic expression simplification
SMath.Math.Symbolic.Expression.DifferentiateEx(MItem, MItem) - Symbolic differentiation of expression
Seems, that's it for now. For further info, please, ask me to describe things you're interested in.
Contact me via ICQ and/or Skype if you need some just-in-time help
I understand, that creating plugins is a hard work and I'm ready to provide maximum help with it! Or, maybe, it is better to publish all questions and answers here... it's up to you (depends on the questions maybe).
Best regards, Andrey Ivashov.
Here is a simple diagram:
When user inputs some data for evaluation SMath Studio stores this data within a simple array of primitives (operands, operators, brackets, functions - that's all). There is a type of data to store this primitives - Class Term. Before transferring input data to the Numeric Library (NuLib.dll) or to the Symbolic Library (SyLib.dll) SMath Studio needs to substitute all available variables (commonly - operands) and functions (all the built-in, user-defined or defined in plugins). There is a place for the low-level expression evaluation. Plugins of this level can extend it in the most non-abstracted way. Array of Term elements represented in Reverse Polish notation (RPN - please be sure, that you understand how it works before creating such kind of plugins). Note, that here you can create the most powerful functions with the smallest CPU & RAM usage, but it is rather hard.
Note, that all the functions that are placed inside plugins delivered in standard Setup (talk is about plugins\SpecialFunctions.dll) created using low-level expression evaluation. Even := operator is also part of this level (but it is built-in to the canvas.dll - not a plugin).
The most abstracted levels of evaluation are: Symbolic expression evaluation and Numeric expression evaluation. They are used depending on the user request to calculate with symbols or not.
Full symbolic expression can be stored in MItem Class. You can operate with instances of this class using standard operators + - * / and it has several methods to make it easy to operate with expressions. Actually, MItem is very interesting Class

Numeric expression evaluation has no any strange facts. You must know, that it is represented by TNumber class with several constructors for any kind of type you want to work with: Double (TDouble), Fraction (TFraction), Complex number (TComplex), Matrix (TMatrix), Algebraic system (TSystem) or number with infinities (TInfinity - obsolete one - will be merged with TFraction later).
Plugins has a higher priority then any built-in behavior, but smaller then any user-defined one (behavior = defined function, operator or operand).
We have some articles for developers in the wiki. In Russian, but, there is just a little text, but the biggest part is the code - so, I hope, you will have no problems there:
IPluginMathNumericEvaluation
There are some implemented methods for conversions between arrays of Term, MItem and TNumber classes:
SMath.Manager.Converter.ToTerms(string) - Converts String to Term[]
SMath.Manager.Converter.ToString(Term[]) - Converts Term[] to String
SMath.Math.Symbolic.Converter.ToMItem(string) - Converts String to MItem
SMath.Math.Symbolic.Converter.ToMItem(Term[]) - Converts Term[] to MItem
SMath.Math.Symbolic.Converter.ToString(MItem) - Converts MItem to String
SMath.Math.Numeric.Expression.Calculate(Term[]) - Numeric expression calculation
SMath.Math.Symbolic.Expression.SimplifyEx(MItem) - Symbolic expression simplification
SMath.Math.Symbolic.Expression.DifferentiateEx(MItem, MItem) - Symbolic differentiation of expression
Seems, that's it for now. For further info, please, ask me to describe things you're interested in.
Contact me via ICQ and/or Skype if you need some just-in-time help

Best regards, Andrey Ivashov.
#5 Posted: 6/2/2010 8:53:43 PM
Andrey,
Since I am only a casual programmer, alot of this is new for me. I am new to object-oriented programming in general and to .NET specifically. In my free time (which is sparse), I have been learning .NET for only about a year now (previously I have done some programming in Lisp and VBA). So, this is still very much a learning process for me.
I have been studying your demo video above and have a couple questions:
1. If I am using Smath version 0.88, would I need to change the 87 to an 88 in the line:
new AssemblyInfo("Smath Studio", new Version (0, 87), new Guid(......
2. How would I go about obtaining the GUID for Smath?
I am sure I will have more questions in the future. Thanks in advance for your patience with such a novice.
Since I am only a casual programmer, alot of this is new for me. I am new to object-oriented programming in general and to .NET specifically. In my free time (which is sparse), I have been learning .NET for only about a year now (previously I have done some programming in Lisp and VBA). So, this is still very much a learning process for me.
I have been studying your demo video above and have a couple questions:
1. If I am using Smath version 0.88, would I need to change the 87 to an 88 in the line:
new AssemblyInfo("Smath Studio", new Version (0, 87), new Guid(......
2. How would I go about obtaining the GUID for Smath?
I am sure I will have more questions in the future. Thanks in advance for your patience with such a novice.
Will Massie
Mechanical Engineer
Oregon, USA
#6 Posted: 6/2/2010 9:55:33 PM
Hello, maweilian.
GUID in question is an unique identifier of the program. All versions and types of SMath Studio has the same GUID:
Use this GUID for every plugin you want to create.
About SMath Studio version number: it is required for now to specify version of SMath Studio you will use to import the result plugin. In future one can be able to specify some minimum version of the program that is enough to import plugin and all the next versions will just work with it. I advise you to start creating plugin for SMath Studio 0.88 and to specify 0.88 version into the plugin's dependences.
Best regards.
GUID in question is an unique identifier of the program. All versions and types of SMath Studio has the same GUID:
a37cba83-b69c-4c71-9992-55ff666763bd
About SMath Studio version number: it is required for now to specify version of SMath Studio you will use to import the result plugin. In future one can be able to specify some minimum version of the program that is enough to import plugin and all the next versions will just work with it. I advise you to start creating plugin for SMath Studio 0.88 and to specify 0.88 version into the plugin's dependences.
Best regards.
#7 Posted: 6/3/2010 10:12:33 PM
Andrey,
Well, I was able to follow your demo video quite well and I have taken it in hand to start a tutorial on creating plugins. I realize that you may have already started one, and I hope this contribution will help. I essentially copied what you did in the video except for two critical differences:
1. The tutorial is in Visual Basic and not C#. This is because Visual Basic is what I am familiar with. It would be good to have someone create another tutorial for C# by simply modifying the tutorial I have created here.
2. The tutorial is for the Express version of Visual Basic. This is a FREE tool that anyone can download. This is great for Smath since I am sure that not too many users can afford to buy the professional version of Visual Studio. The user interface of the Express version is slightly different than the professional version and there are some limitations/difficulties when it comes to debugging. The tutorial explains one workaround for the debugging problem that works well, and I would be interested to know if someone can find a better solution.
Here is the tutorial in doc and pdf format:
Tutorial on creating plugins
Andrey, it would be great if you could modify the tutorial to improve it. You could particularly do so by improving the terminology employed (like I said before, I am only a casual programmer and not up on all the programming lingo) and perhaps more endnotes could be added to give more explanation for the reasons behind certain programming concepts. I think, though, that it is important to keep the tutorial simple for novice programmers.
Feedback welcomed.
Well, I was able to follow your demo video quite well and I have taken it in hand to start a tutorial on creating plugins. I realize that you may have already started one, and I hope this contribution will help. I essentially copied what you did in the video except for two critical differences:
1. The tutorial is in Visual Basic and not C#. This is because Visual Basic is what I am familiar with. It would be good to have someone create another tutorial for C# by simply modifying the tutorial I have created here.
2. The tutorial is for the Express version of Visual Basic. This is a FREE tool that anyone can download. This is great for Smath since I am sure that not too many users can afford to buy the professional version of Visual Studio. The user interface of the Express version is slightly different than the professional version and there are some limitations/difficulties when it comes to debugging. The tutorial explains one workaround for the debugging problem that works well, and I would be interested to know if someone can find a better solution.
Here is the tutorial in doc and pdf format:
Tutorial on creating plugins
Andrey, it would be great if you could modify the tutorial to improve it. You could particularly do so by improving the terminology employed (like I said before, I am only a casual programmer and not up on all the programming lingo) and perhaps more endnotes could be added to give more explanation for the reasons behind certain programming concepts. I think, though, that it is important to keep the tutorial simple for novice programmers.
Feedback welcomed.
Will Massie
Mechanical Engineer
Oregon, USA
#8 Posted: 6/4/2010 11:03:00 AM
Dear Mawellian,
Thank you so much!! I think that you contribution is very usefull and clear, and I hope that it be the beginning of a best documentation about this issue.
Regards!
Oscar Campo
Thank you so much!! I think that you contribution is very usefull and clear, and I hope that it be the beginning of a best documentation about this issue.
Regards!
Oscar Campo
#9 Posted: 6/4/2010 11:13:20 AM
Hello.
It's really great! Document is absolutely clear to understand and detailed enough for those people who want to start creating the plugin(s) for SMath Studio! Thank you very much! I hope I'll create demos for other types of plugins and we could extend your tutorial with all kind of them.
You've done very helpful thing! Thanks and best regards.
It's really great! Document is absolutely clear to understand and detailed enough for those people who want to start creating the plugin(s) for SMath Studio! Thank you very much! I hope I'll create demos for other types of plugins and we could extend your tutorial with all kind of them.
You've done very helpful thing! Thanks and best regards.
#10 Posted: 6/4/2010 11:42:14 AM
Hello Will,
Could you please put this information including the file links on the SMath Wiki as well.
Regards,
Radovan
Could you please put this information including the file links on the SMath Wiki as well.
Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#11 Posted: 6/4/2010 3:59:33 PM
To all,
I will post the info to the wiki. I think that it would also be good to add a link on the wiki to Andrey's video as well. I was also thinking it might be good to record a similar video using Visual Basic, just as in the written tutorial.
Andrey, what software did you use in creating the demo video?
If it is software that I can also access, I can record a video demonstrating the steps in the tutorial in Visual Basic Express.
As people work through the tutorial, please post, in this forum topic, improvements that could be made to it.
I will post the info to the wiki. I think that it would also be good to add a link on the wiki to Andrey's video as well. I was also thinking it might be good to record a similar video using Visual Basic, just as in the written tutorial.
Andrey, what software did you use in creating the demo video?
If it is software that I can also access, I can record a video demonstrating the steps in the tutorial in Visual Basic Express.
As people work through the tutorial, please post, in this forum topic, improvements that could be made to it.
Will Massie
Mechanical Engineer
Oregon, USA
#12 Posted: 6/4/2010 4:05:03 PM
Good idea! I've used Camtasia application (http://www.techsmith.com/camtasia.asp) to record the video. It has 30 days free trial period, so you can use it without any limitations.
Regards.
Regards.
#13 Posted: 6/4/2010 5:57:51 PM
Hello,
There is an open source alternative - CamStudio http://camstudio.org/. It produces AVI and maybe more suitable SWF format (smaller files). Quite useful tool and it is working very good (voice can be recorded as well).
Regards,
Radovan
WroteGood idea! I've used Camtasia application (http://www.techsmith.com/camtasia.asp) to record the video. It has 30 days free trial period, so you can use it without any limitations.
There is an open source alternative - CamStudio http://camstudio.org/. It produces AVI and maybe more suitable SWF format (smaller files). Quite useful tool and it is working very good (voice can be recorded as well).
Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#14 Posted: 6/4/2010 7:20:54 PM
To all,
I have updated the wiki with several new pages under the category of "Developer Guide". Please see link below to browse:
Developer Guide
Andrey and others, please review pages for accuracy and completeness of content. Particularly these pages:
IDEs and languages for developing plugins
Low-level expression evaluations
Numeric expression evaluations
Symbolic expression evaluations
Overview of creating plugins
Thanks,
I have updated the wiki with several new pages under the category of "Developer Guide". Please see link below to browse:
Developer Guide
Andrey and others, please review pages for accuracy and completeness of content. Particularly these pages:
IDEs and languages for developing plugins
Low-level expression evaluations
Numeric expression evaluations
Symbolic expression evaluations
Overview of creating plugins
Thanks,
Will Massie
Mechanical Engineer
Oregon, USA
1 users liked this post
Andrey Ivashov 6/18/2010 11:13:00 AM
#15 Posted: 6/18/2010 6:04:30 PM
I have added a video to accompany the written tutorial. A link to the video is on the following wiki page:
Tutorials for creating Plugins
As always, feedback is welcome!
Thanks, Will
Tutorials for creating Plugins
As always, feedback is welcome!
Thanks, Will
Will Massie
Mechanical Engineer
Oregon, USA
1 users liked this post
Andrey Ivashov 6/18/2010 8:29:00 PM
#16 Posted: 6/18/2010 8:44:28 PM
Thank you so much Will! It is absolutely fantastic video tutorial - very simple to understand and detailed enough to start create a first plugins!
I just want also to duplicate it here: Visual Basic Tutorial on creating plugin for Smath (Video).
Regards.
P.S.: And this is good, that you have chosen our Upload service, because now we can see file statistics within the file card (it is available if you will copy a file url to the new browser window and will follow this url - if you'll use inline link from the wiki/forum, service will detect that link is located on the smath.info server and will not show file card). Maybe it will be also reasonable to put other your files to the same place... it's up to you, of course.
I just want also to duplicate it here: Visual Basic Tutorial on creating plugin for Smath (Video).
Regards.
P.S.: And this is good, that you have chosen our Upload service, because now we can see file statistics within the file card (it is available if you will copy a file url to the new browser window and will follow this url - if you'll use inline link from the wiki/forum, service will detect that link is located on the smath.info server and will not show file card). Maybe it will be also reasonable to put other your files to the same place... it's up to you, of course.
#17 Posted: 8/4/2011 2:38:34 AM
Path to repository was changed to: https://smath.info/svn/public
#18 Posted: 7/14/2015 7:18:28 AM
Thank you for all your contributions. May i ask if we can use Netbeans as for IDE
#19 Posted: 9/16/2018 7:27:01 AM
Automatic algorithms for saving properties you can find in NPlot Region (Settings.cs, NPlotCompact/Windows.PlotSurface2D.cs) and Opens-CAD sources (Canvas\Utils\SerializeUtil.cs, CommonTools\PropertyUtil.cs). The ideas are similar.
NPlot xml sample:
Opens-CAD xml sample:
NPlot xml sample:
<Settings>
<FormFormatSettings>
<Size>
<Width>432</Width>
<Height>635</Height>
</Size>
<Location>
<X>920</X>
<Y>234</Y>
</Location>
<State>Normal</State>
</FormFormatSettings>
</Settings>
Opens-CAD xml sample:
<CanvasDataModel>
<backgroundlayer>
<property name="Color" value="Color [Black]" />
</backgroundlayer>
<gridlayer>
<property name="Spacing" value="{Width=1, Height=1}" />
<property name="MinSize" value="15" />
<property name="GridStyle" value="Dots" />
<property name="Color" value="Color [A=50, R=128, G=128, B=128]" />
<property name="Enabled" value="True" />
</gridlayer>
<layer Id="layer0">
<property name="Color" value="Color [White]" />
<property name="Width" value="0" />
<property name="Name" value="Hairline Layer" />
<property name="Enabled" value="True" />
<property name="Visible" value="True" />
<items>
<line>
<property name="P1" value="{X=0, Y=2.01041651}" />
<property name="P2" value="{X=2, Y=2.01041651}" />
<property name="UseLayerWidth" value="True" />
<property name="UseLayerColor" value="True" />
<property name="Width" value="0" />
<property name="Color" value="Color [White]" />
</line>
<line>
<property name="P1" value="{X=2, Y=2.01041651}" />
<property name="P2" value="{X=2, Y=1.01041651}" />
<property name="UseLayerWidth" value="True" />
<property name="UseLayerColor" value="True" />
<property name="Width" value="0" />
<property name="Color" value="Color [White]" />
</line>
<line>
<property name="P1" value="{X=2, Y=1.01041651}" />
<property name="P2" value="{X=0, Y=1.01041651}" />
<property name="UseLayerWidth" value="True" />
<property name="UseLayerColor" value="True" />
<property name="Width" value="0" />
<property name="Color" value="Color [White]" />
</line>
<line>
<property name="P1" value="{X=0, Y=1.01041651}" />
<property name="P2" value="{X=0, Y=2.01041651}" />
<property name="UseLayerWidth" value="True" />
<property name="UseLayerColor" value="True" />
<property name="Width" value="0" />
<property name="Color" value="Color [White]" />
</line>
</items>
</layer>
<layer Id="layer1">
<property name="Color" value="Color [Red]" />
<property name="Width" value="0.005" />
<property name="Name" value="0.005 Layer" />
<property name="Enabled" value="True" />
<property name="Visible" value="True" />
<items />
</layer>
<layer Id="layer2">
<property name="Color" value="Color [Green]" />
<property name="Width" value="0.025" />
<property name="Name" value="0.025 Layer" />
<property name="Enabled" value="True" />
<property name="Visible" value="True" />
<items />
</layer>
<property name="CenterPoint" value="{X=1.02604163, Y=0.17187548}" />
<property name="Zoom" value="1" />
</CanvasDataModel>
Russia ☭ forever, Viacheslav N. Mezentsev
#20 Posted: 9/18/2018 10:44:10 AM
How to use RegionBase.Regions property: Script Region. Regions list contains one Textbox control.
Russia ☭ forever, Viacheslav N. Mezentsev
1 Pages (20 items)
-
New Posts
-
No New Posts