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
64 changes: 49 additions & 15 deletions src/base/src/AXOpen.VisualComposer/VisualComposerContainer.razor
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<AuthorizeView Roles="Administrator">

<Authorized>
<button class="btn btn-outline-primary m-2" @onclick="ToggleInDesignMode">Toggle design mode</button>
@if (InDesignMode)
{
<div class="d-flex justify-content-end my-2">
Expand Down Expand Up @@ -63,6 +62,7 @@
</CascadingValue>
</CascadingValue>
</EmptyContainer>
<button class="btn btn-outline-primary m-2" @onclick="ToggleInDesignMode">Toggle design mode</button>
@if (InDesignMode)
{
<div class="modal fade" id="showAllModal-@Id.ModalIdHelper()" tabindex="-1" aria-hidden="true">
Expand Down Expand Up @@ -256,23 +256,51 @@
</div>
<span class="@DetailsVisibility m-4">
<div class="card overflow-auto" style="height: 500px;">
<div class="card-header">
<button class="btn btn-close" @onclick="ToggleDetailsVisibility"></button>
</div>
<div class="card-body">
<p class="card-deck overflow-auto" style="height: 250px;">
<div class="card-header">
<div class="container-fluid m-0 p-0">
<div class="row">
<div class="col-auto">
<button class="btn btn-close" @onclick="ToggleDetailsVisibility"></button>
</div>
<div class="col">
<AuthorizeView Roles="Administrator">
<Authorized>
<div class="input-group mb-3">
<button type="button" class="btn btn-outline-secondary">View</button>
<button type="button" class="btn btn-outline-secondary dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
<span class="visually-hidden">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" @onmouseleave="@SetCommandPresentationType">Command</a></li>
<li><a class="dropdown-item" @onmouseleave="@SetStatusPresentationType">Status</a></li>
<li><a class="dropdown-item" @onmouseleave="@SetControlPresentationType">Control</a></li>
<li><a class="dropdown-item" @onmouseleave="@SetDisplayPresentationType">Display</a></li>
</ul>
<input type="text" class="form-control" @bind="@DetailsPresentationType" aria-label="Text input with segmented dropdown button">
</div>
</Authorized>
<NotAuthorized>

</NotAuthorized>
</AuthorizeView>
</div>

</div>
</div>
@* <div class="m-3"> *@
@* <button class="btn btn-close" @onclick="ToggleDetailsVisibility"></button> *@
@* <button class="btn btn-primary" @onclick="SetCommandPresentationType">Command</button> *@
@* <button class="btn btn-primary" @onclick="SetControlPresentationType">Control</button> *@
@* <button class="btn btn-primary" @onclick="SetStatusPresentationType">Status</button> *@
@* <button class="btn btn-primary" @onclick="SetDisplayPresentationType">Display</button> *@
@* <input type="text" class="form-control" placeholder="Presentation" @bind="DetailsPresentationType"> *@
@* </div> *@
</div>
<div class="card-body" style="height: 250px;">
<p class="card-deck overflow-auto">
<RenderableContentControl @ref="detailsRcc" Context="@DetailsObject" Presentation="Command-Control"></RenderableContentControl>
</p>
</div>
<div class="card-footer">
<input type="text" class="form-control" placeholder="Presentation" @bind="DetailsPresentationType">
<div class="m-3">
<button class="btn btn-primary" @onclick="SetCommandPresentationType">Command</button>
<button class="btn btn-primary" @onclick="SetControlPresentationType">Control</button>
<button class="btn btn-primary" @onclick="SetStatusPresentationType">Status</button>
<button class="btn btn-primary" @onclick="SetDisplayPresentationType">Display</button>
</div>
</div>
</div>
</span >
</div>
Expand Down Expand Up @@ -319,6 +347,12 @@
private void ToggleDetailsVisibility()
{
this.DetailsVisibility = this.DetailsVisibility == VISUALLY_HIDDEN ? string.Empty : VISUALLY_HIDDEN;
if (DetailsVisibility == string.Empty)
{
detailsRcc.Presentation = "empty";
detailsRcc.ForceRender();
System.GC.Collect();
}
this.StateHasChanged();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ public void Search()

foreach (ITwinObject obj in Objects)
{
//SearchResult.Add(obj.GetChildren().Flatten(p => p.GetChildren()).FirstOrDefault(p => p.Symbol.StartsWith(SearchValue, StringComparison.OrdinalIgnoreCase)));
SearchResult.AddRange(obj.GetChildren().Flatten(p => p.GetChildren()).ToList().FindAll(p => p.Symbol.Contains(SearchValue, StringComparison.OrdinalIgnoreCase)));
SearchResult.AddRange(obj.RetrievePrimitives().ToList().FindAll(p => p.Symbol.Contains(SearchValue, StringComparison.OrdinalIgnoreCase)));
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/ctrl/src/AxoMessaging/Static/AxoMessenger.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ USING AXOpen.Core;
NAMESPACE AXOpen.Messaging.Static

TYPE
eAxoMessengerState : (Idle, ActiveNoAck, ActiveAckn, NotActiveWatingAckn);
eAxoMessengerState : (Idle, ActiveNoAck, ActiveAckn, NotActiveWaitingAckn);
END_TYPE

{#ix-prop: public string MessageText }
Expand Down Expand Up @@ -82,7 +82,7 @@ NAMESPACE AXOpen.Messaging.Static
END_IF;

IF(THIS.WaitingForAcknowledge) THEN
THIS.MessengerState := eAxoMessengerState#NotActiveWatingAckn;
THIS.MessengerState := eAxoMessengerState#NotActiveWaitingAckn;
END_IF;

END_METHOD
Expand Down Expand Up @@ -125,7 +125,7 @@ NAMESPACE AXOpen.Messaging.Static
END_IF;

IF(THIS.WaitingForAcknowledge) THEN
THIS.MessengerState := eAxoMessengerState#NotActiveWatingAckn;
THIS.MessengerState := eAxoMessengerState#NotActiveWaitingAckn;
END_IF;

END_METHOD
Expand Down
54 changes: 28 additions & 26 deletions src/core/ctrl/src/AxoTask/AxoTask.st
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,7 @@ NAMESPACE AXOpen.Core
/// Contains details about the error.
///</summary>
ErrorDetails : STRING[254];
END_VAR

VAR PRIVATE
_openCycleCountInvoke : ULINT;
_openCycleCountExecute : ULINT;
_taskTimer : AXOpen.Timers.OnDelayTimer;
_isFirstExecutionCycle : BOOL;

///<summary>
/// Enable error message when task is not calling cyclically .
///</summary>
Expand All @@ -86,6 +80,14 @@ NAMESPACE AXOpen.Core
{#ix-set:MessageText = "<#Execute method is called more then once inside one PLC cycle.#>"}
{#ix-set:Help = "<#Check task calling in the code, task is called more then once.#>"}
_MultipleExecuteIsCalled : AXOpen.Messaging.Static.AxoMessenger;
END_VAR

VAR PRIVATE
_openCycleCountInvoke : ULINT;
_openCycleCountExecute : ULINT;
_taskTimer : AXOpen.Timers.OnDelayTimer;
_isFirstExecutionCycle : BOOL;

_SuspendMultipleExecuteCallCheck : BOOL := FALSE;
_RemoteRestoreEnabled : BOOL := TRUE;
_RemoteAbortEnabled : BOOL := FALSE;
Expand Down Expand Up @@ -373,7 +375,7 @@ NAMESPACE AXOpen.Core
IF Status = eAxoTaskState#Ready THEN
IF (THIS.IsExecuteCalledInThisPlcCycle() OR THIS.WasExecuteCalledInPreviousPlcCycle()) THEN
Status := eAxoTaskState#Kicking;
THIS.LogTask('Task invoked', eLogLevel#Verbose, THIS);
_context_.GetLogger().Log('Task invoked', eLogLevel#Verbose, THIS);
ELSE
_CyclicExecuteIsNotCalled.Activate(eAxoMessageCategory#ProgrammingError);
END_IF;
Expand All @@ -387,7 +389,7 @@ NAMESPACE AXOpen.Core
///</summary>
METHOD PUBLIC Restore : IAxoTaskState
IF(Status <> eAxoTaskState#Ready AND Status <> eAxoTaskState#Disabled) THEN
THIS.LogTask('Task restored', eLogLevel#Verbose, THIS);
_context_.GetLogger().Log('Task restored', eLogLevel#Verbose, THIS);
_restoreCycleCount := _context_.OpenCycleCount();
END_IF;
Status := eAxoTaskState#Ready;
Expand Down Expand Up @@ -417,7 +419,7 @@ NAMESPACE AXOpen.Core
END_VAR

IF Condition AND Status = eAxoTaskState#Busy THEN
THIS.LogTask('Task done.', eLogLevel#Verbose, THIS);
_context_.GetLogger().Log('Task done.', eLogLevel#Verbose, THIS);
Status := eAxoTaskState#Done;
THIS.OnDone();
_doneCycleCount := _context_.OpenCycleCount();
Expand Down Expand Up @@ -488,7 +490,7 @@ NAMESPACE AXOpen.Core

// Don't touch this, it is used for remote execs.
StartSignature := _openCycleCountExecute;//_context_.OpenCycleCount();
THIS.LogTask('Task started.', eLogLevel#Verbose, THIS);
_context_.GetLogger().Log('Task started.', eLogLevel#Verbose, THIS);
THIS.OnStart();
_isFirstExecutionCycle := TRUE;
_startCycleCount := _context_.OpenCycleCount();
Expand Down Expand Up @@ -516,19 +518,19 @@ NAMESPACE AXOpen.Core
IF(Execute) THEN Duration := _taskTimer.ElapsedTime; END_IF;
END_METHOD

METHOD PRIVATE LogTask
VAR_INPUT
_message : STRING[80];
_level : eLogLevel;
_sender : IAxoObject;
END_VAR
VAR
_castIIAxoStep : IAxoStep;
END_VAR
_castIIAxoStep ?= _sender;
IF(_castIIAxoStep <> NULL) THEN RETURN; END_IF;
_context_.GetLogger().Log(_message, _level, THIS);
END_METHOD
// METHOD PRIVATE LogTask
// VAR_INPUT
// _message : STRING[80];
// _level : eLogLevel;
// _sender : IAxoObject;
// END_VAR
// VAR
// _castIIAxoStep : IAxoStep;
// END_VAR
// _castIIAxoStep ?= _sender;
// IF(_castIIAxoStep <> NULL) THEN RETURN; END_IF;
// _context_.GetLogger().Log(_message, _level, THIS);
// END_METHOD

///<summary>
/// Makes this task enter into `Error` state, when `HasErrorState` argument is `TRUE`
Expand All @@ -541,7 +543,7 @@ NAMESPACE AXOpen.Core

IF(HasErrorState) THEN
Status := eAxoTaskState#Error;
THIS.LogTask('Task failed', eLogLevel#Error, THIS);
_context_.GetLogger().Log('Task failed', eLogLevel#Error, THIS);
THIS.OnError();
THIS.WhileError();
_errorCycleCount := _context_.OpenCycleCount();
Expand All @@ -559,7 +561,7 @@ NAMESPACE AXOpen.Core
END_VAR
IF(HasErrorState) THEN
ErrorDetails := ErrorDescription;
THIS.LogTask(ErrorDetails, eLogLevel#Error, THIS);
_context_.GetLogger().Log(ErrorDetails, eLogLevel#Error, THIS);
END_IF;
THIS.ThrowWhen(HasErrorState);
END_METHOD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,7 @@
{
@if (!areAlarmsCollapsed)
{
@foreach (var message in Messengers)
{
<div class=" p-1 d-block w-100">
<RenderableContentControl Context="message"></RenderableContentControl>
</div>
}
<AxoObjectDiagnosticsView Component="@this.Component"></AxoObjectDiagnosticsView>
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ private eAlarmLevel AlarmLevel
break;
}
}
else if (_messengers.Any(p => p.State > eAxoMessengerState.NotActiveWatingAckn))
else if (_messengers.Any(p => p.State > eAxoMessengerState.NotActiveWaitingAckn))
{
return eAlarmLevel.Unacknowledged;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

using System.Collections;
using AXSharp.Connector;
using AXSharp.Connector.ValueTypes;
using AXSharp.Presentation.Blazor.Controls.RenderableContent;

namespace AXOpen.Messaging.Static.Blazor;
Expand Down Expand Up @@ -45,7 +46,7 @@ public static AxoMessageObserver Create(IEnumerable<ITwinObject> observedObjects
{
return new AxoMessageObserver(observedObjects, component);
}

/// <summary>
/// Creates an instance of the AxoMessageObserver class.
/// </summary>
Expand All @@ -61,8 +62,16 @@ public string HighestSeverityColor
{
get
{
var s = Provider?.Messengers?.Where(p =>(eAxoMessengerState)p.MessengerState.LastValue == eAxoMessengerState.ActiveNoAck).Select(p => p.Category.LastValue).Max();
return SeverityToColor(s);
try
{
return SeverityToColor(Provider?.Messengers?
.Where(p => (eAxoMessengerState)p.MessengerState.LastValue > eAxoMessengerState.Idle)
.Select(p => p.Category.LastValue).Max());
}
catch (Exception e)
{
return "secondary";
}
}
}

Expand Down Expand Up @@ -106,11 +115,15 @@ public async Task InitializeUpdate()
{
await Task.Run(() => {
foreach (var axoMessenger in this.Provider?.Messengers?
.SelectMany(p => new ITwinElement[] { p.MessengerState, p.Category })!)
.SelectMany(p => new ITwinElement[] { p.MessengerState,
p.Category,
p.MessageCode,
p.AcknowledgedBeforeFallen
})!)
{
Component.AddToPolling(axoMessenger, 2500);
Component.UpdateValuesOnChange(axoMessenger);
Component.UpdateValuesOnChange(axoMessenger, 2500);
}
});
}

}

This file was deleted.

Loading