How to create plugins for SMath Studio

How to create plugins for SMath Studio - Сообщения

#1 Опубликовано: 13.02.2010 01:35:43
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

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
  1. Download SVN client program: TortoiseSVN.
  2. Install it (reboot can be required).
  3. Create a folder on your PC where you want to store the sources.
  4. Right click on created folder and choose "SVN Checkout..." item from the folders context menu.
  5. Fill in text areas into appeared dialog (usually you need to specify only URL of repository) and press OK button.
  6. 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 Опубликовано: 13.02.2010 01:37:30
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

Three types of plugins supported by SMath Studio 0.87 (new types will be available in the future).
  1. Low-level expression evaluations (IPluginLowLevelEvaluation interface).
    See demo video (temporary one).
  2. Numeric expression evaluations (IPluginMathNumericEvaluation interface).
  3. Symbolic expression evaluations (IPluginMathSymbolicEvaluation interface).


Tutorial in progress... please, be patience.
#3 Опубликовано: 05.05.2010 16:16:59
maweilian

maweilian

5 сообщений из 103 понравились пользователям.

Группа: User

Wrote

Three types of plugins supported by SMath Studio 0.87 (new types will be available in the future).

  1. Low-level expression evaluations (IPluginLowLevelEvaluation interface).
    See demo video (temporary one).
  2. Numeric expression evaluations (IPluginMathNumericEvaluation interface).
  3. 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. I really think that the extensibility of Smath is a great feature and hope that you continue to provide support for it in the future.
Will Massie Mechanical Engineer Oregon, USA
#4 Опубликовано: 05.05.2010 18:46:30
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

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.
#5 Опубликовано: 02.06.2010 20:53:43
maweilian

maweilian

5 сообщений из 103 понравились пользователям.

Группа: User

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.
Will Massie Mechanical Engineer Oregon, USA
#6 Опубликовано: 02.06.2010 21:55:33
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

Hello, maweilian.

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
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.
#7 Опубликовано: 03.06.2010 22:12:33
maweilian

maweilian

5 сообщений из 103 понравились пользователям.

Группа: User

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.

Will Massie Mechanical Engineer Oregon, USA
#8 Опубликовано: 04.06.2010 11:03:00
Oscar Campo

Oscar Campo

124 сообщений из 298 понравились пользователям.

Группа: Moderator

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
#9 Опубликовано: 04.06.2010 11:13:20
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

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.
#10 Опубликовано: 04.06.2010 11:42:14
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Hello Will,

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 Опубликовано: 04.06.2010 15:59:33
maweilian

maweilian

5 сообщений из 103 понравились пользователям.

Группа: User

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.
Will Massie Mechanical Engineer Oregon, USA
#12 Опубликовано: 04.06.2010 16:05:03
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

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.
#13 Опубликовано: 04.06.2010 17:57:51
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Hello,
Wrote

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.


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 Опубликовано: 04.06.2010 19:20:54
maweilian

maweilian

5 сообщений из 103 понравились пользователям.

Группа: User

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,
Will Massie Mechanical Engineer Oregon, USA
1 пользователям понравился этот пост
Andrey Ivashov 18.06.2010 11:13:00
#15 Опубликовано: 18.06.2010 18:04:30
maweilian

maweilian

5 сообщений из 103 понравились пользователям.

Группа: User

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
Will Massie Mechanical Engineer Oregon, USA
1 пользователям понравился этот пост
Andrey Ivashov 18.06.2010 20:29:00
#16 Опубликовано: 18.06.2010 20:44:28
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

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.
#17 Опубликовано: 04.08.2011 02:38:34
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

Path to repository was changed to: https://smath.info/svn/public
#18 Опубликовано: 14.07.2015 07:18:28
renante

renante

0 сообщений из 6 понравились пользователям.

Группа: User

Thank you for all your contributions. May i ask if we can use Netbeans as for IDE
#19 Опубликовано: 16.09.2018 07:27:01
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 сообщений из 1708 понравились пользователям.

Группа: Moderator

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:

Показать спойлер

Russia ☭ forever, Viacheslav N. Mezentsev
#20 Опубликовано: 18.09.2018 10:44:10
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 сообщений из 1708 понравились пользователям.

Группа: Moderator

How to use RegionBase.Regions property: Script Region. Regions list contains one Textbox control.
Russia ☭ forever, Viacheslav N. Mezentsev
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений