Merge branch 'master' into develop

This commit is contained in:
zaccaria.majid
2023-08-10 09:35:25 +02:00
9 changed files with 1150 additions and 758 deletions
+1
View File
@@ -8,6 +8,7 @@ namespace SMGen.Data.Data
{
public class FileLinesClass
{
public string file = "";
public Dictionary<string, int> statesOK = new Dictionary<string, int>();
public Dictionary<string, int> eventsOK = new Dictionary<string, int>();
public List<string> lines = new List<string>();
+40 -1
View File
@@ -262,7 +262,7 @@ namespace SMGen.Data.Services
{
foreach (var line in lines)
{
lineOk = line;
lineOk = line.Trim();
if (!lineOk.StartsWith("#") && !string.IsNullOrEmpty(lineOk) && lineOk.Length >= 3)
{
if (lineOk.Contains("#"))
@@ -360,6 +360,7 @@ namespace SMGen.Data.Services
Log.Error($"{exc}{Environment.NewLine}");
}
answ.file = currFile.tempFileName;
answ.statesOK = StatesAll2;
answ.eventsOK = evOk;
answ.lines = lines.ToList();
@@ -590,6 +591,8 @@ namespace SMGen.Data.Services
{
while ((line = await sr.ReadLineAsync().ConfigureAwait(false)) != null)
{
line = line.Replace("\t", " ").Trim();
if (!line.StartsWith("#") && !string.IsNullOrEmpty(line) && line.Length >= 3)
{
if (line.Contains("#"))
@@ -597,6 +600,9 @@ namespace SMGen.Data.Services
var lineSplit = line.Split("#");
line = lineSplit[0];
}
//else if (line.StartsWith("\t"))
//{
//}
var sz_tokens = line.Split(":");
@@ -666,6 +672,9 @@ namespace SMGen.Data.Services
};
Rules.Add(temp_rule);
States2Rules.Add(next_state);
actStates2Chk.Add(state);
nextStates2Chk.Add(next_state);
}
break;
}
@@ -716,9 +725,39 @@ namespace SMGen.Data.Services
}
}
foreach (var state in actStates2Chk.Distinct())
{
var nxtSt = nextStates2Chk.FirstOrDefault(x => x == state);
if (nxtSt == null)
{
errMsg += $"Nel file {currFile.origFileName} lo stato: {state} non risulta essere presente come stato di uscita.{Environment.NewLine}";
Log.Error(errMsg);
currFile.errorMsg = errMsg;
currFile.isOk = false;
currFile.calcRunning = false;
}
}
foreach (var nxtState in nextStates2Chk.Distinct())
{
var St = actStates2Chk.FirstOrDefault(x => x == nxtState);
if (St == null)
{
errMsg += $"Nel file {currFile.origFileName} lo stato: {nxtState} non risulta essere presente come stato di entrata.{Environment.NewLine}";
Log.Error(errMsg);
currFile.errorMsg = errMsg;
currFile.isOk = false;
currFile.calcRunning = false;
}
}
return currFile;
}
private List<string> actStates2Chk { get; set; } = new List<string>();
private List<string> nextStates2Chk { get; set; } = new List<string>();
/// <summary>
/// Valutazione schema macchina a stati x Ingressi --> Eventi
/// </summary>
+71 -2
View File
@@ -17,6 +17,7 @@
}
</th>
<th scope="col"></th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
@@ -47,6 +48,12 @@
<a class="btn btn-sm text-decoration-none" disabled><i class="fa-solid fa-download text-secondary"></i></a>
}
</td>
@if (!hasBit)
{
<td>
<button class="btn btn-sm btn-info" @onclick="()=>doProc(item.Value)"><i class="fa-solid fa-code-compare"></i></button>
</td>
}
@if (item.Value.errorMsg != "")
{
<td>
@@ -54,10 +61,72 @@
</td>
}
else
{}
{ }
}
</tr>
@if (k != null && k.statesOK.Count > 0 && k.eventsOK.Count > 0 && k.lines.Count > 0 && item.Value.tempFileName == k.file)
{
<div class="d-flex justify-content-between p-3">
<div class="card shadow-lg rounded mb-2">
<div class="card-header">
<h4>STATI</h4>
</div>
<div class="card-body overflow-auto" style="max-height: 50rem">
@foreach (var line in k.lines)
{
@if (line.StartsWith("$STATE"))
{
@if (k.statesOK.ContainsKey(line.Split(":")[2].ToUpper().Trim()))
{
<span class="text-success">@line</span>
<br />
}
else
{
<span class="text-danger">@line</span>
<br />
}
}
}
</div>
</div>
<div class="card shadow-lg rounded mb-2">
<div class="card-header">
<h4>EVENTI</h4>
</div>
<div class="card-body overflow-auto" style="max-height: 50rem">
@foreach (var line in k.lines)
{
@if (line.StartsWith("$EVENT"))
{
<div>
@if (k.eventsOK.ContainsKey(line.Split(":")[2].ToUpper().Trim()))
{
<span class="text-success">@line</span>
<br />
}
else if (line.Contains("#"))
{
if (k.eventsOK.ContainsKey(line.Split(":")[2].Split("#")[0].ToUpper().Trim()))
{
<span class="text-success">@line</span>
<br />
}
}
else
{
<span class="text-danger">@line</span>
<br />
}
</div>
}
}
</div>
</div>
</div>
}
}
</tbody>
</table>
+15
View File
@@ -49,6 +49,21 @@ namespace SMGen.Components
private int _totalCount { get; set; } = 0;
protected FileLinesClass k = new FileLinesClass();
protected async Task doProc(FilesClass currFile)
{
await Task.Delay(1);
if (k.statesOK.Count <= 0 && k.eventsOK.Count <= 0 && k.lines.Count <= 0)
{
k = await SMGDService.DoCheckUnusedEvSt(currFile);
}
else
{
k = new FileLinesClass();
}
}
private int currPage
{
get => currFilter.CurrPage;
-5
View File
@@ -34,11 +34,6 @@
<span class="oi oi-plus" aria-hidden="true"></span> Gen. SM Stati
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link p-2" href="CheckUnused">
<span class="oi oi-plus" aria-hidden="true"></span> Controllo inutilizzi
</NavLink>
</div>
</nav>
</div>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,38 @@
IdxFamiglia;IdxStato;IdxTipo;next_IdxStato
15;1;0;0
15;1;14;11
15;1;18;15
15;1;44;38
15;1;45;39
15;1;46;37
15;11;0;0
15;11;15;1
15;11;18;15
15;11;44;38
15;11;45;39
15;11;46;37
15;15;0;0
15;15;14;11
15;15;15;1
15;15;44;38
15;15;45;39
15;15;46;37
15;24;0;0
15;37;0;0
15;37;14;11
15;37;15;1
15;37;18;15
15;37;44;38
15;37;45;39
15;38;0;0
15;38;14;11
15;38;15;1
15;38;18;15
15;38;45;39
15;38;46;37
15;39;0;0
15;39;14;11
15;39;15;1
15;39;18;15
15;39;44;38
15;39;46;37
1 IdxFamiglia IdxStato IdxTipo next_IdxStato
2 15 1 0 0
3 15 1 14 11
4 15 1 18 15
5 15 1 44 38
6 15 1 45 39
7 15 1 46 37
8 15 11 0 0
9 15 11 15 1
10 15 11 18 15
11 15 11 44 38
12 15 11 45 39
13 15 11 46 37
14 15 15 0 0
15 15 15 14 11
16 15 15 15 1
17 15 15 44 38
18 15 15 45 39
19 15 15 46 37
20 15 24 0 0
21 15 37 0 0
22 15 37 14 11
23 15 37 15 1
24 15 37 18 15
25 15 37 44 38
26 15 37 45 39
27 15 38 0 0
28 15 38 14 11
29 15 38 15 1
30 15 38 18 15
31 15 38 45 39
32 15 38 46 37
33 15 39 0 0
34 15 39 14 11
35 15 39 15 1
36 15 39 18 15
37 15 39 44 38
38 15 39 46 37
@@ -0,0 +1,31 @@
IdxFamiglia;IdxStato;IdxTipo;next_IdxStato
15;1;14;11
15;1;18;15
15;1;44;38
15;1;45;39
15;1;46;37
15;11;15;1
15;11;18;15
15;11;44;38
15;11;45;39
15;11;46;37
15;15;14;11
15;15;15;1
15;15;44;38
15;15;45;39
15;15;46;37
15;37;14;11
15;37;15;1
15;37;18;15
15;37;44;38
15;37;45;39
15;38;14;11
15;38;15;1
15;38;18;15
15;38;45;39
15;38;46;37
15;39;14;11
15;39;15;1
15;39;18;15
15;39;44;38
15;39;46;37
1 IdxFamiglia IdxStato IdxTipo next_IdxStato
2 15 1 14 11
3 15 1 18 15
4 15 1 44 38
5 15 1 45 39
6 15 1 46 37
7 15 11 15 1
8 15 11 18 15
9 15 11 44 38
10 15 11 45 39
11 15 11 46 37
12 15 15 14 11
13 15 15 15 1
14 15 15 44 38
15 15 15 45 39
16 15 15 46 37
17 15 37 14 11
18 15 37 15 1
19 15 37 18 15
20 15 37 44 38
21 15 37 45 39
22 15 38 14 11
23 15 38 15 1
24 15 38 18 15
25 15 38 45 39
26 15 38 46 37
27 15 39 14 11
28 15 39 15 1
29 15 39 18 15
30 15 39 44 38
31 15 39 46 37
@@ -0,0 +1,204 @@
IdxFamiglia;IdxStato;IdxTipo;next_IdxStato
20;0;14;11
20;0;15;12
20;0;16;13
20;0;18;15
20;0;24;24
20;0;30;29
20;2;0;0
20;2;14;11
20;2;15;12
20;2;16;13
20;2;18;15
20;2;24;24
20;2;30;29
20;3;0;0
20;3;14;11
20;3;15;12
20;3;16;13
20;3;18;15
20;3;24;24
20;3;30;29
20;4;0;0
20;4;14;11
20;4;15;12
20;4;16;13
20;4;18;15
20;4;24;24
20;4;30;29
20;5;0;0
20;5;14;11
20;5;15;12
20;5;16;13
20;5;18;15
20;5;24;24
20;5;30;29
20;6;0;0
20;6;14;11
20;6;15;12
20;6;16;13
20;6;18;15
20;6;24;24
20;6;30;29
20;7;0;0
20;7;14;11
20;7;15;12
20;7;16;13
20;7;18;15
20;7;24;24
20;7;30;29
20;8;0;0
20;8;14;11
20;8;15;12
20;8;16;13
20;8;18;15
20;8;24;24
20;8;30;29
20;9;0;0
20;9;14;11
20;9;15;12
20;9;16;13
20;9;18;15
20;9;24;24
20;9;30;29
20;10;0;0
20;10;14;11
20;10;15;12
20;10;16;13
20;10;18;15
20;10;24;24
20;10;30;29
20;11;0;0
20;11;15;12
20;11;16;13
20;11;18;15
20;11;24;24
20;11;30;29
20;12;0;0
20;12;14;11
20;12;16;13
20;12;18;15
20;12;24;24
20;12;30;29
20;13;0;0
20;13;14;11
20;13;15;12
20;13;18;15
20;13;24;24
20;13;30;29
20;14;0;0
20;14;14;11
20;14;15;12
20;14;16;13
20;14;18;15
20;14;24;24
20;14;30;29
20;15;0;0
20;15;14;11
20;15;15;12
20;15;16;13
20;15;24;24
20;15;30;29
20;23;0;0
20;23;14;11
20;23;15;12
20;23;16;13
20;23;18;15
20;23;24;24
20;23;30;29
20;24;0;0
20;24;14;11
20;24;15;12
20;24;16;13
20;24;18;15
20;24;30;29
20;25;0;0
20;25;14;11
20;25;15;12
20;25;16;13
20;25;18;15
20;25;24;24
20;25;30;29
20;26;0;0
20;26;14;11
20;26;15;12
20;26;16;13
20;26;18;15
20;26;24;24
20;26;30;29
20;27;0;0
20;27;14;11
20;27;15;12
20;27;16;13
20;27;18;15
20;27;24;24
20;27;30;29
20;28;0;0
20;28;14;11
20;28;15;12
20;28;16;13
20;28;18;15
20;28;24;24
20;28;30;29
20;29;0;0
20;29;14;11
20;29;15;12
20;29;16;13
20;29;18;15
20;29;24;24
20;30;0;0
20;30;14;11
20;30;15;12
20;30;16;13
20;30;18;15
20;30;24;24
20;30;30;29
20;31;0;0
20;31;14;11
20;31;15;12
20;31;16;13
20;31;18;15
20;31;24;24
20;31;30;29
20;32;0;0
20;32;14;11
20;32;15;12
20;32;16;13
20;32;18;15
20;32;24;24
20;32;30;29
20;33;0;0
20;33;14;11
20;33;15;12
20;33;16;13
20;33;18;15
20;33;24;24
20;33;30;29
20;34;0;0
20;34;14;11
20;34;15;12
20;34;16;13
20;34;18;15
20;34;24;24
20;34;30;29
20;35;0;0
20;35;14;11
20;35;15;12
20;35;16;13
20;35;18;15
20;35;24;24
20;35;30;29
20;49;0;0
20;49;14;11
20;49;15;12
20;49;16;13
20;49;18;15
20;49;24;24
20;49;30;29
20;50;0;0
20;50;14;11
20;50;15;12
20;50;16;13
20;50;18;15
20;50;24;24
20;50;30;29
1 IdxFamiglia IdxStato IdxTipo next_IdxStato
2 20 0 14 11
3 20 0 15 12
4 20 0 16 13
5 20 0 18 15
6 20 0 24 24
7 20 0 30 29
8 20 2 0 0
9 20 2 14 11
10 20 2 15 12
11 20 2 16 13
12 20 2 18 15
13 20 2 24 24
14 20 2 30 29
15 20 3 0 0
16 20 3 14 11
17 20 3 15 12
18 20 3 16 13
19 20 3 18 15
20 20 3 24 24
21 20 3 30 29
22 20 4 0 0
23 20 4 14 11
24 20 4 15 12
25 20 4 16 13
26 20 4 18 15
27 20 4 24 24
28 20 4 30 29
29 20 5 0 0
30 20 5 14 11
31 20 5 15 12
32 20 5 16 13
33 20 5 18 15
34 20 5 24 24
35 20 5 30 29
36 20 6 0 0
37 20 6 14 11
38 20 6 15 12
39 20 6 16 13
40 20 6 18 15
41 20 6 24 24
42 20 6 30 29
43 20 7 0 0
44 20 7 14 11
45 20 7 15 12
46 20 7 16 13
47 20 7 18 15
48 20 7 24 24
49 20 7 30 29
50 20 8 0 0
51 20 8 14 11
52 20 8 15 12
53 20 8 16 13
54 20 8 18 15
55 20 8 24 24
56 20 8 30 29
57 20 9 0 0
58 20 9 14 11
59 20 9 15 12
60 20 9 16 13
61 20 9 18 15
62 20 9 24 24
63 20 9 30 29
64 20 10 0 0
65 20 10 14 11
66 20 10 15 12
67 20 10 16 13
68 20 10 18 15
69 20 10 24 24
70 20 10 30 29
71 20 11 0 0
72 20 11 15 12
73 20 11 16 13
74 20 11 18 15
75 20 11 24 24
76 20 11 30 29
77 20 12 0 0
78 20 12 14 11
79 20 12 16 13
80 20 12 18 15
81 20 12 24 24
82 20 12 30 29
83 20 13 0 0
84 20 13 14 11
85 20 13 15 12
86 20 13 18 15
87 20 13 24 24
88 20 13 30 29
89 20 14 0 0
90 20 14 14 11
91 20 14 15 12
92 20 14 16 13
93 20 14 18 15
94 20 14 24 24
95 20 14 30 29
96 20 15 0 0
97 20 15 14 11
98 20 15 15 12
99 20 15 16 13
100 20 15 24 24
101 20 15 30 29
102 20 23 0 0
103 20 23 14 11
104 20 23 15 12
105 20 23 16 13
106 20 23 18 15
107 20 23 24 24
108 20 23 30 29
109 20 24 0 0
110 20 24 14 11
111 20 24 15 12
112 20 24 16 13
113 20 24 18 15
114 20 24 30 29
115 20 25 0 0
116 20 25 14 11
117 20 25 15 12
118 20 25 16 13
119 20 25 18 15
120 20 25 24 24
121 20 25 30 29
122 20 26 0 0
123 20 26 14 11
124 20 26 15 12
125 20 26 16 13
126 20 26 18 15
127 20 26 24 24
128 20 26 30 29
129 20 27 0 0
130 20 27 14 11
131 20 27 15 12
132 20 27 16 13
133 20 27 18 15
134 20 27 24 24
135 20 27 30 29
136 20 28 0 0
137 20 28 14 11
138 20 28 15 12
139 20 28 16 13
140 20 28 18 15
141 20 28 24 24
142 20 28 30 29
143 20 29 0 0
144 20 29 14 11
145 20 29 15 12
146 20 29 16 13
147 20 29 18 15
148 20 29 24 24
149 20 30 0 0
150 20 30 14 11
151 20 30 15 12
152 20 30 16 13
153 20 30 18 15
154 20 30 24 24
155 20 30 30 29
156 20 31 0 0
157 20 31 14 11
158 20 31 15 12
159 20 31 16 13
160 20 31 18 15
161 20 31 24 24
162 20 31 30 29
163 20 32 0 0
164 20 32 14 11
165 20 32 15 12
166 20 32 16 13
167 20 32 18 15
168 20 32 24 24
169 20 32 30 29
170 20 33 0 0
171 20 33 14 11
172 20 33 15 12
173 20 33 16 13
174 20 33 18 15
175 20 33 24 24
176 20 33 30 29
177 20 34 0 0
178 20 34 14 11
179 20 34 15 12
180 20 34 16 13
181 20 34 18 15
182 20 34 24 24
183 20 34 30 29
184 20 35 0 0
185 20 35 14 11
186 20 35 15 12
187 20 35 16 13
188 20 35 18 15
189 20 35 24 24
190 20 35 30 29
191 20 49 0 0
192 20 49 14 11
193 20 49 15 12
194 20 49 16 13
195 20 49 18 15
196 20 49 24 24
197 20 49 30 29
198 20 50 0 0
199 20 50 14 11
200 20 50 15 12
201 20 50 16 13
202 20 50 18 15
203 20 50 24 24
204 20 50 30 29