Skip to content

Commit 6977589

Browse files
authored
additions and clean ups (#75)
* additions and clean ups - apax version number updates only when package publishsing is reqested - cleans up simatic1500 and add simple IRtc implementation for S71500 targets - add time measurement to AxoTask - add start time signature to AxoTask - updates to ax#0.14..0-alpha.96 * fixies dependency in s71500 abstaction library * null check for initial time stamp required due to missing implementation of rtc in tests * version update on dopack instead of dopublish * rev tags when publishes
1 parent 92c4084 commit 6977589

File tree

48 files changed

+262
-445
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+262
-445
lines changed

.config/dotnet-tools.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"AXSharp.ixc": {
6-
"version": "0.14.0-alpha.95",
6+
"version": "0.14.0-alpha.96",
77
"commands": [
88
"ixc"
99
]
@@ -15,13 +15,13 @@
1515
]
1616
},
1717
"AXSharp.ixd": {
18-
"version": "0.14.0-alpha.95",
18+
"version": "0.14.0-alpha.96",
1919
"commands": [
2020
"ixd"
2121
]
2222
},
2323
"AXSharp.ixr": {
24-
"version": "0.14.0-alpha.95",
24+
"version": "0.14.0-alpha.96",
2525
"commands": [
2626
"ixr"
2727
]

cake/BuildContext.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using Cake.Core;
1919
using Cake.Frosting;
2020
using Microsoft.CodeAnalysis.CSharp.Syntax;
21+
using Octokit;
2122
using Polly;
2223
using static NuGet.Packaging.PackagingConstants;
2324
using Path = System.IO.Path;
@@ -138,6 +139,7 @@ public BuildContext(ICakeContext context, BuildParameters buildParameters)
138139
public IEnumerable<(string folder, string name)> Libraries { get; } = new[]
139140
{
140141
("abstractions", "axopen.abstractions"),
142+
("simatic1500", "axopen.simatic1500"),
141143
("utils", "axopen.utils"),
142144
("core", "axopen.core"),
143145
("messaging", "axopen.messaging"),

cake/Program.cs

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
using Cake.Common.IO;
2222
using Cake.Common.Tools.DotNet;
2323
using Cake.Common.Tools.DotNet.Clean;
24+
using Cake.Common.Tools.DotNet.Restore;
2425
using Cake.Core.Diagnostics;
2526
using Cake.Core.IO;
2627
using Cake.Core.Tooling;
@@ -86,8 +87,8 @@ private static void ProvisionTools(BuildContext context)
8687
{
8788
context.ProcessRunner.Start(@"dotnet", new Cake.Core.IO.ProcessSettings()
8889
{
89-
Arguments = $" tool restore",
90-
90+
Arguments = $"tool restore",
91+
WorkingDirectory = context.RootDir
9192
});
9293
}
9394
}
@@ -98,19 +99,33 @@ public sealed class BuildTask : FrostingTask<BuildContext>
9899
{
99100
public override void Run(BuildContext context)
100101
{
102+
if (context.BuildParameters.DoPack)
103+
{
104+
context.Libraries.ToList().ForEach(lib =>
105+
{
106+
context.UpdateApaxVersion(context.GetApaxFile(lib), GitVersionInformation.SemVer);
107+
context.UpdateApaxDependencies(context.GetApaxFile(lib), context.Libraries.Select(p => context.GetApaxFile(p)), GitVersionInformation.SemVer);
108+
});
109+
}
110+
101111
context.Libraries.ToList().ForEach(lib =>
102112
{
103-
context.UpdateApaxVersion(context.GetApaxFile(lib), GitVersionInformation.SemVer);
104-
context.UpdateApaxDependencies(context.GetApaxFile(lib), context.Libraries.Select(p => context.GetApaxFile(p)), GitVersionInformation.SemVer);
105113
context.ApaxInstall(lib);
106114
context.ApaxBuild(lib);
107115
//context.ApaxIxc(lib);
108116
});
109117

118+
if (context.BuildParameters.DoPack)
119+
{
120+
context.Integrations.ToList().ForEach(lib =>
121+
{
122+
context.UpdateApaxVersion(context.GetApaxFile(lib), GitVersionInformation.SemVer);
123+
context.UpdateApaxDependencies(context.GetApaxFile(lib), context.Libraries.Select(p => context.GetApaxFile(p)), GitVersionInformation.SemVer);
124+
});
125+
}
126+
110127
context.Integrations.ToList().ForEach(proj =>
111128
{
112-
context.UpdateApaxVersion(context.GetApaxFile(proj), GitVersionInformation.SemVer);
113-
context.UpdateApaxDependencies(context.GetApaxFile(proj), context.Libraries.Select(p => p.name), GitVersionInformation.SemVer);
114129
context.ApaxInstall(proj);
115130
context.ApaxBuild(proj);
116131
//context.ApaxIxc(proj);

src/abstractions/ctrl/apax.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: "@ix-ax/axopen.abstractions"
2-
version : '0.1.4-add-application-templates-for-integration-testing.197'
2+
version : '0.1.4-alpha.53'
33
type: lib
44
targets:
55
- "1500"

src/abstractions/src/AXOpen.Abstractions/ix_ax_axopen_abstractions.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<PrivateAssets>all</PrivateAssets>
1313
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1414
</PackageReference>
15-
<PackageReference Include="AXSharp.Abstractions" Version="0.14.0-alpha.95" />
16-
<PackageReference Include="AXSharp.Connector" Version="0.14.0-alpha.95" />
15+
<PackageReference Include="AXSharp.Abstractions" Version="0.14.0-alpha.96" />
16+
<PackageReference Include="AXSharp.Connector" Version="0.14.0-alpha.96" />
1717
</ItemGroup>
1818

1919
<ItemGroup>

src/base/src/AXOpen.Base.Abstractions/AXOpen.Base.Abstractions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
</PackageReference>
1313
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
1414
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="5.0.7" />
15-
<PackageReference Include="AXSharp.Connector" Version="0.14.0-alpha.95" />
15+
<PackageReference Include="AXSharp.Connector" Version="0.14.0-alpha.96" />
1616
</ItemGroup>
1717
</Project>

src/core/ctrl/apax-lock.json

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,6 @@
232232
"@ax/target-mc7plus": "4.2.19"
233233
}
234234
},
235-
"@ax/simatic-1500-clocks": {
236-
"version": "3.0.6",
237-
"resolved": "https://registry.simatic-ax.siemens.io/@ax/simatic-1500-clocks/-/simatic-1500-clocks-3.0.6.tgz",
238-
"integrity": "sha512-kh1LWR+jMvYgRjr7RkdNRHX0pJn3KcDl0U2sTxA6CEKvuIBcWPZGsSWYcVyPFORzYTshA7p4oDuxYx4GwnOoKw=="
239-
},
240235
"@ax/sld": {
241236
"version": "0.13.3",
242237
"resolved": "https://registry.simatic-ax.siemens.io/@ax/sld/-/sld-0.13.3.tgz",
@@ -319,11 +314,6 @@
319314
"@ax/st-docs": "4.2.19"
320315
}
321316
},
322-
"@ax/system-bitaccess": {
323-
"version": "5.0.4",
324-
"resolved": "https://registry.simatic-ax.siemens.io/@ax/system-bitaccess/-/system-bitaccess-5.0.4.tgz",
325-
"integrity": "sha512-MhvZdQ20KGKXpHnlcCk61I71runyiQSaO2F0cF1WY+xk3DRc80zRU+yQV56qhWyMsUxP6uaWOHtb+nuLnpJ2BQ=="
326-
},
327317
"@ax/system-datetime": {
328318
"version": "3.1.3",
329319
"resolved": "https://registry.simatic-ax.siemens.io/@ax/system-datetime/-/system-datetime-3.1.3.tgz",
@@ -334,14 +324,6 @@
334324
"resolved": "https://registry.simatic-ax.siemens.io/@ax/system-math/-/system-math-3.1.7.tgz",
335325
"integrity": "sha512-GF3uvdcZw7D/S9yUcj1ZzBJMdF/jC8GvN8JyvAH8q4x2NVHWp+aV6T1M4PqEmRvhXQQ7mQv+xsUvZuBjnOFyGg=="
336326
},
337-
"@ax/system-serde": {
338-
"version": "1.3.13",
339-
"resolved": "https://registry.simatic-ax.siemens.io/@ax/system-serde/-/system-serde-1.3.13.tgz",
340-
"integrity": "sha512-aXJ0APhFrbnmiZcsMjRUestGJaRi8OWUdWnfrULmVUTgquheYBGAeSMQXkKzssyd2jfhR+fipp81LIK7CZNBCw==",
341-
"dependencies": {
342-
"@ax/system-strings": "4.2.3"
343-
}
344-
},
345327
"@ax/system-strings": {
346328
"version": "4.2.3",
347329
"resolved": "https://registry.simatic-ax.siemens.io/@ax/system-strings/-/system-strings-4.2.3.tgz",
@@ -351,6 +333,11 @@
351333
"@ax/system-math": "^3.1.7"
352334
}
353335
},
336+
"@ax/system-timer": {
337+
"version": "3.0.9",
338+
"resolved": "https://registry.simatic-ax.siemens.io/@ax/system-timer/-/system-timer-3.0.9.tgz",
339+
"integrity": "sha512-4yXndi8SQZ0d81MVrJRvGaULPhtfGXC+5Zk6r9MJsCElMzhEIaqqrD1FQHdXvaBOqclN4otR9KW43Mq4nEf/aA=="
340+
},
354341
"@ax/target-axunit": {
355342
"version": "3.0.4",
356343
"resolved": "https://registry.simatic-ax.siemens.io/@ax/target-axunit/-/target-axunit-3.0.4.tgz",

src/core/ctrl/apax.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: "@ix-ax/axopen.core"
2-
version : '0.1.4-add-application-templates-for-integration-testing.197'
2+
version : '0.1.4-alpha.53'
33
type: lib
44
targets:
55
# - "1500"
@@ -14,10 +14,6 @@ scripts:
1414
postbuild:
1515
- dotnet ixc
1616
dependencies:
17-
"@ax/system-strings": ^4.2.3
18-
"@ax/simatic-1500-clocks": ^3.0.6
19-
"@ax/system-serde": ^1.3.13
20-
"@ax/system-bitaccess": ^5.0.4
21-
"@ax/system-datetime": ^3.1.3
22-
"@ix-ax/axopen.abstractions" : '0.1.4-add-application-templates-for-integration-testing.197'
17+
"@ax/system-timer": 3.0.9
18+
"@ix-ax/axopen.abstractions" : '0.1.4-alpha.53'
2319

src/core/ctrl/src/AxoTask/AxoTask.st

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ NAMESPACE AXOpen.Core
4444
///</summary>
4545
StartSignature : ULINT;
4646

47+
///<summary>
48+
/// Gets elapsed time of last task execution.
49+
///</summary>
50+
{#ix-attr:[ReadOnly()]}
51+
Duration : LTIME;
52+
53+
///<summary>
54+
/// Gets date and time when the task started.
55+
///</summary>
56+
{#ix-attr:[ReadOnly()]}
57+
StartTimeStamp : LDATE_AND_TIME;
58+
4759
///<summary>
4860
/// Contains details about the error.
4961
///</summary>
@@ -53,6 +65,7 @@ NAMESPACE AXOpen.Core
5365
VAR PRIVATE
5466
_openCycleCountInvoke : ULINT;
5567
_openCycleCountExecute : ULINT;
68+
_taskTimer : System.Timer.OnDelay;
5669
END_VAR
5770

5871
///<summary>
@@ -244,6 +257,12 @@ NAMESPACE AXOpen.Core
244257

245258
IF(Status = eAxoTaskState#Kicking) THEN
246259
Status := eAxoTaskState#Busy;
260+
261+
// This null check is due to implementation of RTC in unit tests
262+
IF(THIS.GetContext().GetRtc() <> NULL) THEN
263+
StartTimeStamp := THIS.GetContext().GetRtc().NowUTC();
264+
END_IF;
265+
247266
// Don't touch this, it is used for remote execs.
248267
StartSignature := THIS.GetContext().OpenCycleCount();
249268
THIS.OnStart();
@@ -255,6 +274,8 @@ NAMESPACE AXOpen.Core
255274
256275
THIS.UpdateState();
257276
Execute := Status = eAxoTaskState#Busy;
277+
_taskTimer(signal := Execute, duration := LT#99999D);
278+
IF(Execute) THEN Duration := _taskTimer.ElapsedTime; END_IF;
258279
END_METHOD
259280
260281
///<summary>

src/core/src/AXOpen.Core.Blazor/AxoCoordination/AxoStep/AxoStepView.razor

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
<div class="col">
2424
@Component.IsActive.Cyclic
2525
</div>
26+
<div class="col">
27+
@Component.Duration.Cyclic
28+
</div>
29+
<div class="col">
30+
@Component.StartTimeStamp.Cyclic
31+
</div>
2632
</div>
2733
</div>
2834

0 commit comments

Comments
 (0)