diff --git a/WebDoorCreator.Data/DDF/Converter.cs b/WebDoorCreator.Data/DDF/Converter.cs index bc1e907..e1f1e3a 100644 --- a/WebDoorCreator.Data/DDF/Converter.cs +++ b/WebDoorCreator.Data/DDF/Converter.cs @@ -45,6 +45,7 @@ namespace WebDoorCreator.Data.DDF PropertiesDto CurrentProperties = new PropertiesDto(); FinishingDto CurrentFinishing = new FinishingDto(); DDFDto CurrentConf = new DDFDto(); + ListValuesModel CurrentCompoOrder = new ListValuesModel(); // per prima cosa popolo gli oggetti di appoggio... dictDoorOP = new Dictionary>>(); var i = 0; diff --git a/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor.cs b/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor.cs index 10decd7..85cf504 100644 --- a/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor.cs +++ b/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor.cs @@ -64,6 +64,7 @@ namespace WebDoorCreator.UI.Components.Buttons } protected DDFDto CurrentConf { get; set; } = new DDFDto(); protected DoorOpsDTO CurrentDoorOp { get; set; } = new DoorOpsDTO(); + protected List ordListVal { get; set; } = new List(); public async Task SaveYaml(string ddfContent) { await Task.Delay(1); @@ -113,6 +114,17 @@ namespace WebDoorCreator.UI.Components.Buttons { // chiamo metodo x avewre DDF serializzato //var list2Ord = ; + var CurrentCompoOrder = await WDCService.ListValuesGetAll("*", "Hardware"); + if (CurrentCompoOrder != null) + { + foreach (var item in CurrentCompoOrder.OrderBy(x => x.Ordinal).ToList()) + { + ordListVal.Add(item.TableName); + } + } + + listOp = listOp.OrderBy(d => ordListVal.IndexOf(d.ObjectId)).ToList(); + string currDdf = currDdfConv.GetSerialized(listOp); // FIXME TODO: si potrebbe eliminare in futuro che va su REDIS await SaveYaml(currDdf); diff --git a/WebDoorCreator.UI/Components/Hardware/HardwareList.razor.cs b/WebDoorCreator.UI/Components/Hardware/HardwareList.razor.cs index a2c1974..8cb9407 100644 --- a/WebDoorCreator.UI/Components/Hardware/HardwareList.razor.cs +++ b/WebDoorCreator.UI/Components/Hardware/HardwareList.razor.cs @@ -58,6 +58,10 @@ namespace WebDoorCreator.UI.Components.Hardware { var listRecordFolder = await WDService.ListValuesGetAll(HwToShow.TableName, "Folder"); var listRecordTmp = await WDService.ListValuesGetAll(HwToShow.TableName, "template"); + if (listRecordTmp!.Count == 0) + { + listRecordTmp = await WDService.ListValuesGetAll(HwToShow.TableName, "shape"); + } Dictionary> defaultDict = new Dictionary>(); List listDefVal = new List(); Dictionary actDict = new Dictionary(); diff --git a/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor b/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor index 6259700..d0df140 100644 --- a/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor +++ b/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor @@ -46,7 +46,7 @@ else
- Template + @currTempOrSh
@if (listValuesFiles != null && listValuesFiles.Count > 0 && !string.IsNullOrEmpty(templateName)) @@ -77,7 +77,7 @@ else @foreach (var item in currVal) { - @if (item.Key != "Folder" && item.Key != "template") + @if (item.Key != "Folder" && item.Key != "template" && item.Key != "shape") { @if (isCombo(item.Key)) { diff --git a/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.cs b/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.cs index c717362..b9f545d 100644 --- a/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.cs +++ b/WebDoorCreator.UI/Components/Hardware/HwSingleInstance.razor.cs @@ -28,7 +28,7 @@ namespace WebDoorCreator.UI.Components.Hardware public string Lingua { get; set; } = "EN"; [CascadingParameter] - public string userId { get; set; } = ""; + public string userId { get; set; } = ""; #endregion Public Properties @@ -88,27 +88,65 @@ namespace WebDoorCreator.UI.Components.Hardware protected string templateName { - get => currVal != null ? tryGetCurrVal("template") : ""; - set + /*currVal != null ? tryGetCurrVal("template") : tryGetCurrVal("shape");*/ + get { - if (currVal["template"] != value) + string answ = ""; + if (currVal != null) { - currVal["template"] = value; - DoorOpInst.userConfirm = ""; - DoorOpInst.DtConfirm = null; - if (!string.IsNullOrEmpty(value)) + if (currVal[currTempOrSh] != null) { - var pUpd = Task.Run(async () => - { - // aggiorno direttamente i graphics parameters... - var newData = await WDCService.DoorOpGetUpdatedVals(DoorOpInst.ObjectId, currVal, graphicParams); - currVal = newData.Item1; - graphicParams = newData.Item2; - await SetSelectedData(); - await E_recordUpdate.InvokeAsync(DoorOpInst); - }); + answ = tryGetCurrVal(currTempOrSh); } } + return answ; + } + set + { + if (currVal[currTempOrSh] != null) + { + if (currVal[currTempOrSh] != value) + { + currVal[currTempOrSh] = value; + DoorOpInst.userConfirm = ""; + DoorOpInst.DtConfirm = null; + if (!string.IsNullOrEmpty(value)) + { + var pUpd = Task.Run(async () => + { + // aggiorno direttamente i graphics parameters... + var newData = await WDCService.DoorOpGetUpdatedVals(DoorOpInst.ObjectId, currVal, graphicParams); + currVal = newData.Item1; + graphicParams = newData.Item2; + await SetSelectedData(); + await E_recordUpdate.InvokeAsync(DoorOpInst); + }); + } + } + } +#if false + else if (currVal["shape"] != null) + { + if (currVal["shape"] != value) + { + currVal["shape"] = value; + DoorOpInst.userConfirm = ""; + DoorOpInst.DtConfirm = null; + if (!string.IsNullOrEmpty(value)) + { + var pUpd = Task.Run(async () => + { + // aggiorno direttamente i graphics parameters... + var newData = await WDCService.DoorOpGetUpdatedVals(DoorOpInst.ObjectId, currVal, graphicParams); + currVal = newData.Item1; + graphicParams = newData.Item2; + await SetSelectedData(); + await E_recordUpdate.InvokeAsync(DoorOpInst); + }); + } + } + } +#endif } } @@ -250,11 +288,12 @@ namespace WebDoorCreator.UI.Components.Hardware await SetSelectedData(); } + protected string currTempOrSh { get; set; } = ""; + private async Task SetSelectedData() { isLoading = true; await Task.Delay(1); - // fix folder listValuesFiles = null; var tempListVal = await WDCService.ListValuesGetAll(HwCode, "Folder"); @@ -271,19 +310,32 @@ namespace WebDoorCreator.UI.Components.Hardware } // fix template - var tempListFiles = await WDCService.ListValuesGetAll(HwCode, "template"); + var tempListFilesTempl = await WDCService.ListValuesGetAll(HwCode, "template"); - if (tempListFiles != null) + var tempListFilesSh = await WDCService.ListValuesGetAll(HwCode, "shape"); + + if (tempListFilesTempl!.Count != 0) { - listValuesFiles = tempListFiles.Where(x => x.Value.Contains(folderName)).ToList(); + listValuesFiles = tempListFilesTempl.Where(x => x.Value.Contains(folderName)).ToList(); } - if (string.IsNullOrEmpty(templateName)) + else if (tempListFilesSh!.Count != 0) { + listValuesFiles = tempListFilesSh!.Where(x => x.Value.Contains(folderName)).ToList(); + } + try + { + if (listValuesFiles != null && listValuesFiles.Count > 0) { - templateName = listValuesFiles.FirstOrDefault()?.Label!; + currTempOrSh = listValuesFiles.FirstOrDefault()?.FieldName!; + if (string.IsNullOrEmpty(templateName)) + { + templateName = listValuesFiles.FirstOrDefault()?.Label!; + } } } + catch (Exception ex) + { } isLoading = false; await InvokeAsync(StateHasChanged); } diff --git a/WebDoorCreator.UI/Components/SvgComp/HomeCard.razor.cs b/WebDoorCreator.UI/Components/SvgComp/HomeCard.razor.cs index 3e07d2e..9b3c1b2 100644 --- a/WebDoorCreator.UI/Components/SvgComp/HomeCard.razor.cs +++ b/WebDoorCreator.UI/Components/SvgComp/HomeCard.razor.cs @@ -107,18 +107,18 @@ namespace WebDoorCreator.UI.Components.SvgComp pathPointList = new List(); pathClipCloseList = new List(); // calcolo i dati necessari a disegnare - int deltaX = (ObjW / 2 - StartPoint) / 6; + int deltaX = (ObjW / 2 - StartPoint); int deltaY = ObjH / 3; // inizio aggiungendo punti parametrici - pathPointList.Add(new PointData(StartPoint, ObjH)); - pathPointList.Add(new PointData(StartPoint - deltaX, ObjH - (deltaY / 2))); - pathPointList.Add(new PointData(StartPoint + deltaX, ObjH - deltaY)); - pathPointList.Add(new PointData((ObjW / 2) - deltaX * 3, (ObjH / 2) + deltaY / 8)); + pathPointList.Add(new PointData(StartPoint, ObjH + 5)); + pathPointList.Add(new PointData((int)(StartPoint - deltaX * 0.19), ObjH - (deltaY / 2))); + pathPointList.Add(new PointData((int)(StartPoint + deltaX * 0.26), ObjH - deltaY)); + pathPointList.Add(new PointData((int)(ObjW / 2 - deltaX * 0.48 ), (int)((ObjH / 2) + deltaY * 0.216))); pathPointList.Add(new PointData(ObjW / 2, ObjH / 2)); - pathPointList.Add(new PointData((ObjW / 2) + deltaX * 3, (ObjH / 2) - deltaY / 8)); - pathPointList.Add(new PointData(ObjW - (StartPoint + deltaX), deltaY)); - pathPointList.Add(new PointData(ObjW - (StartPoint - deltaX), (deltaY / 2))); - pathPointList.Add(new PointData(ObjW - StartPoint, 0)); + pathPointList.Add(new PointData((int)(ObjW / 2 + deltaX * 0.48 ), (int)((ObjH / 2) - deltaY * 0.216))); + pathPointList.Add(new PointData((int)(ObjW - (StartPoint + deltaX * 0.26)), deltaY)); + pathPointList.Add(new PointData((int)(ObjW - (StartPoint - deltaX * 0.19)), (deltaY / 2))); + pathPointList.Add(new PointData(ObjW - StartPoint, - 5)); // ora provvedo x la parte clip pathClipCloseList.Add(new PointData(ObjW - StartPoint, 0)); pathClipCloseList.Add(new PointData(ObjW, 0)); diff --git a/WebDoorCreator.UI/Data/WebDoorCreatorService.cs b/WebDoorCreator.UI/Data/WebDoorCreatorService.cs index 8fe8575..69e27ef 100644 --- a/WebDoorCreator.UI/Data/WebDoorCreatorService.cs +++ b/WebDoorCreator.UI/Data/WebDoorCreatorService.cs @@ -906,7 +906,7 @@ namespace WebDoorCreator.UI.Data { // cerco il setup del template selezionato var listRecordTmp = await ListValuesGetAll(currDoorOp.ObjectId, "template"); - if (listRecordTmp != null && actDict.ContainsKey("Folder") && actDict.ContainsKey("template")) + if (listRecordTmp != null && actDict.ContainsKey("Folder") && (actDict.ContainsKey("template") || actDict.ContainsKey("shape")) ) { string actKey = actDict["template"];// Path.Combine(actDict["Folder"], actDict["template"]); var firstTemplate = listRecordTmp.Where(x => x.Value == actKey).FirstOrDefault(); @@ -1188,6 +1188,7 @@ namespace WebDoorCreator.UI.Data foreach (string dir in dirs) { string compoCode = ""; + string compoTempOrShape = ""; string[] templateDirectories = Directory.GetDirectories(dir); string[] iniFiles = Directory.GetFiles(dir, "Config.ini"); @@ -1204,7 +1205,9 @@ namespace WebDoorCreator.UI.Data IniFile fIni = new IniFile(file); var compoName = fIni.ReadString("Compo", "Name", "COMPONAME"); + var compoT = fIni.ReadString("Template", "Name", "TEMPSHAPE"); compoCode = compoName.Split("/")[0].Trim(); + compoTempOrShape = compoT.Split("/")[0].Trim(); } string[] templateFiles = Directory.GetFiles(templateDirectory); if (templateFiles.Length > 0) @@ -1255,7 +1258,7 @@ namespace WebDoorCreator.UI.Data ListValuesTempModel temp = new ListValuesTempModel() { TableName = $"{compoCode}".Replace(" ", "_"), - FieldName = "template", + FieldName = compoTempOrShape, Value = @$"{tName[tName.Length - 1]}\{fileName}", Label = fileName, Ordinal = ordin, diff --git a/WebDoorCreator.UI/Pages/Index.razor b/WebDoorCreator.UI/Pages/Index.razor index a393302..007e9b1 100644 --- a/WebDoorCreator.UI/Pages/Index.razor +++ b/WebDoorCreator.UI/Pages/Index.razor @@ -4,6 +4,6 @@
- +
diff --git a/WebDoorCreator.UI/temp/Conf.yaml b/WebDoorCreator.UI/temp/Conf.yaml index c01dd34..ee57649 100644 --- a/WebDoorCreator.UI/temp/Conf.yaml +++ b/WebDoorCreator.UI/temp/Conf.yaml @@ -14,20 +14,13 @@ order: line: date: 2023-11-05T00:00:00.0000000 piece: DO_1 -size: {} -swing: {} -properties: Pine -finishing: Varnishing size: width: 33.8125 height: 81.25 thickness: 1.75 -swing: RH +swing: LH secure: UP material: wood -profiles: {} -hardware: {} - profiles: lockedge: type: SQ @@ -46,17 +39,37 @@ profiles: machining: ON overmaterial: 0.1 hardware: - flush_pulls: - - template: Generic\Circle - position: 35 - back_set: 5 - depth: 1 - face: secure - - template: Generic\Circle - position: 35 - back_set: 5 - depth: 1 - face: secure + vision_cut_outs: + - shape: Generic\Circle + radius: 10 + center_from_top: 20 + center_from_lock: 0 + door_center: center + + louver_cut_outs: + - shape: Generic\Cuore2.nge + length: 10.0000 + width: 18.8125 + bottom_rail: 8.0 + lock_stile: 0.0 + door_center: center + + mail_slots: + - template: Generic\Rect + height: 3 + bottom_rail: 20 + delta_center: 5 + + hinges: + - template: Generic Conceiled\StdConHingeDeepR + ToptoCL: 4.875 + back_set: 0.125 + thickness: 0.25 + + ept: + - template: Generic\StdEPT + ToptoCL: 15 + FacetoCL: 0.875 locks: - template: Generic\DocMyTest5Bore.nge @@ -65,19 +78,36 @@ hardware: offset_WS: 0.0 side: lock_top - hinges: - - template: Generic Conceiled\StdConHingeDeepR - ToptoCL: 4.875 - back_set: 0.125 - thickness: 0.25 + edge_pulls: + - template: Generic\EdgePull230B + position: 45 + offset_WS: 0.0 - groove: - - template: Generic\Groove - type: side + pivot: + - template: Generic\CenterHungPivot + type: centerhung + side: top + radius: 0 + position: 2 + back_set: 0.25 + depth: 0.125 + offset_WS: 0.0 + + stops_and_closers: + - template: Generic\OHCloserArm_103_1_90 + position: 0.000 + + strikes: + - template: Generic\StdFaceStrike + position: 57.875 + back_set: 2.75 + offset_WS: 0.0 + + rabbet: + - template: Generic\Rabbet + side: top width: 0.6 depth: 0.8 - offset_WS: 0 - side: bottom ---