# HG changeset patch # User riono # Date 1620727328 -32400 # Node ID 3929e66a6645226dcd31520d64b45f25b381fcb7 # Parent 9e31b8c7a5bde708d6721a2f5aa2b8344eaec7b7 add RemoteTakeTest diff -r 9e31b8c7a5bd -r 3929e66a6645 Christie_net.csproj --- a/Christie_net.csproj Tue May 04 22:17:11 2021 +0900 +++ b/Christie_net.csproj Tue May 11 19:02:08 2021 +0900 @@ -3,7 +3,7 @@ Exe netcoreapp3.1 - Christie_net.Test.Example.HelloWorld.StartHelloWorld + Christie_net.Test.Example.RemoteTake.StartRemoteTake diff -r 9e31b8c7a5bd -r 3929e66a6645 Test/Example/HelloWorld/FinishHelloWorld.cs --- a/Test/Example/HelloWorld/FinishHelloWorld.cs Tue May 04 22:17:11 2021 +0900 +++ b/Test/Example/HelloWorld/FinishHelloWorld.cs Tue May 11 19:02:08 2021 +0900 @@ -8,7 +8,6 @@ [Take] private string world; public override void Run(CodeGearManager cgm) { - Console.WriteLine("fin:" + hello + " " + world); cgm.GetLocalDGM().Finish(); } } diff -r 9e31b8c7a5bd -r 3929e66a6645 Test/Example/RemoteTake/CreateRemoteTakeTest.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Test/Example/RemoteTake/CreateRemoteTakeTest.cs Tue May 11 19:02:08 2021 +0900 @@ -0,0 +1,15 @@ +using System; +using Christie_net.annotation; +using Christie_net.codegear; + +namespace Christie_net.Test.Example.RemoteTake { +public class CreateRemoteTakeTest : CodeGear { + [Take] public RTCommand command; + + + public override void Run(CodeGearManager cgm) { + Console.WriteLine(command); + cgm.GetLocalDGM().Put("finish" , "end"); + } +} +} \ No newline at end of file diff -r 9e31b8c7a5bd -r 3929e66a6645 Test/Example/RemoteTake/FinishRemoteTake.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Test/Example/RemoteTake/FinishRemoteTake.cs Tue May 11 19:02:08 2021 +0900 @@ -0,0 +1,13 @@ +using Christie_net.annotation; +using Christie_net.codegear; + +namespace Christie_net.Test.Example.RemoteTake { +public class FinishRemoteTake : CodeGear { + [Take] public string finish; + + public override void Run(CodeGearManager cgm) { + cgm.GetDGM("remote").Finish(); + cgm.GetLocalDGM().Finish(); + } +} +} \ No newline at end of file diff -r 9e31b8c7a5bd -r 3929e66a6645 Test/Example/RemoteTake/RTCommand.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Test/Example/RemoteTake/RTCommand.cs Tue May 11 19:02:08 2021 +0900 @@ -0,0 +1,22 @@ +using MessagePack; + +namespace Christie_net.Test.Example.RemoteTake { + +[MessagePackObject] +public class RTCommand { + public string line; + public string cmd; + public int offset; + + public RTCommand(string line, string cmd, int i) { + this.line = line; + this.cmd = cmd; + this.offset = i; + } + + public override string ToString() { + return "RTCommand{ line=" + line + "\\" + + ", cmd=" + cmd + "\\" + ", offset=" + offset + "}"; + } +} +} \ No newline at end of file diff -r 9e31b8c7a5bd -r 3929e66a6645 Test/Example/RemoteTake/StartRemoteTake.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Test/Example/RemoteTake/StartRemoteTake.cs Tue May 11 19:02:08 2021 +0900 @@ -0,0 +1,17 @@ +using Christie_net.codegear; + +namespace Christie_net.Test.Example.RemoteTake { +public class StartRemoteTake : StartCodeGear { + public StartRemoteTake(CodeGearManager cgm) : base(cgm) { } + + public static void Main() { + CodeGearManager cgm = CreateCgm(10001); + cgm.CreateRemoteDGM("remote", "localhost", 10001); + cgm.Setup(new CreateRemoteTakeTest()); + cgm.Setup(new FinishRemoteTake()); + RTCommand cmd = new RTCommand("insert", "line", 0); + cgm.GetDGM("remote").Put("command", cmd); + } + +} +} \ No newline at end of file