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 460  
#1 Posted : 22 November 2016 20:15:02(UTC)
460

Rank: Newbie

Groups: Registered
Joined: 22/11/2016(UTC)
Posts: 2

День добрый!
Написал некий алгоритм на SMath Studio. Какие есть способы доступа к нему из внешней программы? Например дать на вход данные, а после расчета получить данные на выходе.

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

Offline Davide Carpi  
#2 Posted : 23 November 2016 13:02:32(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,654
Man
Italy
Location: Italy

Was thanked: 1340 time(s) in 879 post(s)
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Alex M.  
#3 Posted : 23 November 2016 21:56:03(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 418
Canada

Was thanked: 125 time(s) in 96 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post


ALso would like to point out that as far as I know you cannot call Smath execution from any external software.

Best you can do is Smath inputs to external & Smath retrieves from external, not the other way around.

Edited by user 24 November 2016 00:52:51(UTC)  | Reason: Not specified

Offline 460  
#4 Posted : 24 November 2016 20:12:39(UTC)
460

Rank: Newbie

Groups: Registered
Joined: 22/11/2016(UTC)
Posts: 2

For example MathCad and Delphi

MathCad code (here is the algorithm)
Quote:

A:=Re(in0)
B:=Re(in1)
C:=A+B
out0:=C


Delphi code (enter an input and get the output data)
Quote:
procedure TForm1.Button1Click(Sender: TObject);
begin
with OleContainer1 do
begin
x1:=StrToInt(Edit1.text);
y1:=StrToInt(Edit1.text);
Run;
OleObject.SetComplex('in0', x1, 0);
OleObject.SetComplex('in1', y1, 0);
OleObject.Recalculate;
z2:=OleObject.GetComplex('out0', out_data, out_Buf);
label1.Caption:=IntToStr(z2);
end;
end;


How to do this with SMath?

Edited by user 24 November 2016 20:28:14(UTC)  | Reason: Not specified

Offline uni  
#5 Posted : 24 November 2016 20:30:54(UTC)
uni


Rank: Advanced Member

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

Was thanked: 1275 time(s) in 746 post(s)
Это невозможно сделать, используя SMath Studio (автоматизация не поддерживается). Но вы можете задать файл с данными и выполнить расчётный файл без запуска интерфейса. Выходные переменные нужно также записать в виде файла. Импорт и экспорт можно делать различными способами.

Где-то была тема с ключами SMath Studio, в которой Андрей показывал как вычислить sm-файл без запуска интерфейса.

П.С. Дэвид написал дополнение Run, которое использует эти ключи (silent и test) для вычисления документа.

Options

Edited by user 24 November 2016 20:44:46(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 24/11/2016(UTC)
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.