OK Ordinamento giusto componenti nel ddf +

fix fieldname shape o template
This commit is contained in:
zaccaria.majid
2023-05-11 17:30:07 +02:00
parent 0878d7efc4
commit 7e1cfef511
9 changed files with 168 additions and 66 deletions
+1
View File
@@ -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<string, List<Dictionary<string, string>>>();
var i = 0;
@@ -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<string> ordListVal { get; set; } = new List<string>();
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);
@@ -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<string, List<string>> defaultDict = new Dictionary<string, List<string>>();
List<string> listDefVal = new List<string>();
Dictionary<string, string> actDict = new Dictionary<string, string>();
@@ -46,7 +46,7 @@ else
</div>
<div class="row my-1">
<div class="col-4 d-flex flex-wrap align-items-center">
<span>Template</span>
<span>@currTempOrSh</span>
</div>
@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))
{
@@ -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);
}
@@ -107,18 +107,18 @@ namespace WebDoorCreator.UI.Components.SvgComp
pathPointList = new List<PointData>();
pathClipCloseList = new List<PointData>();
// 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));
@@ -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,
+1 -1
View File
@@ -4,6 +4,6 @@
<div class="shadow-lg">
<HomeCard ObjH="900" ObjW="1920" StartPoint="820" LineWidth="18" TitleText="Web Door Creator" BodyText="The new way to create doors" ImagePath="images/HeroSecDoor.png" EC_ExeFunct="changePage" ButtonText="Go To Orders"></HomeCard>
<HomeCard ObjH="1080" ObjW="1920" StartPoint="850" LineWidth="18" TitleText="Web Door Creator" BodyText="The new way to create doors" ImagePath="images/HeroSecDoor.png" EC_ExeFunct="changePage" ButtonText="Go To Orders"></HomeCard>
</div>
+59 -29
View File
@@ -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
---