From 0b8beea0e3c9a9193e63d8710714dcb1ed3016ed Mon Sep 17 00:00:00 2001 From: Brano5 Date: Mon, 10 Jul 2023 09:43:36 +0200 Subject: [PATCH 01/10] Create draft PR for #112 From 5cd1866a79b174da0fcaec406a57812d005629c5 Mon Sep 17 00:00:00 2001 From: Branko Zachemsky Date: Mon, 10 Jul 2023 15:26:47 +0200 Subject: [PATCH 02/10] Visualization for custom export --- .../AxoDataExchange/DataExchangeView.razor | 75 +++++++++++++++++++ .../AxoDataExchange/DataExchangeViewModel.cs | 26 +++++++ 2 files changed, 101 insertions(+) diff --git a/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeView.razor b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeView.razor index ea7e70923..86bd522df 100644 --- a/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeView.razor +++ b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeView.razor @@ -1,6 +1,7 @@ @namespace AXOpen.Data @using AXOpen.Data; @using AXSharp.Abstractions.Dialogs.AlertDialog; +@using AXSharp.Connector; @using CommunityToolkit.Mvvm.ComponentModel; @using CommunityToolkit.Mvvm.Messaging; @using Microsoft.AspNetCore.Components.Forms; @@ -374,6 +375,7 @@ else } @@ -407,4 +409,77 @@ else + + } \ No newline at end of file diff --git a/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeViewModel.cs b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeViewModel.cs index 2ad11dedc..e6e6847f2 100644 --- a/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeViewModel.cs +++ b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeViewModel.cs @@ -326,5 +326,31 @@ public void ImportData(string path) public int Page { get; set; } = 0; public string CreateItemId { get; set; } public bool IsBusy { get; set; } + + public eExportMode Export; + public int FirstNumber = 50; + public int SecondNumber = 100; + public eFileType FileType; + public char Separator = ';'; + + public enum eExportMode + { + First, + Last, + Exact + } + + public enum eFileType + { + csv, + txt, + excel + } + + public IEnumerable GetValueTags(ITwinObject obj) + { + var prototype = Activator.CreateInstance(obj.GetType(), new object[] { ConnectorAdapterBuilder.Build().CreateDummy().GetConnector(new object[] { }), "_data", "_data" }) as ITwinObject; + return prototype.RetrievePrimitives(); + } } } From 9bc83e7a68275cd3d65c7616a9c8be54d8e99b85 Mon Sep 17 00:00:00 2001 From: Branko Zachemsky Date: Thu, 13 Jul 2023 15:21:19 +0200 Subject: [PATCH 03/10] WIP Added option to customize export in DataExchangeView. Implement CSV, TXT exporter and importer. --- .../AxoDataExchange/DataExchangeView.razor | 38 +-- .../AxoDataExchange/DataExchangeViewModel.cs | 62 ++-- .../DataExchange/AxoDataExchange.cs | 62 +++- .../DataExchange/IAxoDataExchange.cs | 2 +- .../AxoDataFragmentExchange.cs | 6 +- .../ExportImport/BaseDataExporter.cs | 269 ++++++++++++++++++ .../ExportImport/CSVDataExporter.cs | 228 +-------------- .../AXOpen.Data/ExportImport/FragmentData.cs | 20 ++ .../AXOpen.Data/ExportImport/IDataExporter.cs | 2 +- .../ExportImport/TXTDataExporter.cs | 47 +++ .../AXOpen.Data/ExportImport/eExportMode.cs | 15 + .../src/AXOpen.Data/ExportImport/eFileType.cs | 14 + 12 files changed, 495 insertions(+), 270 deletions(-) create mode 100644 src/data/src/AXOpen.Data/ExportImport/BaseDataExporter.cs create mode 100644 src/data/src/AXOpen.Data/ExportImport/FragmentData.cs create mode 100644 src/data/src/AXOpen.Data/ExportImport/TXTDataExporter.cs create mode 100644 src/data/src/AXOpen.Data/ExportImport/eExportMode.cs create mode 100644 src/data/src/AXOpen.Data/ExportImport/eFileType.cs diff --git a/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeView.razor b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeView.razor index 86bd522df..3e5e5989c 100644 --- a/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeView.razor +++ b/src/data/src/AXOpen.Data.Blazor/AxoDataExchange/DataExchangeView.razor @@ -392,7 +392,11 @@ else