From f29b52f9954d1291670142223b5e024580685632 Mon Sep 17 00:00:00 2001 From: Elena Date: Wed, 29 Jun 2022 00:39:15 +0200 Subject: [PATCH] =?UTF-8?q?Ciclo=20limpieza=20lo=20hace=20completo,=20sect?= =?UTF-8?q?oriza=20y=20planifica.=20Falta=20probar=20instalaci=C3=B3n.=20R?= =?UTF-8?q?ecogida=20a=20medias=20de=20probar.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config.daml | 2 +- Helper/HelperGdb.cs | 43 +++++-- Images/config2_olv - copia.png | Bin 0 -> 1789 bytes Images/config2_olv.png | Bin 0 -> 1906 bytes Model/Limpieza.cs | 9 +- Model/Recogida.cs | 21 +++ OliviaAddInPro.csproj | 5 +- Services/EjecServ.cs | 136 +++++++++++++------- Services/FinProcServ.cs | 35 ++--- Services/RecogidaServ.cs | 25 +--- View/PaneEjecutar.xaml.cs | 2 +- ViewModel/Recogida/PaneRecogidaViewModel.cs | 3 + 12 files changed, 183 insertions(+), 98 deletions(-) create mode 100644 Images/config2_olv - copia.png create mode 100644 Images/config2_olv.png diff --git a/Config.daml b/Config.daml index 1e55652..882f6e4 100644 --- a/Config.daml +++ b/Config.daml @@ -38,7 +38,7 @@ Add-In de ArcGIS Pro para la herramienta de optimización de la limpieza viaria, OLIVIA - diff --git a/Helper/HelperGdb.cs b/Helper/HelperGdb.cs index 4368a00..665824f 100644 --- a/Helper/HelperGdb.cs +++ b/Helper/HelperGdb.cs @@ -739,9 +739,10 @@ namespace OliviaAddInPro.Helper if (!fields.Contains(field)) { HelperGdb.OutStr = "No se encuentra el campo " + field; + Free(fc); return false; } - + Free(fc); return true; } /* @@ -757,13 +758,14 @@ namespace OliviaAddInPro.Helper } ObservableCollection fields = GetFieldsSync(fc); + bool encuentra = true; if (!fields.Contains(field)) { HelperGdb.OutStr = "No se encuentra el campo " + field; - return false; + encuentra= false; } - - return true; + Free(fc); + return encuentra; } /* * Lee la capa que se ha seleccionzdo de recogida y se comprueba que contiene los campos necesarios @@ -1942,12 +1944,27 @@ namespace OliviaAddInPro.Helper if (brwsFilt != null) dlg.BrowseFilter = brwsFilt; - bool? ok = dlg.ShowDialog(); + try + { + bool? ok = dlg.ShowDialog(); - if ((ok ?? true) && dlg.FilePath.Length > 0) - return dlg.FilePath; - else + if ((ok ?? true) && dlg.FilePath.Length > 0) + return dlg.FilePath; + else + return string.Empty; + } + catch(Exception ex) + { return string.Empty; + } + } + + /** + * Saca diálogo para elegir directorio + */ + public static string FolderBrowseDlg(string title_, string initloc_) + { + return null; } /** @@ -2438,12 +2455,17 @@ namespace OliviaAddInPro.Helper */ public static bool AddFieldsSync(string fcname, FieldToAdd[] fields) { - bool res = false; + bool res = false; // set up the arguments string fields_str = ""; + int camps = 0; for(int i=0;iE7Jq#@b3StLLe#frtY zsG#*2 zH$g>8*MI^PLqKnu7ga%LFhDk&#$b7~*^K2Nlg?m5bmC@H87$bF4Ksbfsf$c_!;~A~ zP@#Cr7jfc|RXDDPAt*61k(TI1L$NrB!QpUB8cZgYKu`@yI$Um~>I{@=1tDTkU}`6;X^`WacBVX90-!62ht4>4$TQ%ci7sr3J$TI~$lfQKS)bF@4!$F`q8rdolPTk%+^Z<_b|o zf)>%?(_H0SuFtGo(=cfDgl8dwsW%}?F@|cv$)sWR?6I(B)tllfXOG2uRxU&Y1DRU; zuU1c+i1{&XX9kxz%#1#wBjz0=20OF%;RnR`f=YyZnX#ieoUd8HC*{OAu3JT2`(=H{ z4cnhHSjA3|e=na)lJMUR*#LF7J#%V)okmI_Nw^t#@$aPdxS7pA;gRvfx(6pD-<9kL zI?t=v)iBmQR=K*;E4yo`!6y6K@WbmP*HZ4LJZ1Ga4R;=u)VoZyTIgzNg6f5C8<&`no4s@tvDIEb=ayA3h2ER38|)Ndu_bw~v(T zFNoxZ_`?%y*HJcP7U22Z{6KsjzbD~!Oia1h|IC)g?Q!3hj?kkeK2>zf0x&MHZL8y0Vn{Y5L&f?EIxp+^xs1b=EQ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Ldb+@}%02PwwSa-XNO)N-p4`i9Lu(hfR{=hs= zd3!)J3?PbF9gE@S#toOE`kRr^Y zFv1hm(U-Su^^W*Pf3WvAzXqSV9%@5M)q9t+NU{u&_4fUt!TY1b+X;}XBH;*PTmZ9L%`dp}H3nJ;V0W87C4qS{_6J6;@t_{qcl`Sv`k%~nusGv=uhdPaYmfyFV{-PW;;07;U8siCo}1HLbF2%VCqX;lHk zFwkf;D7LSIbN61nX?h9k=2c)6DgbCa`r*4C6{FlpZpb~aWpiwyS^q>*%An(R7I+h0Dw}*8i=9@ilXq# z{RbV=_*6K2|1Qp7`8Z%H(v6EzoC^n|b6G}1pGu)V&5J@n res1 = new Respuesta { Value = TiposEjecucion.FinEjecOk }; - HelperGdb.OpenLayer(@"C:\Users\Elena\Documents\ArcGIS\Projects\MyProject3\MyProject3.gdb\Barrido_man\BarMan_AceM_AceNM_20220529_134336", "SECTOR", true); - return res1;*/ + //Respuesta res1 = new Respuesta { Value = TiposEjecucion.FinEjecOk }; + //HelperGdb.OpenLayer(@"C:\Users\Elena\Documents\ArcGIS\Projects\MyProject3\MyProject3.gdb\Barrido_man\BarMan_AceM_AceNM_20220529_134336", "SECTOR", true); + //Serv.ActualizaSecto(@"D:\Proyectos\Olivia\Instal2.0\data\data_T00_A0405_20220628_214902.shp", @"C:\\Users\\Elena\\Documents\\ArcGIS\\Projects\\MyProject3\\MyProject3.gdb\\Barrido_man\\BarMan_AceM_AceNM_20220628_214613"); + //return res1; + + ////////////////// ///////////////////////////// Respuesta res = new Respuesta { Value=false}; diff --git a/Model/Recogida.cs b/Model/Recogida.cs index 08e1d7c..bfee6f4 100644 --- a/Model/Recogida.cs +++ b/Model/Recogida.cs @@ -171,5 +171,26 @@ namespace OliviaAddInPro.Model RecogidaDef.campos_def.cons_kgrec }; return camps; } + + /** + * Rellena el array de filtros en base a la config + */ + public void RellenaFiltrosReco() + { + //se rellena el array de filtros + RecogidaDef.filtro_str = new string[RecogidaDef.tipos_fracc_str.Length + RecogidaDef.tipos_carg_str.Length]; + for (int i = 0; i < RecogidaDef.tipos_fracc_str.Length; i++) + { + //se comprueba que tipo de fracción se ha seleccionado. Si se ha seleccionado una fracción sin nombre (el campo en la capa es NULL, y en el comboBox de fracciiones aparece como "-") hay que modificar el filtro + if (RecogidaDef.tipos_fracc_str[i] == "-") + RecogidaDef.filtro_str[i] = RecogidaDef.campos_def.cons_fracc + " IS NULL"; + else + RecogidaDef.filtro_str[i] = RecogidaDef.campos_def.cons_fracc + "= '" + RecogidaDef.tipos_fracc_str[i] + "'"; + } + for (int i = RecogidaDef.tipos_fracc_str.Length; i < RecogidaDef.filtro_str.Length; i++) + { + RecogidaDef.filtro_str[i] = RecogidaDef.campos_def.cons_nomrec + "= '" + RecogidaDef.tipos_carg_str[i - RecogidaDef.tipos_fracc_str.Length] + "'"; + } + } } } diff --git a/OliviaAddInPro.csproj b/OliviaAddInPro.csproj index afe5a47..e8f1d77 100644 --- a/OliviaAddInPro.csproj +++ b/OliviaAddInPro.csproj @@ -25,7 +25,7 @@ bin\Debug\ DEBUG;TRACE prompt - 4 + 0 Program $(ArcGISFolder)\bin\ArcGISPro.exe x64 @@ -357,6 +357,9 @@ + + +