Skip to content
Open
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
### [CORE] AxoToggleTaskView aligned with AxoTaskView ([#1143](https://github.com/Inxton/AXOpen/pull/1143))

**Note:** Blazor UI-only change in `src/core/src/AXOpen.Core.Blazor/AxoToggleTask/`. The PLC `AxoToggleTask` class and its public API (`SwitchOn()`, `SwitchOff()`, `Toggle()`, `IsSwitchOn()`, `IsSwitchOff()`, event-like overrides) are unchanged. Bundled with the AxoCmmtAs view expansion under the same PR; the toggle-view refactor is the core-library portion.

- refactor: `AxoToggleTaskView.razor` rebuilt to mirror `AxoTaskView`'s button shell (`flex items-center justify-between gap-2`), state-circle slot on the left (filled `bg-current` when ON, hollow `border-2 border-current` when OFF), uppercased center label, and invisible `size-5` right-slot spacer when `HideRestoreButton=false` to preserve width parity with `AxoTask`'s reset icon in row-of-2 grids.
- feat: Label format changed from `Description:State` to `DESCRIPTION — STATE` (uppercased, em-dash separator) so the on/off state reads alongside the toggle name without relying on color alone.
- feat: State-driven button color matches `AxoTaskView` vocabulary — `btn-success` (ON), `btn-info` (OFF), `btn-inactive blur-[1px]` (disabled).
- feat: Added `Class`, `Style`, and `aria-pressed` parameters/attributes for parity with `AxoTaskView` and improved accessibility.
- docs: Appended `0.50.0` entry to `src/core/docs/CHANGELOG.md`.

**Impact:**
- A row of `AxoTask` + `AxoToggleTask` buttons in a component view now lines up correctly (icon-left, label-center, icon-right) regardless of which task type each cell holds.
- Existing component proxy views that render `AxoToggleTask` via `AxoToggleTaskView` or `RenderableContentControl Presentation="Command"/"Status"` pick up the new look automatically — no host-app code changes required.

**Risks/Review:**
- `assets/AxoToggleTaskExampleVisu.gif` in `src/core/docs/assets/` was recorded against the previous bare-button rendering. Functional documentation prose in `AxoToggleTask.md` is still accurate, but the GIF visually diverges from the new view. Re-recording is a manual screen-capture step; not blocking.
- Pages that relied on the previous compact `Description:State` single-line look may now display wider buttons because of the icon + spacer slots.

**Testing:**
- `dotnet build axopen/src/core/src/AXOpen.Core.Blazor/axopen_core_blazor.csproj` — 0 errors.
- Render an `AxoToggleTask` next to an `AxoTask` in a Blazor showcase page (`Pages/core/DocuExamples/AxoToggleTaskDocu.razor` exposes four variants) and visually verify the icon/label/spacer columns align.
- Toggle the underlying PLC state and confirm the button switches between filled+`btn-success` and hollow+`btn-info`; set `Disable=true` and confirm `btn-inactive blur-[1px]` activates.

### [KUKA] KRC5 showcase, docs, and central changelog ([#1117](https://github.com/Inxton/AXOpen/pull/1117))

**Note:** Extends the KRC5 library assets landed in [#1116](https://github.com/Inxton/AXOpen/pull/1116) with full showcase and documentation coverage. No runtime behavior change in `AxoKrc4` — the existing class drives both KRC4 and KRC5 because the slot 1 / slot 2 = `DIO512` layout is identical.
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ public override void ConfigurePolling()
this.StartPolling(Component.ActualVelocity, 250);
this.StartPolling(Component.ActualTorque, 250);
this.StartPolling(Component.DriveStatus.CurrentMotionTaskId, 500);
this.StartPolling(Component.AxisType, 1000);
this.StartPolling(Component.State, 500);
this.StartPolling(Component.ScalingReadState, 1000);
this.StartPolling(Component.Debug, 1000);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,96 @@
<data name="NewtonMetersUnit" xml:space="preserve">
<value>Nm</value>
</data>
<!-- AxoCmmtAsView - Header state badges -->
<data name="State" xml:space="preserve">
<value>State</value>
</data>
<data name="ScalingReadState" xml:space="preserve">
<value>Scaling read state</value>
</data>
<data name="Debug" xml:space="preserve">
<value>Debug</value>
</data>
<!-- AxoCmmtAsView - Power & Safety extensions -->
<data name="ResetDrive" xml:space="preserve">
<value>Reset drive</value>
</data>
<data name="Restore" xml:space="preserve">
<value>Restore</value>
</data>
<!-- AxoCmmtAsView - Parameter Access Section -->
<data name="ParameterAccess" xml:space="preserve">
<value>Parameter access</value>
</data>
<data name="ParameterAccessDescription" xml:space="preserve">
<value>Read and write integer, real and boolean drive parameters.</value>
</data>
<data name="ParameterAccessMonitorDescription" xml:space="preserve">
<value>Observe parameter read/write transactions and their results.</value>
</data>
<data name="WriteParameter" xml:space="preserve">
<value>Write parameter</value>
</data>
<data name="WriteRealParameter" xml:space="preserve">
<value>Write real parameter</value>
</data>
<data name="WriteBoolParameter" xml:space="preserve">
<value>Write bool parameter</value>
</data>
<data name="ReadParameter" xml:space="preserve">
<value>Read parameter</value>
</data>
<data name="ReadRealParameter" xml:space="preserve">
<value>Read real parameter</value>
</data>
<data name="ReadBoolParameter" xml:space="preserve">
<value>Read bool parameter</value>
</data>
<!-- AxoCmmtAsView - Digital IO Section -->
<data name="DigitalIO" xml:space="preserve">
<value>Digital I/O</value>
</data>
<data name="DigitalIODescription" xml:space="preserve">
<value>Read digital inputs/outputs and write digital outputs.</value>
</data>
<data name="DigitalIOMonitorDescription" xml:space="preserve">
<value>Observe digital I/O transactions and their results.</value>
</data>
<data name="ReadDigitalInput" xml:space="preserve">
<value>Read digital input</value>
</data>
<data name="ReadDigitalOutput" xml:space="preserve">
<value>Read digital output</value>
</data>
<data name="WriteDigitalOutput" xml:space="preserve">
<value>Write digital output</value>
</data>
<!-- AxoCmmtAsView - Explicit Reads Section -->
<data name="ExplicitReads" xml:space="preserve">
<value>Explicit reads</value>
</data>
<data name="ExplicitReadsDescription" xml:space="preserve">
<value>Trigger explicit reads of position, velocity, torque, status and motion state.</value>
</data>
<data name="ExplicitReadsMonitorDescription" xml:space="preserve">
<value>Observe explicit read transactions and their results.</value>
</data>
<data name="ReadActualPosition" xml:space="preserve">
<value>Read actual position</value>
</data>
<data name="ReadActualVelocity" xml:space="preserve">
<value>Read actual velocity</value>
</data>
<data name="ReadActualTorque" xml:space="preserve">
<value>Read actual torque</value>
</data>
<data name="ReadStatus" xml:space="preserve">
<value>Read status</value>
</data>
<data name="ReadMotionState" xml:space="preserve">
<value>Read motion state</value>
</data>
<data name="ReadAxisInfo" xml:space="preserve">
<value>Read axis info</value>
</data>
</root>
5 changes: 5 additions & 0 deletions src/core/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@

**Breaking changes:**
- Documentation file renames may break external bookmarks or links referencing the old UPPERCASE filenames

### 0.50.0

**Other:**
- `AxoToggleTaskView` Blazor rendering aligned with `AxoTaskView` for visual consistency when both task buttons appear side-by-side in component views. Filled/hollow state circle on the left, uppercased `DESCRIPTION — STATE` label in the center, invisible right-slot spacer for width parity, and state-driven button color (`btn-success` ON / `btn-info` OFF / `btn-inactive blur-[1px]` disabled). No PLC API change — `SwitchOn()` / `SwitchOff()` / `Toggle()` / event-like overrides are unchanged.
Original file line number Diff line number Diff line change
@@ -1,10 +1,40 @@
@namespace AXOpen.Core
@namespace AXOpen.Core
@using AXSharp.Connector;
@using Microsoft.AspNetCore.Components.Web;
@using Operon.Icons;
@inherits RenderableComplexComponentBase<AxoToggleTask>
@implements IDisposable;

<div data-axo-toggle-task-view class="flex flex-wrap">
<button type="button" class="btn btn-primary" disabled="@IsDisabled" @onclick="@ToggleTask">
@Description:@StateDescription
</button>
</div>
<button data-axo-toggle-task-view type="button"
aria-disabled="@IsDisabled"
aria-pressed="@IsOn"
class="btn @ButtonClass gap-2 flex items-center justify-between @Class"
style="@Style"
@onclick="this.ToggleTask"
disabled="@IsDisabled">
<span class="flex items-center gap-2 text-inherit">
@if (IsOn)
{
<span class="inline-flex items-center justify-center w-5 h-5 rounded-full bg-current text-inherit @((IsDisabled ? "opacity-70" : string.Empty))"></span>
}
else
{
<span class="inline-flex items-center justify-center w-5 h-5 rounded-full border-2 border-current text-inherit @((IsDisabled ? "border-dashed opacity-70" : "border-solid"))"></span>
}
</span>

<span class="flex-1 text-center text-inherit">
@LabelText.ToUpper()
</span>

@if (!HideRestoreButton)
{
<span aria-hidden="true" class="inline-flex items-center justify-center size-5 opacity-0 pointer-events-none"></span>
}
</button>

@code {

[Parameter] public string? Class { get; set; }
[Parameter] public string? Style { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using AXSharp.Connector;
using AXSharp.Connector;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Authorization;
using System.Security.Principal;
Expand Down Expand Up @@ -31,14 +31,29 @@ private async void ToggleTask()
AxoApplication.Current.Logger.Information($"Command `{Component.HumanReadable}` toggled.", Component, await GetCurrentUserIdentity());
Component.RemoteToggle.Cyclic = true;
}

public bool IsOn => Component.State.LastValue;

private string StateDescription
{
get
{
return Component.State.LastValue ? (string.IsNullOrEmpty(Component.AttributeStateOnDesc) ? "<#On#>" : Component.AttributeStateOnDesc) : (string.IsNullOrEmpty(Component.AttributeStateOffDesc) ? "<#Off#>" : Component.AttributeStateOffDesc);
return IsOn
? (string.IsNullOrEmpty(Component.AttributeStateOnDesc) ? "<#On#>" : Component.AttributeStateOnDesc)
: (string.IsNullOrEmpty(Component.AttributeStateOffDesc) ? "<#Off#>" : Component.AttributeStateOffDesc);
}
}

private string ButtonClass
{
get
{
if (IsDisabled)
return "btn-inactive blur-[1px]";

return IsOn ? "btn-success" : "btn-info";
}
}

[Parameter]
public bool Disable { get; set; }
Expand All @@ -51,7 +66,14 @@ private string StateDescription

public bool IsDisabled => Disable || Component.IsDisabled.Cyclic;

public string Description => Component.GetAttributeName(CultureInfo.CurrentUICulture);
public string Description => string.IsNullOrEmpty(Text)
? string.IsNullOrEmpty(Component.AttributeName)
? Component.GetSymbolTail()
: Component.GetAttributeName(CultureInfo.CurrentUICulture)
: Text;

public string LabelText => $"{Description} — {StateDescription}";

public override void ConfigurePolling()
{
this.StartPolling(Component.IsDisabled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
"TLS": 1,
"WebServer": 2
},
<<<<<<< Updated upstream
"AccessProtectionData": "AQAAAAAAAAAAAAAAAAAAAAABAABQAAAAAAEBAAAAAgDQBwAAIACDmcpW9l2KbKelN6FvcwaLAndUujD+RirRfC5n3hyAByAAk8sLUPu9xFk3Qdse0j9rzoWMkmPkatYswDi7QmJ6VPVQAAAAAAEBAAAAAgDQBwAAIACDmcpW9l2KbKelN6FvcwaLAndUujD+RirRfC5n3hyAByAAEcSJWeZMDmrZvkYFOygiehG/01uxiCv5LVhHYzwo3ZVQAAAAAAEBAAAAAgDQBwAAIACDmcpW9l2KbKelN6FvcwaLAndUujD+RirRfC5n3hyAByAAk8sLUPu9xFk3Qdse0j9rzoWMkmPkatYswDi7QmJ6VPVQAAAAAAEBAAAAAgDQBwAAIACDmcpW9l2KbKelN6FvcwaLAndUujD+RirRfC5n3hyAByAAk8sLUPu9xFk3Qdse0j9rzoWMkmPkatYswDi7QmJ6VPUgAAAAg5nKVvZdimynpTehb3MGiwJ3VLow/kYq0XwuZ94cgAc="
=======
"AccessProtectionData": "AQAAAAAAAAAAAAAAAAAAAAABAABQAAAAAAEBAAAAAgDQBwAAIACGPuCVKRYk+jYv2fiIefhw9xIoSuqwB4TQkDXJrRiO9iAAKa3miXIdXkL6KWpofQo1hiChdI3HBXXMvwu6CHW2s8VQAAAAAAEBAAAAAgDQBwAAIACGPuCVKRYk+jYv2fiIefhw9xIoSuqwB4TQkDXJrRiO9iAAOJc0J9egkkwFS4jD3SOX/4JVM0g7pRghkkLgfOtD8mZQAAAAAAEBAAAAAgDQBwAAIACGPuCVKRYk+jYv2fiIefhw9xIoSuqwB4TQkDXJrRiO9iAAKa3miXIdXkL6KWpofQo1hiChdI3HBXXMvwu6CHW2s8VQAAAAAAEBAAAAAgDQBwAAIACGPuCVKRYk+jYv2fiIefhw9xIoSuqwB4TQkDXJrRiO9iAAKa3miXIdXkL6KWpofQo1hiChdI3HBXXMvwu6CHW2s8UgAAAAhj7glSkWJPo2L9n4iHn4cPcSKErqsAeE0JA1ya0YjvY="
>>>>>>> Stashed changes
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
</select>
</div>
<RenderableContentControl Context="@Entry.Plc.Ctx.festo_drives_documentation.axoCmmtAs.AxoCmmtAs" Presentation="@_selectedPresentation" />
<RenderableContentControl Context="@Entry.Plc.Ctx.festo_drives_documentation.axoCmmtAs.manualControl" Presentation="Control" />
</TabPage>
<TabPage Title="Code reference">
<div class="mt-4 space-y-6">
Expand Down
Loading