From 2cd21b3efd1507d76fa7fdf62c2ac8006f574ee8 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 21 Apr 2023 17:25:09 +0200 Subject: [PATCH] inizio fix gestione params iniziali --- WebDoorCreator.Data/DDF/Converter.cs | 2 +- WebDoorCreator.Data/DTO/DDFDto.cs | 15 ++-- WebDoorCreator.Data/DTO/DoorOpsDTO.cs | 6 +- WebDoorCreator.Data/DbModels/Edges.cs | 8 +-- .../DoorDef/DoorDefSizingSI.razor.cs | 22 +++--- WebDoorCreator.UI/temp/Conf.yaml | 68 +++++++++++++------ 6 files changed, 76 insertions(+), 45 deletions(-) diff --git a/WebDoorCreator.Data/DDF/Converter.cs b/WebDoorCreator.Data/DDF/Converter.cs index 999e45f..d7d06ac 100644 --- a/WebDoorCreator.Data/DDF/Converter.cs +++ b/WebDoorCreator.Data/DDF/Converter.cs @@ -67,7 +67,7 @@ namespace WebDoorCreator.Data.DDF } i++; } - CurrentDoorOp.doorOpsDict = dictDoorOP; + CurrentDoorOp.hardware = dictDoorOP; string doorOpSer = CurrentDoorOp.GetSerialized(RemDoorOp); // ora popolo l'oggetto DTO principale CurrentConf.version = FormatVers; diff --git a/WebDoorCreator.Data/DTO/DDFDto.cs b/WebDoorCreator.Data/DTO/DDFDto.cs index 6ff6007..ab14653 100644 --- a/WebDoorCreator.Data/DTO/DDFDto.cs +++ b/WebDoorCreator.Data/DTO/DDFDto.cs @@ -17,18 +17,19 @@ namespace WebDoorCreator.Data.DTO #region Public Properties public string version { get; set; } = "0"; - + public bool produce { get; set; } = true; + public string measures { get; set; } = "mm"; public string code { get; set; } = "0015943"; - public DateTime date { get; set; } = DateTime.Now; - public string material { get; set; } = "wood"; - public string measures { get; set; } = "millimiters"; + public OrderDto order { get; set; } = new OrderDto(); + public DateTime date { get; set; } = DateTime.Now; public string piece { get; set; } = "DO_1"; - public bool produce { get; set; } = false; - public Edges profiles { get; set; } = new Edges(); - public string secure { get; set; } = "UP"; public Sizing size { get; set; } = new Sizing(); public string swing { get; set; } = "RH"; + public string secure { get; set; } = "UP"; + public string material { get; set; } = "wood"; + + public Edges profiles { get; set; } = new Edges(); #endregion Public Properties diff --git a/WebDoorCreator.Data/DTO/DoorOpsDTO.cs b/WebDoorCreator.Data/DTO/DoorOpsDTO.cs index 1490f36..c7b0348 100644 --- a/WebDoorCreator.Data/DTO/DoorOpsDTO.cs +++ b/WebDoorCreator.Data/DTO/DoorOpsDTO.cs @@ -12,7 +12,7 @@ namespace WebDoorCreator.Data.DTO [Serializable] public class DoorOpsDTO { - public Dictionary>> doorOpsDict { get; set; } = new Dictionary>>(); + public Dictionary>> hardware { get; set; } = new Dictionary>>(); /// /// Recupera oggetto serializzato YAML oppure "semplificato" @@ -30,9 +30,9 @@ namespace WebDoorCreator.Data.DTO var lines = rawData.Split(Environment.NewLine); foreach (var item in lines) { - if (!item.StartsWith("doorOps") && item.Length > 2 && !item.Contains("Separator")) + if (item.Length > 2 && !item.Contains("Separator")) { - sb.AppendLine(item.Substring(2)); + sb.AppendLine(item); } if (item.Contains("Separator")) { diff --git a/WebDoorCreator.Data/DbModels/Edges.cs b/WebDoorCreator.Data/DbModels/Edges.cs index 839b7c5..62e126f 100644 --- a/WebDoorCreator.Data/DbModels/Edges.cs +++ b/WebDoorCreator.Data/DbModels/Edges.cs @@ -9,9 +9,9 @@ namespace WebDoorCreator.Data.DbModels { public class Edges { - public EdgesDto lockEdge { get; set; } = new EdgesDto(); - public EdgesDto hingeEdge { get; set; } = new EdgesDto(); - public EdgesDto topEdge { get; set; } = new EdgesDto(); - public EdgesDto bottomEdge { get; set; } = new EdgesDto(); + public EdgesDto lockedge { get; set; } = new EdgesDto(); + public EdgesDto hingeedge { get; set; } = new EdgesDto(); + public EdgesDto top { get; set; } = new EdgesDto(); + public EdgesDto bottom { get; set; } = new EdgesDto(); } } diff --git a/WebDoorCreator.UI/Components/DoorDef/DoorDefSizingSI.razor.cs b/WebDoorCreator.UI/Components/DoorDef/DoorDefSizingSI.razor.cs index b81ba30..9b8db0d 100644 --- a/WebDoorCreator.UI/Components/DoorDef/DoorDefSizingSI.razor.cs +++ b/WebDoorCreator.UI/Components/DoorDef/DoorDefSizingSI.razor.cs @@ -82,13 +82,11 @@ namespace WebDoorCreator.UI.Components.DoorDef //graphicParamsTemp = deserialized; foreach (var kvp in deserialized) { - foreach (var val in kvp.Value) + if (!graphicParams.ContainsKey(kvp.Key)) { - if (!graphicParams.ContainsKey(val.Key)) - { - graphicParams.Add(val.Key, val.Value); - } + graphicParams.Add(kvp.Key, kvp.Value); } + } } } @@ -105,7 +103,8 @@ namespace WebDoorCreator.UI.Components.DoorDef protected Dictionary currValToCompare { get; set; } = new Dictionary(); - protected Dictionary> graphicParams { get; set; } = new Dictionary>(); + //protected Dictionary> graphicParams { get; set; } = new Dictionary>(); + protected Dictionary>> graphicParams { get; set; } = new Dictionary>>(); protected Dictionary>> graphicParamsTemp { get; set; } = null!; [Inject] @@ -127,10 +126,17 @@ namespace WebDoorCreator.UI.Components.DoorDef protected List comboSet(string pKey) { List answ = new List(); - if (graphicParams.ContainsKey(pKey)) + foreach (var item in graphicParams) { - answ = graphicParams[pKey].ToList(); + foreach (var param in item.Value) + { + //if (item.ContainsKey(pKey)) + //{ + // answ = param[pKey].ToList(); + //} + } } + return answ; } diff --git a/WebDoorCreator.UI/temp/Conf.yaml b/WebDoorCreator.UI/temp/Conf.yaml index bab966c..a900ed4 100644 --- a/WebDoorCreator.UI/temp/Conf.yaml +++ b/WebDoorCreator.UI/temp/Conf.yaml @@ -3,40 +3,64 @@ #Door1 version: 2 +produce: true +measures: mm code: 0015943 -date: 2023-04-21T12:51:15.4331164+02:00 -material: wood -measures: millimiters order: customer: elevation: project: pO: line: +date: 21-04-2023 piece: DO_1 -produce: false -profiles: - lockEdge: - type: BV - machining: ON - overmaterial: 0.1 - hingeEdge: - type: BV - machining: ON - overmaterial: 0.1 - topEdge: - type: BV - machining: ON - overmaterial: 0.1 - bottomEdge: - type: BV - machining: ON - overmaterial: 0.1 -secure: UP size: width: 33.8125 height: 81.25 thickness: 1.75 swing: RH +secure: UP +material: wood +profiles: + lockedge: + type: BV + machining: ON + overmaterial: 0.1 + hingeedge: + type: BV + machining: ON + overmaterial: 0.1 + top: + type: BV + machining: ON + overmaterial: 0.1 + bottom: + type: BV + machining: ON + overmaterial: 0.1 +hardware: + ept: + - template: Generic\StdEPT + ToptoCL: 15 + FacetoCL: 0.875 + - template: Generic\StdEPT + ToptoCL: 15 + FacetoCL: 0.875 + + flush_bolts: + - template: Corner\8501 + type: corner + side: top + position: 5 + offset_WS: 0.0 + + groove: + - template: Generic\Groove + type: side + width: 0.6 + depth: 0.8 + offset_WS: 0 + side: bottom + ---