SMath Studio Forum
»
SMath Studio
»
Questions
»
Access SMath file from within C++ app
Rank: Newbie
Groups: Registered
Joined: 19/08/2012(UTC) Posts: 8
|
Hi,
I wounder if it is possible to access SMath files from within C++ app to provide values for variables and get back results. The reason is that it is easier to develop and check analysis for ever changing tasks in SMath but include it in our general analysis solving application.
Thanks!
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: florian.kosche@difk.no I wounder if it is possible to access SMath files from within C app to provide values for variables and get back results. The reason is that it is easier to develop and check analysis for ever changing tasks in SMath but include it in our general analysis solving application.
Not clear what you are asking for: If you C++ application can generate vector of values and if it can write to NotePad, you can read NotePad from Smath and proceed to the maths you wish, that Smath can digest. Maybe the other way around ?
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 19/08/2012(UTC) Posts: 8
|
In principle yes, but not exchange values through text files, rather than an api towards specific SMath files. You could imagine the SMath file includes operations that can be accessed by a C++ function.
I then could write a program in C++ which would connect to a SMath file and feed it with values and get back results.
Was that maybe clearer?
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Ah ! got it ... Application C++ read Smath data ,<= [data generated by Smath from some function(s)] ... then Smath <= read back application . Bidirectional means both in some universal code. The real question is: could Smath do same as the "Application" ? ... you give no hint.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 19/08/2012(UTC) Posts: 8
|
I have no hints, but I think you understand. In a way you would integrate SMath files into the C++ application during execution as if they were C++ functions. This would not happen at compile time but during execution.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: florian.kosche@difk.no I have no hints, but I think you understand. In a way you would integrate SMath files into the C application during execution as if they were C functions. This would not happen at compile time but during execution. That's what Mathcad is doing with the extension packs. You can work solely from the respective extension pack or from the normal Mathcad work sheet that calls the functions from the pack. But functions in the pack(s) are coded in Mathcad style. In other words, the Smath functions would have to be coded C++ for the application to read at execution time... And from the C++ application, were to you feed that to plot, tabulate and else project demand ? Smath has already some stuff from "Dot Numerics, Matlab..." Cheers, Jean ... Hope you get more professional reply.
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
Originally Posted by: florian.kosche@difk.no I then could write a program in C++ which would connect to a SMath file and feed it with values and get back results. There is no direct way for this. Theoretically, you can use shared memory for this. But still there is no direct access from the unmanaged memory to the managed one. Also you will need a way to calculate the document from the outside. For now there is no API to control SMath Studio from own application. And Andrey was against using separate parts of the program as a worksheet calculator. |
Russia ☭ forever Viacheslav N. Mezentsev |
|
|
|
Rank: Newbie
Groups: Registered
Joined: 19/08/2012(UTC) Posts: 8
|
I see! Would be a very powerful tool for practical engineering though. A work around could be that SMath sheets can be exported as C or C++ code, which than could be linked into the application.
I shall think a bit more.
Thank you for your answers!
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
Originally Posted by: florian.kosche@difk.no A work around could be that SMath sheets can be exported as C or C++ code, which than could be linked into the application.
It's impossible. SMath Studio is a .Net application and worksheets (which including visual components) also depend on .Net assemblies. So, you can't do that. But you can add your code as plugin like Mathcad EFI or CPPPlugin. Edited by user 24 October 2017 11:28:42(UTC)
| Reason: Not specified |
Russia ☭ forever Viacheslav N. Mezentsev |
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
Access SMath file from within C++ app
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.