-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add axopen library template project (#166)
* wip * mend * wip * wip adds workspaces * wip e * wip * add template for axo libraries
- Loading branch information
Showing
75 changed files
with
2,304 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# AXOpen | ||
|
||
This package is part of AXOpen. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Creating new library from template | ||
|
||
1. Navigate to ..src/ folder of this repository | ||
2. Run following command in terminal to update library template | ||
|
||
~~~PowerShell | ||
dotnet new install .\template.axolibrary\ --force | ||
~~~ | ||
|
||
3. Create library template using following command: | ||
|
||
~~~PowerShell | ||
dotnet new axolibrary -o OutputFolder -n LibraryName -ax axlibraryname | ||
-p AXOpen.Components.Pneumatics | ||
~~~ | ||
|
||
> ![IMPORTANT] | ||
> Make sure you run all the commands from within the `src` folder of the repostory. And paramter -o OutputFolder must be in the `src` folder. | ||
> ![IMPORTANT] | ||
> Paramter -n `LibraryName` must contain ONLY alphanumerical characters | ||
> ![IMPORTANT] | ||
> Paramter -ax `axlibraryname` should be lower case (can contain characters that are permissible for npm package/library name, including '.') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Root Type="DevExpress.CodeRush.Foundation.CodePlaces.Options.FavoritesListContainer"> | ||
<Options Language="Neutral"> | ||
<Groups /> | ||
</Options> | ||
</Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/template", | ||
"author": "PTKu", | ||
"classifications": [ "AXOpen", "axolibrary" ], | ||
"identity": "librarytemplate", | ||
"name": "AXOpen Library Template", | ||
"shortName": "axolibrary", | ||
"tags": { | ||
"language": "C#", | ||
"type": "project" | ||
}, | ||
"sourceName": "librarytemplate", | ||
"symbols": { | ||
"axlibname": { | ||
"type": "parameter", | ||
"description": "AX library project name", | ||
"datatype": "text", | ||
"defaultValue": "axolib", | ||
"replaces": "axolib" | ||
}, | ||
"renameDotNetTwinCsProjFileName": { | ||
"type": "derived", | ||
"valueSource": "axlibname", | ||
"valueTransform": "ReplaceDotsInFileName", | ||
"fileRename": "axolib", | ||
"description": "A value derived from the 'name' param, used to rename Application1.cs" | ||
}, | ||
"renameDotNetTwinCsProjReferences": { | ||
"include" : "*.csproj", | ||
"type": "derived", | ||
"valueSource": "axlibname", | ||
"valueTransform": "ReplaceDotsInFileName", | ||
"replaces": "axolib", | ||
"description": "A value derived from the 'name' param, used to rename Application1.cs" | ||
}, | ||
"projname": { | ||
"type": "parameter", | ||
"description": ".NET name", | ||
"datatype": "text", | ||
"defaultValue": "dotnetlibs", | ||
"replaces": "dotnetlibs", | ||
"fileRename" : "dotnetlibs" | ||
}, | ||
"nameLower":{ | ||
"type": "generated", | ||
"generator": "casing", | ||
"parameters": { | ||
"source":"axlibname", | ||
"toLower": true | ||
}, | ||
"nameUpper":{ | ||
"type": "generated", | ||
"generator": "casing", | ||
"parameters": { | ||
"source":"projname", | ||
"toLower": false | ||
} | ||
} | ||
} | ||
}, | ||
"forms": { | ||
"ReplaceDotsInFileName": { | ||
"identifier": "replace", | ||
"pattern": "\\.", | ||
"replacement": "_" | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"dotnet.defaultSolution": "librarytemplate.sln" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.apax | ||
.env | ||
bin | ||
|
||
obj | ||
testresult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"OutputProjectFolder":"ix"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: "librarytemplate" | ||
version: 0.0.0 | ||
type: app | ||
targets: | ||
- "1500" | ||
- plcsim | ||
- axunit-llvm | ||
variables: | ||
APAX_BUILD_ARGS: | ||
- "--debug" # Generate debug information for target "1500" | ||
devDependencies: | ||
"@ax/sdk": 4.0.3 | ||
dependencies: | ||
"@ix-ax/axolib" : 0.1.4-alpha.79 | ||
scripts: | ||
download: | ||
- apax install -L | ||
- apax build | ||
- dotnet ixc | ||
- apax sld -i $AXTARGETPLATFORMINPUT -t $AXTARGET --accept-security-disclaimer --default-server-interface -r | ||
|
||
|
12 changes: 12 additions & 0 deletions
12
src/template.axolibrary/app/ix-blazor/JSONREPOS/Groups/AdminGroup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"Changes": [], | ||
"RecordId": null, | ||
"DataEntityId": "AdminGroup", | ||
"Name": "AdminGroup", | ||
"Roles": [ | ||
"Administrator" | ||
], | ||
"RolesHash": "AQAAAAIAAYagAAAAEOnVgoEc0N/grlrKHOmSswEnXUk0/PHHYrCCns0sBFfQdP27cLrZ3LZPIFyLd6X/oA==", | ||
"Created": "2023-08-09T12:33:03.2736142+02:00", | ||
"Modified": "2023-08-09T12:33:03.4914502+02:00" | ||
} |
12 changes: 12 additions & 0 deletions
12
src/template.axolibrary/app/ix-blazor/librarytemplate.blazor/App.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Router AppAssembly="@typeof(App).Assembly"> | ||
<Found Context="routeData"> | ||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> | ||
<FocusOnNavigate RouteData="@routeData" Selector="h1" /> | ||
</Found> | ||
<NotFound> | ||
<PageTitle>Not found</PageTitle> | ||
<LayoutView Layout="@typeof(MainLayout)"> | ||
<p role="alert">Sorry, there's nothing at this address.</p> | ||
</LayoutView> | ||
</NotFound> | ||
</Router> |
5 changes: 5 additions & 0 deletions
5
src/template.axolibrary/app/ix-blazor/librarytemplate.blazor/Pages/Documentation.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@page "/Documentation" | ||
|
||
<PageTitle>Documentation</PageTitle> | ||
|
||
<RenderableContentControl Context="@Entry.Plc.documentation" Presentation="Command-Control" PollingInterval="100"/> |
42 changes: 42 additions & 0 deletions
42
src/template.axolibrary/app/ix-blazor/librarytemplate.blazor/Pages/Error.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
@page | ||
@model librarytemplate.blazor.Pages.ErrorModel | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> | ||
<title>Error</title> | ||
<link href="~/css/bootstrap/bootstrap.min.css" rel="stylesheet" /> | ||
<link href="~/css/site.css" rel="stylesheet" asp-append-version="true" /> | ||
</head> | ||
|
||
<body> | ||
<div class="main"> | ||
<div class="content px-4"> | ||
<h1 class="text-danger">Error.</h1> | ||
<h2 class="text-danger">An error occurred while processing your request.</h2> | ||
|
||
@if (Model.ShowRequestId) | ||
{ | ||
<p> | ||
<strong>Request ID:</strong> <code>@Model.RequestId</code> | ||
</p> | ||
} | ||
|
||
<h3>Development Mode</h3> | ||
<p> | ||
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred. | ||
</p> | ||
<p> | ||
<strong>The Development environment shouldn't be enabled for deployed applications.</strong> | ||
It can result in displaying sensitive information from exceptions to end users. | ||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong> | ||
and restarting the app. | ||
</p> | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</html> |
27 changes: 27 additions & 0 deletions
27
src/template.axolibrary/app/ix-blazor/librarytemplate.blazor/Pages/Error.cshtml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
using System.Diagnostics; | ||
|
||
namespace librarytemplate.blazor.Pages | ||
{ | ||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] | ||
[IgnoreAntiforgeryToken] | ||
public class ErrorModel : PageModel | ||
{ | ||
public string? RequestId { get; set; } | ||
|
||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); | ||
|
||
private readonly ILogger<ErrorModel> _logger; | ||
|
||
public ErrorModel(ILogger<ErrorModel> logger) | ||
{ | ||
_logger = logger; | ||
} | ||
|
||
public void OnGet() | ||
{ | ||
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/template.axolibrary/app/ix-blazor/librarytemplate.blazor/Pages/Index.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@page "/" | ||
|
||
<PageTitle>Index</PageTitle> | ||
|
||
<h1>Hello, world!</h1> | ||
|
||
Welcome to your new app. | ||
|
||
<SurveyPrompt Title="How is Blazor working for you?" /> |
6 changes: 6 additions & 0 deletions
6
src/template.axolibrary/app/ix-blazor/librarytemplate.blazor/Pages/Testing.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@page "/testing" | ||
@using librarytemplate | ||
|
||
<PageTitle>Testing</PageTitle> | ||
|
||
<RenderableContentControl Context="@Entry.Plc.sandbox" Presentation="Command-Control" PollingInterval="100"/> |
34 changes: 34 additions & 0 deletions
34
src/template.axolibrary/app/ix-blazor/librarytemplate.blazor/Pages/_Host.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@page "/" | ||
@using Microsoft.AspNetCore.Components.Web | ||
@namespace librarytemplate.blazor.Pages | ||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<base href="~/" /> | ||
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" /> | ||
<link href="css/site.css" rel="stylesheet" /> | ||
<link href="librarytemplate.blazor.styles.css" rel="stylesheet" /> | ||
<link rel="icon" type="image/png" href="favicon.png"/> | ||
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" /> | ||
</head> | ||
<body> | ||
<component type="typeof(App)" render-mode="ServerPrerendered" /> | ||
|
||
<div id="blazor-error-ui"> | ||
<environment include="Staging,Production"> | ||
An error has occurred. This application may no longer respond until reloaded. | ||
</environment> | ||
<environment include="Development"> | ||
An unhandled exception has occurred. See browser dev tools for details. | ||
</environment> | ||
<a href="" class="reload">Reload</a> | ||
<a class="dismiss">🗙</a> | ||
</div> | ||
|
||
<script src="_framework/blazor.server.js"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.