Bozza mappa stato con errori (da analizzare)

This commit is contained in:
Samuele Locatelli
2023-09-25 20:07:05 +02:00
parent 1c5d033f75
commit 6767abe820
13 changed files with 523 additions and 53 deletions
@@ -1,6 +1,6 @@
<h3>MachineBlock</h3>
@if (DoPlaceholder)
@if (RecMSE == null)
{
<div class="card text-white mapBlock rCAll bg-secondary p-0 m-0">
<div class="card-body">
@@ -16,9 +16,12 @@
else
{
<div class="card text-white mapBlock rCAll bg-success p-0 m-0">
<div class="card-body">
<div class="card-body @RecMSE.Semaforo">
<div class="fs-2">
EUREKA!
@RecMSE.IdxMacchina
<div class="small">
@RecMSE.DescrizioneStato
</div>
</div>
</div>
</div>
@@ -26,13 +29,7 @@ else
@code {
[Parameter]
public MappaStatoExpl? RecMSE { get; set; }
private bool DoPlaceholder
{
get => RecMSE == null;
}
}
@@ -0,0 +1,164 @@
.statusMap {
/*background: rgba(0,0,0,0.3);*/
}
.statusMap .ui-title,
.statusMap .ui-li-aside {
font-weight: 400;
text-transform: uppercase;
font-size: 2.5em;
line-height: 1.1em;
color: #DEDEDE;
text-shadow: 2px 2px 4px #000;
text-align: center;
background: linear-gradient(270deg, rgba(20, 20, 20, 0.7), rgba(100, 100, 100, 0.7), rgba(20, 20, 20, 0.7));
}
.statusMap .ui-subtitle {
line-height: 1.1em;
color: #DEDEDE;
text-shadow: 2px 2px 4px #000;
text-align: center;
background: linear-gradient(270deg, rgba(0, 0, 0, 0.4), rgba(100, 100, 100, 0.4), rgba(0, 0, 0, 0.4));
}
.statusMap .ui-footer {
color: #CDCDCD;
background: linear-gradient(270deg, rgba(10, 10, 10, 0.7), rgba(80, 80, 80, 0.7), rgba(10, 10, 10, 0.7));
}
.machBlock {
padding: 0 2px 0 2px;
}
/* END: gestione layout dinamico mappa... */
/* area semafori*/
.semBlinkVe,
.semFixVe,
.semFixVe_b,
.semVe,
.semVe_b {
background: #009036;
background: rgba(0, 255, 80, 0.6);
color: #FFFFAA;
}
.semBlinkGr,
.semFixGr,
.semFixGr_b,
.semGr,
.semGr_b {
background-color: #bcbcbc;
background: rgba(180, 180, 180, 0.6);
}
.semGi {
text-align: left;
background: #8a8d27;
background: rgba(230, 210, 0, 0.6);
padding: 0px 4px 0px 4px;
color: #000;
}
.semGi_b,
.semFixGi,
.semFixGi_b {
text-align: left;
background: #f9ff18;
background: rgba(255, 255, 0, 0.8);
padding: 0px 4px 0px 4px;
color: #333;
}
.semBl {
text-align: left;
background: #000E7A;
background: rgba(0, 5, 200, 0.6);
padding: 0px 4px 0px 4px;
color: #959500;
}
.semBl_b,
.semFixBl,
.semFixBl_b {
text-align: left;
background: #243FFF;
background: rgba(60, 80, 255, 0.8);
padding: 0px 4px 0px 4px;
color: #ffff32;
}
.semRo {
text-align: left;
background-color: #7a000e;
background: rgba(200, 0, 5, 0.6);
padding: 0px 4px 0px 4px;
color: #959500;
}
.semRo_b,
.semFixRo,
.semFixRo_b {
text-align: left;
background-color: #ff243f;
background: rgba(255, 60, 80, 0.8);
padding: 0px 4px 0px 4px;
color: #ffff32;
}
/* semafori con animazione blinking */
.no-cpu {
-moz-transform: translateZ(0);
-o-transform: translateZ(0);
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
}
@-webkit-keyframes blinkBack {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
@-moz-keyframes blinkBack {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
@-o-keyframes blinkBack {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
@keyframes blinkBack {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
.semBlinkGi {
background: linear-gradient(270deg, #8a8d27, #f9ff18);
background-size: 400% 400%;
-webkit-animation: blinkBack 2s ease infinite;
-moz-animation: blinkBack 2s ease infinite;
-o-animation: blinkBack 2s ease infinite;
animation: blinkBack 2s ease infinite;
}
.semBlinkRo {
background: linear-gradient(270deg, #7a000e, #ff243f);
background-size: 400% 400%;
-webkit-animation: blinkBack 2s ease infinite;
-moz-animation: blinkBack 2s ease infinite;
-o-animation: blinkBack 2s ease infinite;
animation: blinkBack 2s ease infinite;
color: Yellow;
}
@@ -0,0 +1,192 @@
.statusMap {
/*background: rgba(0,0,0,0.3);*/
}
.statusMap .ui-title, .statusMap .ui-li-aside {
font-weight: 400;
text-transform: uppercase;
font-size: 2.5em;
line-height: 1.1em;
color: #DEDEDE;
text-shadow: 2px 2px 4px #000;
text-align: center;
background: linear-gradient(270deg, rgba(20,20,20,0.7), rgba(100,100,100,0.7), rgba(20,20,20,0.7));
}
.statusMap .ui-subtitle {
line-height: 1.1em;
color: #DEDEDE;
text-shadow: 2px 2px 4px #000;
text-align: center;
background: linear-gradient(270deg, rgba(0,0,0,0.4), rgba(100,100,100,0.4), rgba(0,0,0,0.4));
}
.statusMap .ui-art {
}
.statusMap .ui-footer {
color: #CDCDCD;
background: linear-gradient(270deg, rgba(10,10,10,0.7), rgba(80,80,80,0.7), rgba(10,10,10,0.7));
}
.machBlock {
padding: 0 2px 0 2px;
}
/* END: gestione layout dinamico mappa... */
/* area semafori*/
.semBlinkVe,
.semFixVe,
.semFixVe_b,
.semVe,
.semVe_b {
background: #009036;
background: rgba(0,255,80,.6);
color: #FFFFAA;
}
.semBlinkGr,
.semFixGr,
.semFixGr_b,
.semGr,
.semGr_b {
background-color: #bcbcbc;
background: rgba(180,180,180,.6);
}
.semGi {
text-align: left;
background: #8a8d27;
background: rgba(230,210,0,.6);
padding: 0px 4px 0px 4px;
color: #000;
}
.semGi_b,
.semFixGi,
.semFixGi_b {
text-align: left;
background: #f9ff18;
background: rgba(255,255,0,.8);
padding: 0px 4px 0px 4px;
color: #333;
}
.semBl {
text-align: left;
background: #000E7A;
background: rgba(0,5,200,.6);
padding: 0px 4px 0px 4px;
color: #959500;
}
.semBl_b,
.semFixBl,
.semFixBl_b {
text-align: left;
background: #243FFF;
background: rgba(60,80,255,.8);
padding: 0px 4px 0px 4px;
color: #ffff32;
}
.semRo {
text-align: left;
background-color: #7a000e;
background: rgba(200,0,5,.6);
padding: 0px 4px 0px 4px;
color: #959500;
}
.semRo_b,
.semFixRo,
.semFixRo_b {
text-align: left;
background-color: #ff243f;
background: rgba(255,60,80,.8);
padding: 0px 4px 0px 4px;
color: #ffff32;
}
/* semafori con animazione blinking */
.no-cpu {
-moz-transform: translateZ(0);
-o-transform: translateZ(0);
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
}
@-webkit-keyframes blinkBack {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
@-moz-keyframes blinkBack {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
@-o-keyframes blinkBack {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
@keyframes blinkBack {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
.semBlinkGi {
background: linear-gradient(270deg, #8a8d27, #f9ff18);
background-size: 400% 400%;
-webkit-animation: blinkBack 2s ease infinite;
-moz-animation: blinkBack 2s ease infinite;
-o-animation: blinkBack 2s ease infinite;
animation: blinkBack 2s ease infinite;
}
.semBlinkRo {
background: linear-gradient(270deg, #7a000e, #ff243f);
background-size: 400% 400%;
-webkit-animation: blinkBack 2s ease infinite;
-moz-animation: blinkBack 2s ease infinite;
-o-animation: blinkBack 2s ease infinite;
animation: blinkBack 2s ease infinite;
color: Yellow;
}
@@ -0,0 +1 @@
.statusMap .ui-title,.statusMap .ui-li-aside{font-weight:400;text-transform:uppercase;font-size:2.5em;line-height:1.1em;color:#dedede;text-shadow:2px 2px 4px #000;text-align:center;background:linear-gradient(270deg,rgba(20,20,20,.7),rgba(100,100,100,.7),rgba(20,20,20,.7));}.statusMap .ui-subtitle{line-height:1.1em;color:#dedede;text-shadow:2px 2px 4px #000;text-align:center;background:linear-gradient(270deg,rgba(0,0,0,.4),rgba(100,100,100,.4),rgba(0,0,0,.4));}.statusMap .ui-footer{color:#cdcdcd;background:linear-gradient(270deg,rgba(10,10,10,.7),rgba(80,80,80,.7),rgba(10,10,10,.7));}.machBlock{padding:0 2px 0 2px;}.semBlinkVe,.semFixVe,.semFixVe_b,.semVe,.semVe_b{background:#009036;background:rgba(0,255,80,.6);color:#ffa;}.semBlinkGr,.semFixGr,.semFixGr_b,.semGr,.semGr_b{background-color:#bcbcbc;background:rgba(180,180,180,.6);}.semGi{text-align:left;background:#8a8d27;background:rgba(230,210,0,.6);padding:0 4px 0 4px;color:#000;}.semGi_b,.semFixGi,.semFixGi_b{text-align:left;background:#f9ff18;background:rgba(255,255,0,.8);padding:0 4px 0 4px;color:#333;}.semBl{text-align:left;background:#000e7a;background:rgba(0,5,200,.6);padding:0 4px 0 4px;color:#959500;}.semBl_b,.semFixBl,.semFixBl_b{text-align:left;background:#243fff;background:rgba(60,80,255,.8);padding:0 4px 0 4px;color:#ffff32;}.semRo{text-align:left;background-color:#7a000e;background:rgba(200,0,5,.6);padding:0 4px 0 4px;color:#959500;}.semRo_b,.semFixRo,.semFixRo_b{text-align:left;background-color:#ff243f;background:rgba(255,60,80,.8);padding:0 4px 0 4px;color:#ffff32;}.no-cpu{-moz-transform:translateZ(0);-o-transform:translateZ(0);-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);}@-webkit-keyframes blinkBack{0%{background-position:0% 50%;}50%{background-position:100% 50%;}100%{background-position:0% 50%;}}@-moz-keyframes blinkBack{0%{background-position:0% 50%;}50%{background-position:100% 50%;}100%{background-position:0% 50%;}}@-o-keyframes blinkBack{0%{background-position:0% 50%;}50%{background-position:100% 50%;}100%{background-position:0% 50%;}}@keyframes blinkBack{0%{background-position:0% 50%;}50%{background-position:100% 50%;}100%{background-position:0% 50%;}}.semBlinkGi{background:linear-gradient(270deg,#8a8d27,#f9ff18);background-size:400% 400%;-webkit-animation:blinkBack 2s ease infinite;-moz-animation:blinkBack 2s ease infinite;-o-animation:blinkBack 2s ease infinite;animation:blinkBack 2s ease infinite;}.semBlinkRo{background:linear-gradient(270deg,#7a000e,#ff243f);background-size:400% 400%;-webkit-animation:blinkBack 2s ease infinite;-moz-animation:blinkBack 2s ease infinite;-o-animation:blinkBack 2s ease infinite;animation:blinkBack 2s ease infinite;color:#ff0;}
+12
View File
@@ -17,6 +17,18 @@
<None Remove="wwwroot\lib\**" />
</ItemGroup>
<ItemGroup>
<Content Remove="compilerconfig.json" />
</ItemGroup>
<ItemGroup>
<_ContentIncludedByDefault Remove="compilerconfig.json" />
</ItemGroup>
<ItemGroup>
<None Include="compilerconfig.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="EgwCoreLib.Razor" Version="1.4.2308.216" />
<PackageReference Include="EgwCoreLib.Utils" Version="1.4.2308.216" />
+8 -19
View File
@@ -1,39 +1,28 @@
@attribute [RenderModeAuto]
@if (ListMSE == null || ListMSE.Count == 0)
{
<div class="row">
<div class="col-12 my-2 alert alert-secondary fs-3">
executing on browser
</div>
<div class="row">
@if (ListMSE == null || ListMSE.Count == 0)
{
@for (int i = 0; i < 9; i++)
{
<div class="col-4 my-2">
<MP_TAB.Client.Components.MachineBlock></MP_TAB.Client.Components.MachineBlock>
</div>
}
</div>
}
else
{
<div class="row">
<div class="col-12 my-2 alert alert-success fs-3">
loaded on browser
</div>
}
else
{
@foreach (var item in ListMSE)
{
<div class="col-4 my-2">
<MP_TAB.Client.Components.MachineBlock RecMSE="@item"></MP_TAB.Client.Components.MachineBlock>
</div>
}
</div>
}
}
</div>
@code {
[Parameter]
public List<MappaStatoExpl>? ListMSE { get; set; }
}
+6
View File
@@ -0,0 +1,6 @@
[
{
"outputFile": "Components/MachineBlock.razor.css",
"inputFile": "Components/MachineBlock.razor.less"
}
]
@@ -0,0 +1,71 @@
{
"compilers": {
"less": {
"autoPrefix": "",
"cssComb": "none",
"ieCompat": true,
"math": null,
"strictMath": false,
"strictUnits": false,
"relativeUrls": true,
"rootPath": "",
"sourceMapRoot": "",
"sourceMapBasePath": "",
"sourceMap": false
},
"sass": {
"autoPrefix": "",
"loadPaths": "",
"style": "expanded",
"relativeUrls": true,
"sourceMap": false
},
"nodesass": {
"autoPrefix": "",
"includePath": "",
"indentType": "space",
"indentWidth": 2,
"outputStyle": "nested",
"precision": 5,
"relativeUrls": true,
"sourceMapRoot": "",
"lineFeed": "",
"sourceMap": false
},
"stylus": {
"sourceMap": false
},
"babel": {
"sourceMap": false
},
"coffeescript": {
"bare": false,
"runtimeMode": "node",
"sourceMap": false
},
"handlebars": {
"root": "",
"noBOM": false,
"name": "",
"namespace": "",
"knownHelpersOnly": false,
"forcePartial": false,
"knownHelpers": [],
"commonjs": "",
"amd": false,
"sourceMap": false
}
},
"minifiers": {
"css": {
"enabled": true,
"termSemicolons": true,
"gzip": false
},
"javascript": {
"enabled": true,
"termSemicolons": true,
"gzip": false
}
}
}
@@ -6,4 +6,3 @@
<MP_TAB.Client.Pages.StatusMap ListMSE="@listMSE"></MP_TAB.Client.Pages.StatusMap>
@@ -26,7 +26,7 @@ namespace MP_TAB.Components.Pages
public partial class StatusMap : IDisposable
{
[Inject]
protected MonDataFeeder MMDataService { get; set; } = null !;
protected MonDataFeeder MMDataService { get; set; } = null!;
[Inject]
protected NavigationManager NavManager { get; set; } = null!;
@@ -78,7 +78,9 @@ namespace MP_TAB.Components.Pages
MMDataService.dataPipe.EA_NewMessage += DataPipe_EA_NewMessage;
MMDataService.blinkPipe.EA_NewMessage += BlinkPipe_EA_NewMessage;
Random rnd = new Random();
await Task.Delay(rnd.Next(1000, 1200));
await Task.Delay(rnd.Next(100, 200));
// carico i dati iniziali...
listMSE = await MMDataService.MseGetAll();
StartTimer();
}
@@ -102,7 +104,7 @@ namespace MP_TAB.Components.Pages
{
StateHasChanged();
});
}
}
}
/// <summary>
@@ -122,38 +124,20 @@ namespace MP_TAB.Components.Pages
var dataList = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(currArgs.newMessage);
if (dataList != null)
{
#if DEBUG
// hack: legge 3 volte i dati x stressare sistema
var singleData = dataList;
listMSE = new List<MappaStatoExpl>();
for (int i = 0; i < 3; i++)
{
listMSE.AddRange(singleData);
}
#else
listMSE = dataList;
#endif
listMSE = dataList;
}
}
catch
{ }
}
InvokeAsync(() =>
{
#if DEBUG
// attesa random 0-50ms...
Random rnd = new Random();
Task.Delay(rnd.Next(5, 50));
#endif
StateHasChanged();
});
InvokeAsync(StateHasChanged);
}
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private static System.Timers.Timer slowTimer = new System.Timers.Timer(300000);
private List<ConfigModel>? CurrConfig = null;
private bool doBlink = false;
private List<MappaStatoExpl>? listMSE = null;
private static List<MappaStatoExpl>? listMSE = null;
private Random rnd = new Random();
private void disposeTimers()
{
+8
View File
@@ -11,6 +11,14 @@
<ItemGroup>
<ProjectReference Include="..\MP-TAB.Client\MP-TAB.Client.csproj" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.0-rc.1.23421.29" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="StackExchange.Redis" Version="2.6.90" />
</ItemGroup>
<ItemGroup>
<None Update="logs\.placeholder">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
+46
View File
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
<!-- optional, add some variables
https://github.com/nlog/NLog/wiki/Configuration-file#variables
-->
<variable name="myvar" value="myvalue" />
<!--
See https://github.com/nlog/nlog/wiki/Configuration-file
for information on customizing logging rules and outputs.
-->
<targets>
<!--
add your targets here
See https://github.com/nlog/NLog/wiki/Targets for possible targets.
See https://github.com/nlog/NLog/wiki/Layout-Renderers for the possible layout renderers.
-->
<!--
Write events to a file with the date in the filename.
<target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}" />
-->
<target xsi:type="File" name="fileTarget" fileName="${basedir}/logs/${shortdate}.log" layout="${longdate} | ${uppercase:${level}} | ${logger:shortName=false} | ${message}" />
<target xsi:type="ColoredConsole" name="consoleTarget" layout="${longdate} | ${uppercase:${level}} | ${logger:shortName=true} | ${message}" />
</targets>
<rules>
<!-- add your logging rules here -->
<!--
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f"
<logger name="*" minlevel="Debug" writeTo="f" />
-->
<logger name="*" minlevel="Debug" writeTo="consoleTarget" />
<!--<logger name="Microsoft.*" maxlevel="Info" final="true" />-->
<logger name="*" minlevel="Info" writeTo="fileTarget" />
</rules>
</nlog>
+1
View File
@@ -0,0 +1 @@