
ICS Manager与pulsar通信方式采用grpc实现,Pulsar端为grpcserver,采用PulsarEZFlow执行。
在ICS Manager文件夹中Adaptor文件夹为与Pulsar通信而生成的ezflow库。为了应用EZFlow,请把文末EZA脚本加载到Pulsar中,并把其中C:\Adaptor替换为Adaptor文件夹在本地电脑的绝对路径。
再检查C:\ProgramData\Servotest\AdvancedEZFDlls\路径是否为PulsarEZFlow运行路径,如果不是需要把所有C:\ProgramData\Servotest\AdvancedEZFDlls\改为本地电脑中的相应路径。
更新:eza中添加了直接启动ICSManager相关内容,可更改脚本中
F:\计划\ICS\Relesae\net6.0-windows\IcsManager.exe内容,该路径为本地电脑中ICSManager路径。
准备好EZFlow后,开始执行EZFlow;然后运行ICSManager 软件,如果软件没有报告Pulsar连接问题,则标识通信成功,可以进行与Pulsar交互相关操作。
Pulsar 相关操作请查阅Pulsar操作手册。
#include C:\Adaptor\Google.Protobuf.dll;
#include C:\Adaptor\Grpc.Core.Api.dll;
#include C:\Adaptor\Grpc.Core.dll;
//#include C:\Adaptor\grpc_csharp_ext.x64.dll;
//#include C:\Adaptor\grpc_csharp_ext.x86.dll;
#include C:\Adaptor\IcsManagerPulsarAdaptor.dll;
#include C:\Adaptor\PulsarConnector.dll;
#include C:\Adaptor\System.Buffers.dll;
#include C:\Adaptor\System.Memory.dll;
#include C:\Adaptor\System.Numerics.Vectors.dll;
#include C:\Adaptor\System.Runtime.CompilerServices.Unsafe.dll;
#using BBK.IcsManager.PulsarAdaptor
#using Servotest.Foundation.Utils;
#using System.Linq;
#using System.ComponentModel;
#using System.Text;
#using System.Text.RegularExpressions;
#using System.Resources;
#using Servotest.D2R.Ui.Sockets;
#using Servotest.D2R.Multisystem;
#using System.Net;
#using System.Net.Sockets;
#using System.Diagnostics;
//#include C:\Adaptor\libgrpc_csharp_ext.x64.so;
//#include C:\Adaptor\libgrpc_csharp_ext.x64.dylib;
//C:\ProgramData\Servotest\AdvancedEZFDlls\
if(!File.Exists(@"C:\ProgramData\Servotest\AdvancedEZFDlls\grpc_csharp_ext.x86.dll"))
{
File.Copy(@"C:\Adaptor\grpc_csharp_ext.x86.dll",@"C:\ProgramData\Servotest\AdvancedEZFDlls\grpc_csharp_ext.x86.dll",true);
}
string path = @"F:\计划\ICS\Relesae\net6.0-windows\IcsManager.exe";
string env=Path.GetDirectoryName(path)??"";
Task.Factory.StartNew(async ()=>
{
await Task.Delay(1000);
string temp = Environment.CurrentDirectory;
Environment.CurrentDirectory = env;
Process.Start(path);
Environment.CurrentDirectory = temp;
});
messagePasser("Script start !");
Adaptor adaptor=new Adaptor();
adaptor.InitSystem(pulsarSystem,messagePasser);
return await adaptor.StartServer(cancelToken);