diff --git a/MP.MONO.UI.sln b/MP.MONO.UI.sln index dd60750..f49cdfe 100644 --- a/MP.MONO.UI.sln +++ b/MP.MONO.UI.sln @@ -9,6 +9,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.MONO.Data", "MP.MONO.Dat EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.MONO.Core", "MP.MONO.Core\MP.MONO.Core.csproj", "{7DE649D8-511E-4674-A170-7E7AFDE4FD89}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MachineSim", "MachineSim\MachineSim.csproj", "{4C719185-F1C9-4066-8464-183166475CB5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -27,6 +29,10 @@ Global {7DE649D8-511E-4674-A170-7E7AFDE4FD89}.Debug|Any CPU.Build.0 = Debug|Any CPU {7DE649D8-511E-4674-A170-7E7AFDE4FD89}.Release|Any CPU.ActiveCfg = Release|Any CPU {7DE649D8-511E-4674-A170-7E7AFDE4FD89}.Release|Any CPU.Build.0 = Release|Any CPU + {4C719185-F1C9-4066-8464-183166475CB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C719185-F1C9-4066-8464-183166475CB5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C719185-F1C9-4066-8464-183166475CB5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C719185-F1C9-4066-8464-183166475CB5}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/MachineSim/MachineSim.csproj b/MachineSim/MachineSim.csproj new file mode 100644 index 0000000..2e5263d --- /dev/null +++ b/MachineSim/MachineSim.csproj @@ -0,0 +1,16 @@ + + + + Exe + net6.0 + enable + enable + + + + + + + + + diff --git a/MachineSim/Program.cs b/MachineSim/Program.cs new file mode 100644 index 0000000..6403cfc --- /dev/null +++ b/MachineSim/Program.cs @@ -0,0 +1,27 @@ +// See https://aka.ms/new-console-template for more information +using StackExchange.Redis; +using System.Configuration; + +string lineSep = "------------------------------------------------------"; +string redisConf = "127.0.0.1:6379"; + +Console.WriteLine(lineSep); +Console.WriteLine($"Starting Machine SIM - redis server on {redisConf}!"); +Console.WriteLine(lineSep); +Console.WriteLine(""); + +//Create a connection +using (ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("127.0.0.1:6379")) +{ + ISubscriber sub = redis.GetSubscriber(); + + Console.WriteLine("please enter any character and exit to exit"); + + string input; + + do + { + input = Console.ReadLine(); + sub.Publish("allarmi", input); + } while (input != "exit"); +} \ No newline at end of file