Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
π Links: 1. How to create plugins for SMath Studio2. Command-line build with csc.exe3. Template project for numerical plugin (VS2017, .Net 2.0+, C#)4. SMath Studio Core documentation (CHM) 5. Developer Guide (partially obsolete) For c#: 1. Create file build.cmd
Code:::Autor: Viacheslav N. Mezentsev (viacheslavmezentsev@ya.ru)
@echo off && cls
set dotnet=%windir%\Microsoft.NET\Framework64
if "%~x1" == ".cs" set lang=cs
if "%~x1" == ".vb" set lang=vb
for %%n in (2.0.50727,3.5,4.0.30319) do if exist "%dotnet%\v%%n\%lang%c.exe" set comp="%dotnet%\v%%n\%lang%c.exe"
if exist %comp% (
%comp% -nologo ^
-target:library ^
-lib:"%ProgramFiles(x86)%\SMath Studio" ^
-reference:System.Xml.dll,System.Data.dll,SMath.Controls.dll,SMath.Manager.dll,SMath.Math.Numeric.dll,SMath.Math.Symbolic.dll ^
-out:"%~n1.dll" %1 ) && echo SMath plugin: "%~n1.dll"
)
2. Create source file CSTinyPlugin.cs
Code:using System;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using SMath.Manager;
using SMath.Math;
using SMath.Math.Numeric;
[assembly: AssemblyTitle( "CSTinyPlugin" )]
[assembly: AssemblyDescription( "Template project for numerical plugin." )]
[assembly: AssemblyVersion("0.1.*")]
// NOTE: Each plugin must have unique GUID. Use online guid generators for this.
[assembly: Guid("3F8D4EC4-637C-4E5E-95D1-4F0422B71A27")]
public class Plugin : IPluginMathNumericEvaluation
{
private TermInfo[] _terms;
private Dictionary<string, string> _description = new Dictionary<string, string> { { "ENG", "mult function." }, { "RUS", "ΡΡΠ½ΠΊΡΠΈΡ ΡΠΌΠ½ΠΎΠΆΠ΅Π½ΠΈΡ." } };
public TermInfo[] GetTermsHandled( SessionProfile sessionProfile )
{
return _terms;
}
public void Initialize()
{
_terms = new[] {
new TermInfo (
"mult", TermType.Function, _description[ "ENG" ], FunctionSections.Unknown, true,
new[] { new ArgumentInfo( ArgumentSections.RealNumber ), new ArgumentInfo( ArgumentSections.RealNumber ) }
)};
}
public bool NumericEvaluation( Term value, TNumber[] args, ref TNumber result )
{
result = args[0] * args[1];
return true;
}
public void Dispose() {}
}
3. Build assembly using command: build CSTinyPlugin.csAlso you can use drag and drop technique for this. You get CSTinyPlugin.dll 5. Copy CSTinyPlugin.dll to the C:\Program Files (x86)\SMath Studio\plugins folder and restart the program. 6. Test it. 7. Read the SMath Studio Core documentation: SSCoreDoc.chm. Edited by user 13 August 2019 15:27:55(UTC)
| Reason: Not specified |
Russia β forever Viacheslav N. Mezentsev |
2 users thanked uni for this useful post.
|
on 06/08/2019(UTC), on 07/08/2019(UTC)
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
π Links: 1. How to create plugins for SMath Studio2. Sample compilation command lines (Visual Basic)3. Template project for numerical plugin (VS2017, .Net 2.0+, VB.Net)4. SMath Studio Core documentation (CHM) 5. Developer Guide (partially obsolete) For vb.net: 1. Create file build.cmd
Code:::Autor: Viacheslav N. Mezentsev (viacheslavmezentsev@ya.ru)
@echo off && cls
set dotnet=%windir%\Microsoft.NET\Framework64
if "%~x1" == ".cs" set lang=cs
if "%~x1" == ".vb" set lang=vb
for %%n in (2.0.50727,3.5,4.0.30319) do if exist "%dotnet%\v%%n\%lang%c.exe" set comp="%dotnet%\v%%n\%lang%c.exe"
if exist %comp% (
%comp% -nologo ^
-target:library ^
-lib:"%ProgramFiles(x86)%\SMath Studio" ^
-reference:System.Xml.dll,System.Data.dll,SMath.Controls.dll,SMath.Manager.dll,SMath.Math.Numeric.dll,SMath.Math.Symbolic.dll ^
-out:"%~n1.dll" %1 ) && echo SMath plugin: "%~n1.dll"
)
2. Create source file VBTinyPlugin.vb
Code:Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports System.Collections.Generic
Imports SMath.Manager
Imports SMath.Math
Imports SMath.Math.Numeric
<Assembly: AssemblyTitle("VBTinyPlugin")>
<Assembly: AssemblyDescription("Template project for numerical plugin.")>
<Assembly: AssemblyVersion("0.1.*")>
' NOTE: Each plugin must have unique GUID. Use online guid generators for this.
<Assembly: Guid("FB41BCBC-11EC-4D8D-BDE1-C5772608EEA9")>
Public Class Plugin
Implements IPluginMathNumericEvaluation
Private _terms As TermInfo()
Private _description As Dictionary(Of String, String) = New Dictionary(Of String, String) From {
{"ENG", "mult function."},
{"RUS", "ΡΡΠ½ΠΊΡΠΈΡ ΡΠΌΠ½ΠΎΠΆΠ΅Π½ΠΈΡ."}
}
Public Function GetTermsHandled(sessionProfile As SessionProfile) As TermInfo() Implements IPluginHandleEvaluation.GetTermsHandled
Return _terms
End Function
Public Sub Initialize() Implements IPlugin.Initialize
_terms = {New TermInfo("mult", TermType.[Function], _description("ENG"), FunctionSections.Unknown, True,
{ New ArgumentInfo(ArgumentSections.RealNumber), New ArgumentInfo(ArgumentSections.RealNumber)}) }
End Sub
Public Function NumericEvaluation(value As Term, args As TNumber(), ByRef result As TNumber) As Boolean Implements IPluginMathNumericEvaluation.NumericEvaluation
result = args(0) * args(1)
Return True
End Function
Public Sub Dispose() Implements IDisposable.Dispose
End Sub
End Class
3. Build assembly using command: build VBTinyPlugin.vbAlso you can use drag and drop technique for this. You get VBTinyPlugin.dll 5. Copy VBTinyPlugin.dll to the C:\Program Files (x86)\SMath Studio\plugins folder and restart the program. 6. Test it. 7. Read the SMath Studio Core documentation: SSCoreDoc.chm. Edited by user 07 August 2019 18:13:55(UTC)
| Reason: Not specified |
Russia β forever Viacheslav N. Mezentsev |
1 user thanked uni for this useful post.
|
|
|
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.