diff --git a/MP-TAB/MP-TAB.Client/Components/MachineBlock.razor b/MP-TAB/MP-TAB.Client/Components/MachineBlock.razor index c3fd5895..18d55b02 100644 --- a/MP-TAB/MP-TAB.Client/Components/MachineBlock.razor +++ b/MP-TAB/MP-TAB.Client/Components/MachineBlock.razor @@ -1,6 +1,6 @@ 

MachineBlock

-@if (DoPlaceholder) +@if (RecMSE == null) {
@@ -16,9 +16,12 @@ else {
-
+
- EUREKA! + @RecMSE.IdxMacchina +
+ @RecMSE.DescrizioneStato +
@@ -26,13 +29,7 @@ else @code { - - [Parameter] public MappaStatoExpl? RecMSE { get; set; } - private bool DoPlaceholder - { - get => RecMSE == null; - } } diff --git a/MP-TAB/MP-TAB.Client/Components/MachineBlock.razor.css b/MP-TAB/MP-TAB.Client/Components/MachineBlock.razor.css new file mode 100644 index 00000000..da778a63 --- /dev/null +++ b/MP-TAB/MP-TAB.Client/Components/MachineBlock.razor.css @@ -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; +} \ No newline at end of file diff --git a/MP-TAB/MP-TAB.Client/Components/MachineBlock.razor.less b/MP-TAB/MP-TAB.Client/Components/MachineBlock.razor.less new file mode 100644 index 00000000..a19d4a4c --- /dev/null +++ b/MP-TAB/MP-TAB.Client/Components/MachineBlock.razor.less @@ -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; +} diff --git a/MP-TAB/MP-TAB.Client/Components/MachineBlock.razor.min.css b/MP-TAB/MP-TAB.Client/Components/MachineBlock.razor.min.css new file mode 100644 index 00000000..3f07489b --- /dev/null +++ b/MP-TAB/MP-TAB.Client/Components/MachineBlock.razor.min.css @@ -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;} \ No newline at end of file diff --git a/MP-TAB/MP-TAB.Client/MP-TAB.Client.csproj b/MP-TAB/MP-TAB.Client/MP-TAB.Client.csproj index 9e05a261..77496456 100644 --- a/MP-TAB/MP-TAB.Client/MP-TAB.Client.csproj +++ b/MP-TAB/MP-TAB.Client/MP-TAB.Client.csproj @@ -17,6 +17,18 @@ + + + + + + <_ContentIncludedByDefault Remove="compilerconfig.json" /> + + + + + + diff --git a/MP-TAB/MP-TAB.Client/Pages/StatusMap.razor b/MP-TAB/MP-TAB.Client/Pages/StatusMap.razor index 7078da83..2440ab01 100644 --- a/MP-TAB/MP-TAB.Client/Pages/StatusMap.razor +++ b/MP-TAB/MP-TAB.Client/Pages/StatusMap.razor @@ -1,39 +1,28 @@ @attribute [RenderModeAuto] -@if (ListMSE == null || ListMSE.Count == 0) -{ -
-
- executing on browser -
+
+ @if (ListMSE == null || ListMSE.Count == 0) + { @for (int i = 0; i < 9; i++) {
} -
-} -else -{ - -
-
- loaded on browser -
+ } + else + { @foreach (var item in ListMSE) {
} -
-} - + } +
@code { [Parameter] public List? ListMSE { get; set; } - } diff --git a/MP-TAB/MP-TAB.Client/compilerconfig.json b/MP-TAB/MP-TAB.Client/compilerconfig.json new file mode 100644 index 00000000..18edd0fb --- /dev/null +++ b/MP-TAB/MP-TAB.Client/compilerconfig.json @@ -0,0 +1,6 @@ +[ + { + "outputFile": "Components/MachineBlock.razor.css", + "inputFile": "Components/MachineBlock.razor.less" + } +] \ No newline at end of file diff --git a/MP-TAB/MP-TAB.Client/compilerconfig.json.defaults b/MP-TAB/MP-TAB.Client/compilerconfig.json.defaults new file mode 100644 index 00000000..41870cc5 --- /dev/null +++ b/MP-TAB/MP-TAB.Client/compilerconfig.json.defaults @@ -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 + } + } +} \ No newline at end of file diff --git a/MP-TAB/MP-TAB/Components/Pages/StatusMap.razor b/MP-TAB/MP-TAB/Components/Pages/StatusMap.razor index b1328ed6..60cb1979 100644 --- a/MP-TAB/MP-TAB/Components/Pages/StatusMap.razor +++ b/MP-TAB/MP-TAB/Components/Pages/StatusMap.razor @@ -6,4 +6,3 @@ - diff --git a/MP-TAB/MP-TAB/Components/Pages/StatusMap.razor.cs b/MP-TAB/MP-TAB/Components/Pages/StatusMap.razor.cs index c10ca39f..4dcbde73 100644 --- a/MP-TAB/MP-TAB/Components/Pages/StatusMap.razor.cs +++ b/MP-TAB/MP-TAB/Components/Pages/StatusMap.razor.cs @@ -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(); }); - } + } } /// @@ -122,38 +124,20 @@ namespace MP_TAB.Components.Pages var dataList = JsonConvert.DeserializeObject>(currArgs.newMessage); if (dataList != null) { -#if DEBUG - // hack: legge 3 volte i dati x stressare sistema - var singleData = dataList; - listMSE = new List(); - 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? CurrConfig = null; private bool doBlink = false; - private List? listMSE = null; + private static List? listMSE = null; private Random rnd = new Random(); private void disposeTimers() { diff --git a/MP-TAB/MP-TAB/MP-TAB.csproj b/MP-TAB/MP-TAB/MP-TAB.csproj index 9febd979..2993cd68 100644 --- a/MP-TAB/MP-TAB/MP-TAB.csproj +++ b/MP-TAB/MP-TAB/MP-TAB.csproj @@ -11,6 +11,14 @@ + + + + + + + Always + diff --git a/MP-TAB/MP-TAB/NLog.config b/MP-TAB/MP-TAB/NLog.config new file mode 100644 index 00000000..3e4185f4 --- /dev/null +++ b/MP-TAB/MP-TAB/NLog.config @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MP-TAB/MP-TAB/logs/.placeholder b/MP-TAB/MP-TAB/logs/.placeholder new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/MP-TAB/MP-TAB/logs/.placeholder @@ -0,0 +1 @@ + \ No newline at end of file