Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docfx/framework/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ items:
- name: Core
href: ../core/docs/index.html
- name: Data
href: ../data/index.html
href: ../data/docs/index.html
- name: Inspectors
href: ../inspectors/index.html
href: ../inspectors/docs/index.html
- name: Timers
href: ../timers/index.html
href: ../timers/docs/index.html
28 changes: 0 additions & 28 deletions src/data/README.md

This file was deleted.

3 changes: 2 additions & 1 deletion src/data/app/ix-blazor/librarytemplate.blazor/App.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Router AppAssembly="@typeof(App).Assembly">
@using librarytemplate.blazor.hmi.Shared;
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

<PageTitle>Documentation</PageTitle>

<RenderableContentControl Context="@Entry.Plc.documentation" Presentation="Command-Control" PollingInterval="100"/>
@*<RenderableContentControl Context="@Entry.Plc.documentation" Presentation="Command-Control" PollingInterval="100"/>*@
Original file line number Diff line number Diff line change
@@ -1,6 +1,50 @@
@page "/testing"
@using AXOpen.Base.Dialogs;
@using AXOpen.Data;
@using librarytemplate
@inject AuthenticationStateProvider _authenticationProvider
@inject IAlertDialogService _alertDialogService

<PageTitle>Testing</PageTitle>

<RenderableContentControl Context="@Entry.Plc.sandbox" Presentation="Command-Control" PollingInterval="100"/>
<h2>Command</h2>
<RenderableContentControl Context="@Entry.Plc.AxoDataExchangeManager" Presentation="Command" />

//<CommandView>
<RenderableContentControl Context="@Entry.Plc.AxoDataFramentsExchangeManager" Presentation="Command" />
//</CommandView>

<h2>Status</h2>
//<StatusView>
<RenderableContentControl Context="@Entry.Plc.AxoDataFramentsExchangeManager" Presentation="Status" />
//</StatusView>

<h2>Custom columns</h2>
//<CustomColumns>
<DataExchangeView Vm="@_vm" Presentation="Command">
<ColumnData HeaderName="Some data" BindingValue="SomeData" Clickable="false" />
<ColumnData HeaderName="A number" BindingValue="SomeNumber" Clickable="false" />
<ColumnData HeaderName="Yes/No" BindingValue="SomeBool" Clickable="false" />
</DataExchangeView>
//</CustomColumns>

<h2>Export</h2>
//<Export>
<DataExchangeView Vm="@_vm" Presentation="Command" CanExport="true" />
//</Export>

<h2>Modal</h2>
//<Modal>
<DataExchangeView Vm="@_vm" Presentation="Command" ModalDetailView="false" />
//</Modal>

//<CustomColumnsCode>
@code {
private DataExchangeViewModel _vm;

protected override void OnInitialized()
{
_vm = new DataExchangeViewModel { Model = Entry.Plc.AxoDataFramentsExchangeManager, AlertDialogService = _alertDialogService, AuthenticationProvider = _authenticationProvider };
}
}
//</CustomColumnsCode>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/"
@using Microsoft.AspNetCore.Components.Web
@using librarytemplate.blazor.hmi;
@namespace librarytemplate.blazor.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

Expand Down Expand Up @@ -30,5 +31,6 @@
</div>

<script src="_framework/blazor.server.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
</body>
</html>
23 changes: 23 additions & 0 deletions src/data/app/ix-blazor/librarytemplate.blazor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using AXOpen;
using AXOpen.Logging;
using librarytemplate;
using AXOpen.Data.InMemory;

var builder = WebApplication.CreateBuilder(args);

Expand Down Expand Up @@ -42,6 +43,28 @@
.WriteTo.Console().MinimumLevel.Verbose()
.CreateLogger()));

//<SetUpAxoDataFragmentExchange>
var SharedDataHeaderDataRepository = new InMemoryRepositorySettings<Pocos.AxoDataFramentsExchangeExample.SharedDataHeaderData>().Factory();
var Station_1_DataRepository = new InMemoryRepositorySettings<Pocos.AxoDataFramentsExchangeExample.Station_1_Data>().Factory();

var AxoProcessDataManager = Entry.Plc.AxoDataFramentsExchangeManager.CreateBuilder<AxoDataFramentsExchangeExample.AxoProcessDataManager>();

AxoProcessDataManager.SharedHeader.SetRepository(SharedDataHeaderDataRepository);
AxoProcessDataManager.Station_1.SetRepository(Station_1_DataRepository);
AxoProcessDataManager.InitializeRemoteDataExchange();
//</SetUpAxoDataFragmentExchange>

//<SetUpAxoDataExchange>
var AxoProcessDataRepository = new InMemoryRepositorySettings<Pocos.AxoDataExchangeExample.AxoProcessData>().Factory();

Entry.Plc.AxoDataExchangeManager.InitializeRemoteDataExchange(AxoProcessDataRepository);
//</SetUpAxoDataExchange>

//<CleanUp>
// Clean Temp directory
AXOpen.Data.IAxoDataExchange.CleanUp();
//</CleanUp>

var app = builder.Build();

// Configure the HTTP request pipeline.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using librarytemplate.blazor
@using librarytemplate.blazor.Shared

@using AXSharp.Presentation.Blazor.Controls.RenderableContent
@using Microsoft.Extensions.Localization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Packable>false</Packable>
<RootNamespace>librarytemplate.blazor.hmi</RootNamespace>
<UseRazorSourceGenerator>true</UseRazorSourceGenerator>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\..\base\src\AXOpen.Logging\AXOpen.Logging.Serilog.csproj" />
<ProjectReference Include="..\..\..\..\core\src\AXOpen.Core.Blazor\axopen_core_blazor.csproj" />
<ProjectReference Include="..\..\..\..\data\src\AXOpen.Data.Blazor\axopen_data_blazor.csproj" />
<ProjectReference Include="..\..\..\..\data\src\repositories\Json\AXOpen.Data.Json.csproj" />
<ProjectReference Include="..\..\..\..\security\src\AXOpen.Security.Blazor\AXOpen.Security.Blazor.csproj" />
<ProjectReference Include="..\..\..\src\repositories\InMemory\AXOpen.Data.InMemory.csproj" />
<ProjectReference Include="..\..\ix\axopen_data_app.csproj" />
</ItemGroup>

Expand Down
9 changes: 5 additions & 4 deletions src/data/app/ix/axopen_data_app.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AXSharp.Abstractions"/>
<PackageReference Include="AXSharp.Connector"/>
<PackageReference Include="AXSharp.Connector.S71500.WebAPI"/>
<PackageReference Include="AXSharp.Abstractions" />
<PackageReference Include="AXSharp.Connector" />
<PackageReference Include="AXSharp.Connector.S71500.WebAPI" />
</ItemGroup>

<ItemGroup>
Expand All @@ -17,5 +17,6 @@

<ItemGroup>
<ProjectReference Include="..\..\..\core\src\AXOpen.Core\ix_ax_axopen_core.csproj" />
<ProjectReference Include="..\..\src\AXOpen.Data\ix_ax_axopen_data.csproj" />
</ItemGroup>
</Project>
13 changes: 0 additions & 13 deletions src/data/app/src/Documentation/DocumentationContext.st

This file was deleted.

112 changes: 112 additions & 0 deletions src/data/app/src/Examples/AxoDataExchangeExample.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
USING AXOpen;
using AXOpen.Data;

NAMESPACE AxoDataExchangeExample

//<ContextDeclaration>
CLASS PUBLIC Context EXTENDS AXOpen.Core.AxoContext
VAR PUBLIC
DataManager : AxoProcessDataManager;
END_VAR

METHOD OVERRIDE Main
DataManager.Run(THIS);
END_METHOD
END_CLASS
//</ContextDeclaration>

//<AxoProcessDataManagerDeclaration>
CLASS AxoProcessDataManager EXTENDS AXOpen.Data.AxoDataExchange
VAR PUBLIC
{#ix-generic:TOnline}
{#ix-generic:TPlain as POCO}
{#ix-attr:[AXOpen.Data.AxoDataEntityAttribute]}
Set : AxoProcessData; // <- Manager will operate on this member.
END_VAR
END_CLASS
//</AxoProcessDataManagerDeclaration>

//<AxoProcessDataDeclaration>
CLASS AxoProcessData EXTENDS AXOpen.Data.AxoDataEntity
VAR PUBLIC
{#ix-set:AttributeName = "Some string"}
SomeString : STRING;
{#ix-set:AttributeName = "Some int"}
SomeInt : INT;
END_VAR
END_CLASS
//</AxoProcessDataDeclaration>

//<Usage>
CLASS UseManager
VAR
_create : BOOL;
_read : BOOL;
_update : BOOL;
_delete : BOOL;
_id : STRING;
END_VAR

METHOD Use
VAR_IN_OUT
DataManager : AxoProcessDataManager;
END_VAR
IF(_create) THEN
IF(DataManager.Create(_id).IsDone()) THEN
_create := FALSE;
END_IF;
END_IF;

IF(_read) THEN
IF(DataManager.Read(_id).IsDone()) THEN
_read := FALSE;
END_IF;
END_IF;

IF(_update) THEN
IF(DataManager.Update(_id).IsDone()) THEN
_update := FALSE;
END_IF;
END_IF;

IF(_delete) THEN
IF(DataManager.Delete(_id).IsDone()) THEN
_delete := FALSE;
END_IF;
END_IF;
END_METHOD
END_CLASS
//</Usage>

//<Execute>
CLASS CU EXTENDS AXOpen.Core.AxoObject
VAR PUBLIC
ProcessData : REF_TO AxoProcessDataManager;
END_VAR

METHOD PRIVATE Execute
ProcessData^.Run(THIS);
END_METHOD
END_CLASS
//</Execute>

//<Run>
CLASS PUBLIC AutomatSequence EXTENDS AXOpen.Core.AxoSequencerContainer
VAR PRIVATE
ProcessData : REF_TO AxoProcessDataManager;
END_VAR

METHOD INTERNAL Run
VAR_INPUT
_processData : REF_TO AxoProcessDataManager;
END_VAR
ProcessData := _processData;
END_METHOD

METHOD OVERRIDE Main
;
END_METHOD
END_CLASS
//</Run>

END_NAMESPACE
Loading