Merge branch 'master' into develop
This commit is contained in:
@@ -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>();
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
+38
@@ -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
|
||||
|
+31
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user