1 страниц (9 вхождений)
How to share user defined functions or plugins without programming? - How to share user defined functions or plugins without programming? - Сообщения
#1 Опубликовано: 19.12.2016 05:27:40
Hello,
As far as I know, Smath allow us to create user defined functions and to share them using the "plugins". Plugins can be created by programming the functions using a development tool.
But this solution is not practical enough when the functions are really complicated. (cf https://smath.com/wiki/GetFile.aspx?File=Developer%20Guide/Tutorial%20on%20creating%20plugin%20for%20Smath.pdf)
I would like to know how would it be possible to share some user defined functions or plugins without having to program.
For example, imagine I use "function1" in several Smath projects.
I want to be able to use this "function1" in all of my sheets without having to redefine "function1" in every project.
Please this would be very helpful for me.
Thank you for your suggestions.
Fernando
As far as I know, Smath allow us to create user defined functions and to share them using the "plugins". Plugins can be created by programming the functions using a development tool.
But this solution is not practical enough when the functions are really complicated. (cf https://smath.com/wiki/GetFile.aspx?File=Developer%20Guide/Tutorial%20on%20creating%20plugin%20for%20Smath.pdf)
I would like to know how would it be possible to share some user defined functions or plugins without having to program.
For example, imagine I use "function1" in several Smath projects.
I want to be able to use this "function1" in all of my sheets without having to redefine "function1" in every project.
Please this would be very helpful for me.
Thank you for your suggestions.
Fernando
#2 Опубликовано: 19.12.2016 05:38:11
You can use include plugin for this.
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
fernando_92 19.12.2016 07:52:00
#3 Опубликовано: 19.12.2016 10:59:13
I use snippets for this purpose.
For more info on snippets see the wiki here: https://smath.com/wiki/Snippets.ashx
For more info on snippets see the wiki here: https://smath.com/wiki/Snippets.ashx
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
2 пользователям понравился этот пост
#4 Опубликовано: 19.12.2016 21:59:30
WroteFor example, imagine I use "function1" in several Smath projects.
I want to be able to use this "function1" in all of my sheets without having to redefine "function1" in every project.
That's what the "plugin Include" does.
1. Plug these two in the same directory.
2. Open "Genfit Algo Include Test.sm"
3. It will ask to install "include Plugin", install.
4. Press F9 to calculate work sheet.
Please confirm if it works for you.
Was created Smath 5346, works fine latest Smath 6179.
Jean
Genfit Algo Include.sm (13 КиБ) скачан 39 раз(а).
Genfit Algo Include Test.sm (16 КиБ) скачан 42 раз(а).
1 пользователям понравился этот пост
fernando_92 20.12.2016 04:18:00
#5 Опубликовано: 20.12.2016 00:04:51
... try these two . Same topo as previous "Genfit"
Fourier 2D ZOOM Include.sm (11 КиБ) скачан 44 раз(а).
Fourier 2D ZOOM Include Test.sm (105 КиБ) скачан 46 раз(а).
Fourier 2D ZOOM Include.sm (11 КиБ) скачан 44 раз(а).
Fourier 2D ZOOM Include Test.sm (105 КиБ) скачан 46 раз(а).
#6 Опубликовано: 20.12.2016 04:22:49
Hello, thank you for your suggestions, plugin " Include " works for me. It is really helpful. I will have to test its limits.
But I would like to know now what is the difference between Snippets and the "Include" Plugin ? Why couldn't we just use snippets?
Thank you!
But I would like to know now what is the difference between Snippets and the "Include" Plugin ? Why couldn't we just use snippets?
Thank you!
#7 Опубликовано: 20.12.2016 10:05:06
Both Snippets and Include you have a "master" worksheet that includes all the functions you'd like to incorporate into the worksheet.
With Snippets, you actually create a copy of the "master" and essentially paste it into the worksheet that you are using. It puts the copied worksheet into a collapsible area so you can minimize it if you'd like.
Advantages and disadvantages to this approach are as follows.
1.) You have direct access to the function definitions. You can see how you wrote a certain function or make changes in your local copy but they don't get updated in the "master" snippet.
2.) If you update the "master" snippet worksheet, it does NOT update worksheets where the snippet as been used. You would have to re-add the snippet in subsequent worksheets to update.
With the Include plugin, you are essentially running the "master" worksheet in the background and you have access to the results and functions defined in that worksheet. This has the potential advantages/disadvantages of
1.) Cannot see or change the function definitions in the local worksheet.
2.) An update in the "master" worksheet will be immediately available to any worksheets that include the master.
I prefer snippets for managing functions a couple reasons.
1.) I like to have the local copy of the functions in the worksheet. I often make worksheets and don't come back to them for months or years at a time. When I do, I like to see the state of the functions that I used at that time. Everything I need is in one worksheet. If I were to use the include plugin and for any reason I lost or misplaced the master Include worksheet, I'd be SOL.
2.) I think I ran into the issue with the include plugin with which function Descriptions don't get passed from one worksheet to another. I often write a lot of detail on how some of my more complicated functions work so they can be useful to others or so I can remember how to use them properly. Using the include plugin, you'd have to go to the master worksheet to see that information
I find include plugin to be much more useful for transferring results. Perhaps I create a worksheet to solve for the output of a certain circuit. I then want to use the results of that for the input of another circuit. I may use the include plugin in that situation.
With Snippets, you actually create a copy of the "master" and essentially paste it into the worksheet that you are using. It puts the copied worksheet into a collapsible area so you can minimize it if you'd like.
Advantages and disadvantages to this approach are as follows.
1.) You have direct access to the function definitions. You can see how you wrote a certain function or make changes in your local copy but they don't get updated in the "master" snippet.
2.) If you update the "master" snippet worksheet, it does NOT update worksheets where the snippet as been used. You would have to re-add the snippet in subsequent worksheets to update.
With the Include plugin, you are essentially running the "master" worksheet in the background and you have access to the results and functions defined in that worksheet. This has the potential advantages/disadvantages of
1.) Cannot see or change the function definitions in the local worksheet.
2.) An update in the "master" worksheet will be immediately available to any worksheets that include the master.
I prefer snippets for managing functions a couple reasons.
1.) I like to have the local copy of the functions in the worksheet. I often make worksheets and don't come back to them for months or years at a time. When I do, I like to see the state of the functions that I used at that time. Everything I need is in one worksheet. If I were to use the include plugin and for any reason I lost or misplaced the master Include worksheet, I'd be SOL.
2.) I think I ran into the issue with the include plugin with which function Descriptions don't get passed from one worksheet to another. I often write a lot of detail on how some of my more complicated functions work so they can be useful to others or so I can remember how to use them properly. Using the include plugin, you'd have to go to the master worksheet to see that information
I find include plugin to be much more useful for transferring results. Perhaps I create a worksheet to solve for the output of a certain circuit. I then want to use the results of that for the input of another circuit. I may use the include plugin in that situation.
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
1 пользователям понравился этот пост
frapuano 20.12.2016 13:01:00
#8 Опубликовано: 20.12.2016 12:03:20
Thanks for the ellaborate distinction.
"Snippets" is like a plugin, like something done for ever [so to speak].
I understand better how to manage "Include". Looks much easier to recompose
a stand alone work sheet to share in the forum.
"Snippets" is like a plugin, like something done for ever [so to speak].
I understand better how to manage "Include". Looks much easier to recompose
a stand alone work sheet to share in the forum.
#9 Опубликовано: 20.12.2016 12:13:45
WroteHello, thank you for your suggestions, plugin " Include " works for me. It is really helpful. I will have to test its limits.
But I would like to know now what is the difference between Snippets and the "Include" Plugin ? Why couldn't we just use snippets?
Thank you!
Fernando:
Did the 2nd "Fourier" example work ?
It didn't work for me the first time. It couldn't find the Matlab "mwXXX.."
library. By luck I type 'mwbesselj(1,1.23456789) in new sheet. It did want
to install the 8 MB Matlab stuff, YES, done, then the Fourier is available.
Viacheslav replied: repaired.
Jean
1 страниц (9 вхождений)
-
Новые сообщения
-
Нет новых сообщений