From 52209ce3ea258ae3498b7568d15f3be312d10af3 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Thu, 3 Aug 2023 13:04:03 +0200 Subject: [PATCH 01/18] continuo fix generale --- SMGen.Data/Controllers/SMGenController.cs | 11 ++++++-- SMGen.Data/DbModels/AnagEventiModelTemp.cs | 2 +- SMGen.Data/Services/SMGDataService.cs | 31 +++++++++++++++------- SMGen/Components/FilesList.razor.cs | 3 ++- 4 files changed, 34 insertions(+), 13 deletions(-) diff --git a/SMGen.Data/Controllers/SMGenController.cs b/SMGen.Data/Controllers/SMGenController.cs index c284b56..de440d9 100644 --- a/SMGen.Data/Controllers/SMGenController.cs +++ b/SMGen.Data/Controllers/SMGenController.cs @@ -22,9 +22,9 @@ namespace SMGen.Data.Controllers { } - public List AnagEventiGetAll() + public Dictionary AnagEventiGetAll() { - List events = new List(); + Dictionary events = new Dictionary(); using (SMGDataContext localDbCtx = new SMGDataContext(_configuration)) { try @@ -32,6 +32,13 @@ namespace SMGen.Data.Controllers var currRec = localDbCtx .DbSetAnagEventi .ToList(); + if (currRec != null) + { + foreach (var rec in currRec) + { + events.Add(rec.IdxTipo, rec.Nome); + } + } } catch (Exception exc) { diff --git a/SMGen.Data/DbModels/AnagEventiModelTemp.cs b/SMGen.Data/DbModels/AnagEventiModelTemp.cs index c09eea3..67c19a5 100644 --- a/SMGen.Data/DbModels/AnagEventiModelTemp.cs +++ b/SMGen.Data/DbModels/AnagEventiModelTemp.cs @@ -12,7 +12,7 @@ namespace SMGen.Data.DbModels public class AnagEventiModelTemp { [Key] - public int? IdxTipo { get; set; } = 0; + public int IdxTipo { get; set; } = 0; [MaxLength(50)] public string Nome { get; set; } = ""; [MaxLength(50)] diff --git a/SMGen.Data/Services/SMGDataService.cs b/SMGen.Data/Services/SMGDataService.cs index 6c3b407..c143040 100644 --- a/SMGen.Data/Services/SMGDataService.cs +++ b/SMGen.Data/Services/SMGDataService.cs @@ -140,10 +140,10 @@ namespace SMGen.Data.Services } - public async Task> AnagEventiGetAll() + public async Task> AnagEventiGetAll() { string source = "DB"; - List dbResult = new List(); + Dictionary dbResult = new Dictionary(); try { // cerco da cache @@ -154,10 +154,10 @@ namespace SMGen.Data.Services if (!string.IsNullOrEmpty(rawData)) { source = "REDIS"; - var tempResult = JsonConvert.DeserializeObject>(rawData); + var tempResult = JsonConvert.DeserializeObject>(rawData); if (tempResult == null) { - dbResult = new List(); + dbResult = new Dictionary(); } else { @@ -172,7 +172,7 @@ namespace SMGen.Data.Services } if (dbResult == null) { - dbResult = new List(); + dbResult = new Dictionary(); } stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; @@ -229,7 +229,7 @@ namespace SMGen.Data.Services private List Bits { get; set; } = new List(); private List Events_to_send { get; set; } = new List(); - private List events2Add { get; set; } = new List(); + public List events2Add { get; set; } = new List(); private List Rules { get; set; } = new List(); private List States { get; set; } = new List(); private List TranInList2add { get; set; } = new List(); @@ -254,6 +254,8 @@ namespace SMGen.Data.Services // recupero nome file x partire string filePath = currFile.tempFileName; + Dictionary eventsFromDb = await AnagEventiGetAll(); + // stream lettura file using (StreamReader sr = new StreamReader(filePath)) { @@ -309,7 +311,17 @@ namespace SMGen.Data.Services Nome = sz_tokens[2].Trim().ToUpper() }; - events2Add.Add(newEvent); + var listElement = events2Add.FirstOrDefault(x => x.IdxTipo == newEvent.IdxTipo); + + if (listElement != null && listElement.Nome != newEvent.Nome) + { + Log.Error($"L'evento '{newEvent.IdxTipo}: {newEvent.Nome}' non può essere importato perchè diverso da '{listElement.IdxTipo}: {listElement.Nome}' nel file {currFile.origFileName}.{Environment.NewLine}"); + return null; + } + else if(listElement == null) + { + events2Add.Add(newEvent); + } break; case "$RULES": @@ -326,9 +338,10 @@ namespace SMGen.Data.Services currFile = await evalIn2Ev_transitions(currFile); if (saveToDb) { - await AnagEventinInsert(events2Add); + //await AnagEventinInsert(events2Add); + await Task.Delay(1); - await TranInInsert(TranInList2add, int.Parse(n_state_machine_index)); + //await TranInInsert(TranInList2add, int.Parse(n_state_machine_index)); } } break; diff --git a/SMGen/Components/FilesList.razor.cs b/SMGen/Components/FilesList.razor.cs index 4f83489..4f0f63f 100644 --- a/SMGen/Components/FilesList.razor.cs +++ b/SMGen/Components/FilesList.razor.cs @@ -77,7 +77,7 @@ namespace SMGen.Components await Task.Delay(1); FilesTemp = await SMGDService.FilesGetAll(); totalCount = FilesTemp.Count; - Files = FilesTemp.Skip(numRecord * (currPage - 1)).Take(numRecord).ToDictionary(x => x.Key, y => y.Value); + Files = FilesTemp.Skip(numRecord * (currPage - 1)).Take(numRecord).OrderBy(x => x.Value.origFileName).ToDictionary(x => x.Key, y => y.Value); await InvokeAsync(() => StateHasChanged()); } @@ -102,6 +102,7 @@ namespace SMGen.Components item.Value.calcRunning = false; await InvokeAsync(() => StateHasChanged()); } + var currEvents = SMGDService.events2Add; } } } \ No newline at end of file From 4466ac88e6609c4a6e2d46bc0f48cb146320ef87 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Thu, 3 Aug 2023 13:08:49 +0200 Subject: [PATCH 02/18] fix cartella di destinazione s tates --- SMGen/Pages/SMEvent2State.razor.cs | 39 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/SMGen/Pages/SMEvent2State.razor.cs b/SMGen/Pages/SMEvent2State.razor.cs index c328b2c..8821ee4 100644 --- a/SMGen/Pages/SMEvent2State.razor.cs +++ b/SMGen/Pages/SMEvent2State.razor.cs @@ -135,14 +135,15 @@ namespace SMGen.Pages } } + protected int maxAllowedFiles { get; set; } = 100; //// va dopo //private StreamWriter objWriter { get; set; }; private async Task LoadFiles(InputFileChangeEventArgs e) { List loadedFiles = new(); - long maxFileSize = 1024 * 50; - int maxAllowedFiles = 150; + long maxFileSize = 1024 * 1024; loadedFiles.Clear(); + Files.Clear(); foreach (var file in e.GetMultipleFiles(maxAllowedFiles)) { @@ -154,13 +155,11 @@ namespace SMGen.Pages var trustedFileNameForFileStorage = Path.GetRandomFileName(); //path del file da scrivere - pathFile = Path.Combine(env.ContentRootPath, - env.EnvironmentName, "unsafe_uploads", + pathFile = Path.Combine("Temp", "unsafe_uploads", trustedFileNameForFileStorage); //path cartella root (development) - pathDir = Path.Combine(env.ContentRootPath, - env.EnvironmentName, "unsafe_uploads"); + pathDir = Path.Combine("Temp", "unsafe_uploads"); //se la cartella non esiste, creo if (!Directory.Exists(pathDir)) @@ -169,36 +168,38 @@ namespace SMGen.Pages Log.Info($"Creato directory {pathDir}"); } - //creo file + // creo file using (FileStream fs = new(pathFile, FileMode.Create)) { - //copio il contenuto del file + // copio il contenuto del file await file.OpenReadStream(maxFileSize).CopyToAsync(fs); + // scrivo log + Log.Info($"Salvato file temp {pathFile}"); } + if (file.Name.Contains(".rul")) { - var newFIle = new FilesClass() { tempFileName = pathFile, - isOk = false + isOk = false, + origFileName = file.Name, + calcRunning = false, + DLoadFileName = "" }; Files.Add(file.Name, newFIle); - //files2Read.Add(file.Name, pathFile); - //filesStatus.Add(file.Name, false); } } - catch (Exception ex) + catch (Exception exc) { - Log.Error($"Generato errore durante caricamento file: {Environment.NewLine}{ex}"); - } - - if(Files != null && Files.Count > 0) - { - await SMGDService.FilesLoadRedis(Files); + Log.Error($"Errore durante salvataggio file temp {file.Name}: {exc}{Environment.NewLine}"); } } + if (Files != null && Files.Count > 0) + { + await SMGDService.FilesLoadRedis(Files); + } await InvokeAsync(() => StateHasChanged()); } From 26c39d1ddc31b1e61bda8dd36c4dcd85877f1d84 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Thu, 3 Aug 2023 15:47:37 +0200 Subject: [PATCH 03/18] fix ordinamento --- SMGen/Components/FilesList.razor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SMGen/Components/FilesList.razor.cs b/SMGen/Components/FilesList.razor.cs index 4f0f63f..f0d3ec0 100644 --- a/SMGen/Components/FilesList.razor.cs +++ b/SMGen/Components/FilesList.razor.cs @@ -85,7 +85,7 @@ namespace SMGen.Components protected async Task Read_rule_file_transitions() { Files = await SMGDService.FilesGetAll(); - foreach (var item in Files) + foreach (var item in Files.OrderBy(x=>x.Value.origFileName)) { item.Value.calcRunning = true; await InvokeAsync(() => StateHasChanged()); From c9e4c53114a16efe898974039632dc133a526dc5 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 4 Aug 2023 10:03:58 +0200 Subject: [PATCH 04/18] update gitlab yaml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5903778..73b49b9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -76,7 +76,7 @@ SMGen:deploy: APP_NAME: SMGen SOL_NAME: SMGen only: - - main + - master needs: ["SMGen:build"] before_script: - *nuget-fix From 22909f3fddbcff75d5965a5b14b689a91da25160 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 4 Aug 2023 12:41:14 +0200 Subject: [PATCH 05/18] corretto ordinamento eventi csv --- SMGen.Data/Data/RuleClass.cs | 3 + SMGen.Data/Services/SMGDataService.cs | 26 +- .../PROCESSED/BIT/12_FAMIGLIA_JETCO_NEW.csv | 775 ++++++++++++++++++ 3 files changed, 795 insertions(+), 9 deletions(-) create mode 100644 SMGen/Temp/Rules/PROCESSED/BIT/12_FAMIGLIA_JETCO_NEW.csv diff --git a/SMGen.Data/Data/RuleClass.cs b/SMGen.Data/Data/RuleClass.cs index 0f8eafe..263a1b3 100644 --- a/SMGen.Data/Data/RuleClass.cs +++ b/SMGen.Data/Data/RuleClass.cs @@ -2,9 +2,12 @@ { public class RuleClass { + public int id_state { get; set; } = 0; public string state { get; set; } = ""; public string expression { get; set; } = ""; + public int id_next_state { get; set; } = 0; public string next_state { get; set; } = ""; public string event_to_send { get; set; } = ""; + public int id_event_to_send { get; set; } = 0; } } diff --git a/SMGen.Data/Services/SMGDataService.cs b/SMGen.Data/Services/SMGDataService.cs index c143040..e952e9d 100644 --- a/SMGen.Data/Services/SMGDataService.cs +++ b/SMGen.Data/Services/SMGDataService.cs @@ -228,7 +228,7 @@ namespace SMGen.Data.Services } private List Bits { get; set; } = new List(); - private List Events_to_send { get; set; } = new List(); + private Dictionary Events_to_send { get; set; } = new Dictionary(); public List events2Add { get; set; } = new List(); private List Rules { get; set; } = new List(); private List States { get; set; } = new List(); @@ -304,7 +304,7 @@ namespace SMGen.Data.Services break; case "$EVENT": - Events_to_send.Add(sz_tokens[2].Trim().ToUpper()); + Events_to_send.Add(sz_tokens[2].Trim().ToUpper(), int.Parse(sz_tokens[1].Trim().ToUpper())); var newEvent = new AnagEventiModelTemp() { IdxTipo = int.Parse(sz_tokens[1].Trim().ToUpper()), @@ -351,10 +351,13 @@ namespace SMGen.Data.Services { var temp_rule = new RuleClass() { + id_state = StatesAll[sz_temp.Trim().ToUpper()], state = sz_temp.Trim().ToUpper(), expression = sz_tokens[1].Trim().ToUpper(), next_state = sz_tokens[2].Trim().ToUpper(), - event_to_send = sz_tokens[3].Trim().ToUpper() + id_next_state = StatesAll[sz_temp.Trim().ToUpper()], + event_to_send = sz_tokens[3].Trim().ToUpper(), + id_event_to_send = Events_to_send[sz_tokens[3].Trim().ToUpper()] }; Rules.Add(temp_rule); @@ -429,7 +432,7 @@ namespace SMGen.Data.Services break; case "$EVENT": - Events_to_send.Add(sz_tokens[2].Trim().ToUpper()); + Events_to_send.Add(sz_tokens[2].Trim().ToUpper(), int.Parse(sz_tokens[1].Trim().ToUpper())); var newEvent = new AnagEventiModelTemp() { IdxTipo = int.Parse(sz_tokens[1].Trim().ToUpper()), @@ -465,7 +468,9 @@ namespace SMGen.Data.Services { state = state, event_to_send = event_to_send, - next_state = next_state + next_state = next_state, + id_next_state = StatesAll[next_state], + id_event_to_send = Events_to_send[event_to_send] }; Rules.Add(temp_rule); States2Rules.Add(next_state); @@ -575,7 +580,7 @@ namespace SMGen.Data.Services $";" + $"{n_input}" + $";" + - $"{Events_to_send.IndexOf(act_rule.event_to_send)}" + + $"{Events_to_send[act_rule.event_to_send]}" + $";" + $"{nextState}"; @@ -586,7 +591,7 @@ namespace SMGen.Data.Services IdxFamigliaIngresso = int.Parse(n_state_machine_index), IdxMicroStato = i, ValoreIngresso = n_input, - IdxTipoEvento = Events_to_send.IndexOf(act_rule.event_to_send), + IdxTipoEvento = Events_to_send[act_rule.event_to_send], next_IdxMicroStato = States.IndexOf(act_rule.next_state) }; @@ -644,6 +649,9 @@ namespace SMGen.Data.Services } } + Events_to_send = Events_to_send.OrderBy(x => x.Value).ToDictionary(x => x.Key, x => x.Value); + Rules = Rules.OrderBy(x => x.id_event_to_send).ToList(); + //ciclo negli stati try { @@ -678,7 +686,7 @@ namespace SMGen.Data.Services $";" + $"{item.Value}" + $";" + - $"{Events_to_send.IndexOf(act_rule.event_to_send)}" + + $"{Events_to_send[act_rule.event_to_send]}" + $";" + $"{nextState}"; sb.AppendLine(sz_line); @@ -687,7 +695,7 @@ namespace SMGen.Data.Services { IdxFamigliaIngresso = int.Parse(n_state_machine_index), IdxMicroStato = item.Value, - IdxTipoEvento = Events_to_send.IndexOf(act_rule.event_to_send), + IdxTipoEvento = Events_to_send[act_rule.event_to_send], next_IdxMicroStato = nextState }; diff --git a/SMGen/Temp/Rules/PROCESSED/BIT/12_FAMIGLIA_JETCO_NEW.csv b/SMGen/Temp/Rules/PROCESSED/BIT/12_FAMIGLIA_JETCO_NEW.csv new file mode 100644 index 0000000..4daa081 --- /dev/null +++ b/SMGen/Temp/Rules/PROCESSED/BIT/12_FAMIGLIA_JETCO_NEW.csv @@ -0,0 +1,775 @@ +IdxFamiglia;IdxStato;IdxTipo;next_IdxStato +12;0;1;13 +12;0;2;2 +12;0;3;3 +12;0;4;4 +12;0;5;5 +12;0;6;6 +12;0;7;7 +12;0;8;8 +12;0;9;9 +12;0;10;10 +12;0;12;11 +12;0;14;11 +12;0;19;30 +12;0;26;27 +12;0;31;31 +12;0;32;32 +12;0;37;33 +12;0;38;34 +12;0;39;35 +12;0;40;34 +12;0;49;49 +12;0;50;50 +12;2;1;13 +12;2;3;3 +12;2;4;4 +12;2;5;5 +12;2;6;6 +12;2;7;7 +12;2;8;8 +12;2;9;9 +12;2;10;10 +12;2;12;11 +12;2;14;11 +12;2;19;30 +12;2;26;27 +12;2;28;26 +12;2;31;31 +12;2;32;32 +12;2;37;33 +12;2;38;34 +12;2;39;35 +12;2;40;34 +12;2;49;49 +12;2;50;50 +12;3;1;13 +12;3;2;2 +12;3;4;4 +12;3;5;5 +12;3;6;6 +12;3;7;7 +12;3;8;8 +12;3;9;9 +12;3;10;10 +12;3;12;11 +12;3;14;11 +12;3;19;30 +12;3;26;27 +12;3;28;26 +12;3;31;31 +12;3;32;32 +12;3;37;33 +12;3;38;34 +12;3;39;35 +12;3;40;34 +12;3;49;49 +12;3;50;50 +12;4;1;13 +12;4;2;2 +12;4;3;3 +12;4;5;5 +12;4;6;6 +12;4;7;7 +12;4;8;8 +12;4;9;9 +12;4;10;10 +12;4;12;11 +12;4;14;11 +12;4;19;30 +12;4;26;27 +12;4;28;26 +12;4;31;31 +12;4;32;32 +12;4;37;33 +12;4;38;34 +12;4;39;35 +12;4;40;34 +12;4;49;49 +12;4;50;50 +12;5;1;13 +12;5;2;2 +12;5;3;3 +12;5;4;4 +12;5;6;6 +12;5;7;7 +12;5;8;8 +12;5;9;9 +12;5;10;10 +12;5;12;11 +12;5;14;11 +12;5;19;30 +12;5;26;27 +12;5;28;26 +12;5;31;31 +12;5;32;32 +12;5;37;33 +12;5;38;34 +12;5;39;35 +12;5;40;34 +12;5;49;49 +12;5;50;50 +12;6;1;13 +12;6;2;2 +12;6;3;3 +12;6;4;4 +12;6;5;5 +12;6;7;7 +12;6;8;8 +12;6;9;9 +12;6;10;10 +12;6;12;11 +12;6;14;11 +12;6;19;30 +12;6;26;27 +12;6;28;26 +12;6;31;31 +12;6;32;32 +12;6;37;33 +12;6;38;34 +12;6;39;35 +12;6;40;34 +12;6;49;49 +12;6;50;50 +12;7;1;13 +12;7;2;2 +12;7;3;3 +12;7;4;4 +12;7;5;5 +12;7;6;6 +12;7;8;8 +12;7;9;9 +12;7;10;10 +12;7;12;11 +12;7;14;11 +12;7;19;30 +12;7;26;27 +12;7;28;26 +12;7;31;31 +12;7;32;32 +12;7;37;33 +12;7;38;34 +12;7;39;35 +12;7;40;34 +12;7;49;49 +12;7;50;50 +12;8;1;13 +12;8;2;2 +12;8;3;3 +12;8;4;4 +12;8;5;5 +12;8;6;6 +12;8;7;7 +12;8;9;9 +12;8;10;10 +12;8;12;11 +12;8;14;11 +12;8;19;30 +12;8;26;27 +12;8;28;26 +12;8;31;31 +12;8;32;32 +12;8;37;33 +12;8;38;34 +12;8;39;35 +12;8;40;34 +12;8;49;49 +12;8;50;50 +12;9;1;13 +12;9;2;2 +12;9;3;3 +12;9;4;4 +12;9;5;5 +12;9;6;6 +12;9;7;7 +12;9;8;8 +12;9;10;10 +12;9;12;11 +12;9;14;11 +12;9;19;30 +12;9;26;27 +12;9;28;26 +12;9;31;31 +12;9;32;32 +12;9;37;33 +12;9;38;34 +12;9;39;35 +12;9;40;34 +12;9;49;49 +12;9;50;50 +12;10;1;13 +12;10;2;2 +12;10;3;3 +12;10;4;4 +12;10;5;5 +12;10;6;6 +12;10;7;7 +12;10;8;8 +12;10;9;9 +12;10;12;11 +12;10;14;11 +12;10;19;30 +12;10;26;27 +12;10;28;26 +12;10;31;31 +12;10;32;32 +12;10;37;33 +12;10;38;34 +12;10;39;35 +12;10;40;34 +12;10;49;49 +12;10;50;50 +12;11;1;13 +12;11;2;2 +12;11;3;3 +12;11;4;4 +12;11;5;5 +12;11;6;6 +12;11;7;7 +12;11;8;8 +12;11;9;9 +12;11;10;10 +12;11;15;12 +12;11;16;13 +12;11;17;14 +12;11;18;15 +12;11;19;30 +12;11;20;14 +12;11;21;13 +12;11;22;14 +12;11;23;23 +12;11;24;24 +12;11;25;25 +12;11;26;27 +12;11;29;28 +12;11;30;29 +12;11;31;31 +12;11;32;32 +12;11;33;15 +12;11;35;13 +12;11;36;14 +12;11;37;33 +12;11;38;34 +12;11;39;35 +12;11;40;34 +12;11;49;49 +12;11;50;50 +12;12;1;13 +12;12;2;2 +12;12;3;3 +12;12;4;4 +12;12;5;5 +12;12;6;6 +12;12;7;7 +12;12;8;8 +12;12;9;9 +12;12;10;10 +12;12;12;11 +12;12;14;11 +12;12;16;13 +12;12;18;15 +12;12;19;30 +12;12;21;13 +12;12;23;23 +12;12;24;24 +12;12;25;25 +12;12;26;27 +12;12;28;26 +12;12;29;28 +12;12;30;29 +12;12;31;31 +12;12;32;32 +12;12;33;15 +12;12;35;13 +12;12;37;33 +12;12;38;34 +12;12;39;35 +12;12;40;34 +12;12;49;49 +12;12;50;50 +12;13;2;2 +12;13;3;3 +12;13;4;4 +12;13;5;5 +12;13;6;6 +12;13;7;7 +12;13;8;8 +12;13;9;9 +12;13;10;10 +12;13;12;11 +12;13;14;11 +12;13;15;12 +12;13;18;15 +12;13;19;30 +12;13;23;23 +12;13;24;24 +12;13;25;25 +12;13;26;27 +12;13;27;12 +12;13;28;26 +12;13;29;28 +12;13;30;29 +12;13;31;31 +12;13;32;32 +12;13;33;15 +12;13;37;33 +12;13;38;34 +12;13;39;35 +12;13;40;34 +12;13;49;49 +12;13;50;50 +12;14;1;13 +12;14;2;2 +12;14;3;3 +12;14;4;4 +12;14;5;5 +12;14;6;6 +12;14;7;7 +12;14;8;8 +12;14;9;9 +12;14;10;10 +12;14;12;11 +12;14;14;11 +12;14;15;12 +12;14;16;13 +12;14;18;15 +12;14;19;30 +12;14;21;13 +12;14;23;23 +12;14;24;24 +12;14;25;25 +12;14;26;27 +12;14;28;26 +12;14;29;28 +12;14;30;29 +12;14;31;31 +12;14;32;32 +12;14;33;15 +12;14;35;13 +12;14;37;33 +12;14;38;34 +12;14;39;35 +12;14;40;34 +12;14;49;49 +12;14;50;50 +12;15;1;13 +12;15;2;2 +12;15;3;3 +12;15;4;4 +12;15;5;5 +12;15;6;6 +12;15;7;7 +12;15;8;8 +12;15;9;9 +12;15;10;10 +12;15;12;11 +12;15;14;11 +12;15;15;12 +12;15;16;13 +12;15;19;30 +12;15;21;13 +12;15;23;23 +12;15;24;24 +12;15;25;25 +12;15;26;27 +12;15;28;26 +12;15;29;28 +12;15;30;29 +12;15;31;31 +12;15;32;32 +12;15;35;13 +12;15;37;33 +12;15;38;34 +12;15;39;35 +12;15;40;34 +12;15;49;49 +12;15;50;50 +12;23;1;13 +12;23;2;2 +12;23;3;3 +12;23;4;4 +12;23;5;5 +12;23;6;6 +12;23;7;7 +12;23;8;8 +12;23;9;9 +12;23;10;10 +12;23;12;11 +12;23;14;11 +12;23;15;12 +12;23;16;13 +12;23;17;14 +12;23;18;15 +12;23;19;30 +12;23;20;14 +12;23;21;13 +12;23;22;14 +12;23;24;24 +12;23;25;25 +12;23;26;27 +12;23;28;26 +12;23;29;28 +12;23;30;29 +12;23;31;31 +12;23;32;32 +12;23;33;15 +12;23;35;13 +12;23;36;14 +12;23;37;33 +12;23;38;34 +12;23;39;35 +12;23;40;34 +12;23;49;49 +12;23;50;50 +12;24;1;13 +12;24;2;2 +12;24;3;3 +12;24;4;4 +12;24;5;5 +12;24;6;6 +12;24;7;7 +12;24;8;8 +12;24;9;9 +12;24;10;10 +12;24;12;11 +12;24;14;11 +12;24;15;12 +12;24;16;13 +12;24;18;15 +12;24;19;30 +12;24;21;13 +12;24;23;23 +12;24;25;25 +12;24;26;27 +12;24;28;26 +12;24;29;28 +12;24;30;29 +12;24;31;31 +12;24;32;32 +12;24;33;15 +12;24;35;13 +12;24;37;33 +12;24;38;34 +12;24;39;35 +12;24;40;34 +12;24;49;49 +12;24;50;50 +12;25;1;13 +12;25;2;2 +12;25;3;3 +12;25;4;4 +12;25;5;5 +12;25;6;6 +12;25;7;7 +12;25;8;8 +12;25;9;9 +12;25;10;10 +12;25;12;11 +12;25;14;11 +12;25;16;13 +12;25;17;14 +12;25;18;15 +12;25;19;30 +12;25;20;14 +12;25;21;13 +12;25;22;14 +12;25;23;23 +12;25;24;24 +12;25;26;27 +12;25;28;26 +12;25;29;28 +12;25;30;29 +12;25;31;31 +12;25;32;32 +12;25;33;15 +12;25;35;13 +12;25;36;14 +12;25;37;33 +12;25;38;34 +12;25;39;35 +12;25;40;34 +12;25;49;49 +12;25;50;50 +12;26;1;13 +12;26;2;2 +12;26;3;3 +12;26;4;4 +12;26;5;5 +12;26;6;6 +12;26;7;7 +12;26;8;8 +12;26;9;9 +12;26;10;10 +12;26;12;11 +12;26;14;11 +12;26;15;12 +12;26;16;13 +12;26;17;14 +12;26;18;15 +12;26;19;30 +12;26;20;14 +12;26;21;13 +12;26;22;14 +12;26;23;23 +12;26;24;24 +12;26;25;25 +12;26;26;27 +12;26;29;28 +12;26;30;29 +12;26;31;31 +12;26;32;32 +12;26;33;15 +12;26;35;13 +12;26;36;14 +12;26;37;33 +12;26;38;34 +12;26;39;35 +12;26;40;34 +12;26;49;49 +12;26;50;50 +12;27;1;13 +12;27;2;2 +12;27;3;3 +12;27;4;4 +12;27;5;5 +12;27;6;6 +12;27;7;7 +12;27;8;8 +12;27;9;9 +12;27;10;10 +12;27;12;11 +12;27;14;11 +12;27;19;30 +12;27;28;26 +12;27;31;31 +12;27;32;32 +12;27;37;33 +12;27;38;34 +12;27;39;35 +12;27;40;34 +12;27;49;49 +12;27;50;50 +12;28;1;13 +12;28;2;2 +12;28;3;3 +12;28;4;4 +12;28;5;5 +12;28;6;6 +12;28;7;7 +12;28;8;8 +12;28;9;9 +12;28;10;10 +12;28;12;11 +12;28;14;11 +12;28;16;13 +12;28;19;30 +12;28;26;27 +12;28;31;31 +12;28;32;32 +12;28;37;33 +12;28;38;34 +12;28;39;35 +12;28;40;34 +12;28;49;49 +12;28;50;50 +12;29;1;13 +12;29;2;2 +12;29;3;3 +12;29;4;4 +12;29;5;5 +12;29;6;6 +12;29;7;7 +12;29;8;8 +12;29;9;9 +12;29;10;10 +12;29;12;11 +12;29;14;11 +12;29;16;13 +12;29;19;30 +12;29;24;24 +12;29;26;27 +12;29;31;31 +12;29;32;32 +12;29;37;33 +12;29;38;34 +12;29;39;35 +12;29;40;34 +12;29;49;49 +12;29;50;50 +12;30;1;13 +12;30;2;2 +12;30;3;3 +12;30;4;4 +12;30;5;5 +12;30;6;6 +12;30;7;7 +12;30;8;8 +12;30;9;9 +12;30;10;10 +12;30;12;11 +12;30;14;11 +12;30;26;27 +12;30;31;31 +12;30;32;32 +12;30;37;33 +12;30;38;34 +12;30;39;35 +12;30;40;34 +12;30;49;49 +12;30;50;50 +12;31;1;13 +12;31;2;2 +12;31;3;3 +12;31;4;4 +12;31;5;5 +12;31;6;6 +12;31;7;7 +12;31;8;8 +12;31;9;9 +12;31;10;10 +12;31;12;11 +12;31;14;11 +12;31;19;30 +12;31;26;27 +12;31;28;26 +12;31;32;32 +12;31;37;33 +12;31;38;34 +12;31;39;35 +12;31;40;34 +12;31;49;49 +12;31;50;50 +12;32;1;13 +12;32;2;2 +12;32;3;3 +12;32;4;4 +12;32;5;5 +12;32;6;6 +12;32;7;7 +12;32;8;8 +12;32;9;9 +12;32;10;10 +12;32;12;11 +12;32;14;11 +12;32;19;30 +12;32;26;27 +12;32;28;26 +12;32;31;31 +12;32;37;33 +12;32;38;34 +12;32;39;35 +12;32;40;34 +12;32;49;49 +12;32;50;50 +12;33;1;13 +12;33;2;2 +12;33;3;3 +12;33;4;4 +12;33;5;5 +12;33;6;6 +12;33;7;7 +12;33;8;8 +12;33;9;9 +12;33;10;10 +12;33;12;11 +12;33;14;11 +12;33;19;30 +12;33;26;27 +12;33;28;26 +12;33;31;31 +12;33;32;32 +12;33;38;34 +12;33;39;35 +12;33;40;34 +12;33;49;49 +12;33;50;50 +12;34;1;13 +12;34;2;2 +12;34;3;3 +12;34;4;4 +12;34;5;5 +12;34;6;6 +12;34;7;7 +12;34;8;8 +12;34;9;9 +12;34;10;10 +12;34;12;11 +12;34;14;11 +12;34;15;12 +12;34;16;13 +12;34;19;30 +12;34;24;24 +12;34;26;27 +12;34;28;26 +12;34;31;31 +12;34;32;32 +12;34;37;33 +12;34;39;35 +12;34;49;49 +12;34;50;50 +12;35;1;13 +12;35;2;2 +12;35;3;3 +12;35;4;4 +12;35;5;5 +12;35;6;6 +12;35;7;7 +12;35;8;8 +12;35;9;9 +12;35;10;10 +12;35;12;11 +12;35;14;11 +12;35;19;30 +12;35;26;27 +12;35;28;26 +12;35;31;31 +12;35;32;32 +12;35;37;33 +12;35;38;34 +12;35;40;34 +12;35;49;49 +12;35;50;50 +12;49;1;13 +12;49;2;2 +12;49;3;3 +12;49;4;4 +12;49;5;5 +12;49;6;6 +12;49;7;7 +12;49;8;8 +12;49;9;9 +12;49;10;10 +12;49;12;11 +12;49;14;11 +12;49;19;30 +12;49;26;27 +12;49;28;26 +12;49;31;31 +12;49;32;32 +12;49;37;33 +12;49;38;34 +12;49;39;35 +12;49;40;34 +12;49;50;50 +12;50;1;13 +12;50;2;2 +12;50;3;3 +12;50;4;4 +12;50;5;5 +12;50;6;6 +12;50;7;7 +12;50;8;8 +12;50;9;9 +12;50;10;10 +12;50;12;11 +12;50;14;11 +12;50;19;30 +12;50;26;27 +12;50;28;26 +12;50;31;31 +12;50;32;32 +12;50;37;33 +12;50;38;34 +12;50;39;35 +12;50;40;34 +12;50;49;49 From 2939dfb09304c048e5441464713ab24544efb9cc Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 4 Aug 2023 16:29:59 +0200 Subject: [PATCH 06/18] fix grafici --- SMGen.Data/Services/SMGDataService.cs | 12 ++++--- SMGen/Components/FilesList.razor.cs | 6 +++- SMGen/Pages/SMEvent2State.razor | 33 +++++++++++++++---- SMGen/Pages/SMEvent2State.razor.cs | 2 ++ .../PROCESSED/BIT/12_FAMIGLIA_JETCO_NEW.csv | 29 ++++++++++++++++ .../Rules/PROCESSED/BIT/15_FAMIGLIA_JETCO.csv | 31 +++++++++++++++++ 6 files changed, 101 insertions(+), 12 deletions(-) create mode 100644 SMGen/Temp/Rules/PROCESSED/BIT/15_FAMIGLIA_JETCO.csv diff --git a/SMGen.Data/Services/SMGDataService.cs b/SMGen.Data/Services/SMGDataService.cs index e952e9d..bd130c8 100644 --- a/SMGen.Data/Services/SMGDataService.cs +++ b/SMGen.Data/Services/SMGDataService.cs @@ -204,6 +204,7 @@ namespace SMGen.Data.Services get => _configuration.GetValue("ServerConf:BitCsvPath"); } +#if false protected bool calcEmptyState { get => _configuration.GetValue("SetupOptions:DoCalcEmptyState"); @@ -212,7 +213,8 @@ namespace SMGen.Data.Services protected bool calcItself { get => _configuration.GetValue("SetupOptions:DoCalcItself"); - } + } +#endif protected string procRootDir { @@ -377,7 +379,7 @@ namespace SMGen.Data.Services /// Path file *.rul da processare /// Indica se salvare sul DB /// - public async Task EvalIn2StateRuleFile(FilesClass currFile, bool saveToDb) + public async Task EvalIn2StateRuleFile(FilesClass currFile, bool saveToDb, bool calcItself, bool calcEmptyState) { await Task.Delay(1); sz_state_machine_name = ""; @@ -453,7 +455,7 @@ namespace SMGen.Data.Services { var fileName = $"{currFile.origFileName.Split(".")[0]}.csv"; currFile.DLoadFileName = $"{Path.Combine(procRootDir, bitCsvPath, fileName)}"; - currFile = await evalIn2State_transitions(currFile); + currFile = await evalIn2State_transitions(currFile, calcItself, calcEmptyState); } break; @@ -495,6 +497,7 @@ namespace SMGen.Data.Services /// /// protected async Task evalIn2Ev_transitions(FilesClass currFile) + { await Task.Delay(1); StringBuilder sb = new StringBuilder(); @@ -620,13 +623,12 @@ namespace SMGen.Data.Services } return currFile; } - /// /// Valutazione schema macchina a stati x Ingressi --> stati /// /// /// - protected async Task evalIn2State_transitions(FilesClass currFile) + protected async Task evalIn2State_transitions(FilesClass currFile, bool calcItself, bool calcEmptyState) { TranInList2add.Clear(); StringBuilder sb = new StringBuilder(); diff --git a/SMGen/Components/FilesList.razor.cs b/SMGen/Components/FilesList.razor.cs index f0d3ec0..efd3e15 100644 --- a/SMGen/Components/FilesList.razor.cs +++ b/SMGen/Components/FilesList.razor.cs @@ -37,6 +37,10 @@ namespace SMGen.Components public SelectSMIn2EvParams currFilter { get; set; } = null!; [Parameter] public bool hasBit { get; set; } = false; + [Parameter] + public bool calcItSelf { get; set; } = false; + [Parameter] + public bool calcEmptyState { get; set; } = false; [Inject] protected SMGDataService SMGDService { get; set; } = null!; @@ -97,7 +101,7 @@ namespace SMGen.Components } else { - await SMGDService.EvalIn2StateRuleFile(item.Value, false); + await SMGDService.EvalIn2StateRuleFile(item.Value, false, calcItSelf, calcEmptyState); } item.Value.calcRunning = false; await InvokeAsync(() => StateHasChanged()); diff --git a/SMGen/Pages/SMEvent2State.razor b/SMGen/Pages/SMEvent2State.razor index d2aeee2..b349134 100644 --- a/SMGen/Pages/SMEvent2State.razor +++ b/SMGen/Pages/SMEvent2State.razor @@ -8,19 +8,40 @@

I dati generati potrebbero andare direttamente sul DB, nella tab TransizioneStatiNew (da creare...):
- select * from TransizioneStatiNew + select * from TransizioneStatiNew

Vista in preview si può poi inserire in prod se confermato

-
-
- +
+ +
+ +
+ +
+ +
+
+ + +
+
+ + +
+
+
- +
+ +
- \ No newline at end of file diff --git a/SMGen/Pages/SMEvent2State.razor.cs b/SMGen/Pages/SMEvent2State.razor.cs index 8821ee4..af5350a 100644 --- a/SMGen/Pages/SMEvent2State.razor.cs +++ b/SMGen/Pages/SMEvent2State.razor.cs @@ -53,6 +53,8 @@ namespace SMGen.Pages await SMGDService.ExecFlushRedisPattern(Constants.FILES_TO_PROC); } + protected bool CalcItself { get; set; } = false; + protected bool CalcEmptyState { get; set; } = false; protected void ForceReload(int newNum) { numRecord = newNum; diff --git a/SMGen/Temp/Rules/PROCESSED/BIT/12_FAMIGLIA_JETCO_NEW.csv b/SMGen/Temp/Rules/PROCESSED/BIT/12_FAMIGLIA_JETCO_NEW.csv index 4daa081..2a7a86d 100644 --- a/SMGen/Temp/Rules/PROCESSED/BIT/12_FAMIGLIA_JETCO_NEW.csv +++ b/SMGen/Temp/Rules/PROCESSED/BIT/12_FAMIGLIA_JETCO_NEW.csv @@ -21,6 +21,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;0;40;34 12;0;49;49 12;0;50;50 +12;2;0;0 12;2;1;13 12;2;3;3 12;2;4;4 @@ -43,6 +44,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;2;40;34 12;2;49;49 12;2;50;50 +12;3;0;0 12;3;1;13 12;3;2;2 12;3;4;4 @@ -65,6 +67,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;3;40;34 12;3;49;49 12;3;50;50 +12;4;0;0 12;4;1;13 12;4;2;2 12;4;3;3 @@ -87,6 +90,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;4;40;34 12;4;49;49 12;4;50;50 +12;5;0;0 12;5;1;13 12;5;2;2 12;5;3;3 @@ -109,6 +113,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;5;40;34 12;5;49;49 12;5;50;50 +12;6;0;0 12;6;1;13 12;6;2;2 12;6;3;3 @@ -131,6 +136,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;6;40;34 12;6;49;49 12;6;50;50 +12;7;0;0 12;7;1;13 12;7;2;2 12;7;3;3 @@ -153,6 +159,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;7;40;34 12;7;49;49 12;7;50;50 +12;8;0;0 12;8;1;13 12;8;2;2 12;8;3;3 @@ -175,6 +182,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;8;40;34 12;8;49;49 12;8;50;50 +12;9;0;0 12;9;1;13 12;9;2;2 12;9;3;3 @@ -197,6 +205,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;9;40;34 12;9;49;49 12;9;50;50 +12;10;0;0 12;10;1;13 12;10;2;2 12;10;3;3 @@ -219,6 +228,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;10;40;34 12;10;49;49 12;10;50;50 +12;11;0;0 12;11;1;13 12;11;2;2 12;11;3;3 @@ -254,6 +264,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;11;40;34 12;11;49;49 12;11;50;50 +12;12;0;0 12;12;1;13 12;12;2;2 12;12;3;3 @@ -287,6 +298,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;12;40;34 12;12;49;49 12;12;50;50 +12;13;0;0 12;13;2;2 12;13;3;3 12;13;4;4 @@ -318,6 +330,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;13;40;34 12;13;49;49 12;13;50;50 +12;14;0;0 12;14;1;13 12;14;2;2 12;14;3;3 @@ -352,6 +365,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;14;40;34 12;14;49;49 12;14;50;50 +12;15;0;0 12;15;1;13 12;15;2;2 12;15;3;3 @@ -384,6 +398,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;15;40;34 12;15;49;49 12;15;50;50 +12;23;0;0 12;23;1;13 12;23;2;2 12;23;3;3 @@ -421,6 +436,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;23;40;34 12;23;49;49 12;23;50;50 +12;24;0;0 12;24;1;13 12;24;2;2 12;24;3;3 @@ -454,6 +470,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;24;40;34 12;24;49;49 12;24;50;50 +12;25;0;0 12;25;1;13 12;25;2;2 12;25;3;3 @@ -490,6 +507,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;25;40;34 12;25;49;49 12;25;50;50 +12;26;0;0 12;26;1;13 12;26;2;2 12;26;3;3 @@ -527,6 +545,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;26;40;34 12;26;49;49 12;26;50;50 +12;27;0;0 12;27;1;13 12;27;2;2 12;27;3;3 @@ -549,6 +568,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;27;40;34 12;27;49;49 12;27;50;50 +12;28;0;0 12;28;1;13 12;28;2;2 12;28;3;3 @@ -572,6 +592,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;28;40;34 12;28;49;49 12;28;50;50 +12;29;0;0 12;29;1;13 12;29;2;2 12;29;3;3 @@ -596,6 +617,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;29;40;34 12;29;49;49 12;29;50;50 +12;30;0;0 12;30;1;13 12;30;2;2 12;30;3;3 @@ -617,6 +639,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;30;40;34 12;30;49;49 12;30;50;50 +12;31;0;0 12;31;1;13 12;31;2;2 12;31;3;3 @@ -639,6 +662,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;31;40;34 12;31;49;49 12;31;50;50 +12;32;0;0 12;32;1;13 12;32;2;2 12;32;3;3 @@ -661,6 +685,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;32;40;34 12;32;49;49 12;32;50;50 +12;33;0;0 12;33;1;13 12;33;2;2 12;33;3;3 @@ -683,6 +708,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;33;40;34 12;33;49;49 12;33;50;50 +12;34;0;0 12;34;1;13 12;34;2;2 12;34;3;3 @@ -707,6 +733,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;34;39;35 12;34;49;49 12;34;50;50 +12;35;0;0 12;35;1;13 12;35;2;2 12;35;3;3 @@ -729,6 +756,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;35;40;34 12;35;49;49 12;35;50;50 +12;49;0;0 12;49;1;13 12;49;2;2 12;49;3;3 @@ -751,6 +779,7 @@ IdxFamiglia;IdxStato;IdxTipo;next_IdxStato 12;49;39;35 12;49;40;34 12;49;50;50 +12;50;0;0 12;50;1;13 12;50;2;2 12;50;3;3 diff --git a/SMGen/Temp/Rules/PROCESSED/BIT/15_FAMIGLIA_JETCO.csv b/SMGen/Temp/Rules/PROCESSED/BIT/15_FAMIGLIA_JETCO.csv new file mode 100644 index 0000000..5da4945 --- /dev/null +++ b/SMGen/Temp/Rules/PROCESSED/BIT/15_FAMIGLIA_JETCO.csv @@ -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 From 061e3aaf68074ea5d1a66cb966b53acaaf9f18b0 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 4 Aug 2023 17:07:55 +0200 Subject: [PATCH 07/18] fix grafici x unificare le due pagine --- SMGen.Data/Services/SMGDataService.cs | 19 +- SMGen/Components/FilesList.razor | 2 +- SMGen/Pages/SMEvent2State.razor | 2 +- SMGen/Pages/SMIn2Event.razor | 32 +- .../Rules/PROCESSED/BIT/10049_LVF_FANUC.csv | 448 --- .../PROCESSED/BIT/10063_SEGHETTO_DANOBAT.csv | 3584 ----------------- .../PROCESSED/BIT/10066_FLUITEK_SEMAPHORE.csv | 80 - .../PROCESSED/BIT/10067_FLUITEK_FEMCO.csv | 192 - .../PROCESSED/BIT/10_Mitsubishi_simple.csv | 128 - SMGen/Temp/Rules/PROCESSED/BIT/11.csv | 1792 --------- .../PROCESSED/BIT/12_FAMIGLIA_JETCO_NEW.csv | 29 - SMGen/Temp/Rules/PROCESSED/BIT/15.csv | 2304 ----------- .../Rules/PROCESSED/BIT/15_FAMIGLIA_JETCO.csv | 1 + SMGen/Temp/Rules/PROCESSED/BIT/17.csv | 1536 ------- SMGen/Temp/Rules/PROCESSED/BIT/18.csv | 2304 ----------- SMGen/Temp/Rules/PROCESSED/BIT/19.csv | 2304 ----------- .../Rules/PROCESSED/BIT/1_Simple_Machine.csv | 160 - SMGen/Temp/Rules/PROCESSED/BIT/20_nikkei.csv | 288 -- SMGen/Temp/Rules/PROCESSED/BIT/21_DMG1035.csv | 768 ---- SMGen/Temp/Rules/PROCESSED/BIT/22_COSMAP.csv | 2304 ----------- .../Rules/PROCESSED/BIT/23_EMCO_LM600.csv | 384 -- .../Rules/PROCESSED/BIT/24_EMCO_MM500.csv | 192 - .../BIT/25_ABB_BTB_TECNOTRANSFER.csv | 448 --- .../PROCESSED/BIT/26_ABB_DOOSAN_main.csv | 448 --- .../PROCESSED/BIT/27_ABB_DOOSAN_pallet.csv | 2 - .../Rules/PROCESSED/BIT/28_ABB_RIELLO.csv | 448 --- .../Rules/PROCESSED/BIT/29_EMCO_LM1200.csv | 192 - SMGen/Temp/Rules/PROCESSED/BIT/2_Caber.csv | 192 - .../Rules/PROCESSED/BIT/30_SCATOLE_INTEC.csv | 192 - .../Temp/Rules/PROCESSED/BIT/46_OSAI_CMS.csv | 192 - .../Rules/PROCESSED/BIT/54_STD_base_6bit.csv | 448 --- .../Rules/PROCESSED/BIT/5_MoriSeiki_main.csv | 112 - .../Rules/PROCESSED/BIT/60_STD_MACHINE.csv | 2048 ---------- .../Rules/PROCESSED/BIT/61_STD_DP_MAIN.csv | 2048 ---------- .../Rules/PROCESSED/BIT/62_STD_DP_TAV.csv | 2 - .../PROCESSED/BIT/66_FLUITEK_SEMAPHORE.csv | 81 - .../Rules/PROCESSED/BIT/67_FLUITEK_FEMCO.csv | 193 - .../PROCESSED/BIT/6_MoriSeiki_pallet.csv | 2 - .../PROCESSED/BIT/7_MoriSeiki_simple.csv | 64 - .../Temp/Rules/PROCESSED/BIT/8_TAV_1_IMP.csv | 11 - .../Temp/Rules/PROCESSED/BIT/9_TAV_2_IMP.csv | 11 - 41 files changed, 29 insertions(+), 25958 deletions(-) diff --git a/SMGen.Data/Services/SMGDataService.cs b/SMGen.Data/Services/SMGDataService.cs index bd130c8..4cb9ac4 100644 --- a/SMGen.Data/Services/SMGDataService.cs +++ b/SMGen.Data/Services/SMGDataService.cs @@ -303,6 +303,10 @@ namespace SMGen.Data.Services case "$STATE": States.Add(sz_tokens[2].Trim().ToUpper()); + if (!StatesAll.ContainsKey(sz_tokens[2].Trim().ToUpper())) + { + StatesAll.Add(sz_tokens[2].Trim().ToUpper(), int.Parse(sz_tokens[1].Trim().ToUpper())); + } break; case "$EVENT": @@ -313,6 +317,10 @@ namespace SMGen.Data.Services Nome = sz_tokens[2].Trim().ToUpper() }; + + events2Add.Add(newEvent); +#if false + var listElement = events2Add.FirstOrDefault(x => x.IdxTipo == newEvent.IdxTipo); if (listElement != null && listElement.Nome != newEvent.Nome) @@ -320,10 +328,11 @@ namespace SMGen.Data.Services Log.Error($"L'evento '{newEvent.IdxTipo}: {newEvent.Nome}' non può essere importato perchè diverso da '{listElement.IdxTipo}: {listElement.Nome}' nel file {currFile.origFileName}.{Environment.NewLine}"); return null; } - else if(listElement == null) + else if (listElement == null) { events2Add.Add(newEvent); - } + } +#endif break; case "$RULES": @@ -353,13 +362,11 @@ namespace SMGen.Data.Services { var temp_rule = new RuleClass() { - id_state = StatesAll[sz_temp.Trim().ToUpper()], state = sz_temp.Trim().ToUpper(), - expression = sz_tokens[1].Trim().ToUpper(), next_state = sz_tokens[2].Trim().ToUpper(), - id_next_state = StatesAll[sz_temp.Trim().ToUpper()], event_to_send = sz_tokens[3].Trim().ToUpper(), - id_event_to_send = Events_to_send[sz_tokens[3].Trim().ToUpper()] + id_next_state = StatesAll[sz_tokens[2].Trim().ToUpper()], + id_event_to_send = Events_to_send[sz_tokens[3].Trim().ToUpper()] }; Rules.Add(temp_rule); diff --git a/SMGen/Components/FilesList.razor b/SMGen/Components/FilesList.razor index 556a984..4de78c1 100644 --- a/SMGen/Components/FilesList.razor +++ b/SMGen/Components/FilesList.razor @@ -7,7 +7,7 @@ @if(Files!=null && Files.Count>0) { - + } diff --git a/SMGen/Pages/SMEvent2State.razor b/SMGen/Pages/SMEvent2State.razor index b349134..dd07ee8 100644 --- a/SMGen/Pages/SMEvent2State.razor +++ b/SMGen/Pages/SMEvent2State.razor @@ -24,7 +24,7 @@
-
+