Skip to content

Commit

Permalink
Merge branch 'main' into messagebuffer-factory
Browse files Browse the repository at this point in the history
  • Loading branch information
BalassaMarton authored Jun 19, 2023
2 parents ce5599f + 7ec6dfd commit e36257a
Show file tree
Hide file tree
Showing 74 changed files with 3,807 additions and 1,085 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\..\..\src\messaging\dotnet\src\Client\MorganStanley.ComposeUI.Messaging.Client.csproj" />
<ProjectReference Include="../../../../../src/messaging/dotnet/src/Client/MorganStanley.ComposeUI.Messaging.Client.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
using System.Linq;
using System.Windows;
using MorganStanley.ComposeUI.Messaging.Client.WebSocket;
using System.Collections.Generic;
using MorganStanley.ComposeUI.ProcessExplorer.Abstractions.Entities;
using MorganStanley.ComposeUI.ProcessExplorer.Client.DependencyInjection;

namespace WPFDataGrid.TestApp;

Expand All @@ -33,6 +36,7 @@ public partial class App : Application
/// Url to connect
/// </summary>
public static Uri WebsocketURI { get; set; } = new("ws://localhost:5000/ws");
public static Guid WebsocketURIId { get; } = Guid.NewGuid();

/// <summary>
/// Overriding Statup so we can do DI.
Expand All @@ -52,7 +56,7 @@ protected async override void OnStartup(StartupEventArgs e)
var loggerFactory = new LoggerFactory();

var serilogger = new LoggerConfiguration()
.WriteTo.File(string.Format("{0}/log.log", Directory.GetCurrentDirectory()))
.WriteTo.File($"{Directory.GetCurrentDirectory()}/log.log")
.CreateLogger();

serviceCollection
Expand All @@ -65,8 +69,24 @@ protected async override void OnStartup(StartupEventArgs e)
mr =>
mr.UseWebSocket(new MessageRouterWebSocketOptions { Uri = WebsocketURI }));

serviceCollection.AddSingleton(typeof(DataGridView));
serviceCollection
.AddProcessExplorerClientWithGrpc(localCollector =>
localCollector.UseGrpc(new ClientServiceOptions
{
Connections = new List<IConnectionInfo>()
{
new ConnectionInfo(
id: WebsocketURIId,
name: nameof(WebsocketURI),
status: ConnectionStatus.Running,
remoteEndpoint: WebsocketURI.ToString())
},
LoadedServices = serviceCollection,
Port = 5056,
Host = "localhost"
}));

serviceCollection.AddSingleton(typeof(DataGridView));

_serviceProvider = serviceCollection.BuildServiceProvider();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
<ProjectReference Include="../ComposeUI.Example.WPFDataGrid/WPFDataGrid.csproj" />
</ItemGroup>


</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
using System.Windows;
using System.Windows.Controls;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using MorganStanley.ComposeUI.Messaging;
using MorganStanley.ComposeUI.ProcessExplorer.Client;
using WPFDataGrid.Models;

namespace WPFDataGrid.Views;
Expand All @@ -28,26 +30,40 @@ namespace WPFDataGrid.Views;
/// </summary>
public partial class DataGridView : Window
{
private readonly ILogger<DataGridView>? _logger;
private readonly ILogger<DataGridView> _logger;
private readonly IMessageRouter _messageRouter;
private readonly ObservableCollection<SymbolModel> _symbols;
private readonly IProcessInfoHandler _processInfoHandler;

/// <summary>
/// Constructor for the View.
/// </summary>
/// <param name="logger"></param>
/// <param name="messageRouter"></param>
public DataGridView(ILogger<DataGridView> logger, IMessageRouter messageRouter)
public DataGridView(
ILogger<DataGridView>? logger,
IMessageRouter messageRouter,
IProcessInfoHandler processInfoHandler)
{
_logger = logger;
_logger = logger ?? NullLogger<DataGridView>.Instance;
_messageRouter = messageRouter;
_symbols = new(MarketDataAccess.MarketData);
_processInfoHandler = processInfoHandler;
InitializeComponent();
}

private async void Window_Loaded(object sender, RoutedEventArgs e)
{
MyDataGridMarketData.ItemsSource = _symbols;

try
{
await _processInfoHandler.SendRuntimeInfo();
}
catch (Exception exception)
{
_logger.LogError($"Error occurred while sending information to the Process Explorer server. Detailed exception: {exception}");
}
}

private async void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
Expand All @@ -56,15 +72,15 @@ private async void DataGrid_SelectionChanged(object sender, SelectionChangedEven
{
var selectedObject = e.AddedItems.Cast<SymbolModel>().FirstOrDefault();

if (selectedObject is not null)
if (selectedObject != null)
{
_logger?.LogInformation(string.Format("You have selected: {0}", selectedObject.Fullname));
_logger.LogInformation(string.Format("You have selected: {0}", selectedObject.Fullname));
await _messageRouter.PublishJsonAsync("proto_select_marketData", selectedObject, SymbolModel.JsonSerializerOptions);
}
}
catch (Exception exception)
{
_logger?.LogError(exception.ToString());
_logger.LogError(exception.ToString());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@
</PropertyGroup>

<ItemGroup>
<None Remove="Theme\Style.xaml" />
<None Remove="Views\DataGridView.xaml" />
<None Remove="Theme/Style.xaml" />
<None Remove="Views/DataGridView.xaml" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.3" />
</ItemGroup>

<ItemGroup>
<Page Include="Theme\Style.xaml" />
<Page Include="Views\DataGridView.xaml" />
<Page Include="Theme/Style.xaml" />
<Page Include="Views/DataGridView.xaml" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\..\..\src\messaging\dotnet\src\Client\MorganStanley.ComposeUI.Messaging.Client.csproj" />
<ProjectReference Include="../../../../../src/messaging/dotnet/src/Client/MorganStanley.ComposeUI.Messaging.Client.csproj" />
<ProjectReference Include="../../../../process-explorer/dotnet/src/MorganStanley.ComposeUI.ProcessExplorer.Client/MorganStanley.ComposeUI.ProcessExplorer.Client.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComposeUI.Example.DataServi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WPFDataGrid", "ComposeUI.Example.WPFDataGrid\WPFDataGrid.csproj", "{EFF70E7E-C320-4F47-8A13-C1FE5C8F2982}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WPFDataGrid.TestApp", "ComposeUI.Example.WPFDataGrid.TestApp\WPFDataGrid.TestApp.csproj", "{21BA0993-6F19-4549-8884-CB4C7FAE34A8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Process Explorer", "Process Explorer", "{BF3D9176-E2B0-4C87-9691-8288C257BFAF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "modules", "modules", "{E761C6B7-625B-47D8-811B-A67B3E7221D5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MorganStanley.ComposeUI.ProcessExplorer.LocalCollector", "..\..\..\process-explorer\dotnet\src\MorganStanley.ComposeUI.LocalCollector\MorganStanley.ComposeUI.ProcessExplorer.LocalCollector.csproj", "{592929ED-A4B6-4A0E-B30B-610D9110BF8E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MorganStanley.ComposeUI.ProcessExplorer.Abstractions", "..\..\..\process-explorer\dotnet\src\MorganStanley.ComposeUI.ProcessExplorer.Abstractions\MorganStanley.ComposeUI.ProcessExplorer.Abstractions.csproj", "{C82B3A79-82C7-409D-868E-0DF45C0DFB56}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MorganStanley.ComposeUI.ProcessExplorer.Core", "..\..\..\process-explorer\dotnet\src\MorganStanley.ComposeUI.ProcessExplorer.Core\MorganStanley.ComposeUI.ProcessExplorer.Core.csproj", "{AF8A1D0A-D20F-4853-89C0-C9C80F50C5ED}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MorganStanley.ComposeUI.ProcessExplorer.Server", "..\..\..\process-explorer\dotnet\src\MorganStanley.ComposeUI.ProcessExplorer.Server\MorganStanley.ComposeUI.ProcessExplorer.Server.csproj", "{D5327512-2467-4EE0-83F8-3630997703F2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WPFDataGrid.TestApp", "ComposeUI.Example.WPFDataGrid.TestApp\WPFDataGrid.TestApp.csproj", "{DC7886A9-7639-4748-8FAE-D208672BAEB9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MorganStanley.ComposeUI.ProcessExplorer.Client", "..\..\..\process-explorer\dotnet\src\MorganStanley.ComposeUI.ProcessExplorer.Client\MorganStanley.ComposeUI.ProcessExplorer.Client.csproj", "{047E4B24-FCFB-4DAE-8641-B07DA55A58D1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -65,14 +65,6 @@ Global
{EFF70E7E-C320-4F47-8A13-C1FE5C8F2982}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EFF70E7E-C320-4F47-8A13-C1FE5C8F2982}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EFF70E7E-C320-4F47-8A13-C1FE5C8F2982}.Release|Any CPU.Build.0 = Release|Any CPU
{21BA0993-6F19-4549-8884-CB4C7FAE34A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21BA0993-6F19-4549-8884-CB4C7FAE34A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21BA0993-6F19-4549-8884-CB4C7FAE34A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21BA0993-6F19-4549-8884-CB4C7FAE34A8}.Release|Any CPU.Build.0 = Release|Any CPU
{592929ED-A4B6-4A0E-B30B-610D9110BF8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{592929ED-A4B6-4A0E-B30B-610D9110BF8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{592929ED-A4B6-4A0E-B30B-610D9110BF8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{592929ED-A4B6-4A0E-B30B-610D9110BF8E}.Release|Any CPU.Build.0 = Release|Any CPU
{C82B3A79-82C7-409D-868E-0DF45C0DFB56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C82B3A79-82C7-409D-868E-0DF45C0DFB56}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C82B3A79-82C7-409D-868E-0DF45C0DFB56}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -85,19 +77,27 @@ Global
{D5327512-2467-4EE0-83F8-3630997703F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D5327512-2467-4EE0-83F8-3630997703F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D5327512-2467-4EE0-83F8-3630997703F2}.Release|Any CPU.Build.0 = Release|Any CPU
{DC7886A9-7639-4748-8FAE-D208672BAEB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC7886A9-7639-4748-8FAE-D208672BAEB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC7886A9-7639-4748-8FAE-D208672BAEB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC7886A9-7639-4748-8FAE-D208672BAEB9}.Release|Any CPU.Build.0 = Release|Any CPU
{047E4B24-FCFB-4DAE-8641-B07DA55A58D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{047E4B24-FCFB-4DAE-8641-B07DA55A58D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{047E4B24-FCFB-4DAE-8641-B07DA55A58D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{047E4B24-FCFB-4DAE-8641-B07DA55A58D1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{C20FA602-71E5-4383-8F8F-B966873EFA69} = {E761C6B7-625B-47D8-811B-A67B3E7221D5}
{EFF70E7E-C320-4F47-8A13-C1FE5C8F2982} = {E761C6B7-625B-47D8-811B-A67B3E7221D5}
{21BA0993-6F19-4549-8884-CB4C7FAE34A8} = {E761C6B7-625B-47D8-811B-A67B3E7221D5}
{BF3D9176-E2B0-4C87-9691-8288C257BFAF} = {E761C6B7-625B-47D8-811B-A67B3E7221D5}
{592929ED-A4B6-4A0E-B30B-610D9110BF8E} = {BF3D9176-E2B0-4C87-9691-8288C257BFAF}
{C82B3A79-82C7-409D-868E-0DF45C0DFB56} = {BF3D9176-E2B0-4C87-9691-8288C257BFAF}
{AF8A1D0A-D20F-4853-89C0-C9C80F50C5ED} = {BF3D9176-E2B0-4C87-9691-8288C257BFAF}
{D5327512-2467-4EE0-83F8-3630997703F2} = {BF3D9176-E2B0-4C87-9691-8288C257BFAF}
{DC7886A9-7639-4748-8FAE-D208672BAEB9} = {E761C6B7-625B-47D8-811B-A67B3E7221D5}
{047E4B24-FCFB-4DAE-8641-B07DA55A58D1} = {BF3D9176-E2B0-4C87-9691-8288C257BFAF}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {98497725-4038-46B9-910E-2BADC6FDC7E4}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\src\messaging\dotnet\src\Core\MorganStanley.ComposeUI.Messaging.Core.csproj" />
<ProjectReference Include="..\..\..\..\..\src\messaging\dotnet\src\Server\MorganStanley.ComposeUI.Messaging.Server.csproj" />
<ProjectReference Include="..\..\..\..\process-explorer\dotnet\src\MorganStanley.ComposeUI.ProcessExplorer.Server\MorganStanley.ComposeUI.ProcessExplorer.Server.csproj" />
<ProjectReference Include="..\..\..\src\module-loader\dotnet\ModuleLoader\MorganStanley.ComposeUI.ModuleLoader.csproj" />
<ProjectReference Include="../../../../../src/messaging/dotnet/src/Core/MorganStanley.ComposeUI.Messaging.Core.csproj" />
<ProjectReference Include="../../../../../src/messaging/dotnet/src/Server/MorganStanley.ComposeUI.Messaging.Server.csproj" />
<ProjectReference Include="../../../../process-explorer/dotnet/src/MorganStanley.ComposeUI.ProcessExplorer.Server/MorganStanley.ComposeUI.ProcessExplorer.Server.csproj" />
<ProjectReference Include="../../../src/module-loader/dotnet/ModuleLoader/MorganStanley.ComposeUI.ModuleLoader.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,9 @@ public static async Task Main(string[] args)

foreach (var module in instances)
{
if (module.Value.Name == "dataservice")
{
instances.TryGetValue(module.Key, out var instance);
instance.State = SubsystemState.Started;
loader.RequestStartProcess(new LaunchRequest { name = module.Value.Name, instanceId = module.Key });
}
instances.TryGetValue(module.Key, out var instance);
instance.State = SubsystemState.Started;
loader.RequestStartProcess(new LaunchRequest { name = module.Value.Name, instanceId = module.Key });
}

await infoAggregator.SubsystemController.InitializeSubsystems(instances.Select(kvp => new KeyValuePair<Guid, SubsystemInfo>(kvp.Key, SubsystemInfo.FromModule(kvp.Value))));
Expand Down
Loading

0 comments on commit e36257a

Please sign in to comment.