Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline florian.kosche@difk.no  
#1 Posted : 23 October 2017 11:03:14(UTC)
florian.kosche@difk.no

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!

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Jean Giraud  
#2 Posted : 23 October 2017 18:55:24(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: florian.kosche@difk.no Go to Quoted Post
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 ?

Read NotePad.PNG
Offline florian.kosche@difk.no  
#3 Posted : 23 October 2017 19:15:39(UTC)
florian.kosche@difk.no

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?
Offline Jean Giraud  
#4 Posted : 23 October 2017 23:05:14(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

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.
Offline florian.kosche@difk.no  
#5 Posted : 24 October 2017 03:36:51(UTC)
florian.kosche@difk.no

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.

Offline Jean Giraud  
#6 Posted : 24 October 2017 04:42:49(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: florian.kosche@difk.no Go to Quoted Post
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.
Offline uni  
#7 Posted : 24 October 2017 07:48:52(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Originally Posted by: florian.kosche@difk.no Go to Quoted Post
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
Offline florian.kosche@difk.no  
#8 Posted : 24 October 2017 11:04:07(UTC)
florian.kosche@difk.no

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!
Offline uni  
#9 Posted : 24 October 2017 11:26:03(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Originally Posted by: florian.kosche@difk.no Go to Quoted Post

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
Users browsing this topic
Guest
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.