Skip to content

Commit

Permalink
fix refactor of eAlertDialogType
Browse files Browse the repository at this point in the history
  • Loading branch information
blazej.kuhajda committed Feb 20, 2024
1 parent 4f721b4 commit 0bbd9a1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ else

public void CreateToast()
{
DialogService.AddAlertDialog(eAlertDialogType.Success, "Test", "test", 30);
DialogService.AddAlertDialog(eAlertType.Success, "Test", "test", 30);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@using AXOpen.VisualComposer;
@using AXSharp.Connector;
@using AXOpen.Core;
@inject IAlertDialogService _alerts
@inject IAlertService _alerts
@inherits RenderableComplexComponentBase<axosimple.UnitTemplate.Unit>


Expand Down
14 changes: 7 additions & 7 deletions src/templates.simple/axosimple.sln
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AXOpen.Data.Json", "..\data
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AXOpen.Data.MongoDb", "..\data\src\repositories\MongoDb\AXOpen.Data.MongoDb.csproj", "{6600F42A-C561-41A5-BB6B-2C93613DB92E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AxOpen.Inspectors.Blazor", "..\inspectors\src\AXOpen.Inspectors.blazor\AxOpen.Inspectors.Blazor.csproj", "{286B0C9D-2B65-4C10-B7D2-19052C559ACC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AXOpen.Inspectors.Blazor", "..\inspectors\src\AXOpen.Inspectors.blazor\AXOpen.Inspectors.Blazor.csproj", "{286B0C9D-2B65-4C10-B7D2-19052C559ACC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ix_ax_axopen_inspectors", "..\inspectors\src\AXOpen.Inspectors\ix_ax_axopen_inspectors.csproj", "{21BC94A1-E2EE-46A8-B062-45581DF36A3E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ix_ax_axopen_io", "..\io\src\AXOpen.Io\ix_ax_axopen_io.csproj", "{3C46ABB6-689C-450A-9019-C727F9CA2EF8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ix_ax_ax_sdk", "..\sdk-ax\ctrl\ix\ix_ax_ax_sdk.csproj", "{8A767D14-0309-494B-BC9F-D48D65C7ACF7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AXOpen.Security.Blazor", "..\Security\src\AXOpen.Security.Blazor\AXOpen.Security.Blazor.csproj", "{9E31DA60-74BA-484D-875F-A0429EB31EDF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AXOpen.Security.Blazor", "..\security\src\AXOpen.Security.Blazor\AXOpen.Security.Blazor.csproj", "{9E31DA60-74BA-484D-875F-A0429EB31EDF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AXOpen.Security", "..\Security\src\AXOpen.Security\AXOpen.Security.csproj", "{85FDDFCA-D24E-4F3A-BA06-9F0369B44609}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AXOpen.Security", "..\security\src\AXOpen.Security\AXOpen.Security.csproj", "{85FDDFCA-D24E-4F3A-BA06-9F0369B44609}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ix_ax_axopen_simatic1500", "..\simatic1500\ctrl\ix\ix_ax_axopen_simatic1500.csproj", "{81B6C9F9-9762-4D72-863D-9FEC9DCC2A99}"
EndProject
Expand Down Expand Up @@ -205,13 +205,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ctrl", "..\sdk-ax\ctrl", "{
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sdk-ax", "..\sdk-ax", "{43F64FF5-AD56-4894-AA58-262B5F390E75}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AXOpen.Security.Blazor", "..\Security\src\AXOpen.Security.Blazor", "{119FD137-5E60-4A1E-BFE8-55846B5EB162}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AXOpen.Security.Blazor", "..\security\src\AXOpen.Security.Blazor", "{119FD137-5E60-4A1E-BFE8-55846B5EB162}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AXOpen.Security", "..\Security\src\AXOpen.Security", "{BF810C4C-61B8-4021-8413-0DB2A86B90B9}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AXOpen.Security", "..\security\src\AXOpen.Security", "{BF810C4C-61B8-4021-8413-0DB2A86B90B9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "..\Security\src", "{7893F729-96F2-406E-A028-70DC28D95530}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "..\security\src", "{7893F729-96F2-406E-A028-70DC28D95530}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Security", "..\Security", "{1CAA7320-D822-4287-8318-8D2740F18BC8}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "security", "..\security", "{1CAA7320-D822-4287-8318-8D2740F18BC8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ix", "..\simatic1500\ctrl\ix", "{2B44526B-EB7F-4233-A6C9-8F89A294507E}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
{
private async Task Automat()
{
_alerts.AddAlertDialog(eAlertDialogType.Info, Localizer["Mode change"], $"{Localizer[$"Requesting automatic mode of selected units"]}.", 1);
_alerts.AddAlertDialog(eAlertType.Info, Localizer["Mode change"], $"{Localizer[$"Requesting automatic mode of selected units"]}.", 1);

var notGroundedStations = ControlledUnits.Where(p => p.unit.GroundStatus != eAxoTaskState.Done);
var ungroundedStationsList = string.Join(",", notGroundedStations.Select(p => p.unit.Component.AttributeName));

if (notGroundedStations.Count() > 0)
{
_alerts.AddAlertDialog(eAlertDialogType.Warning, Localizer["Mode change"],
_alerts.AddAlertDialog(eAlertType.Warning, Localizer["Mode change"],
$"{Localizer[$"Cannot start automatic mode on unit(s)"]} `{ungroundedStationsList}`. Ground must be executed successfully first.", 5);
return;
}
Expand All @@ -49,12 +49,12 @@
await a.unit.Automat.ExecuteAsync();
}

_alerts.AddAlertDialog(eAlertDialogType.Success, Localizer["Mode change"], $"{Localizer[$"Automatic mode of selected units"]} has been started.", 3);
_alerts.AddAlertDialog(eAlertType.Success, Localizer["Mode change"], $"{Localizer[$"Automatic mode of selected units"]} has been started.", 3);
}

private async Task Ground()
{
_alerts.AddAlertDialog(eAlertDialogType.Info, Localizer["Mode change"], $"{Localizer[$"Requesting ground mode of selected units"]}.", 1);
_alerts.AddAlertDialog(eAlertType.Info, Localizer["Mode change"], $"{Localizer[$"Requesting ground mode of selected units"]}.", 1);
int expectedTimeToExecute = 20000;
ControlledUnits.ToList().ForEach(async a => await a.unit.Ground.ExecuteAsync());

Expand All @@ -79,15 +79,15 @@
.Where(p => p.unit.GroundStatus != eAxoTaskState.Done)
.Select(p => p.unit.Component.AttributeName));

_alerts.AddAlertDialog(eAlertDialogType.Danger,
_alerts.AddAlertDialog(eAlertType.Danger,
Localizer["Mode change"],
$"{Localizer[$"Ground mode did not succeed on unit"]} " +
$"{pp}", 5);

return;
}

_alerts.AddAlertDialog(eAlertDialogType.Success,
_alerts.AddAlertDialog(eAlertType.Success,
Localizer["Mode change"],
$"{Localizer[$"Ground mode of selected unit(s)"]} was successfully executed.", 3);

Expand Down

0 comments on commit 0bbd9a1

Please sign in to comment.