Compare commits

...

33 Commits

Author SHA1 Message Date
Gerardo bf4fffcaff Remates version 4.0.0.0 2024-04-12 22:35:29 +02:00
Gerardo a225a6b8af Correccion de errores 2024-04-11 16:29:41 +02:00
Gerardo 3f57544e9d Modos de viaje 2024-03-12 12:43:13 +01:00
Gerardo 9273611e3f modos de viaje 2024-01-24 13:22:01 +01:00
Gerardo bb62863fab Merge branch 'Gerardo/elevacion' into Gerardo/ModosViaje 2024-01-24 11:04:02 +01:00
Gerardo ec850008c0 modo eje de calles 2024-01-24 11:02:41 +01:00
Gerardo 4b81570591 modos de viaje 2024-01-16 22:40:57 +01:00
Gerardo dcc3040cef cambios revisa congunciones 2024-01-16 22:39:32 +01:00
Gerardo f1444fd25a Versionado de configuracion 2023-12-04 22:02:32 +01:00
Gerardo 3b42f1b379 añadir comprobaciones de elevacion de manera estandar 2023-11-22 23:01:24 +01:00
Gerardo e9faefdafd Comprobación de topologia y configuracion por defecto 2023-11-12 22:31:34 +01:00
Gerardo 6d7d2f7033 Pasar elevacion como parametro 2023-11-06 00:22:04 +01:00
Gerardo 4628ea88e4 Quita comprobaciones de campos 2023-11-04 00:43:53 +01:00
Gerardo f94b4e3a2e Añadido configuracion tipo de red. 2023-11-03 23:56:06 +01:00
Gerardo 6e7c7f787c Merge branch 'Gerardo/Compilacion.net' into develop 2023-04-18 21:19:49 +02:00
Gerardo 002d3edd17 Merge branch 'Gerardo/ErrorGuardadoCSV' into develop
# Conflicts:
#	Conexion/Cstr_socket.cs
#	Helper/HelperGdb.cs
#	Services/EjecServ.cs
#	Services/LanzaSrv/LanzaLimpSrv.cs
#	Services/ProcesoEjecServ.cs
#	View/Configuracion/PaneConfigView.xaml
#	View/Limpieza/PaneLimpiezaSub2.xaml.cs
#	ViewModel/Limpieza/PaneLimpiezaSub1ViewModel.cs
2023-04-18 21:19:03 +02:00
Gerardo f6435a0de9 Solución error guardado CSV
version 3.2
2023-04-18 21:06:27 +02:00
Gerardo 895d4e89f0 Log mensaje error 2023-03-29 23:41:00 +02:00
Gerardo e834cdfb57 Arreglos varios pedidos de cambio de títulos y envío de mima de nw 2023-02-17 11:16:44 +01:00
Elena 2b91905abb Cambios en nombres pedidos por vsm, arreglo tema oscuro propertygrid, envia mima 2023-02-17 01:16:51 +01:00
Gerardo a4fe3bb805 Arreglos 3.0 de exportación de ObjectID 2023-02-13 22:40:09 +01:00
Elena c7f8bb403a Arreglos ObjectID exportacion shp 2023-02-13 22:34:35 +01:00
Gerardo c2f857ba48 Compilacion .NET6 + modificado para pasarle IP/puerto desde el que conectarse 2023-02-13 18:09:52 +01:00
Elena 0f9a21eddc Arreglos IP local 2023-02-13 14:04:36 +01:00
Gerardo 114abcccc2 integracion con cambios debelop 2023-01-16 10:29:41 +01:00
Elena 407d06bf00 Modificaciones para exportar OID y otras de nombres de campos 2023-01-13 13:24:23 +01:00
Elena a056f6d78b Modificaciones varias última versión 2023-01-12 01:05:54 +01:00
Elena dd2c58667d probada ventana para pedir nombre de ftclass 2022-12-22 00:31:05 +01:00
Elena 31ded359f6 Probado ventana guardar nombre ftclass 2022-12-21 15:31:15 +01:00
Gerardo 6ed9074bf8 Version compilando arcgis pro 3.0 (.net 6) 2022-12-20 00:19:52 +01:00
Elena 39757fce61 Avances cambios pedidos por VSM 2022-11-08 21:23:11 +01:00
Elena 8081d00bbe Cambios ventana intermedia para elegir nombre de FeatureClass. sin probar. 2022-10-26 12:32:30 +02:00
Elena 23cd733c9b Comienzos hacer ventana para cambiar Dataset y Nombre 2022-10-24 13:07:45 +02:00
58 changed files with 2150 additions and 1118 deletions

BIN
Backup-2.x.zip Normal file

Binary file not shown.

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Controls;
using ArcGIS.Core.CIM; using ArcGIS.Core.CIM;
using ArcGIS.Core.Data; using ArcGIS.Core.Data;
using ArcGIS.Core.Geometry; using ArcGIS.Core.Geometry;
@ -18,6 +19,7 @@ using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Desktop.Mapping; using ArcGIS.Desktop.Mapping;
using OliviaAddInPro.Helper; using OliviaAddInPro.Helper;
using OliviaAddInPro.Model; using OliviaAddInPro.Model;
using Button = ArcGIS.Desktop.Framework.Contracts.Button;
namespace OliviaAddInPro namespace OliviaAddInPro
{ {

View File

@ -29,8 +29,7 @@ namespace OliviaAddInPro
if (OliviaGlob.TipoView == TiposEjecucion.Ninguno) if (OliviaGlob.TipoView == TiposEjecucion.Ninguno)
{ {
///Comprueba que existe la red navegable configurada ///Comprueba que existe la red navegable configurada
if (!OliviaGlob.CompruebaNwYCampos()) if (!OliviaGlob.CompruebaNwYCampos())
{ {
HelperGlobal.ponMsg("No se encuentra red navegable, cambie Configuración: " + HelperGdb.OutStr, HelperGlobal.ponMsg("No se encuentra red navegable, cambie Configuración: " + HelperGdb.OutStr,

View File

@ -24,7 +24,7 @@ namespace OliviaAddIn
//devuelve -1 si no se ha podido crear socket //devuelve -1 si no se ha podido crear socket
//0 si no se puede conectar //0 si no se puede conectar
//1 si conectado //1 si conectado
public bool conecta(string ip, int puerto) public bool conecta(string ip, int puerto, string ip_local="")
{ {
termina(); termina();
try try
@ -39,7 +39,7 @@ namespace OliviaAddIn
return false; return false;
try try
{ {
return str_socket_conecta(sc, ip, puerto) != 0; return str_socket_conecta(sc, ip, puerto, ip_local) != 0;
} }
catch catch
{ {
@ -120,7 +120,7 @@ namespace OliviaAddIn
unsafe public static extern IntPtr str_socket_crea(); unsafe public static extern IntPtr str_socket_crea();
[DllImport("utiles.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)] [DllImport("utiles.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
unsafe public static extern int str_socket_conecta(IntPtr soc, String ip, int puerto); unsafe public static extern int str_socket_conecta(IntPtr soc, String ip, int puerto, String ip_local=null);
[DllImport("utiles.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)] [DllImport("utiles.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
unsafe public static extern int str_socket_envia(IntPtr soc, String txt);//solo este unsafe public static extern int str_socket_envia(IntPtr soc, String txt);//solo este

View File

@ -1,11 +1,12 @@
<ArcGIS defaultAssembly="OliviaAddInPro.dll" defaultNamespace="OliviaAddInPro" xmlns="http://schemas.esri.com/DADF/Registry" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.esri.com/DADF/Registry file:///C:/Program%20Files/ArcGIS/Pro/bin/ArcGIS.Desktop.Framework.xsd"> <?xml version="1.0" encoding="utf-8"?>
<AddInInfo id="{10742570-cf59-42f2-bea2-2a38002a06ee}" version="3.0" desktopVersion="2.8.29751"> <ArcGIS defaultAssembly="OliviaAddInPro.dll" defaultNamespace="OliviaAddInPro" xmlns="http://schemas.esri.com/DADF/Registry" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.esri.com/DADF/Registry file:///C:/Program%20Files/ArcGIS/Pro/bin/ArcGIS.Desktop.Framework.xsd">
<AddInInfo id="{10742570-cf59-42f2-bea2-2a38002a06ee}" version="4.0" desktopVersion="3.0.3.36057">
<Name>OliviaAddInPro</Name> <Name>OliviaAddInPro</Name>
<Description>AddIn de Optimización de la Limpieza Viaria para ArcGIs Pro</Description> <Description>AddIn de Optimización de la Limpieza Viaria para ArcGIs Pro</Description>
<Image>Images\AddinDesktop32.png</Image> <Image>Images\AddinDesktop32.png</Image>
<Author>VSM</Author> <Author>VSM</Author>
<Company>VSM - Narvaling</Company> <Company>VSM - Narvaling</Company>
<Date>08/07/2022 12:00:00, 2022</Date> <Date>12/04/2024 12:00:00, 2024</Date>
<Subject>Framework</Subject> <Subject>Framework</Subject>
<!-- Note subject can be one or more of these topics: <!-- Note subject can be one or more of these topics:
Content, Framework, Editing, Geodatabase, Geometry, Geoprocessing, Layouts, Map Authoring, Map Exploration --> Content, Framework, Editing, Geodatabase, Geometry, Geoprocessing, Layouts, Map Authoring, Map Exploration -->
@ -16,17 +17,17 @@
<tabs> <tabs>
<tab id="OliviaAddInPro_Tab1" caption="Olivia Pro"> <tab id="OliviaAddInPro_Tab1" caption="Olivia Pro">
<group refID="OliviaAddInPro_Group1" /> <group refID="OliviaAddInPro_Group1" />
<group refID="OliviaAddInPro_Group2" /> <group refID="OliviaAddInPro_Group2" />
</tab> </tab>
</tabs> </tabs>
<groups> <groups>
<group id="OliviaAddInPro_Group2" caption=" " appearsOnAddInTab="false"> <group id="OliviaAddInPro_Group2" caption=" " appearsOnAddInTab="false">
<button refID="OliviaAddInPro_ButtonLimp" size="large" /> <button refID="OliviaAddInPro_ButtonLimp" size="large" />
<button refID="OliviaAddInPro_ButtonRec" size="large" /> <button refID="OliviaAddInPro_ButtonRec" size="large" />
</group>
<group id="OliviaAddInPro_Group1" caption=" " appearsOnAddInTab="false">
<button refID="OliviaAddInPro_ButtonConfig" size="large" />
</group> </group>
<group id="OliviaAddInPro_Group1" caption=" " appearsOnAddInTab="false">
<button refID="OliviaAddInPro_ButtonConfig" size="large" />
</group>
</groups> </groups>
<controls> <controls>
<!-- add your controls here --> <!-- add your controls here -->
@ -41,7 +42,7 @@
<button id="OliviaAddInPro_ButtonConfig" caption="Configuración" className="ButtonConfig" loadOnClick="true" largeImage="Images/config2_olv.png"> <button id="OliviaAddInPro_ButtonConfig" caption="Configuración" className="ButtonConfig" loadOnClick="true" largeImage="Images/config2_olv.png">
<tooltip heading="OLIVIA - Configuración"> <tooltip heading="OLIVIA - Configuración">
Add-In de ArcGIS Pro para la herramienta de optimización de la limpieza viaria, OLIVIA<disabledText /></tooltip> Add-In de ArcGIS Pro para la herramienta de optimización de la limpieza viaria, OLIVIA<disabledText /></tooltip>
</button> </button>
</controls> </controls>
<dockPanes> <dockPanes>
<dockPane id="OliviaAddInPro_DockpaneLimpieza" caption="OLIVIA | Limpieza" className="DockpaneLimpiezaViewModel" dock="group" dockWith="esri_core_contentsDockPane"> <dockPane id="OliviaAddInPro_DockpaneLimpieza" caption="OLIVIA | Limpieza" className="DockpaneLimpiezaViewModel" dock="group" dockWith="esri_core_contentsDockPane">

View File

@ -25,12 +25,16 @@ using OliviaAddInPro.Model.contract;
using ArcGIS.Core.Data.DDL; using ArcGIS.Core.Data.DDL;
using ArcGIS.Core.CIM; using ArcGIS.Core.CIM;
using System.Threading; using System.Threading;
using ArcGIS.Core.Data.Exceptions;
using Microsoft.Win32;
using Microsoft.WindowsAPICodePack.Dialogs;
using System.Security.Cryptography;
using ArcGIS.Desktop.Internal.Mapping;
namespace OliviaAddInPro.Helper namespace OliviaAddInPro.Helper
{ {
public static class HelperGdb public static class HelperGdb
{ {
private static string ObjectId = "OBJECTID";
private static string out_str = string.Empty; private static string out_str = string.Empty;
public static string OutStr public static string OutStr
{ {
@ -76,7 +80,7 @@ namespace OliviaAddInPro.Helper
} }
//Proceso para sacar un diálogo y seleccionar una o varias geometrías de dentro de una fclass //Proceso para sacar un diálogo y seleccionar una o varias geometrías de dentro de una fclass
public static ArcGIS.Core.Geometry.Geometry OpenGeom(TiposOpenFileDlg tipo, out string txt_sal, string initialLoc = "") public static ArcGIS.Core.Geometry.Geometry OpenGeom(TiposOpenFileDlg tipo, out string txt_sal, string initialLoc = "", bool multisel = false)
{ {
//inicialmente //inicialmente
ArcGIS.Core.Geometry.Geometry geom = null; ArcGIS.Core.Geometry.Geometry geom = null;
@ -87,7 +91,7 @@ namespace OliviaAddInPro.Helper
if (fc != null) if (fc != null)
{ {
//hace geom //hace geom
geom = SelecLeeGeom(fc, out txt_sal, true); geom = SelecLeeGeom(fc, out txt_sal, multisel);
if (geom == null && (HelperGdb.OutStr.Length > 0)) if (geom == null && (HelperGdb.OutStr.Length > 0))
HelperGlobal.ponMsg(HelperGdb.OutStr, System.Windows.MessageBoxImage.Error); HelperGlobal.ponMsg(HelperGdb.OutStr, System.Windows.MessageBoxImage.Error);
@ -434,44 +438,123 @@ namespace OliviaAddInPro.Helper
} }
//Dado un path de una feature class devuelve la ftclass abierta directamente,
//o null si ha habido algún problema o no lo ha encontrado
public static FeatureClass GetFtClass(string pathFtClss)
{
FeatureClass ftclss = null;
if (string.IsNullOrEmpty(pathFtClss))
return null;
Geodatabase gdb = GetGdb(pathFtClss).Result;
ReiniciaOutStr();
if (gdb != null)
{
ftclss = GetFtClass(System.IO.Path.GetFileNameWithoutExtension(pathFtClss), gdb).Result;
}
else //mira a ver si es shapefile
{
ftclss = GetFtClassFromShp(pathFtClss).Result;
}
Free(gdb);
return ftclss;
}
//Dado un path de una feature class devuelve la ftclass abierta directamente, //Dado un path de una feature class devuelve la ftclass abierta directamente,
//o null si ha habido algún problema o no lo ha encontrado //o null si ha habido algún problema o no lo ha encontrado
public static FeatureClass GetFtClassSync(string pathFtClss) public static FeatureClass GetFtClassSync(string pathFtClss)
{ {
FeatureClass ftclss = null; FeatureClass ftclss = null;
FeatureDataset dtset = null;
if (string.IsNullOrEmpty(pathFtClss)) if (string.IsNullOrEmpty(pathFtClss))
return null; return null;
Geodatabase gdb = GetGdbSync(pathFtClss); Geodatabase gdb = GetGdbSync(pathFtClss);
ReiniciaOutStr(); ReiniciaOutStr();
if (gdb != null) if (gdb != null)
{ {
ftclss = GetFtClassSync(System.IO.Path.GetFileNameWithoutExtension(pathFtClss), gdb); string dtsetName = new DirectoryInfo(System.IO.Path.GetDirectoryName(pathFtClss)).Name;
try
{
dtset = gdb.OpenDataset<FeatureDataset>(dtsetName);
}
catch (Exception ex)
{
HelperGdb.OutStr = "Error al abrir Dataset " + dtsetName + ": " + ex.Message;
dtset= null;
}
string ftclassName = System.IO.Path.GetFileNameWithoutExtension(pathFtClss);
if (dtset != null)
{
try
{
ftclss = dtset.OpenDataset<FeatureClass>(ftclassName);
}
catch/* (Exception ex)*/
{
ftclss = null;
}
}
else
{
try
{
ftclss = gdb.OpenDataset<FeatureClass>(ftclassName);
}
catch /*(Exception ex)*/
{
ftclss = null;
}
}
if(ftclss==null)
HelperGdb.OutStr = "Error al abrir Feature Class " + ftclassName;
} }
else //mira a ver si es shapefile else //mira a ver si es shapefile
{ {
ftclss = GetFtClassFromShpSync(pathFtClss); ftclss = GetFtClassFromShpSync(pathFtClss);
} }
Free(gdb); Free(gdb);
Free(dtset);
return ftclss;
}
//Dado un path de una feature class devuelve la ftclass abierta directamente,
//o null si ha habido algún problema o no lo ha encontrado
public static FeatureClass GetFtClass(string pathFtClss)
{
FeatureClass ftclss = null;
FeatureDataset dtset = null;
if (string.IsNullOrEmpty(pathFtClss))
return null;
Geodatabase gdb = GetGdb(pathFtClss).Result;
ReiniciaOutStr();
if (gdb != null)
{
var task = ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run((Func<FeatureClass>)(() =>
{
string dtsetName = new DirectoryInfo(System.IO.Path.GetDirectoryName(pathFtClss)).Name;
try
{
dtset = gdb.OpenDataset<FeatureDataset>(dtsetName);
}
catch (Exception ex)
{
HelperGdb.OutStr = "Error al abrir Dataset " + dtsetName + ": " + ex.Message;
dtset = null;
}
string ftclassName = System.IO.Path.GetFileNameWithoutExtension(pathFtClss);
if (dtset != null)
{
try
{
ftclss = dtset.OpenDataset<FeatureClass>(ftclassName);
}
catch /*(Exception ex)*/
{
ftclss = null;
}
}
else
{
try
{
ftclss = gdb.OpenDataset<FeatureClass>(ftclassName);
}
catch /*(Exception ex)*/
{
ftclss = null;
}
}
if (ftclss == null)
HelperGdb.OutStr = "Error al abrir Feature Class " + ftclassName;
return ftclss;
}));
task.Wait();
}
else //mira a ver si es shapefile
{
ftclss = GetFtClassFromShp(pathFtClss).Result;
}
Free(gdb);
Free(dtset);
return ftclss; return ftclss;
} }
//Dado el path de una gdb y el nombre de una feature class, devuelve la //Dado el path de una gdb y el nombre de una feature class, devuelve la
@ -486,7 +569,7 @@ namespace OliviaAddInPro.Helper
{ {
try try
{ {
ftclss = gdb.OpenDataset<FeatureClass>(nameFtclss); ftclss = gdb.OpenDataset<FeatureClass>(nameFtclss);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -591,7 +674,7 @@ namespace OliviaAddInPro.Helper
public static ArcGIS.Core.Data.SpatialQueryFilter CreateFiler(string consulta, ArcGIS.Core.Geometry.Geometry geom, SpatialRelationship rel = SpatialRelationship.Contains) public static ArcGIS.Core.Data.SpatialQueryFilter CreateFiler(string consulta, ArcGIS.Core.Geometry.Geometry geom, SpatialRelationship rel = SpatialRelationship.Contains)
{ {
ArcGIS.Core.Data.SpatialQueryFilter filt = null; ArcGIS.Core.Data.SpatialQueryFilter filt = null;
if (geom != null) if (geom != null && !geom.IsEmpty)
{ {
SpatialQueryFilter filtSpat = new SpatialQueryFilter SpatialQueryFilter filtSpat = new SpatialQueryFilter
{ {
@ -624,8 +707,8 @@ namespace OliviaAddInPro.Helper
{ {
if (filt == null) if (filt == null)
filt = new ArcGIS.Core.Data.QueryFilter(); filt = new ArcGIS.Core.Data.QueryFilter();
sel = fc.Select(filt, SelectionType.ObjectID, SelectionOption.Normal); sel = fc.Select(filt, ArcGIS.Core.Data.SelectionType.ObjectID, SelectionOption.Normal);
int nsel = sel.GetCount(); long nsel = sel.GetCount();
IReadOnlyList<long> ids_ = sel.GetObjectIDs(); IReadOnlyList<long> ids_ = sel.GetObjectIDs();
ids = ids_.ToList(); ids = ids_.ToList();
return ids; return ids;
@ -655,8 +738,8 @@ namespace OliviaAddInPro.Helper
{ {
if (filt == null) if (filt == null)
filt = new ArcGIS.Core.Data.QueryFilter(); filt = new ArcGIS.Core.Data.QueryFilter();
sel = fc.Select(filt, SelectionType.ObjectID, SelectionOption.Normal); sel = fc.Select(filt, ArcGIS.Core.Data.SelectionType.ObjectID, SelectionOption.Normal);
int nsel = sel.GetCount(); var nsel = sel.GetCount();
IReadOnlyList<long> ids_ = sel.GetObjectIDs(); IReadOnlyList<long> ids_ = sel.GetObjectIDs();
ids = ids_.ToList(); ids = ids_.ToList();
return ids; return ids;
@ -728,6 +811,27 @@ namespace OliviaAddInPro.Helper
return fields_st; return fields_st;
} }
//Devuelve una lista con los campos de una feature class
public static IReadOnlyList<ArcGIS.Core.Data.Field> GetFieldsSyncEx(FeatureClass fc)
{
FeatureClassDefinition ftcldef = null;
IReadOnlyList<ArcGIS.Core.Data.Field> fields = null;
ReiniciaOutStr();
if (fc == null)
return null;
try
{
ftcldef = fc.GetDefinition();
fields = ftcldef.GetFields();
}
catch (Exception ex)
{
HelperGdb.OutStr = "Error al leer los campos " + fc.GetName() + ": " + ex.Message;
return fields;
}
return fields;
}
/* /*
* Comprueba que en la capa dada exista un campo con nombre 'field' * Comprueba que en la capa dada exista un campo con nombre 'field'
@ -796,7 +900,7 @@ namespace OliviaAddInPro.Helper
for (i = 0; i < camps.Length; i++) for (i = 0; i < camps.Length; i++)
{ {
//if (!fields.Any(f=>f.ToUpper().Trim().Contains(camps[i].Substring (0,Math.Min(camps[i].Length, ComunDef.MaxCaracteresBBDD)).ToUpper().Trim()))) //if (!fields.Any(f=>f.ToUpper().Trim().Contains(camps[i].Substring (0,Math.Min(camps[i].Length, ComunDef.MaxCaracteresBBDD)).ToUpper().Trim())))
if (!fields.Any(f=>f.ToUpper().Trim().Contains(camps[i].ToUpper().Trim()))) if (!fields.Any(f=>f.ToUpper().Trim().Equals(camps[i].ToUpper().Trim())))
{ {
OutStr = OutStr + camps[i] + " "; OutStr = OutStr + camps[i] + " ";
mal++; mal++;
@ -839,7 +943,7 @@ namespace OliviaAddInPro.Helper
{ {
//if (!fields.Any(f => f.ToUpper().Trim().Contains(camps[i].Substring(0, Math.Min(camps[i].Length, ComunDef.MaxCaracteresBBDD)).ToUpper().Trim()))) //if (!fields.Any(f => f.ToUpper().Trim().Contains(camps[i].Substring(0, Math.Min(camps[i].Length, ComunDef.MaxCaracteresBBDD)).ToUpper().Trim())))
if (!fields.Any(f => f.ToUpper().Trim().Contains(camps[i].ToUpper().Trim()))) if (!fields.Any(f => f.ToUpper().Trim().Equals(camps[i].ToUpper().Trim())))
{ {
OutStr = OutStr + camps[i] + " "; OutStr = OutStr + camps[i] + " ";
mal++; mal++;
@ -966,7 +1070,7 @@ namespace OliviaAddInPro.Helper
* Devuelve una geometría que es la suma de la inicial y la que se añade Add * Devuelve una geometría que es la suma de la inicial y la que se añade Add
*/ */
public static ArcGIS.Core.Geometry.Geometry IntersectGeom(ArcGIS.Core.Geometry.Geometry geomIni, ArcGIS.Core.Geometry.Geometry geomInters, public static ArcGIS.Core.Geometry.Geometry IntersectGeom(ArcGIS.Core.Geometry.Geometry geomIni, ArcGIS.Core.Geometry.Geometry geomInters,
GeometryDimension resultDimension = GeometryDimension.esriGeometryNoDimension) GeometryDimensionType resultDimension = GeometryDimensionType.EsriGeometryUnknownDimension)//esriGeometryNoDimension)
{ {
if (geomIni == null) if (geomIni == null)
return geomInters; return geomInters;
@ -975,7 +1079,7 @@ namespace OliviaAddInPro.Helper
ArcGIS.Core.Geometry.Geometry geomSal = null; ArcGIS.Core.Geometry.Geometry geomSal = null;
try try
{ {
if (resultDimension == GeometryDimension.esriGeometryNoDimension) if (resultDimension == GeometryDimensionType.EsriGeometryUnknownDimension)//GeometryDimension.esriGeometryNoDimension)
geomSal = GeometryEngine.Instance.Intersection(geomIni, geomInters); geomSal = GeometryEngine.Instance.Intersection(geomIni, geomInters);
else else
geomSal = GeometryEngine.Instance.Intersection(geomIni, geomInters, resultDimension); geomSal = GeometryEngine.Instance.Intersection(geomIni, geomInters, resultDimension);
@ -1080,6 +1184,16 @@ namespace OliviaAddInPro.Helper
geomIni = GeometryEngine.Instance.ConvexHull(geomIni); geomIni = GeometryEngine.Instance.ConvexHull(geomIni);
return geomIni; return geomIni;
} }
public static ArcGIS.Core.Geometry.Geometry GetGeomUnique(String path, ArcGIS.Core.Data.QueryFilter filtro)
{
FeatureClass fc = GetFtClassSync(path);
if (fc == null)
{
OutStr = "Error al abrir Feature Class:" + path;
return null; ;
}
return GetGeomUnique(fc, filtro);
}
/* /*
* A partir de una capa recorre todos los elementos que cumplen el filtro y los une en una única geometría * A partir de una capa recorre todos los elementos que cumplen el filtro y los une en una única geometría
*/ */
@ -1091,6 +1205,7 @@ namespace OliviaAddInPro.Helper
try try
{ {
var geom = new List<ArcGIS.Core.Geometry.Geometry>(); var geom = new List<ArcGIS.Core.Geometry.Geometry>();
using (RowCursor rowCursor = fclss.Search(filtro)) using (RowCursor rowCursor = fclss.Search(filtro))
{ {
@ -1099,7 +1214,10 @@ namespace OliviaAddInPro.Helper
using (Row row = rowCursor.Current) using (Row row = rowCursor.Current)
{ {
if (row is Feature ft) if (row is Feature ft)
geom.Add(ft.GetShape()); {
geom.Add(ft.GetShape());
}
} }
} }
geomsal = GeometryEngine.Instance.Union(geom); geomsal = GeometryEngine.Instance.Union(geom);
@ -1166,11 +1284,11 @@ namespace OliviaAddInPro.Helper
/** /**
* Devuelve el número de entidades de una FeatureClass que cumplen la consulta, o todos si la consulta es empty * Devuelve el número de entidades de una FeatureClass que cumplen la consulta, o todos si la consulta es empty
*/ */
public static int GetNumElems(string pathGdb, string ftclssName, string consulta = "") public static long GetNumElems(string pathGdb, string ftclssName, string consulta = "")
{ {
Geodatabase gdb = GetGdb(pathGdb).Result; Geodatabase gdb = GetGdb(pathGdb).Result;
FeatureClass fc = null; FeatureClass fc = null;
int n = -1; long n = -1;
if (gdb != null) if (gdb != null)
{ {
fc = GetFtClass(ftclssName, gdb).Result; fc = GetFtClass(ftclssName, gdb).Result;
@ -1223,11 +1341,11 @@ namespace OliviaAddInPro.Helper
/** /**
* Devuelve el número de entidades de una FeatureClass que cumplen la consulta, o todos si la consulta es empty * Devuelve el número de entidades de una FeatureClass que cumplen la consulta, o todos si la consulta es empty
*/ */
public static Task<int> GetNumElems(FeatureClass fc, string consulta = "") public static Task<long> GetNumElems(FeatureClass fc, string consulta = "")
{ {
int n = -1; long n = -1;
ReiniciaOutStr(); ReiniciaOutStr();
return ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run((Func<int>)(() => return ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run((Func<long>)(() =>
{ {
try try
{ {
@ -1240,7 +1358,7 @@ namespace OliviaAddInPro.Helper
//realiza consulta //realiza consulta
n = 0; n = 0;
//fc.GetDefinition().GetFields().First().Name kfadpskfpasp //fc.GetDefinition().GetFields().First().Name kfadpskfpasp
using (Selection sel = fc.Select(new ArcGIS.Core.Data.QueryFilter { WhereClause = consulta }, SelectionType.ObjectID, SelectionOption.Normal)) using (Selection sel = fc.Select(new ArcGIS.Core.Data.QueryFilter { WhereClause = consulta }, ArcGIS.Core.Data.SelectionType.ObjectID, SelectionOption.Normal))
n = sel.GetCount(); n = sel.GetCount();
} }
} }
@ -1257,9 +1375,9 @@ namespace OliviaAddInPro.Helper
/** /**
* Devuelve el número de entidades de una FeatureClass que cumplen la consulta, o todos si la consulta es empty * Devuelve el número de entidades de una FeatureClass que cumplen la consulta, o todos si la consulta es empty
*/ */
public static int GetNumElemsSync(FeatureClass fc, string consulta = "") public static long GetNumElemsSync(FeatureClass fc, string consulta = "")
{ {
int n = -1; long n = -1;
ReiniciaOutStr(); ReiniciaOutStr();
try try
{ {
@ -1271,7 +1389,7 @@ namespace OliviaAddInPro.Helper
{ {
//realiza consulta //realiza consulta
n = 0; n = 0;
using (Selection sel = fc.Select(new ArcGIS.Core.Data.QueryFilter { WhereClause = consulta }, SelectionType.ObjectID, SelectionOption.Normal)) using (Selection sel = fc.Select(new ArcGIS.Core.Data.QueryFilter { WhereClause = consulta }, ArcGIS.Core.Data.SelectionType.ObjectID, SelectionOption.Normal))
n = sel.GetCount(); n = sel.GetCount();
} }
} }
@ -1288,17 +1406,17 @@ namespace OliviaAddInPro.Helper
/** /**
* Devuelve el número de entidades de una FeatureClass que cumplen la consulta, o todos si la consulta es empty * Devuelve el número de entidades de una FeatureClass que cumplen la consulta, o todos si la consulta es empty
*/ */
public static int GetNumElems(string pathFtClss, string consulta = "") public static long GetNumElems(string pathFtClss, string consulta = "")
{ {
FeatureClass fc = GetFtClass(pathFtClss); FeatureClass fc = GetFtClass(pathFtClss);
int n = GetNumElems(fc, consulta).Result; var n = GetNumElems(fc, consulta).Result;
Free(fc); Free(fc);
return n; return n;
} }
public static int GetNumElemsSync(string pathFtClss, string consulta = "") public static long GetNumElemsSync(string pathFtClss, string consulta = "")
{ {
FeatureClass fc = GetFtClassSync(pathFtClss); FeatureClass fc = GetFtClassSync(pathFtClss);
int n = GetNumElemsSync(fc, consulta); var n = GetNumElemsSync(fc, consulta);
Free(fc); Free(fc);
return n; return n;
} }
@ -1342,11 +1460,14 @@ namespace OliviaAddInPro.Helper
if (!System.IO.Directory.Exists(outpath)) if (!System.IO.Directory.Exists(outpath))
System.IO.Directory.CreateDirectory(outpath); System.IO.Directory.CreateDirectory(outpath);
FeatureClass fc = null; FeatureClass fc = null;
bool debug = false;
///////////////////////////////////////////////////////// /////////////////////////////////////////////////////////
//Prepara una where_clause con las entidades que cumplen el filtro //Prepara una where_clause con las entidades que cumplen el filtro
//Abre la featureclass //Abre la featureclass
try try
{ {
if (debug)
HelperGlobal.ponMsg("pathLayerIn " + pathLayerIn);
fc = GetFtClassSync(pathLayerIn); fc = GetFtClassSync(pathLayerIn);
if (fc == null) if (fc == null)
{ {
@ -1355,14 +1476,24 @@ namespace OliviaAddInPro.Helper
} }
List<long> ids = new List<long>(); List<long> ids = new List<long>();
if (debug)
HelperGlobal.ponMsg("fc " + fc.GetName() + " tipo " + fc.GetType().Name);
///////////////////////////////////////////////////////// /////////////////////////////////////////////////////////
/////TODO comprobar que el object id no está indexado en la capa de nw, cómo hacerlo indexado
///https://pro.arcgis.com/en/pro-app/3.0/tool-reference/data-management/add-attribute-index.htm
///
//Añade a la lista los ids que cumplen el filtro espacial //Añade a la lista los ids que cumplen el filtro espacial
try try
{ {
ids = fc.Select(filter, SelectionType.ObjectID, SelectionOption.Normal).GetObjectIDs().ToList(); var aux = fc.Select(filter, ArcGIS.Core.Data.SelectionType.ObjectID, SelectionOption.Normal);
var aux2 = aux.GetObjectIDs();
//ids = fc.Select(filter, SelectionType.ObjectID, SelectionOption.Normal).GetObjectIDs().ToList();
ids = aux2.ToList();
} }
catch catch (Exception ex)
{ {
OutStr = "Error al seleccionar IDs. "+ex.Message;
ids = new List<long>(); ids = new List<long>();
} }
@ -1378,9 +1509,11 @@ namespace OliviaAddInPro.Helper
}*/ }*/
if (ids.Count <= 0) if (ids.Count <= 0)
{ {
OutStr = "Error al aplicar filtro espacial en exportación"; OutStr = "Error al aplicar filtro espacial en exportación: "+ OutStr;
return false; return false;
} }
if (debug)
HelperGlobal.ponMsg("Número de líneas a exportar "+ids.Count);
///////////////////////////////////////////////////////// /////////////////////////////////////////////////////////
if (cps.Getcancelled()) if (cps.Getcancelled())
{ {
@ -1389,8 +1522,9 @@ namespace OliviaAddInPro.Helper
} }
//convierte la lista de ids a string para la clause de la forma //convierte la lista de ids a string para la clause de la forma
//(id1, id2, id3..) //(id1, id2, id3..)
string whereClause = GetWhereClauseFromIds(ids); string whereClause = GetWhereClauseFromIds(ids,fc.GetDefinition().GetObjectIDField());
if (debug)
HelperGlobal.ponMsg(whereClause);
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
///Exporta ///Exporta
string[] args = { pathLayerIn, outpath, nameShp, whereClause }; string[] args = { pathLayerIn, outpath, nameShp, whereClause };
@ -1402,7 +1536,7 @@ namespace OliviaAddInPro.Helper
var environments = Geoprocessing.MakeEnvironmentArray(outputCoordinateSystem: sr); var environments = Geoprocessing.MakeEnvironmentArray(outputCoordinateSystem: sr);
//SpatialReferenceBuilder.CreateSpatialReference(3857) //SpatialReferenceBuilder.CreateSpatialReference(3857)
double valini = cps.GetProgress(); double valini = cps.GetProgress();
IGPResult gpResult = Geoprocessing.ExecuteToolAsync("FeatureClassToFeatureClass_conversion", args, var gpres = Geoprocessing.ExecuteToolAsync("FeatureClassToFeatureClass_conversion", args,
environments, null, environments, null,
(event_name, o) => // implement delegate and handle events (event_name, o) => // implement delegate and handle events
@ -1436,8 +1570,10 @@ namespace OliviaAddInPro.Helper
break; break;
} }
} }
}).Result; });
while (!gpres.IsCompleted && !gpres.IsCanceled && !gpres.IsFaulted)
Thread.Sleep(10);
IGPResult gpResult = gpres.Result;
if (gpResult.IsCanceled) if (gpResult.IsCanceled)
{ {
cps.Setcancelled(); cps.Setcancelled();
@ -1453,6 +1589,8 @@ namespace OliviaAddInPro.Helper
OutStr = "Error: " + msg; OutStr = "Error: " + msg;
return false; return false;
} }
gpres.Dispose();
return true; return true;
} }
catch (Exception ex) catch (Exception ex)
@ -1630,11 +1768,49 @@ namespace OliviaAddInPro.Helper
ArcGIS.Core.Geometry.Geometry geomBuff = null; ArcGIS.Core.Geometry.Geometry geomBuff = null;
try try
{ {
geomBuff = GeometryEngine.Instance.Buffer(geom, buffer); //GeometryEngine.Instance.Buffer(geom.)
//geomBuff= GeometryEngine.Instance.ConvexHull(geom);
//convierte las unidades del buffer a las unidades de la geometría
double buff_aux = buffer;
//comprueba que la geometría tenga unidades de metros para aplicar el buffer
if (geom.SpatialReference.Unit.FactoryCode != (int)ArcGIS.Core.Geometry.UnitTypeCode.Meters)
{
switch (geom.SpatialReference.Unit.FactoryCode)
{
case (int)ArcGIS.Core.Geometry.UnitTypeCode.Degrees://9102
//360º = 40.075 km
buff_aux = 360 * buffer / 40075000;
break;
case (int)ArcGIS.Core.Geometry.UnitTypeCode.Radians:
//2pi
buff_aux = 2 * Math.PI * buffer / 40075000;
break;
default:
if (geom.SpatialReference.Unit.UnitType == ArcGIS.Core.Geometry.UnitType.Linear)
{
//es de tipo lineal pero otras unidades que no son metros
buff_aux = ArcGIS.Core.Geometry.LinearUnit.Meters.ConvertTo(buffer, (ArcGIS.Core.Geometry.LinearUnit)geom.SpatialReference.Unit);
}
else
{
resp.Error = new List<string>();
resp.Error.Add("Error al aplicar buffer, la geometría del polígono de entrada es de tipo " + geom.SpatialReference.Unit.Name);
geomBuff = null;
buff_aux = 0;
}
break;
}
}
if(resp.Error.IsNullOrEmpty())
geomBuff = GeometryEngine.Instance.Buffer(geom, buff_aux);
} }
catch catch( Exception e)
{ {
//resp.HasError = true;
if (resp.Error.IsNullOrEmpty())
resp.Error = new List<string>();
resp.Error.Add(e.Message);
return resp;
} }
resp.Value = geomBuff; resp.Value = geomBuff;
return resp; return resp;
@ -1646,7 +1822,7 @@ namespace OliviaAddInPro.Helper
{ {
Respuesta<ArcGIS.Core.Geometry.Geometry> resp = new Respuesta<ArcGIS.Core.Geometry.Geometry>(); Respuesta<ArcGIS.Core.Geometry.Geometry> resp = new Respuesta<ArcGIS.Core.Geometry.Geometry>();
double buffer = 0;//m de distancia desde la instalación double buffer = 0;//m de distancia desde la instalación
bool repite = true; //bool repite = true;
ArcGIS.Core.Geometry.Geometry geom_pto, geom_sal; ArcGIS.Core.Geometry.Geometry geom_pto, geom_sal;
try try
{ {
@ -1677,9 +1853,9 @@ namespace OliviaAddInPro.Helper
} }
} }
} }
while (repite);*/ while (repite);*/
buffer = buff; buffer = buff;
geom_pto = GeometryEngine.Instance.Buffer(pto.ToMapPoint(), buffer); geom_pto = HelperGdb.BufferGeom((ArcGIS.Core.Geometry.Geometry)pto.ToMapPoint(geom.SpatialReference),buffer).Value; //GeometryEngine.Instance.Buffer(pto.ToMapPoint(), buffer);
if (geom_pto == null || geom_pto.IsEmpty) if (geom_pto == null || geom_pto.IsEmpty)
{ {
resp.Value = null; resp.Value = null;
@ -1708,7 +1884,7 @@ namespace OliviaAddInPro.Helper
* Dada una lista de ids de elemento, crea una consulta en la que se llama a todos esos elementos * Dada una lista de ids de elemento, crea una consulta en la que se llama a todos esos elementos
* campo IN (id1, id2, id3..) * campo IN (id1, id2, id3..)
*/ */
public static string GetWhereClauseFromIds(List<long> ids) public static string GetWhereClauseFromIds(List<long> ids, string ObjectId = "OBJECTID")
{ {
if (ids.Count <= 0) if (ids.Count <= 0)
return string.Empty; return string.Empty;
@ -1755,7 +1931,7 @@ namespace OliviaAddInPro.Helper
public static bool RemoveRowsFromShp(FeatureClass fc, List<long> quita) public static bool RemoveRowsFromShp(FeatureClass fc, List<long> quita)
{ {
//Crea la consulta //Crea la consulta
var consulta = GetWhereClauseFromIds(quita); var consulta = GetWhereClauseFromIds(quita, fc.GetDefinition().GetObjectIDField());
if (String.IsNullOrEmpty(consulta)) if (String.IsNullOrEmpty(consulta))
return false; return false;
@ -1902,7 +2078,7 @@ namespace OliviaAddInPro.Helper
geom = f.GetShape(); geom = f.GetShape();
line = (ArcGIS.Core.Geometry.Polyline)geom; line = (ArcGIS.Core.Geometry.Polyline)geom;
longi_tot = line.Length; longi_tot = line.Length;
geom = IntersectGeom(geom_zon, line, GeometryDimension.esriGeometry1Dimension); geom = IntersectGeom(geom_zon, line, GeometryDimensionType.EsriGeometry1Dimension);//GeometryDimension.esriGeometry1Dimension);
line = (ArcGIS.Core.Geometry.Polyline)geom; line = (ArcGIS.Core.Geometry.Polyline)geom;
longi_zon = line.Length;//se consigue la longitud de ámbito (linea) que interseca con el nivel) longi_zon = line.Length;//se consigue la longitud de ámbito (linea) que interseca con el nivel)
if ((longi_zon / longi_tot) < porc) if ((longi_zon / longi_tot) < porc)
@ -1957,7 +2133,7 @@ namespace OliviaAddInPro.Helper
MapView.Active.Map.RemoveLayer(lyr); MapView.Active.Map.RemoveLayer(lyr);
return true; return true;
} }
catch (Exception ex) catch/*(Exception ex)*/
{ {
return false; return false;
} }
@ -2005,18 +2181,19 @@ namespace OliviaAddInPro.Helper
if (!string.IsNullOrEmpty(ext_)) if (!string.IsNullOrEmpty(ext_))
dlg.DefaultExt = ext_; dlg.DefaultExt = ext_;
if (brwsFilt != null) if (brwsFilt != null)
{
brwsFilt.BrowsingFilesMode = true;
dlg.BrowseFilter = brwsFilt; dlg.BrowseFilter = brwsFilt;
}
try try
{ {
bool? ok = dlg.ShowDialog(); bool? ok = dlg.ShowDialog();
if ((ok ?? true) && dlg.FilePath.Length > 0) if ((ok ?? true) && dlg.FilePath.Length > 0)
return dlg.FilePath; return dlg.FilePath;
else else
return string.Empty; return string.Empty;
} }
catch(Exception ex) catch/*(Exception ex)*/
{ {
return string.Empty; return string.Empty;
} }
@ -2027,6 +2204,17 @@ namespace OliviaAddInPro.Helper
*/ */
public static string FolderBrowseDlg(string title_, string initloc_) public static string FolderBrowseDlg(string title_, string initloc_)
{ {
var openFileDialog = new CommonOpenFileDialog();
//{ IsFolderPicker = true };
if(!String.IsNullOrEmpty(initloc_))
openFileDialog.InitialDirectory = initloc_;
openFileDialog.IsFolderPicker = true;
//openFileDialog.InitialDirectory = initloc_;
openFileDialog.Title = title_;
//openFileDialog.Filter = "Folders";
//if (openFileDialog.ShowDialog() == true)
if (openFileDialog.ShowDialog() == CommonFileDialogResult.Ok)
return openFileDialog.FileName;
return null; return null;
} }
@ -2088,11 +2276,12 @@ namespace OliviaAddInPro.Helper
try try
{ {
FeatureDatasetDefinition featureDatasetDefinition = gdb.GetDefinition<FeatureDatasetDefinition>(datasetName); FeatureDatasetDefinition featureDatasetDefinition = gdb.GetDefinition<FeatureDatasetDefinition>(datasetName);
if(featureDatasetDefinition.GetSpatialReference().Equals(spatref)) ArcGIS.Core.Geometry.SpatialReference entr = featureDatasetDefinition.GetSpatialReference();
if (entr.Wkid==spatref.Wkid)
return 0; return 0;
return 2; return 2;
} }
catch (Exception ex) catch /*(Exception ex)*/
{ {
return 1; return 1;
} }
@ -2101,7 +2290,10 @@ namespace OliviaAddInPro.Helper
/** /**
* Crea un FeatureDataset con el nombre dado y la spatialrefernece dada en la gdb dada * Crea un FeatureDataset con el nombre dado y la spatialrefernece dada en la gdb dada
* Devuelve 0 si no hay que crear nada o si lo ha creado bien, 2 si existe el dataset pero con otra referencia espacial, 1 si da error * Devuelve 0 si no hay que crear nada, existe y coincide ref espac
* 2 si existe el dataset pero con otra referencia espacial, así que se crea otro
* 1 si da error
* 4 si no existe así que se crea
*/ */
public static Respuesta<int> CreateDataset(string gdbPath, string datasetName, ArcGIS.Core.Geometry.SpatialReference spatref, out string datasetNameOut) public static Respuesta<int> CreateDataset(string gdbPath, string datasetName, ArcGIS.Core.Geometry.SpatialReference spatref, out string datasetNameOut)
{ {
@ -2119,10 +2311,11 @@ namespace OliviaAddInPro.Helper
return res; return res;
} }
//comprueba si extiste ya el dataset //comprueba si extiste ya el dataset
bool repite = false; //bool repite = false;
bool crea = false; //bool crea = false;
int idat = 1; int idat = 1;
int r = 2; int r = 2;
bool refspatdif = false;
while(r==2) while(r==2)
{ {
var task1 = CheckDataset(gdb, datasetName); var task1 = CheckDataset(gdb, datasetName);
@ -2140,7 +2333,8 @@ namespace OliviaAddInPro.Helper
{ {
//existe ese nombre, pero con otra ref espacial //existe ese nombre, pero con otra ref espacial
//crea un nuevo dataset y avisa //crea un nuevo dataset y avisa
datasetName = string.Format("{0}_{1}",datasetName,idat); datasetName = string.Format("{0}_{1}",datasetName,idat);
refspatdif = true;
idat++; idat++;
} }
else//r==1 else//r==1
@ -2186,10 +2380,11 @@ namespace OliviaAddInPro.Helper
task.Wait(); task.Wait();
if (task.Result.Value)//ha ido bien if (task.Result.Value)//ha ido bien
{ {
if (string.IsNullOrEmpty(datasetNameOut)) //avisa
res.Value = 0; if (refspatdif)
res.Value = 2;
else else
res.Value = 2;//avisa res.Value = 4;
//actualiza la gdb //actualiza la gdb
Refresh(gdbPath); Refresh(gdbPath);
} }
@ -2217,7 +2412,7 @@ namespace OliviaAddInPro.Helper
/** /**
* Importa el shp en la gdb y el dataset, como una featureclass * Importa el shp en la gdb y el dataset, como una featureclass
*/ */
public static Respuesta<bool> ImportShp(string nom_shp, string Gdb_dataset, string namefc) public static Respuesta<bool> ImportShp(string nom_shp, string Gdb_dataset, string namefc, ArcGIS.Core.Geometry.SpatialReference spatref=null)
{ {
var res = new Respuesta<bool> { Value = false }; var res = new Respuesta<bool> { Value = false };
string[] args = { nom_shp, Gdb_dataset, namefc }; string[] args = { nom_shp, Gdb_dataset, namefc };
@ -2225,11 +2420,12 @@ namespace OliviaAddInPro.Helper
try try
{ {
ArcGIS.Core.Geometry.SpatialReference spatref = GetSpatRef(nom_shp); if(spatref==null)
spatref = GetSpatRef(nom_shp);
var environments = Geoprocessing.MakeEnvironmentArray(outputCoordinateSystem: spatref); var environments = Geoprocessing.MakeEnvironmentArray(outputCoordinateSystem: spatref);
//CancelableProgressorSource cps = new CancelableProgressorSource(); //CancelableProgressorSource cps = new CancelableProgressorSource();
var _cts = new System.Threading.CancellationTokenSource(); var _cts = new System.Threading.CancellationTokenSource();
var completa = false; //var completa = false;
var gpres = Geoprocessing.ExecuteToolAsync("FeatureClassToFeatureClass_conversion", args, environments, _cts.Token, var gpres = Geoprocessing.ExecuteToolAsync("FeatureClassToFeatureClass_conversion", args, environments, _cts.Token,
(event_name, o) => // implement delegate and handle events (event_name, o) => // implement delegate and handle events
{ {
@ -2301,6 +2497,7 @@ namespace OliviaAddInPro.Helper
msg = e.Message; msg = e.Message;
}*/ }*/
res.Value = true; res.Value = true;
gpres.Dispose();
//actualiza la gdb //actualiza la gdb
Refresh(System.IO.Path.GetDirectoryName(Gdb_dataset)); Refresh(System.IO.Path.GetDirectoryName(Gdb_dataset));
return res; return res;
@ -2314,17 +2511,73 @@ namespace OliviaAddInPro.Helper
/** /**
* Borrar una feature class de un dataset * Borrar una feature class de un dataset
* Devuelve -1 si da error al abrir la gdb, -2 si da error al abrir el ftclass (igual porque no existe)
* y 0 si da error el proceso de borrar, y 1 si va todo bien
*/ */
public static Respuesta<bool> DeleteFeatureClass(string gdbPath, string featureClassPath) public static Respuesta<int> DeleteFeatureClassSync(string gdbPathDataset, string featureClassName)
{
var res = new Respuesta<int> { Value = 0 };
Geodatabase gdb = GetGdbSync(gdbPathDataset);
if (gdb == null)
{
res.Value = -1;
return res;
}
FeatureClass ftclss = GetFtClassSync(gdbPathDataset + " \\"+ featureClassName);
if (ftclss == null)
{
res.Value = -2;
return res;
}
Respuesta<bool> resp = new Respuesta<bool> { Value = false };
SchemaBuilder schemaBuilder = null;
try
{
// Create a FeatureClassDescription object
FeatureClassDescription featureClassDescription = new FeatureClassDescription(ftclss.GetDefinition());
// Create a SchemaBuilder object
schemaBuilder = new SchemaBuilder(gdb);
// Add the deletion fo the feature class to our list of DDL tasks
schemaBuilder.Delete(featureClassDescription);
// Execute the DDL
resp.Value = schemaBuilder.Build();
if (!resp.Value && schemaBuilder.ErrorMessages.Count > 0)
resp.Error.Add(schemaBuilder.ErrorMessages.FirstOrDefault());
}
catch
{
resp.Error.Add(schemaBuilder.ErrorMessages.FirstOrDefault());
}
if (resp.Value)
res.Value = 1;
else
{
res.Error.Add(resp.Error.FirstOrDefault());
}
Free(gdb);
Free(ftclss);
return res;
}
/**
* Borrar una feature class de un dataset
*/
public static Respuesta<bool> DeleteFeatureClass(string gdbPathDataset, string featureClassName)
{ {
var res = new Respuesta<bool> { Value = false }; var res = new Respuesta<bool> { Value = false };
FeatureClass ftclss = GetFtClass(featureClassPath);
if (ftclss == null) Geodatabase gdb = GetGdb(gdbPathDataset).Result;
return res;
Geodatabase gdb = GetGdb(gdbPath).Result;
if (gdb == null) if (gdb == null)
return res; return res;
FeatureClass ftclss = GetFtClass(gdbPathDataset + " \\" + featureClassName);
if (ftclss == null)
return res;
var task = ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run((Func<Respuesta<bool>>)(() => var task = ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run((Func<Respuesta<bool>>)(() =>
{ {
Respuesta<bool> resp = new Respuesta<bool> { Value = false }; Respuesta<bool> resp = new Respuesta<bool> { Value = false };
@ -2462,7 +2715,8 @@ namespace OliviaAddInPro.Helper
//{ //{
try try
{ {
String[] fields = new string[] { field }; //field to be used to retrieve unique values List<String> fields = new List<string>();
fields.Add(field);
UniqueValueRendererDefinition uniqueValueRendererDef; UniqueValueRendererDefinition uniqueValueRendererDef;
CIMSymbolReference symbolTemplate=new CIMSymbolReference(); CIMSymbolReference symbolTemplate=new CIMSymbolReference();
if (tipo == GeometryType.Point)//puntual if (tipo == GeometryType.Point)//puntual
@ -2486,7 +2740,7 @@ namespace OliviaAddInPro.Helper
featureLayer.SetRenderer(uniqueValueRenderer); featureLayer.SetRenderer(uniqueValueRenderer);
} }
catch (Exception ex) catch /*(Exception ex)*/
{ {
} }
@ -2518,7 +2772,9 @@ namespace OliviaAddInPro.Helper
try try
{ {
var gpres = Geoprocessing.ExecuteToolAsync("management.AlterField", args); var gpres = Geoprocessing.ExecuteToolAsync("management.AlterField", args);
if (gpres.Result.IsFailed) while (!gpres.IsCompleted && !gpres.IsCanceled && !gpres.IsFaulted)
Thread.Sleep(10);
if (!gpres.IsCompletedSuccessfully)
{ {
var gpResult = gpres.Result; var gpResult = gpres.Result;
string msg; string msg;
@ -2529,6 +2785,7 @@ namespace OliviaAddInPro.Helper
} }
else else
res= true; //ha ido bien res= true; //ha ido bien
gpres.Dispose();
return res; return res;
} }
catch catch
@ -2555,7 +2812,7 @@ namespace OliviaAddInPro.Helper
/* /*
* Renombra un campo de la feature class dada * Renombra un campo de la feature class dada
*/ */
public static bool AddFieldsSync(string fcname, FieldToAdd[] fields) public static bool AddFieldsSync(string fcname, FieldToAdd[] fields)
{ {
bool res = false; bool res = false;
@ -2595,7 +2852,9 @@ namespace OliviaAddInPro.Helper
try try
{ {
var gpres = Geoprocessing.ExecuteToolAsync("management.AddFields", args); var gpres = Geoprocessing.ExecuteToolAsync("management.AddFields", args);
if (gpres.Result.IsFailed) while (!gpres.IsCompleted && !gpres.IsCanceled && !gpres.IsFaulted)
Thread.Sleep(10);
if (gpres.IsFaulted)
{ {
var gpResult = gpres.Result; var gpResult = gpres.Result;
string msg; string msg;
@ -2606,6 +2865,70 @@ namespace OliviaAddInPro.Helper
} }
else else
res = true; //ha ido bien res = true; //ha ido bien
gpres.Dispose();
return res;
}
catch
{
}
return res;
}
public static bool ExplodeAll(string pahtFc)
{
/*
var ft = GetFtClassSync(pahtFc);
var ids=ft.Select(new ArcGIS.Core.Data.QueryFilter() { WhereClause = "true" }, SelectionType.ObjectID, SelectionOption.Normal).GetObjectIDs().ToList();
var explodeFeatures = new EditOperation();
explodeFeatures.Name = "Explode Features";
//Take a multipart and convert it into one feature per part
//Provide a list of ids to convert multiple
explodeFeatures.Explode(ft, ids, true);
//Execute to execute the operation
//Must be called within QueuedTask.Run
if (!explodeFeatures.IsEmpty)
{
var result = explodeFeatures.Execute(); //Execute and ExecuteAsync will return true if the operation was successful and false if not
}
return true;
//or use async flavor
//await explodeFeatures.ExecuteAsync();
*/
return true;
}
/*
* Añadir columna calculada
*/
public static bool CalculateFieldsSync(string fcname, string field, string sqlquery)
{
bool res = false;
var args = Geoprocessing.MakeValueArray(fcname, field, sqlquery, "ARCADE");
// run the tool
try
{
var gpres = Geoprocessing.ExecuteToolAsync("management.CalculateField", args);
while (!gpres.IsCompleted && !gpres.IsCanceled && !gpres.IsFaulted)
Thread.Sleep(10);
if (gpres.IsFaulted)
{
var gpResult = gpres.Result;
string msg;
if (gpResult.ErrorMessages != null)
msg = gpResult.ErrorMessages.First().Text;
else
msg = "Errores al calcular campo "+ field;
}
else
{
res = true; //ha ido bien
}
gpres.Dispose();
return res; return res;
} }
catch catch

View File

@ -0,0 +1,16 @@
<!DOCTYPE html >
<html>
<head />
<body>
<h2>Migration Status Report</h2>
<p>Migrate project: D:\desa\v2019\OliviaAddInPro\OliviaAddInPro.csproj</p>
<h3>OliviaAddInPro.csproj</h3>
<ul>project folder: <a href="D:\desa\v2019\OliviaAddInPro\" target="_new">D:\desa\v2019\OliviaAddInPro\</a></ul>
<ul>language: CS</ul>
<p style="color:Red;font-weight:bold">Warning: this project [D:\desa\v2019\OliviaAddInPro\] contains References to 'ArcGIS.Core', but the HintPath tag is wrong or missing. Use the 'Pro Fix References utility' before migrating this project.</p>
<ul>project type: NonArcGIS</ul>
<ul>project has WPF: PresentationFramework</ul>
<p style="color:Red;font-weight:bold">Note: project might contain NuGets in packages.config, please check all NuGets for the most up-to-date .NET variant and if needed, replace with a NuGet that supports .NET 6.</p>
<p style="color:Red;font-weight:bold">Note: please check all NuGets for the most up-to-date .NET variant and if needed, replace with a NuGet that supports .NET 6.</p>
</body>
</html>

View File

@ -0,0 +1,12 @@
Migration Status Report
Migrate project: D:\desa\v2019\OliviaAddInPro\OliviaAddInPro.csproj
OliviaAddInPro.csproj
project folder:
D:\desa\v2019\OliviaAddInPro\
D:\desa\v2019\OliviaAddInPro\
language: CS
Warning: this project [D:\desa\v2019\OliviaAddInPro\] contains References to 'ArcGIS.Core', but the HintPath tag is wrong or missing. Use the 'Pro Fix References utility' before migrating this project.
project type: NonArcGIS
project has WPF: PresentationFramework
Note: project might contain NuGets in packages.config, please check all NuGets for the most up-to-date .NET variant and if needed, replace with a NuGet that supports .NET 6.
Note: please check all NuGets for the most up-to-date .NET variant and if needed, replace with a NuGet that supports .NET 6.

View File

@ -10,18 +10,28 @@ namespace OliviaAddInPro.Model
//************************************************************************************* //*************************************************************************************
//Enums y structs generales //Enums y structs generales
public static int BuffExport = 1000; public static int BuffExport = 1000;
//public static int MaxCaracteresBBDD = 10;
//public static int MaxCaracteresBBDD = 10;
public static OliviaConfMV configMV; //configuracion para modos de viaje
/** /**
* Nombre de los campos de la cartografía de la red navegable que se consultan para la exportación * Nombre de los campos de la cartografía de la red navegable que se consultan para la exportación
*/ */
public struct CamposNW public struct CamposNW
{ {
public static string cons_onew; //<Campo que indica el sentido public static string cons_onewFT="_sen_ft"; //<Campo que indica el sentido
public static string cons_kph; //<Campo que indica la velocidad en kph public static string cons_onewTF="_sen_tf"; //<Campo que indica el sentido
public static string cons_name; //<Campo que indica el nombre de la calle
public static string cons_fow; //Campo que indica el tipo de vial, si es peatonal o no public static string cons_kph="_vel"; //<Campo que indica la velocidad en kph
public static string cons_name="_dir"; //<Campo que indica el nombre de la calle
public static string cons_fow="_pea"; //Campo que indica el tipo de vial, si es peatonal o no
public static string cons_evit = "_evita"; //Campo que indica si el vial es evitable
public static string cons_ele_f = "_elev_f"; //altura from
public static string cons_ele_t = "_elev_t"; //altura to
public static string cons_angulo = "_angulo"; //altura to
public static OliviaConfNW config; //configuracion para sacar capmos por defecto
}; };
/** /**
* Nombre de los Atributos de la cartografía de la red navegable que se consultan para la exportación * Nombre de los Atributos de la cartografía de la red navegable que se consultan para la exportación
*/ */
@ -33,5 +43,18 @@ namespace OliviaAddInPro.Model
public static string atr_pedes; //<Atributo del campo FOW que indica peatonal public static string atr_pedes; //<Atributo del campo FOW que indica peatonal
}; };
/**
* Campos comunes a la capa de entidades
*/
public struct CamposCom
{
public static string camp_oid; //<Campo de la tabla de entidades que indica el objectid
public static string consulta_sector; //<Campo de la tabla donde se guarda info de sector
public static string consulta_secuen; //<Campo de la tabla donde se guarda info de secuencia
public static double giro_max;
public static double desv_max;
public static double desv_max_abs;
}
} }
} }

View File

@ -65,6 +65,9 @@ namespace OliviaAddInPro.Model
Respuesta<bool> res = new Respuesta<bool> { Value=false}; Respuesta<bool> res = new Respuesta<bool> { Value=false};
Respuesta<TiposEjecucion> res2 = new Respuesta<TiposEjecucion> (){ Value = TiposEjecucion.FinEjecNOk }; Respuesta<TiposEjecucion> res2 = new Respuesta<TiposEjecucion> (){ Value = TiposEjecucion.FinEjecNOk };
Serv.TipoMv = TipoMV;
res = Serv.Ejecuta(modo); res = Serv.Ejecuta(modo);
if (res.Value) if (res.Value)
{ {

View File

@ -37,8 +37,6 @@ namespace OliviaAddInPro.Model
public static string consulta_observ; //<Campo a consultar de la capa de limpieza, observaciones public static string consulta_observ; //<Campo a consultar de la capa de limpieza, observaciones
public static string consulta_anch_tip; //<Campo a consultar de la capa de limpieza, ancho tipo public static string consulta_anch_tip; //<Campo a consultar de la capa de limpieza, ancho tipo
public static string consulta_tipolo; //<Campo a consultar de la capa de limpieza, tipología public static string consulta_tipolo; //<Campo a consultar de la capa de limpieza, tipología
public static string consulta_sector; //<Campo a consultar de la capa planificada, sector
public static string consulta_secuen; //<Campo a consultar de la capa planificada, planificacion
}; };
/** /**
* Nombre de los atributos (de las capas) sobre los que se realizarán consultas para la limpieza * Nombre de los atributos (de las capas) sobre los que se realizarán consultas para la limpieza
@ -137,15 +135,12 @@ namespace OliviaAddInPro.Model
public static double umbral_reco; //<Umbral de llenado para la recogida de contenedores public static double umbral_reco; //<Umbral de llenado para la recogida de contenedores
}; };
public struct OtrosParam public struct OtrosParam
{ {
public static double giro_max;
public static double anch_peat; public static double anch_peat;
public static double anch_ace; public static double anch_ace;
public static double anch_aplin; public static double anch_aplin;
public static double anch_apbat; public static double anch_apbat;
public static double anch_bordlib; public static double anch_bordlib;
public static double desv_max;
public static double desv_max_abs;
}; };
//************************************************************************************* //*************************************************************************************
//Enums globales limpieza //Enums globales limpieza

View File

@ -11,9 +11,12 @@ using System.Windows;
using Xceed.Wpf.Toolkit.PropertyGrid; using Xceed.Wpf.Toolkit.PropertyGrid;
using Xceed.Wpf.Toolkit.PropertyGrid.Editors; using Xceed.Wpf.Toolkit.PropertyGrid.Editors;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes; using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
using static OliviaAddInPro.Model.OliviaConf;
namespace OliviaAddInPro.Model namespace OliviaAddInPro.Model
{ {
[CategoryOrder("General", 1)] [CategoryOrder("General", 1)]
[CategoryOrder("Campos Limpieza", 2)] [CategoryOrder("Campos Limpieza", 2)]
[CategoryOrder("Atributos Limpieza", 3)] [CategoryOrder("Atributos Limpieza", 3)]
@ -44,12 +47,30 @@ namespace OliviaAddInPro.Model
[Description("Usa 'Kg por Defecto'")] [Description("Usa 'Kg por Defecto'")]
UsaKgDef UsaKgDef
} }
[TypeConverter(typeof(EnumOpsNWToString))]
public enum OpsNW
{
nw_0, //TomTom
nw_1, //Streetmap
nw_2, //
nw_3,
nw_4,
}
private string m2s(int min) private string m2s(int min)
{ {
var val = min; var val = min;
int horas = val / 60; int horas = val / 60;
return string.Format("{0}:{1:D2}", horas, val - (horas * 60)); return string.Format("{0}:{1:D2}", horas, val - (horas * 60));
} }
public OliviaConfNW GetOliviaConfNW()
{
int i = (int)Tipo_eje_via;
if (ListaNw != null && ListaNw.Count() > i)
return ListaNw[i];
return null;
}
private int s2m(string str, int defec) private int s2m(string str, int defec)
{ {
var match = Regex.Match(str, @"^([0-9]*):([0-9]*)"); var match = Regex.Match(str, @"^([0-9]*):([0-9]*)");
@ -66,16 +87,20 @@ namespace OliviaAddInPro.Model
} }
return defec; return defec;
} }
public OliviaConf() public OliviaConf()
{ {
Ip = "0.0.0.0"; Ip = "127.0.0.1";
Puerto = 19995; Puerto = 19995;
TiempoOutSocket = 20; TiempoOutSocket = 20;
}
}
#region PropiedadesOcultas #region PropiedadesOcultas
#region parametrosConexion #region parametrosConexion
/**
* Version de las configuraciones
*/
[Browsable(false)]
public string Version { get; set; }
/** /**
* IP donde va a realizar la conexión a OliviaTask, se inicializa al arrancar con la local * IP donde va a realizar la conexión a OliviaTask, se inicializa al arrancar con la local
*/ */
@ -174,7 +199,10 @@ namespace OliviaAddInPro.Model
#endregion #endregion
#region ParametrosReco_Ocultos #region ParametrosReco_Ocultos
[Browsable(false)]
public List<OliviaConfNW> ListaNw { get; set; }
[Browsable(false)]
public List<OliviaConfMV> ListaMV { get; set; }
[Browsable(false)] [Browsable(false)]
public int t_vaciado_max { get; set; } public int t_vaciado_max { get; set; }
[Browsable(false)] [Browsable(false)]
@ -217,7 +245,20 @@ namespace OliviaAddInPro.Model
[PropertyOrder(1)] [PropertyOrder(1)]
[Description("Red de carreteras que se usa para la navegación")] [Description("Red de carreteras que se usa para la navegación")]
[Editor(typeof(PropertyGridFilePickerLine), typeof(PropertyGridFilePickerLine))] [Editor(typeof(PropertyGridFilePickerLine), typeof(PropertyGridFilePickerLine))]
public string Path_Eje_via { get; set; } public string Path_Eje_via { get; set; }
[Category("General")]
[DisplayName("Conjunciones red de carreteras")]
[PropertyOrder(1)]
[Description("Conjunciones red de carreteras que se usa para la navegación")]
[Editor(typeof(PropertyGridFilePickerPto), typeof(PropertyGridFilePickerPto))]
public string Path_Conj_Eje_via { get; set; }
[Category("General")]
[DisplayName("Tipo Red de carreteras")]
[PropertyOrder(1)]
[Description("Tipo de Red de carreteras que se usa para la navegación")]
[RefreshProperties(System.ComponentModel.RefreshProperties.All)]
//[Editor(typeof(PropertyGridFilePickerLine), typeof(PropertyGridFilePickerLine))]
public OpsNW Tipo_eje_via { get; set; }
[Category("General")] [Category("General")]
[PropertyOrder(2)] [PropertyOrder(2)]
@ -239,14 +280,14 @@ namespace OliviaAddInPro.Model
[Category("General")] [Category("General")]
[PropertyOrder(5)] [PropertyOrder(5)]
[DisplayName("GDB para Importación")] [DisplayName("GDB para Resultados")]
[Description("Gdb en la que se importarán los resultados de la ejecución")] [Description("Gdb en la que se importarán los resultados de la ejecución")]
[Editor(typeof(PropertyGridFilePickerGDB), typeof(PropertyGridFilePickerGDB))] [Editor(typeof(PropertyGridFilePickerGDB), typeof(PropertyGridFilePickerGDB))]
public string Path_Gdb_Import { get; set; } public string Path_Gdb_Import { get; set; }
[Category("General")] [Category("General")]
[PropertyOrder(6)] [PropertyOrder(6)]
[DisplayName("Dataset para Importación")] [DisplayName("Dataset para Resultados")]
[Description("Dataset, dentro de la GDB, en la que se importarán los resultados de la ejecución")] [Description("Dataset, dentro de la GDB, en la que se importarán los resultados de la ejecución")]
[Editor(typeof(PropertyGridFilePickerDataset), typeof(PropertyGridFilePickerDataset))] [Editor(typeof(PropertyGridFilePickerDataset), typeof(PropertyGridFilePickerDataset))]
public string Path_Dataset_Import { get; set; } public string Path_Dataset_Import { get; set; }
@ -263,6 +304,12 @@ namespace OliviaAddInPro.Model
[DisplayName("Ignorar aislados")] [DisplayName("Ignorar aislados")]
[Description("Indica si por defecto se van a ignorar elementos aislados")] [Description("Indica si por defecto se van a ignorar elementos aislados")]
public bool Igno_ais { get; set; } public bool Igno_ais { get; set; }
[Category("General")]
[PropertyOrder(9)]
[DisplayName("Campo para exportar ID")]
[Description("Nombre del campo que indica el ID del ámbito")]
public string id { get; set; }
#endregion #endregion
#region 02CamposLimp #region 02CamposLimp
@ -378,11 +425,6 @@ namespace OliviaAddInPro.Model
#endregion #endregion
#region 04CamposRecogida #region 04CamposRecogida
[Category("Campos Recogida")]
[DisplayName("ID")]
[Description("Nombre del campo que indica el ID del contenedor")]
public string id { get; set; }
[Category("Campos Recogida")] [Category("Campos Recogida")]
[DisplayName("Tipo de carga")] [DisplayName("Tipo de carga")]
[Description("Nombre del campo que indica el tipo de carga")] [Description("Nombre del campo que indica el tipo de carga")]
@ -588,21 +630,25 @@ namespace OliviaAddInPro.Model
#endregion #endregion
#region 06CambosNW #region 06CambosNW
[Browsable(false)]
[Category("Campos Red Navegable")] [Category("Campos Red Navegable")]
[DisplayName("Sentido de la vía")] [DisplayName("Sentido de la vía")]
[Description("Nombre del campo que indica si la vía es de doble sentido o no")] [Description("Nombre del campo que indica si la vía es de doble sentido o no")]
public string cons_onew { get; set; } public string cons_onew { get; set; }
[Browsable(false)]
[Category("Campos Red Navegable")] [Category("Campos Red Navegable")]
[DisplayName("Velocidad de la vía")] [DisplayName("Velocidad de la vía")]
[Description("Nombre del campo que indica la velociad máxima permitida de la vía")] [Description("Nombre del campo que indica la velociad máxima permitida de la vía")]
public string cons_kph { get; set; } public string cons_kph { get; set; }
[Browsable(false)]
[Category("Campos Red Navegable")] [Category("Campos Red Navegable")]
[DisplayName("Tipo de vía")] [DisplayName("Tipo de vía")]
[Description("Nombre del campo que indica el tipo de la vía (usado para ver si es vía peatonal).")] [Description("Nombre del campo que indica el tipo de la vía (usado para ver si es vía peatonal).")]
public string cons_fow { get; set; } public string cons_fow { get; set; }
[Browsable(false)]
[Category("Campos Red Navegable")] [Category("Campos Red Navegable")]
[DisplayName("Nombre de la vía")] [DisplayName("Nombre de la vía")]
[Description("Nombre del campo que indica el nombre de la vía")] [Description("Nombre del campo que indica el nombre de la vía")]
@ -610,24 +656,28 @@ namespace OliviaAddInPro.Model
#endregion #endregion
#region 07AtrNw #region 07AtrNw
[Browsable(false)]
[Category("Atributos Red Navegable")] [Category("Atributos Red Navegable")]
[PropertyOrder(1)] [PropertyOrder(1)]
[DisplayName("To-From")] [DisplayName("To-From")]
[Description("Valor del campo 'Sentido de la vía' que indica sentido de la vía To-From")] [Description("Valor del campo 'Sentido de la vía' que indica sentido de la vía To-From")]
public string atr_TF { get; set; } public string atr_TF { get; set; }
[Browsable(false)]
[Category("Atributos Red Navegable")] [Category("Atributos Red Navegable")]
[PropertyOrder(2)] [PropertyOrder(2)]
[DisplayName("From-To")] [DisplayName("From-To")]
[Description("Valor del campo 'Sentido de la vía' que indica sentido de la vía From-To")] [Description("Valor del campo 'Sentido de la vía' que indica sentido de la vía From-To")]
public string atr_FT { get; set; } public string atr_FT { get; set; }
[Browsable(false)]
[Category("Atributos Red Navegable")] [Category("Atributos Red Navegable")]
[PropertyOrder(3)] [PropertyOrder(3)]
[DisplayName("Sin circulación")] [DisplayName("Sin circulación")]
[Description("Valor del campo 'Sentido de la vía' que indica no circulación")] [Description("Valor del campo 'Sentido de la vía' que indica no circulación")]
public string atr_N { get; set; } public string atr_N { get; set; }
[Browsable(false)]
[Category("Atributos Red Navegable")] [Category("Atributos Red Navegable")]
[PropertyOrder(4)] [PropertyOrder(4)]
[DisplayName("Peatonal")] [DisplayName("Peatonal")]
@ -1069,37 +1119,37 @@ namespace OliviaAddInPro.Model
#endregion #endregion
#region 12TiemposRecoAvanz #region 12TiemposRecoAvanz
[Category("Tiempos de Tratamiento Recogida (min) - Avanzadas")]//OCULTAR [Category("Tiempos de Tratamiento Recogida (seg) - Avanzadas")]//OCULTAR
[DisplayName("Carga Trasera")] [DisplayName("Carga Trasera")]
[Description("")] [Description("")]
public int t_vaci_trasera { get; set; } public int t_vaci_trasera { get; set; }
[Category("Tiempos de Tratamiento Recogida (min) - Avanzadas")]//OCULTAR [Category("Tiempos de Tratamiento Recogida (seg) - Avanzadas")]//OCULTAR
[DisplayName("Carga Lateral")] [DisplayName("Carga Lateral")]
[Description("")] [Description("")]
public int t_vaci_lateral { get; set; } public int t_vaci_lateral { get; set; }
[Category("Tiempos de Tratamiento Recogida (min) - Avanzadas")]//OCULTAR [Category("Tiempos de Tratamiento Recogida (seg) - Avanzadas")]//OCULTAR
[DisplayName("Carga superior")] [DisplayName("Carga superior")]
[Description("")] [Description("")]
public int t_vaci_superior { get; set; } public int t_vaci_superior { get; set; }
[Category("Tiempos de Tratamiento Recogida (min) - Avanzadas")]//OCULTAR [Category("Tiempos de Tratamiento Recogida (seg) - Avanzadas")]//OCULTAR
[DisplayName("Carga Bilateral")] [DisplayName("Carga Bilateral")]
[Description("")] [Description("")]
public int t_vaci_bilateral { get; set; } public int t_vaci_bilateral { get; set; }
[Category("Tiempos de Tratamiento Recogida (min) - Avanzadas")]//OCULTAR [Category("Tiempos de Tratamiento Recogida (seg) - Avanzadas")]//OCULTAR
[DisplayName("Bolseo")] [DisplayName("Bolseo")]
[Description("")] [Description("")]
public int t_vaci_bolseo { get; set; } public int t_vaci_bolseo { get; set; }
[Category("Tiempos de Tratamiento Recogida (min) - Avanzadas")]//OCULTAR [Category("Tiempos de Tratamiento Recogida (seg) - Avanzadas")]//OCULTAR
[DisplayName("Lavado")] [DisplayName("Lavado")]
[Description("")] [Description("")]
public int t_vaci_lavado { get; set; } public int t_vaci_lavado { get; set; }
[Category("Tiempos de Tratamiento Recogida (min) - Avanzadas")]//OCULTAR [Category("Tiempos de Tratamiento Recogida (seg) - Avanzadas")]//OCULTAR
[DisplayName("Otro tipo de carga")] [DisplayName("Otro tipo de carga")]
[Description("")] [Description("")]
public int t_vaci_otra { get; set; } public int t_vaci_otra { get; set; }
@ -1326,9 +1376,55 @@ namespace OliviaAddInPro.Model
public string atr_suelo { get; set; } public string atr_suelo { get; set; }
#endregion #endregion
}
public class EnumOpsNWToString : TypeConverter
{
public static List<OliviaConfNW> ListaNw { get; set; }
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
return (sourceType.Equals(typeof(OpsNW)));
}
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
return (destinationType.Equals(typeof(String)));
}
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
return base.ConvertFrom(context, culture, value);
}
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (!destinationType.Equals(typeof(String)))
{
throw new ArgumentException("Can only convert to string.", "destinationType");
}
if (!value.GetType().Equals(typeof(OpsNW)))
{
throw new ArgumentException("Can only convert an instance of enum.", "value");
}
int i = 0;
if (int.TryParse(value.ToString().Substring(3), out i) && ListaNw != null && i < ListaNw.Count())
{
var aux = ListaNw[i];
if (aux == null)
return "";
else
return aux.nombre;
}
return "";
}
} }
public class EnumToStringUsingDescription : TypeConverter public class EnumToStringUsingDescription : TypeConverter
{ {
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{ {
return (sourceType.Equals(typeof(Enum))); return (sourceType.Equals(typeof(Enum)));

30
Model/OliviaConfMV.cs Normal file
View File

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace OliviaAddInPro.Model
{
[Serializable]
public class OliviaConfMV
{
public OliviaConfMV()
{
nombre = "default";
filtro_omitir = "";
campo_prioridad = "0";
vehiculo_def_reco = -1;
vehiculo_def_lim = -1;
}
public string nombre { get; set; }
public string filtro_omitir { get; set; }
public string campo_prioridad { get; set; }
public int vehiculo_def_reco { get; set; }
public int vehiculo_def_lim { get; set; }
}
}

31
Model/OliviaConfNW.cs Normal file
View File

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace OliviaAddInPro.Model
{
[Serializable]
public class OliviaConfNW
{
public OliviaConfNW()
{
}
public string nombre { get; set; }
public string campo_velocidad { get; set; }
public string campo_nombre { get; set; }
public string campo_sentidoFT { get; set; }
public string campo_sentidoTf { get; set; }
public string campo_peatonal { get; set; }
public string campo_elevacion_to { get; set; }
public string campo_elevacion_from { get; set; }
public bool comprueba_elevacion { get; set; }
public bool revisa_topologia { get; set; }
public bool revisa_conjunciones { get; set; }
public bool revisa_angulos { get; set; }
public string campo_angulos { get; set; }
}
}

View File

@ -51,8 +51,8 @@ namespace OliviaAddInPro.Model
public const int ProgrMax = 100; public const int ProgrMax = 100;
public const int ProgrStep = 5; public const int ProgrStep = 5;
public const int ParamN = 5; public const int ParamN = 5;
public const int ParamLimpN = 45; public const int ParamLimpN = 52;
public const int ParamRecoN = 43; public const int ParamRecoN = 50;
/* /*
* Define el separador entre parámetros de la llamada al proceso oliviatasks * Define el separador entre parámetros de la llamada al proceso oliviatasks
*/ */
@ -60,7 +60,6 @@ namespace OliviaAddInPro.Model
public const string EjecGeoProgName = "olivia"; public const string EjecGeoProgName = "olivia";
public const string EjecGeoParamIgual = ":"; public const string EjecGeoParamIgual = ":";
public const string NombOlvTasks = "OliviaTasks"; public const string NombOlvTasks = "OliviaTasks";
public const string NombColSector = "SECTOR";
/** /**
* Define el nombre del grupo de propiedades generales * Define el nombre del grupo de propiedades generales
*/ */
@ -143,6 +142,7 @@ namespace OliviaAddInPro.Model
public const string GG_pt = "path_temp"; public const string GG_pt = "path_temp";
public const string GG_pd = "path_data"; public const string GG_pd = "path_data";
public const string GG_pn = "path_nw"; public const string GG_pn = "path_nw";
public const string GG_pnj = "path_cnw";
public const string GG_pcar = "path_cart"; public const string GG_pcar = "path_cart";
public const string GG_pcfg = "path_cfgeo"; public const string GG_pcfg = "path_cfgeo";
public const string GG_strtto = "str_tto"; public const string GG_strtto = "str_tto";
@ -161,7 +161,10 @@ namespace OliviaAddInPro.Model
public const string GG_hini = "h_inicio"; public const string GG_hini = "h_inicio";
public const string GG_trafic = "trafico"; public const string GG_trafic = "trafico";
public const string GG_ais = "aislados"; public const string GG_ais = "aislados";
public const string GG_elev = "elevacion";
public const string GG_topo = "reviTopo";
public const string GG_conj = "reviConj";
public const string GG_angu = "reviAng";
/** /**
* Define las propiedades de limpieza a enviar a oliviatasks * Define las propiedades de limpieza a enviar a oliviatasks
*/ */
@ -531,6 +534,15 @@ namespace OliviaAddInPro.Model
public const string GTO_girmax = "Giro_max_vehiculo"; public const string GTO_girmax = "Giro_max_vehiculo";
public const string GTO_desv_max = "Desv_max_rel"; public const string GTO_desv_max = "Desv_max_rel";
public const string GTO_desv_max_abs = "Desv_max_abs"; public const string GTO_desv_max_abs = "Desv_max_abs";
public const string GTO_camp_objectid = "Camp_objectid";
public const string GTO_camp_sector = "Camp_sector";
public const string GTO_camp_secuencia = "Camp_secuencia";
//mima
public const string GTO_mima_xmin = "Coor_mima_xmin";
public const string GTO_mima_xmax = "Coor_mima_xmax";
public const string GTO_mima_ymin = "Coor_mima_ymin";
public const string GTO_mima_ymax = "Coor_mima_ymax";
/** /**
* Define el nombre para mandar a oliviatasks la configuración * Define el nombre para mandar a oliviatasks la configuración
*/ */
@ -590,7 +602,17 @@ namespace OliviaAddInPro.Model
/** /**
* Define el nombre para mandar a oliviatasks la configuración para planificación, ya se ha hecho sectorización * Define el nombre para mandar a oliviatasks la configuración para planificación, ya se ha hecho sectorización
*/ */
public const string SockConfTodo = "CONFIG_TODO"; public const string SockConfTodo = "CONFIG_TODO";
//atributos network por defecto------------------------------------------------------------------------------
public const string cons_camp_sentido_tf = "_sen_ft"; //<Campo que indica el sentido 0 1
public const string cons_camp_sentido_ft = "_sen_tf"; //<Campo que indica el sentido 0 1
public const string cons__camp_vel= "_vel"; //<Campo que indica la velocidad en kph
public const string cons_name="_nom"; //<Campo que indica el nombre de la calle
public const string cons_peat="_peat"; //Campo que indica el tipo de vial, si es peatonal o no
public const string cons_ev = "_ev"; //Campo que indica si hay que intentar evitar o no (0-1)
//-----------------------------------------------------------------------------------------------------------
//************************************************************************************* //*************************************************************************************
} }
} }

View File

@ -51,10 +51,12 @@ namespace OliviaAddInPro.Model
public static string DirData; //<Dir donde están los shapefiles data y nw public static string DirData; //<Dir donde están los shapefiles data y nw
public static string PathData; //<Path del shp con datos a planificar, ya filtrados e intersecados con las zonas y niveles public static string PathData; //<Path del shp con datos a planificar, ya filtrados e intersecados con las zonas y niveles
public static string PathNW; //<Path del shp con la red navegable public static string PathNW; //<Path del shp con la red navegable
public static string PathNW_c; //<Path del shp con las conjunciones de la red navegable
//paths GDBs //paths GDBs
public static string PathGdbGen; //<Path de la gdb general de la que se extraen los datos de interés public static string PathGdbGen; //<Path de la gdb general de la que se extraen los datos de interés
public static string PathGdbNw; //<Path de la gdb referente a la red de carreteras de TOMTOM public static string PathGdbNw; //<Path de la gdb referente a la red de carreteras de
public static string PathGdbNw_conj; //<Path de la gdb referente a las conjunciones de la red de carreteras
public static string PathSimbVSM; //<Path de la galeria de estilos aplicada por VSM public static string PathSimbVSM; //<Path de la galeria de estilos aplicada por VSM
public static string PathSimbESRI; //<Path de la galeria de estilos de ESRI public static string PathSimbESRI; //<Path de la galeria de estilos de ESRI
@ -84,8 +86,8 @@ namespace OliviaAddInPro.Model
public struct Capas public struct Capas
{ {
public static string pathEjeVia; public static string pathEjeVia;
public static string ftclass_ejes; //<Nombre de la capa de ejes de carretera //public static string ftclass_ejes; //<Nombre de la capa de ejes de carretera
public static string ftclass_muni; //<Nombre de la capa de municipios de TOMTOM //public static string ftclass_muni; //<Nombre de la capa de municipios de TOMTOM
}; };
private static TiposEjecucion tipoEjec; private static TiposEjecucion tipoEjec;
public static Limpieza limp; public static Limpieza limp;
@ -272,15 +274,17 @@ namespace OliviaAddInPro.Model
ArcGIS.Core.Data.FeatureClass ft = HelperGdb.GetFtClass(OliviaGlob.Paths.PathGdbNw); ArcGIS.Core.Data.FeatureClass ft = HelperGdb.GetFtClass(OliviaGlob.Paths.PathGdbNw);
if (ft == null) if (ft == null)
return false; return false;
HelperGdb.Free(ft);
int NCAMPS = 4; /*int NCAMPS = 5;
string[] camps; string[] camps;
camps = new string[NCAMPS]; camps = new string[NCAMPS];
camps[0] = ComunDef.CamposNW.cons_onew; camps[0] = ComunDef.CamposNW.cons_onewFT;
camps[1] = ComunDef.CamposNW.cons_kph; camps[1] = ComunDef.CamposNW.cons_onewTF;
camps[2] = ComunDef.CamposNW.cons_name; camps[2] = ComunDef.CamposNW.cons_kph;
camps[3] = ComunDef.CamposNW.cons_fow; camps[3] = ComunDef.CamposNW.cons_name;
return HelperGdb.CheckFileds(OliviaGlob.Paths.PathGdbNw, camps) == 0; camps[4] = ComunDef.CamposNW.cons_fow;
return HelperGdb.CheckFileds(OliviaGlob.Paths.PathGdbNw, camps) == 0;*/
return true;
} }
/** /**
@ -332,10 +336,11 @@ namespace OliviaAddInPro.Model
try try
{ {
string[] ips = OliviaGlob.dame_local_ips(); string[] ips = OliviaGlob.dame_local_ips();
if (ips != null && ips.Length > 0) /*if (ips != null && ips.Length > 0)
Conexion.Ip = ips[0]; Conexion.Ip = ips[0];
else else
Conexion.Ip = "127.0.0.1"; Conexion.Ip = "127.0.0.1";*/
Conexion.Ip = "127.0.0.1";
resp.Value = true; resp.Value = true;
return resp; return resp;
} }
@ -388,7 +393,7 @@ namespace OliviaAddInPro.Model
*/ */
public static void OpenManual() public static void OpenManual()
{ {
string[] archivos = null; //string[] archivos = null;
try try
{ {
@ -396,12 +401,12 @@ namespace OliviaAddInPro.Model
HelperGlobal.ponMsg("No se encuentra el archivo " + OliviaGlob.Paths.PathManualOlivia); HelperGlobal.ponMsg("No se encuentra el archivo " + OliviaGlob.Paths.PathManualOlivia);
else else
{ {
System.Diagnostics.Process.Start(OliviaGlob.Paths.PathManualOlivia); Process.Start(new ProcessStartInfo(OliviaGlob.Paths.PathManualOlivia) { UseShellExecute = true });
} }
} }
catch (Exception) catch (Exception ex)
{ {
HelperGlobal.ponMsg("Error al abrir el manual de ayuda " + OliviaGlob.Paths.PathManualOlivia); HelperGlobal.ponMsg("Error al abrir el manual de ayuda " + OliviaGlob.Paths.PathManualOlivia + " "+ex.Message);
return; return;
} }
} }
@ -428,6 +433,7 @@ namespace OliviaAddInPro.Model
Paths.PathGdbGen = c.PathGdbGen; Paths.PathGdbGen = c.PathGdbGen;
Paths.PathGdbNw = c.Path_Eje_via; Paths.PathGdbNw = c.Path_Eje_via;
Paths.PathGdbNw_conj = c.Path_Conj_Eje_via;
Paths.PathSimbVSM = c.PathSimbVSM; Paths.PathSimbVSM = c.PathSimbVSM;
Paths.PathSimbESRI = c.PathSimbESRI; Paths.PathSimbESRI = c.PathSimbESRI;
Conexion.Puerto = c.Puerto; Conexion.Puerto = c.Puerto;
@ -439,6 +445,7 @@ namespace OliviaAddInPro.Model
//Capas.ftclass_ejes = c.eje_via; //Capas.ftclass_ejes = c.eje_via;
//Capas.ftclass_muni = c.municipios; //Capas.ftclass_muni = c.municipios;
Capas.pathEjeVia = c.Path_Eje_via; Capas.pathEjeVia = c.Path_Eje_via;
//Capas.Path_Conj_Eje_via = c.Path_Conj_Eje_via;
/////////////////////////////////////// ///////////////////////////////////////
//Capas, consultas, atributos y filtros de LIMPIEZA //Capas, consultas, atributos y filtros de LIMPIEZA
LimpiezaDef.Campos.consulta_entidad = c.cons_tip_ent; LimpiezaDef.Campos.consulta_entidad = c.cons_tip_ent;
@ -446,8 +453,6 @@ namespace OliviaAddInPro.Model
LimpiezaDef.Campos.consulta_observ = c.cons_obser; LimpiezaDef.Campos.consulta_observ = c.cons_obser;
LimpiezaDef.Campos.consulta_anch_tip = c.cons_anch_tip; LimpiezaDef.Campos.consulta_anch_tip = c.cons_anch_tip;
LimpiezaDef.Campos.consulta_tipolo = c.cons_tipolo; LimpiezaDef.Campos.consulta_tipolo = c.cons_tipolo;
LimpiezaDef.Campos.consulta_sector = c.consulta_sector;
LimpiezaDef.Campos.consulta_secuen = c.consulta_secuen;
LimpiezaDef.Atributos.atr_esca = c.atr_esca; LimpiezaDef.Atributos.atr_esca = c.atr_esca;
LimpiezaDef.Atributos.atr_fuent = c.atr_fuent; LimpiezaDef.Atributos.atr_fuent = c.atr_fuent;
@ -494,6 +499,7 @@ namespace OliviaAddInPro.Model
LimpiezaDef.Parametros.h_inicio = c.hora_inicio; LimpiezaDef.Parametros.h_inicio = c.hora_inicio;
LimpiezaDef.Parametros.reduc_traf = c.reduc_traf; LimpiezaDef.Parametros.reduc_traf = c.reduc_traf;
LimpiezaDef.Parametros.igno_ais = c.Igno_ais; LimpiezaDef.Parametros.igno_ais = c.Igno_ais;
LimpiezaDef.Parametros.ancho_viaM = c.ancho_via_max; LimpiezaDef.Parametros.ancho_viaM = c.ancho_via_max;
LimpiezaDef.Parametros.ancho_viam = c.ancho_via_min; LimpiezaDef.Parametros.ancho_viam = c.ancho_via_min;
LimpiezaDef.Parametros.ancho_via = c.ancho_via; LimpiezaDef.Parametros.ancho_via = c.ancho_via;
@ -540,10 +546,6 @@ namespace OliviaAddInPro.Model
LimpiezaDef.OtrosParam.anch_aplin = c.Ancho_ap_lin_def; LimpiezaDef.OtrosParam.anch_aplin = c.Ancho_ap_lin_def;
LimpiezaDef.OtrosParam.anch_apbat = c.Ancho_ap_bat_def; LimpiezaDef.OtrosParam.anch_apbat = c.Ancho_ap_bat_def;
LimpiezaDef.OtrosParam.anch_bordlib = c.Ancho_bord_lib_def; LimpiezaDef.OtrosParam.anch_bordlib = c.Ancho_bord_lib_def;
LimpiezaDef.OtrosParam.giro_max = c.Giro_max_vehiculo;
LimpiezaDef.OtrosParam.desv_max = c.Desv_max;
LimpiezaDef.OtrosParam.desv_max_abs = c.Desv_max_abs;
//Capas, consultas, atributos y filtros de RECOGIDA //Capas, consultas, atributos y filtros de RECOGIDA
@ -625,15 +627,22 @@ namespace OliviaAddInPro.Model
ComunDef.BuffExport = c.buffer_export; ComunDef.BuffExport = c.buffer_export;
//Campos de la red navegable que se leen //Campos de la red navegable que se leen
ComunDef.CamposNW.cons_onew = c.cons_onew; /*ComunDef.CamposNW.cons_onew = c.cons_onew;
ComunDef.CamposNW.cons_kph = c.cons_kph; ComunDef.CamposNW.cons_kph = "_vel";
ComunDef.CamposNW.cons_fow = c.cons_fow; ComunDef.CamposNW.cons_fow = "_peat";
ComunDef.CamposNW.cons_name = c.cons_name; ComunDef.CamposNW.cons_name = c.cons_name;*/
//Atributos de la red navegable que se leen //Atributos de la red navegable que se leen
ComunDef.AtributosNW.atr_TF = c.atr_TF; ComunDef.AtributosNW.atr_TF = c.atr_TF;
ComunDef.AtributosNW.atr_FT = c.atr_FT; ComunDef.AtributosNW.atr_FT = c.atr_FT;
ComunDef.AtributosNW.atr_N = c.atr_N; ComunDef.AtributosNW.atr_N = c.atr_N;
ComunDef.AtributosNW.atr_pedes = c.atr_pedes; ComunDef.AtributosNW.atr_pedes = c.atr_pedes;
ComunDef.CamposNW.config = c.GetOliviaConfNW();
ComunDef.CamposCom.camp_oid = c.id;
ComunDef.CamposCom.consulta_sector = c.consulta_sector;
ComunDef.CamposCom.consulta_secuen = c.consulta_secuen;
ComunDef.CamposCom.giro_max = c.Giro_max_vehiculo;
ComunDef.CamposCom.desv_max = c.Desv_max;
ComunDef.CamposCom.desv_max_abs = c.Desv_max_abs;
} }
} }

View File

@ -91,6 +91,7 @@ namespace OliviaAddInPro.Model
{ {
Respuesta<bool> res = new Respuesta<bool> { Value = false }; Respuesta<bool> res = new Respuesta<bool> { Value = false };
Respuesta<TiposEjecucion> res2 = new Respuesta<TiposEjecucion>() { Value = TiposEjecucion.FinEjecNOk }; Respuesta<TiposEjecucion> res2 = new Respuesta<TiposEjecucion>() { Value = TiposEjecucion.FinEjecNOk };
Serv.TipoMv = TipoMV;
res = Serv.Ejecuta(modo); res = Serv.Ejecuta(modo);
if (res.Value) if (res.Value)
{ {
@ -164,7 +165,7 @@ namespace OliviaAddInPro.Model
public override string[] GetCampos(string capa=null) public override string[] GetCampos(string capa=null)
{ {
string[] camps = { string[] camps = {
RecogidaDef.campos_def.cons_id, //RecogidaDef.campos_def.cons_id,
RecogidaDef.campos_def.cons_nomrec, RecogidaDef.campos_def.cons_nomrec,
RecogidaDef.campos_def.cons_lateral , RecogidaDef.campos_def.cons_lateral ,
RecogidaDef.campos_def.cons_fracc, RecogidaDef.campos_def.cons_fracc,

View File

@ -405,9 +405,13 @@ namespace OliviaAddInPro.Model
int n, i_def, icar, iveh; int n, i_def, icar, iveh;
//Rellena las opciones de carga máxima por vehículo //Rellena las opciones de carga máxima por vehículo
//////////////////////////////////////////////////
//Carga Trasera
////////////////////////////////////////////////
//Trasera-satelite //Trasera-satelite
n = 4; n = 4;
i_def = 2; i_def = 2;
//Rellena volumenes
info[0] = 2; info[0] = 2;
info[1] = 3; info[1] = 3;
info[2] = 5; info[2] = 5;
@ -425,6 +429,7 @@ namespace OliviaAddInPro.Model
//Trasera-2 ejes //Trasera-2 ejes
n = 6; n = 6;
i_def = 2; i_def = 2;
//Rellena volumenes
info[0] = 8; info[0] = 8;
info[1] = 10; info[1] = 10;
info[2] = 12; info[2] = 12;
@ -447,6 +452,7 @@ namespace OliviaAddInPro.Model
//Trasera-3ejes //Trasera-3ejes
n = 4; n = 4;
i_def = 3; i_def = 3;
//Rellena volumenes
info[0] = 18; info[0] = 18;
info[1] = 20; info[1] = 20;
info[2] = 22; info[2] = 22;
@ -454,6 +460,9 @@ namespace OliviaAddInPro.Model
rellena_carg((int)RecogidaDef.TiposCarga.Trasera, rellena_carg((int)RecogidaDef.TiposCarga.Trasera,
(int)RecogidaDef.TiposVehic.Ejes3, n, i_def, info); (int)RecogidaDef.TiposVehic.Ejes3, n, i_def, info);
//////////////////////////////////////////////////
//Carga Lateral
////////////////////////////////////////////////
//Lateral-satelite, no hay //Lateral-satelite, no hay
rellena_carg((int)RecogidaDef.TiposCarga.Lateral, rellena_carg((int)RecogidaDef.TiposCarga.Lateral,
(int)RecogidaDef.TiposVehic.Satelite, 0, 0, null); (int)RecogidaDef.TiposVehic.Satelite, 0, 0, null);
@ -461,6 +470,7 @@ namespace OliviaAddInPro.Model
//Lateral - 2 ejes //Lateral - 2 ejes
n = 2; n = 2;
i_def = 1; i_def = 1;
//Rellena volumenes
info[0] = 15; info[0] = 15;
info[1] = 17; info[1] = 17;
rellena_carg((int)RecogidaDef.TiposCarga.Lateral, rellena_carg((int)RecogidaDef.TiposCarga.Lateral,
@ -476,6 +486,7 @@ namespace OliviaAddInPro.Model
//Lateral - 3 ejes //Lateral - 3 ejes
n = 3; n = 3;
i_def = 2; i_def = 2;
//Rellena volumenes
info[0] = 21; info[0] = 21;
info[1] = 23; info[1] = 23;
info[2] = 26; info[2] = 26;
@ -486,9 +497,13 @@ namespace OliviaAddInPro.Model
rellena_carg((int)RecogidaDef.TiposCarga.Superior, rellena_carg((int)RecogidaDef.TiposCarga.Superior,
(int)RecogidaDef.TiposVehic.Satelite, 0, 0, null); (int)RecogidaDef.TiposVehic.Satelite, 0, 0, null);
//////////////////////////////////////////////////
//Carga Superior
////////////////////////////////////////////////
//Superior - 2 ejes //Superior - 2 ejes
n = 2; n = 2;
i_def = 0; i_def = 0;
//Rellena volumenes
info[0] = 16; info[0] = 16;
info[1] = 17; info[1] = 17;
rellena_carg((int)RecogidaDef.TiposCarga.Superior, rellena_carg((int)RecogidaDef.TiposCarga.Superior,
@ -497,6 +512,7 @@ namespace OliviaAddInPro.Model
//Superior - 3 ejes //Superior - 3 ejes
n = 3; n = 3;
i_def = 2; i_def = 2;
//Rellena volumenes
info[0] = 20; info[0] = 20;
info[1] = 23; info[1] = 23;
info[2] = 25; info[2] = 25;
@ -507,47 +523,9 @@ namespace OliviaAddInPro.Model
rellena_carg((int)RecogidaDef.TiposCarga.Bilateral, rellena_carg((int)RecogidaDef.TiposCarga.Bilateral,
(int)RecogidaDef.TiposVehic.Satelite, 0, 0, null); (int)RecogidaDef.TiposVehic.Satelite, 0, 0, null);
//Bilateral - 2 ejes //////////////////////////////////////////////////
n = 3; //Carga Bilateral
i_def = 1; ////////////////////////////////////////////////
info[0] = 14;
info[1] = 16;
info[2] = 18;
rellena_carg((int)RecogidaDef.TiposCarga.Bilateral,
(int)RecogidaDef.TiposVehic.Ejes2, n, i_def, info);
//Bilateral - 3 ejes
n = 3;
i_def = 1;
info[0] = 20;
info[1] = 23;
info[2] = 26;
rellena_carg((int)RecogidaDef.TiposCarga.Bilateral,
(int)RecogidaDef.TiposVehic.Ejes3, n, i_def, info);
//Bolseo - todas, no hay
//Lavado - todas, no hay
//Otra - todas, no hay
for (icar = (int)RecogidaDef.TiposCarga.BolseoPtaPta; icar < (int)RecogidaDef.TiposCarga.N; icar++)
{
for (iveh = (int)RecogidaDef.TiposVehic.Ejes3; iveh < (int)RecogidaDef.TiposVehic.N; iveh++)
{
rellena_carg(icar, iveh, 0, 0, null);
}
}
////////////////////////////////////////////////////////
//Barcelona new
rellena_offsets_bcn();
}
private static void rellena_offsets_bcn()
{
int[] info = new int[10];
int n, i_def;
////////////////////////////////////////////////////////
//Barcelona new
//Bilateral - satelite //Bilateral - satelite
n = 1; n = 1;
i_def = 0; i_def = 0;
@ -577,6 +555,50 @@ namespace OliviaAddInPro.Model
info[0] = -2050; info[0] = -2050;
rellena_carg_offset((int)RecogidaDef.TiposCarga.Bilateral, rellena_carg_offset((int)RecogidaDef.TiposCarga.Bilateral,
(int)RecogidaDef.TiposVehic.Satelite, (int)RecogidaDef.TiposFracción.Vidrio, n, info); (int)RecogidaDef.TiposVehic.Satelite, (int)RecogidaDef.TiposFracción.Vidrio, n, info);
//Bilateral - 2 ejes
n = 3;
i_def = 1;
//Rellena volumenes
info[0] = 14;
info[1] = 16;
info[2] = 18;
rellena_carg((int)RecogidaDef.TiposCarga.Bilateral,
(int)RecogidaDef.TiposVehic.Ejes2, n, i_def, info);
//Bilateral - 3 ejes
n = 3;
i_def = 1;
//Rellena volumenes
info[0] = 20;
info[1] = 23;
info[2] = 26;
rellena_carg((int)RecogidaDef.TiposCarga.Bilateral,
(int)RecogidaDef.TiposVehic.Ejes3, n, i_def, info);
//Bolseo - todas, no hay
//Lavado - todas, no hay
//Otra - todas, no hay
for (icar = (int)RecogidaDef.TiposCarga.BolseoPtaPta; icar < (int)RecogidaDef.TiposCarga.N; icar++)
{
for (iveh = (int)RecogidaDef.TiposVehic.Ejes3; iveh < (int)RecogidaDef.TiposVehic.N; iveh++)
{
rellena_carg(icar, iveh, 0, 0, null);
}
}
////////////////////////////////////////////////////////
//Rellena offsets
rellena_offsets_bcn();
}
private static void rellena_offsets_bcn()
{
int[] info = new int[10];
int n, i_def;
////////////////////////////////////////////////////////
//Barcelona revisado abril 24
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
//Trasera - satélite - organico, resto //Trasera - satélite - organico, resto
@ -814,22 +836,15 @@ namespace OliviaAddInPro.Model
//Bilateral - 2 ejes - vidrio //Bilateral - 2 ejes - vidrio
rellena_carg_offset((int)RecogidaDef.TiposCarga.Superior, rellena_carg_offset((int)RecogidaDef.TiposCarga.Superior,
(int)RecogidaDef.TiposVehic.Ejes3, (int)RecogidaDef.TiposFracción.Vidrio, n, info); (int)RecogidaDef.TiposVehic.Ejes3, (int)RecogidaDef.TiposFracción.Vidrio, n, info);
//Bilateral - 2 ejes - papel //Bilateral - 2 ejes - papel
info[0] = 1820; info[0] = 1540;
info[1] = 2080; info[1] = 1760;
info[2] = 2340; info[2] = 1980;
rellena_carg_offset((int)RecogidaDef.TiposCarga.Bilateral, rellena_carg_offset((int)RecogidaDef.TiposCarga.Bilateral,
(int)RecogidaDef.TiposVehic.Ejes2, (int)RecogidaDef.TiposFracción.Papel, n, info); (int)RecogidaDef.TiposVehic.Ejes2, (int)RecogidaDef.TiposFracción.Papel, n, info);
//Bilateral - 2 ejes - vidrio
info[0] = -140;
info[1] = -160;
info[2] = -180;
rellena_carg_offset((int)RecogidaDef.TiposCarga.Bilateral,
(int)RecogidaDef.TiposVehic.Ejes2, (int)RecogidaDef.TiposFracción.Vidrio, n, info);
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
//Bilateral - 3 ejes - resto, org //Bilateral - 3 ejes - resto, org
n = 3; n = 3;

View File

@ -25,10 +25,19 @@ namespace OliviaAddInPro.Model
* String para Tipo de tratamiento, se guarda como columna en el shp * String para Tipo de tratamiento, se guarda como columna en el shp
*/ */
public string TipoTtoStr { get; set; } = String.Empty; public string TipoTtoStr { get; set; } = String.Empty;
/**
* Tipo modo de viaje
*/
public int TipoMV { get; set; } = -1;
/** /**
* Capa de ámbitos * Capa de ámbitos
*/ */
public string CapaElems { get; set; } = string.Empty; public string CapaElems { get; set; } = string.Empty;
/**
* Capa de ámbitos de referencia.
* Cuando se hace tratamiento con ejes de calle, se guarda la capa de referencia
*/
public string CapaElemsRef { get; set; } = string.Empty;
/** /**
* Capa de ámbitos después de haber planificado * Capa de ámbitos después de haber planificado
*/ */
@ -45,6 +54,7 @@ namespace OliviaAddInPro.Model
* Nombre dle shp exportado de nw * Nombre dle shp exportado de nw
*/ */
public string NombreShpExportNw { get; set; } = string.Empty; public string NombreShpExportNw { get; set; } = string.Empty;
public string NombreShpExportNw_C { get; set; } = string.Empty;
/** /**
* Velocidad de desplazamiento, en km/h. Si es 0, es determinada por la vía * Velocidad de desplazamiento, en km/h. Si es 0, es determinada por la vía
*/ */
@ -116,6 +126,10 @@ namespace OliviaAddInPro.Model
* Ignorar o noelementos aislados * Ignorar o noelementos aislados
*/ */
public bool IgnoAis { get; set; } = LimpiezaDef.Parametros.igno_ais; public bool IgnoAis { get; set; } = LimpiezaDef.Parametros.igno_ais;
/**
* Coordenadas Min y Max de la red navegable
*/
public Envelope MimaNw { get; set; } = null;
/** /**
* Almacena la consulta para exportar los ámbitos * Almacena la consulta para exportar los ámbitos
*/ */
@ -137,6 +151,8 @@ namespace OliviaAddInPro.Model
set { err_str = value; } set { err_str = value; }
} }
private ObservableCollection<string> nombCamposOrig = new ObservableCollection<string>();
private IReadOnlyList<ArcGIS.Core.Data.Field> camposOrig = null;
/** /**
* Para la ventana de progreso * Para la ventana de progreso
*/ */
@ -195,51 +211,80 @@ namespace OliviaAddInPro.Model
ambitos = string.Empty; ambitos = string.Empty;
} }
/** /**
* Restaura el nombre original del campo si se ha truncado a 10 car al exportar a shp * Devuelve los campos característicos de Limpieza o Recogida
*/ */
public virtual string[] GetCampos(string capa=null) public virtual string[] GetCampos(string capa=null)
{ {
return null; return null;
} }
/** /**
* Restaura el nombre original del campo si se ha truncado a 10 car al exportar a shp * Restaura el nombre original del campo si se ha truncado a 10 car al exportar a shp
*/ */
public Respuesta<bool> RestauraNomCampos(string nombFtClass) public virtual string[] GetCamposOrig()
{
string[] camps = null;
if (nombCamposOrig.Count > 0)
{
camps = new string[nombCamposOrig.Count];
for (int i=0;i<nombCamposOrig.Count;i++)
{
camps[i] = nombCamposOrig[i];
}
}
return camps;
}
/**
* Restaura el nombre original del campo si se ha truncado a 10 car al exportar a shp
*/
public Respuesta<bool> RestauraNomCampos(string nombFtClass)
{ {
int LENGTHCAMPSHP = 10; int LENGTHCAMPSHP = 10;
Respuesta<bool> resp = new Respuesta<bool> { Value = false }; Respuesta<bool> resp = new Respuesta<bool> { Value = false };
FeatureClass fc = HelperGdb.GetFtClassSync(nombFtClass); FeatureClass fc = HelperGdb.GetFtClassSync(nombFtClass);
if (fc == null) if (fc == null)
return resp; return resp;
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
string[] camps = GetCampos(); if (camposOrig == null || camposOrig.Count==0)
{
HelperGdb.Free(fc);
return resp;
}
ObservableCollection<string> fields = HelperGdb.GetFieldsSync(fc); ObservableCollection<string> fields = HelperGdb.GetFieldsSync(fc);
HelperGdb.Free(fc); HelperGdb.Free(fc);
if (fields == null) if (fields == null)
{
HelperGdb.Free(fc);
return resp; return resp;
}
try try
{ {
int i = 0; int i = 0;
int indx; int indx;
string campTrunc = string.Empty; string campTrunc = string.Empty;
for (i = 0; i < camps.Length; i++) for (i = 0; i < camposOrig.Count; i++)
{ {
if (camps[i].Length <= LENGTHCAMPSHP) if (camposOrig[i].Name.Length <= LENGTHCAMPSHP)
continue; continue;
campTrunc = camps[i].Substring(0, LENGTHCAMPSHP); if (EstaRepeNomb(fields, camposOrig[i].Name))
continue;
campTrunc = camposOrig[i].Name.Substring(0, LENGTHCAMPSHP);
//si tiene más de 10 caracteres, lo ha truncado al exportar //si tiene más de 10 caracteres, lo ha truncado al exportar
//busca el nombre actual del campo en la fc //busca el nombre actual del campo en la fc
indx = fields.IndexOf(campTrunc); indx = fields.IndexOf(campTrunc);
if (indx < 0) if (indx < 0)
break; break;
if (!HelperGdb.RenameFieldSync(nombFtClass, campTrunc, camps[i],camps[i])) if (!HelperGdb.RenameFieldSync(nombFtClass, campTrunc, camposOrig[i].Name, camposOrig[i].AliasName))
break; break;
} }
if (i < camps.Length) if (i < camposOrig.Count)
{ {
resp.Error.Add("Error en el campo " + camps[i]); resp.Error.Add("Error en el campo " + camposOrig[i].Name);
} }
else else
resp.Value = true; resp.Value = true;
@ -248,8 +293,47 @@ namespace OliviaAddInPro.Model
{ {
} }
HelperGdb.Free(fc);
return resp; return resp;
} }
private bool EstaRepeNomb(ObservableCollection<string> fields, string nomb)
{
foreach( string fnomb in fields)
{
if (string.Compare(fnomb, nomb, true)==0)
return true;
}
return false;
}
/**
* Guarda el nombre de los campos originales para luego restaurarlos
*/
public void GuardaNombCamposOrig(string pathFtClass)
{
FeatureClass fc = HelperGdb.GetFtClassSync(pathFtClass);
if (fc != null)
{
nombCamposOrig = HelperGdb.GetFieldsSync(fc);
}
else
nombCamposOrig = new ObservableCollection<string>();
HelperGdb.Free(fc);
}
/**
* Guarda el nombre de los campos originales para luego restaurarlos
*/
public void GuardaCamposOrig(string pathFtClass)
{
FeatureClass fc = HelperGdb.GetFtClassSync(pathFtClass);
if (fc != null)
{
camposOrig = HelperGdb.GetFieldsSyncEx(fc);
}
else
camposOrig = null;
HelperGdb.Free(fc);
}
} }
} }

View File

@ -1,406 +1,153 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <TargetFramework>net6.0-windows</TargetFramework>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<ProductVersion>8.0.30703</ProductVersion> <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<SchemaVersion>2.0</SchemaVersion> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<ProjectGuid>{10742570-CF59-42F2-BEA2-2A38002A06EE}</ProjectGuid> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<OutputType>Library</OutputType> <NoWarn>CA1416</NoWarn>
<AppDesignerFolder>Properties</AppDesignerFolder> <UseWPF>true</UseWPF>
<RootNamespace>OliviaAddInPro</RootNamespace> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyName>OliviaAddInPro</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<PropertyGroup>
<ArcGISFolder>$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\ArcGISPro', 'InstallDir', null, RegistryView.Registry64))</ArcGISFolder>
<ArcGISFolder Condition="'$(ArcGISFolder)' == ''">$(registry:HKEY_CURRENT_USER\SOFTWARE\ESRI\ArcGISPro@InstallDir)</ArcGISFolder>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>0</WarningLevel>
<StartAction>Program</StartAction>
<StartProgram>$(ArcGISFolder)\bin\ArcGISPro.exe</StartProgram>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<StartAction>Program</StartAction>
<StartProgram>$(ArcGISFolder)\bin\ArcGISPro.exe</StartProgram>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Compile Remove=".git\**" />
<HintPath>packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <EmbeddedResource Remove=".git\**" />
</Reference> <None Remove=".git\**" />
<Reference Include="System" /> <Page Remove=".git\**" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="WindowsBase" />
<Reference Include="System.Xaml" />
<Reference Include="ArcGIS.Desktop.Framework">
<HintPath>$(ArcGISFolder)\bin\ArcGIS.Desktop.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Core">
<HintPath>$(ArcGISFolder)\bin\ArcGIS.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Core">
<HintPath>$(ArcGISFolder)\bin\Extensions\Core\ArcGIS.Desktop.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Mapping">
<HintPath>$(ArcGISFolder)\bin\Extensions\Mapping\ArcGIS.Desktop.Mapping.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Catalog">
<HintPath>$(ArcGISFolder)\bin\Extensions\Catalog\ArcGIS.Desktop.Catalog.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Editing">
<HintPath>$(ArcGISFolder)\bin\Extensions\Editing\ArcGIS.Desktop.Editing.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Extensions">
<HintPath>$(ArcGISFolder)\bin\Extensions\DesktopExtensions\ArcGIS.Desktop.Extensions.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.GeoProcessing">
<HintPath>$(ArcGISFolder)\bin\Extensions\GeoProcessing\ArcGIS.Desktop.GeoProcessing.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Layouts">
<HintPath>$(ArcGISFolder)\bin\Extensions\Layout\ArcGIS.Desktop.Layouts.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Shared.Wpf">
<HintPath>$(ArcGISFolder)\bin\ArcGIS.Desktop.Shared.Wpf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Ribbon.Wpf">
<HintPath>$(ArcGISFolder)\bin\ArcGIS.Desktop.Ribbon.Wpf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.DataGrid.Contrib.Wpf">
<HintPath>$(ArcGISFolder)\bin\ArcGIS.Desktop.DataGrid.Contrib.Wpf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Resources">
<HintPath>$(ArcGISFolder)\bin\ArcGIS.Desktop.Resources.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Resources">
<HintPath>$(ArcGISFolder)\bin\ArcGIS.Desktop.Resources.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ESRI.ArcGIS.ItemIndex">
<HintPath>$(ArcGISFolder)\bin\ESRI.ArcGIS.ItemIndex.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=4.1.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\bin\Release\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<AddInContent Include="Config.daml" /> <Content Include="Config.daml" />
<AddInContent Include="Images\AddInDesktop16.png" /> <Content Include="Images\AddInDesktop16.png" />
<AddInContent Include="Images\AddInDesktop32.png" /> <Content Include="Images\AddInDesktop32.png" />
<AddInContent Include="DarkImages\AddInDesktop16.png" /> <Content Include="DarkImages\AddInDesktop16.png" />
<AddInContent Include="DarkImages\AddInDesktop32.png" /> <Content Include="DarkImages\AddInDesktop32.png" />
</ItemGroup> <Content Include="DarkImages\GenericButtonBlue16.png" />
<ItemGroup> <Content Include="DarkImages\GenericButtonBlue32.png" />
<Compile Include="Button\ButtonConfig.cs" /> <Content Include="Images\OliviaIconPro16.png" />
<Compile Include="Button\ButtonLimp.cs" /> <Content Include="Images\OliviaIconPro32.png" />
<Compile Include="Button\ButtonMaq.cs" /> <Content Include="DarkImages\GenericButtonPurple16.png" />
<Compile Include="Button\ButtonRec.cs" /> <Content Include="DarkImages\GenericButtonPurple32.png" />
<Compile Include="Conexion\Cstr_socket.cs" /> <Content Include="DarkImages\GenericButtonGreen16.png" />
<Compile Include="Helper\EnabledComboBoxItem.cs" /> <Content Include="DarkImages\GenericButtonGreen32.png" />
<Compile Include="Helper\CheckedListItem.cs" /> <Content Include="Images\reco2.png" />
<Compile Include="Helper\HelperGdb.cs" /> <Content Include="Images\carrito2.png" />
<Compile Include="Helper\HelperGlobal.cs" /> <Content Include="Images\config2_olv.png" />
<Compile Include="Model\ComunDef.cs" />
<Compile Include="Model\contract\IprocessManager.cs" />
<Compile Include="Model\ESRI.ArcGIS.Geometry.esriSRProjCS4Type.cs" />
<Compile Include="Model\Recogida.cs" />
<Compile Include="Model\RecogidaDef.cs" />
<Compile Include="Model\Respuesta.cs" />
<Compile Include="Model\TratamientoComun.cs" />
<Compile Include="Model\Limpieza.cs" />
<Compile Include="Model\LimpiezaDef.cs" />
<Compile Include="Services\EjecServ.cs" />
<Compile Include="Model\OliviaConf.cs" />
<Compile Include="Model\OliviaDef.cs" />
<Compile Include="Services\ConfigServ.cs" />
<Compile Include="Services\FinProcServ.cs" />
<Compile Include="Services\LanzaSrv\LanzaLimpSrv.cs" />
<Compile Include="Services\LanzaSrv\LanzaOlvServ.cs" />
<Compile Include="Services\LanzaSrv\LanzaRecoSrv.cs" />
<Compile Include="Services\LimpiezaServ.cs" />
<Compile Include="Services\ProcesoEjecServ.cs" />
<Compile Include="Services\RecogidaServ.cs" />
<Compile Include="ViewModel\Comun\MarchandoUnaDeViewModel.cs" />
<Compile Include="ViewModel\Configuracion\DockpaneConfigViewModel.cs" />
<Compile Include="ViewModel\Configuracion\PaneConfigViewModel.cs" />
<Compile Include="ViewModel\OptionsMenuItem.cs" />
<Compile Include="ViewModel\PaneEjecutarViewModel.cs" />
<Compile Include="ViewModel\Limpieza\PaneLimpiezaSub4ViewModel.cs" />
<Compile Include="ViewModel\Limpieza\PaneLimpiezaSub3ViewModel.cs" />
<Compile Include="ViewModel\Limpieza\PaneLimpiezaSub2ViewModel.cs" />
<Compile Include="ViewModel\Limpieza\PaneLimpiezaViewModel.cs" />
<Compile Include="ViewModel\PanelViewModelBase.cs" />
<Compile Include="ViewModel\Recogida\PaneRecogidaSub1ViewModel.cs" />
<Compile Include="View\Comun\MarchandoUnaDe.xaml.cs">
<DependentUpon>MarchandoUnaDe.xaml</DependentUpon>
</Compile>
<Compile Include="View\Configuracion\PropertyGridFilePickerFolder.xaml.cs">
<DependentUpon>PropertyGridFilePickerFolder.xaml</DependentUpon>
</Compile>
<Compile Include="View\Configuracion\PropertyGridFilePickerDataset.xaml.cs">
<DependentUpon>PropertyGridFilePickerDataset.xaml</DependentUpon>
</Compile>
<Compile Include="View\Configuracion\PropertyGridFilePickerLine.xaml.cs">
<DependentUpon>PropertyGridFilePickerLine.xaml</DependentUpon>
</Compile>
<Compile Include="View\Configuracion\PropertyGridFilePickerGDB.xaml.cs">
<DependentUpon>PropertyGridFilePickerGDB.xaml</DependentUpon>
</Compile>
<Compile Include="View\Recogida\PaneRecogidaSub1.xaml.cs">
<DependentUpon>PaneRecogidaSub1.xaml</DependentUpon>
</Compile>
<Compile Include="View\Recogida\PaneRecogida.xaml.cs">
<DependentUpon>PaneRecogida.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModel\Recogida\PaneRecogidaViewModel.cs" />
<Compile Include="View\Configuracion\DockPaneConfig.xaml.cs">
<DependentUpon>DockPaneConfig.xaml</DependentUpon>
</Compile>
<Compile Include="View\Configuracion\PaneConfigView.xaml.cs">
<DependentUpon>PaneConfigView.xaml</DependentUpon>
</Compile>
<Compile Include="View\PaneEjecutar.xaml.cs">
<DependentUpon>PaneEjecutar.xaml</DependentUpon>
</Compile>
<Compile Include="View\Limpieza\PaneLimpiezaSub4.xaml.cs">
<DependentUpon>PaneLimpiezaSub4.xaml</DependentUpon>
</Compile>
<Compile Include="View\Limpieza\PaneLimpiezaSub3.xaml.cs">
<DependentUpon>PaneLimpiezaSub3.xaml</DependentUpon>
</Compile>
<Compile Include="View\Limpieza\PaneLimpiezaSub2.xaml.cs">
<DependentUpon>PaneLimpiezaSub2.xaml</DependentUpon>
</Compile>
<Compile Include="View\Limpieza\PaneLimpiezaSub1.xaml.cs">
<DependentUpon>PaneLimpiezaSub1.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModel\Limpieza\PaneLimpiezaSub1ViewModel.cs" />
<Compile Include="View\Limpieza\PaneLimpieza.xaml.cs">
<DependentUpon>PaneLimpieza.xaml</DependentUpon>
</Compile>
<Compile Include="View\Limpieza\DockpaneLimpieza.xaml.cs">
<DependentUpon>DockpaneLimpieza.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModel\Limpieza\DockpaneLimpiezaViewModel.cs" />
<Compile Include="View\Recogida\DockpaneRecogida.xaml.cs">
<DependentUpon>DockpaneRecogida.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModel\Recogida\DockpaneRecogidaViewModel.cs" />
<Compile Include="Module1.cs" />
<Compile Include="Model\OliviaGlob.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Resource1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resource1.resx</DependentUpon>
</Compile>
<Compile Include="View\ProWndSelectFields.xaml.cs">
<DependentUpon>ProWndSelectFields.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModel\ShowProWndSelectFields.cs" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="DarkImages\GenericButtonBlue16.png" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="DarkImages\GenericButtonBlue32.png" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="Images\OliviaIconPro16.png" />
<AddInContent Include="Images\OliviaIconPro32.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="OliviaIconPro.ico" /> <Resource Include="OliviaIconPro.ico" />
</ItemGroup>
<ItemGroup>
<Page Include="View\Comun\MarchandoUnaDe.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Configuracion\PropertyGridFilePickerFolder.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Configuracion\PropertyGridFilePickerDataset.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Configuracion\PropertyGridFilePickerLine.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Configuracion\PropertyGridFilePickerGDB.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Recogida\PaneRecogidaSub1.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Recogida\PaneRecogida.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Configuracion\DockPaneConfig.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Configuracion\PaneConfigView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\PaneEjecutar.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Limpieza\PaneLimpiezaSub4.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Limpieza\PaneLimpiezaSub3.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Limpieza\PaneLimpiezaSub2.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Limpieza\PaneLimpiezaSub1.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Limpieza\PaneLimpieza.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Limpieza\DockpaneLimpieza.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Recogida\DockpaneRecogida.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\ProWndSelectFields.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<AddInContent Include="DarkImages\GenericButtonPurple16.png" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="DarkImages\GenericButtonPurple32.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resource1.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resource1.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<AddInContent Include="DarkImages\GenericButtonGreen16.png" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="DarkImages\GenericButtonGreen32.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="View\OliviaIconPro16.png" /> <Resource Include="View\OliviaIconPro16.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="View\OliviaIconPro.ico" /> <Resource Include="View\OliviaIconPro.ico" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\inicio.png" /> <Resource Include="Resources\inicio.png" />
<Resource Include="Resources\ptosctrl.png" /> <Resource Include="Resources\ptosctrl.png" />
<Resource Include="Resources\time.png" /> <Resource Include="Resources\time.png" />
<Resource Include="Resources\zonas.png" /> <Resource Include="Resources\zonas.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\openfolder.png" /> <Resource Include="Images\openfolder.png" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="Images\reco2.png" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="Images\carrito2.png" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="Images\config2_olv.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\help16Pro.png" /> <Resource Include="Images\help16Pro.png" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ItemGroup>
<!-- <PackageReference Include="DotNetProjects.Extended.Wpf.Toolkit" Version="5.0.103" />
PackageAction can be: <PackageReference Include="Microsoft.WindowsAPICodePack.Shell" Version="1.1.0" />
BuildDefault: ArcGIS Pro is required. An esriAddinX package is created and copied to ArcGIS Pro add-in folder. <PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
BuildZipPostProcess: ArcGIS Pro install is NOT required to build the add-in. An esriAddinX package is created in your output folder. <Reference Include="ArcGIS.Desktop.Framework">
BuildNoPostProcess: ArcGIS Pro install is NOT required to build the add-in. An esriAddinX package is NOT created. <HintPath>C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.Framework.dll</HintPath>
--> <CopyLocal>false</CopyLocal>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> </Reference>
<PackageAction>BuildDefault</PackageAction> <Reference Include="ArcGIS.Core">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <HintPath>C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Core.dll</HintPath>
</PropertyGroup> <CopyLocal>false</CopyLocal>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> </Reference>
<PackageAction>BuildDefault</PackageAction> <Reference Include="ArcGIS.Desktop.Core">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\Core\ArcGIS.Desktop.Core.dll</HintPath>
</PropertyGroup> <CopyLocal>false</CopyLocal>
<UsingTask AssemblyFile="$(ArcGISFolder)\bin\proapp-sdk-MSBuild.dll" TaskName="proapp_sdk_MSBuild.PackageAddIn" /> </Reference>
<UsingTask AssemblyFile="$(ArcGISFolder)\bin\proapp-sdk-MSBuild.dll" TaskName="proapp_sdk_MSBuild.CleanAddIn" /> <Reference Include="ArcGIS.Desktop.Layouts">
<UsingTask AssemblyFile="$(ArcGISFolder)\bin\proapp-sdk-MSBuild.dll" TaskName="proapp_sdk_MSBuild.ConvertToRelativePath" /> <HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\Layout\ArcGIS.Desktop.Layouts.dll</HintPath>
<!--<Import Project="Esri.ArcGISPro.Extensions.targets" Condition="Exists('Esri.ArcGISPro.Extensions.targets')" />--> </Reference>
<Import Project="$(ArcGISFolder)\bin\Esri.ProApp.SDK.Desktop.targets" Condition="Exists('$(ArcGISFolder)\bin\Esri.ProApp.SDK.Desktop.targets') AND !Exists('Esri.ArcGISPro.Extensions.targets')" /> <Reference Include="ArcGIS.Desktop.Mapping">
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\Mapping\ArcGIS.Desktop.Mapping.dll</HintPath>
Other similar extension points exist, see Microsoft.Common.targets. <CopyLocal>false</CopyLocal>
<Target Name="BeforeBuild"> </Reference>
</Target> <Reference Include="ArcGIS.Desktop.Catalog">
<Target Name="AfterBuild"> <HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\Catalog\ArcGIS.Desktop.Catalog.dll</HintPath>
</Target> <CopyLocal>false</CopyLocal>
--> </Reference>
<!--<Target Name="BeforeBuild"> <Reference Include="ArcGIS.Desktop.Shared.Wpf">
<Error Text="C:\Users\Elena\AppData\Local\Programs\ArcGIS\Pro\bin\Esri.ProApp.SDK.Desktop.targets not found." Condition="!Exists('C:\Users\Elena\AppData\Local\Programs\ArcGIS\Pro\bin\Esri.ProApp.SDK.Desktop.targets') AND !Exists('Esri.ArcGISPro.Extensions.targets')" /> <HintPath>C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.Shared.Wpf.dll</HintPath>
</Target>--> <CopyLocal>false</CopyLocal>
</Reference>
<Reference Include="ArcGIS.Desktop.Editing">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\Editing\ArcGIS.Desktop.Editing.dll</HintPath>
<CopyLocal>false</CopyLocal>
</Reference>
<Reference Include="ArcGIS.Desktop.Extensions">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\DesktopExtensions\ArcGIS.Desktop.Extensions.dll</HintPath>
<CopyLocal>false</CopyLocal>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include=".gitignore" />
<None Include="Backup-2.x.zip" />
<None Include="OliviaAddInPro.csproj.bak" />
<None Include="OliviaAddInPro.csproj.user" />
<None Include="OliviaIconPro.ico" />
<None Include="Images\config2_.png" />
<None Include="Images\config2_olv - copia.png" />
<None Include="Images\config_old.png" />
<None Include="Images\genericproperties32.png" />
<None Include="Images\help16Pro.png" />
<None Include="Images\masking32.png" />
<None Include="Images\OliviaIconPro.ico" />
<None Include="Images\OliviaIconPro32Web.png" />
<None Include="Images\open32.png" />
<None Include="Images\openfolder.png" />
<None Include="Images\openfolder32.png" />
<None Include="Images\time32.png" />
<None Include="Model\OliviaGlob.cs.bak" />
<None Include="Model\Recogida.cs.bak" />
<None Include="packages\Newtonsoft.Json.13.0.1\.signature.p7s" />
<None Include="packages\Newtonsoft.Json.13.0.1\LICENSE.md" />
<None Include="packages\Newtonsoft.Json.13.0.1\Newtonsoft.Json.13.0.1.nupkg" />
<None Include="packages\Newtonsoft.Json.13.0.1\packageIcon.png" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\net20\Newtonsoft.Json.dll" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\net20\Newtonsoft.Json.xml" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\net35\Newtonsoft.Json.dll" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\net35\Newtonsoft.Json.xml" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\net40\Newtonsoft.Json.dll" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\net40\Newtonsoft.Json.xml" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.xml" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\netstandard1.0\Newtonsoft.Json.dll" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\netstandard1.0\Newtonsoft.Json.xml" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\netstandard1.3\Newtonsoft.Json.dll" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\netstandard1.3\Newtonsoft.Json.xml" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\netstandard2.0\Newtonsoft.Json.dll" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\netstandard2.0\Newtonsoft.Json.xml" />
<None Include="Resources\inicio.png" />
<None Include="Resources\inicio24.png" />
<None Include="Resources\ptosctrl.png" />
<None Include="Resources\ptosctrl24.png" />
<None Include="Resources\time.png" />
<None Include="Resources\time24.png" />
<None Include="Resources\zonas.png" />
<None Include="Resources\zonas24.png" />
<None Include="Services\ProcesoEjecServ.cs.bak" />
<None Include="View\OliviaIconPro.ico" />
<None Include="View\OliviaIconPro16.png" />
<None Include="View\Recogida\old\PaneRecogidaSub2.xaml.NotUsed" />
<None Include="View\Recogida\old\PaneRecogidaSub2.xaml.cs.NotUsed" />
<None Include="View\Recogida\old\PaneRecogidaSub4.xaml.NotUsed" />
<None Include="View\Recogida\old\PaneRecogidaSub4.xaml.cs.NotUsed" />
<None Include="ViewModel\Limpieza\PaneLimpiezaViewModel.cs.bak" />
<None Include="ViewModel\Recogida\old\PaneRecogidaSub2ViewModel.cs.NotUsed" />
<None Include="ViewModel\Recogida\old\PaneRecogidaSub4ViewModel.cs.NotUsed" />
</ItemGroup>
<ItemGroup>
<Compile Update="Resource1.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resource1.resx</DependentUpon>
</Compile>
</ItemGroup>
<Import Project="C:\Program Files\ArcGIS\Pro\bin\Esri.ProApp.SDK.Desktop.targets" Condition="Exists('C:\Program Files\ArcGIS\Pro\bin\Esri.ProApp.SDK.Desktop.targets') AND !Exists('Esri.ArcGISPro.Extensions.targets')" />
</Project> </Project>

View File

@ -1,344 +1,156 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <TargetFramework>net6.0-windows</TargetFramework>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<ProductVersion>8.0.30703</ProductVersion> <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<SchemaVersion>2.0</SchemaVersion> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<ProjectGuid>{10742570-CF59-42F2-BEA2-2A38002A06EE}</ProjectGuid> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<OutputType>Library</OutputType> <NoWarn>CA1416</NoWarn>
<AppDesignerFolder>Properties</AppDesignerFolder> <UseWPF>true</UseWPF>
<RootNamespace>OliviaAddInPro</RootNamespace> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyName>OliviaAddInPro</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<PropertyGroup>
<ArcGISFolder>$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\ArcGISPro', 'InstallDir', null, RegistryView.Registry64))</ArcGISFolder>
<ArcGISFolder Condition="'$(ArcGISFolder)' == ''">$(registry:HKEY_CURRENT_USER\SOFTWARE\ESRI\ArcGISPro@InstallDir)</ArcGISFolder>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<StartAction>Program</StartAction>
<StartProgram>$(ArcGISFolder)\bin\ArcGISPro.exe</StartProgram>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<StartAction>Program</StartAction>
<StartProgram>$(ArcGISFolder)\bin\ArcGISPro.exe</StartProgram>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Compile Remove=".git\**" />
<HintPath>packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <EmbeddedResource Remove=".git\**" />
</Reference> <None Remove=".git\**" />
<Reference Include="System" /> <Page Remove=".git\**" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="WindowsBase" />
<Reference Include="System.Xaml" />
<Reference Include="ArcGIS.Desktop.Framework">
<HintPath>$(ArcGISFolder)\bin\ArcGIS.Desktop.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Core">
<HintPath>$(ArcGISFolder)\bin\ArcGIS.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Core">
<HintPath>$(ArcGISFolder)\bin\Extensions\Core\ArcGIS.Desktop.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Mapping">
<HintPath>$(ArcGISFolder)\bin\Extensions\Mapping\ArcGIS.Desktop.Mapping.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Catalog">
<HintPath>$(ArcGISFolder)\bin\Extensions\Catalog\ArcGIS.Desktop.Catalog.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Editing">
<HintPath>$(ArcGISFolder)\bin\Extensions\Editing\ArcGIS.Desktop.Editing.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Extensions">
<HintPath>$(ArcGISFolder)\bin\Extensions\DesktopExtensions\ArcGIS.Desktop.Extensions.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.GeoProcessing">
<HintPath>$(ArcGISFolder)\bin\Extensions\GeoProcessing\ArcGIS.Desktop.GeoProcessing.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Layouts">
<HintPath>$(ArcGISFolder)\bin\Extensions\Layout\ArcGIS.Desktop.Layouts.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Shared.Wpf">
<HintPath>$(ArcGISFolder)\bin\ArcGIS.Desktop.Shared.Wpf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Ribbon.Wpf">
<HintPath>$(ArcGISFolder)\bin\ArcGIS.Desktop.Ribbon.Wpf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.DataGrid.Contrib.Wpf">
<HintPath>$(ArcGISFolder)\bin\ArcGIS.Desktop.DataGrid.Contrib.Wpf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Resources">
<HintPath>$(ArcGISFolder)\bin\ArcGIS.Desktop.Resources.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Resources">
<HintPath>$(ArcGISFolder)\bin\ArcGIS.Desktop.Resources.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ESRI.ArcGIS.ItemIndex">
<HintPath>$(ArcGISFolder)\bin\ESRI.ArcGIS.ItemIndex.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit">
<HintPath>..\wpftoolkit-master\ExtendedWPFToolkitSolution\Src\Xceed.Wpf.Toolkit\bin\Release\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<AddInContent Include="Config.daml" /> <Content Include="Config.daml" />
<AddInContent Include="Images\AddInDesktop16.png" /> <Content Include="Images\AddInDesktop16.png" />
<AddInContent Include="Images\AddInDesktop32.png" /> <Content Include="Images\AddInDesktop32.png" />
<AddInContent Include="DarkImages\AddInDesktop16.png" /> <Content Include="DarkImages\AddInDesktop16.png" />
<AddInContent Include="DarkImages\AddInDesktop32.png" /> <Content Include="DarkImages\AddInDesktop32.png" />
</ItemGroup> <Content Include="DarkImages\GenericButtonBlue16.png" />
<ItemGroup> <Content Include="DarkImages\GenericButtonBlue32.png" />
<Compile Include="Button\ButtonConfig.cs" /> <Content Include="Images\OliviaIconPro16.png" />
<Compile Include="Button\ButtonLimp.cs" /> <Content Include="Images\OliviaIconPro32.png" />
<Compile Include="Button\ButtonMaq.cs" /> <Content Include="DarkImages\GenericButtonPurple16.png" />
<Compile Include="Button\ButtonRec.cs" /> <Content Include="DarkImages\GenericButtonPurple32.png" />
<Compile Include="Conexion\Cstr_socket.cs" /> <Content Include="DarkImages\GenericButtonGreen16.png" />
<Compile Include="Helper\EnabledComboBoxItem.cs" /> <Content Include="DarkImages\GenericButtonGreen32.png" />
<Compile Include="Helper\CheckedListItem.cs" /> <Content Include="Images\reco2.png" />
<Compile Include="Helper\HelperGdb.cs" /> <Content Include="Images\carrito2.png" />
<Compile Include="Helper\HelperGlobal.cs" /> <Content Include="Images\config2_olv.png" />
<Compile Include="Model\ComunDef.cs" />
<Compile Include="Model\ESRI.ArcGIS.Geometry.esriSRProjCS4Type.cs" />
<Compile Include="Model\Recogida.cs" />
<Compile Include="Model\RecogidaDef.cs" />
<Compile Include="Model\Respuesta.cs" />
<Compile Include="Model\TratamientoComun.cs" />
<Compile Include="Model\Limpieza.cs" />
<Compile Include="Model\LimpiezaDef.cs" />
<Compile Include="Services\EjecServ.cs" />
<Compile Include="Model\OliviaConf.cs" />
<Compile Include="Model\OliviaDef.cs" />
<Compile Include="Services\ConfigServ.cs" />
<<<<<<< HEAD
<Compile Include="Services\LanzaSrv\LanzaLimpSrv.cs" />
<Compile Include="Services\LanzaSrv\LanzaOlvServ.cs" />
<Compile Include="Services\LanzaSrv\LanzaRecoSrv.cs" />
=======
<Compile Include="Services\ImportaResServ.cs" />
>>>>>>> Elena/reco
<Compile Include="Services\LimpiezaServ.cs" />
<Compile Include="Services\RecogidaServ.cs" />
<Compile Include="ViewModel\Configuracion\DockpaneConfigViewModel.cs" />
<Compile Include="ViewModel\Configuracion\PaneConfigViewModel.cs" />
<Compile Include="ViewModel\OptionsMenuItem.cs" />
<Compile Include="ViewModel\PaneEjecutarViewModel.cs" />
<Compile Include="ViewModel\Limpieza\PaneLimpiezaSub4ViewModel.cs" />
<Compile Include="ViewModel\Limpieza\PaneLimpiezaSub3ViewModel.cs" />
<Compile Include="ViewModel\Limpieza\PaneLimpiezaSub2ViewModel.cs" />
<Compile Include="ViewModel\Limpieza\PaneLimpiezaViewModel.cs" />
<Compile Include="ViewModel\PanelViewModelBase.cs" />
<Compile Include="ViewModel\Recogida\PaneRecogidaSub1ViewModel.cs" />
<Compile Include="View\Recogida\PaneRecogidaSub1.xaml.cs">
<DependentUpon>PaneRecogidaSub1.xaml</DependentUpon>
</Compile>
<Compile Include="View\Recogida\PaneRecogida.xaml.cs">
<DependentUpon>PaneRecogida.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModel\Recogida\PaneRecogidaViewModel.cs" />
<Compile Include="View\Configuracion\DockPaneConfig.xaml.cs">
<DependentUpon>DockPaneConfig.xaml</DependentUpon>
</Compile>
<Compile Include="View\Configuracion\PaneConfigView.xaml.cs">
<DependentUpon>PaneConfigView.xaml</DependentUpon>
</Compile>
<Compile Include="View\PaneEjecutar.xaml.cs">
<DependentUpon>PaneEjecutar.xaml</DependentUpon>
</Compile>
<Compile Include="View\Limpieza\PaneLimpiezaSub4.xaml.cs">
<DependentUpon>PaneLimpiezaSub4.xaml</DependentUpon>
</Compile>
<Compile Include="View\Limpieza\PaneLimpiezaSub3.xaml.cs">
<DependentUpon>PaneLimpiezaSub3.xaml</DependentUpon>
</Compile>
<Compile Include="View\Limpieza\PaneLimpiezaSub2.xaml.cs">
<DependentUpon>PaneLimpiezaSub2.xaml</DependentUpon>
</Compile>
<Compile Include="View\Limpieza\PaneLimpiezaSub1.xaml.cs">
<DependentUpon>PaneLimpiezaSub1.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModel\Limpieza\PaneLimpiezaSub1ViewModel.cs" />
<Compile Include="View\Limpieza\PaneLimpieza.xaml.cs">
<DependentUpon>PaneLimpieza.xaml</DependentUpon>
</Compile>
<Compile Include="View\Limpieza\DockpaneLimpieza.xaml.cs">
<DependentUpon>DockpaneLimpieza.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModel\Limpieza\DockpaneLimpiezaViewModel.cs" />
<Compile Include="View\Recogida\DockpaneRecogida.xaml.cs">
<DependentUpon>DockpaneRecogida.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModel\Recogida\DockpaneRecogidaViewModel.cs" />
<Compile Include="Module1.cs" />
<Compile Include="Model\OliviaGlob.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Resource1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resource1.resx</DependentUpon>
</Compile>
<Compile Include="View\ProWndSelectFields.xaml.cs">
<DependentUpon>ProWndSelectFields.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModel\ShowProWndSelectFields.cs" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="DarkImages\GenericButtonBlue16.png" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="DarkImages\GenericButtonBlue32.png" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="Images\OliviaIconPro16.png" />
<AddInContent Include="Images\OliviaIconPro32.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="OliviaIconPro.ico" /> <Resource Include="OliviaIconPro.ico" />
</ItemGroup>
<ItemGroup>
<Page Include="View\Recogida\PaneRecogidaSub1.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Recogida\PaneRecogida.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Configuracion\DockPaneConfig.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Configuracion\PaneConfigView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\PaneEjecutar.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Limpieza\PaneLimpiezaSub4.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Limpieza\PaneLimpiezaSub3.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Limpieza\PaneLimpiezaSub2.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Limpieza\PaneLimpiezaSub1.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Limpieza\PaneLimpieza.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Limpieza\DockpaneLimpieza.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Recogida\DockpaneRecogida.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\ProWndSelectFields.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<AddInContent Include="DarkImages\GenericButtonPurple16.png" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="DarkImages\GenericButtonPurple32.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resource1.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resource1.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<AddInContent Include="Images\config.png" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="DarkImages\GenericButtonGreen16.png" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="DarkImages\GenericButtonGreen32.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="View\OliviaIconPro16.png" /> <Resource Include="View\OliviaIconPro16.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="View\OliviaIconPro.ico" /> <Resource Include="View\OliviaIconPro.ico" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\inicio.png" /> <Resource Include="Resources\inicio.png" />
<Resource Include="Resources\ptosctrl.png" /> <Resource Include="Resources\ptosctrl.png" />
<Resource Include="Resources\time.png" /> <Resource Include="Resources\time.png" />
<Resource Include="Resources\zonas.png" /> <Resource Include="Resources\zonas.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\openfolder.png" /> <Resource Include="Images\openfolder.png" />
<Resource Include="Images\help16Pro.png" />
</ItemGroup> </ItemGroup>
<<<<<<< HEAD <<<<<<< HEAD
<ItemGroup /> <ItemGroup>
<PackageReference Include="DotNetProjects.Extended.Wpf.Toolkit" Version="5.0.103" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<Reference Include="ArcGIS.Desktop.Framework">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.Framework.dll</HintPath>
<CopyLocal>false</CopyLocal>
</Reference>
<Reference Include="ArcGIS.Core">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Core.dll</HintPath>
<CopyLocal>false</CopyLocal>
</Reference>
<Reference Include="ArcGIS.Desktop.Core">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\Core\ArcGIS.Desktop.Core.dll</HintPath>
<CopyLocal>false</CopyLocal>
</Reference>
<Reference Include="ArcGIS.Desktop.Layouts">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\Layout\ArcGIS.Desktop.Layouts.dll</HintPath>
</Reference>
<Reference Include="ArcGIS.Desktop.Mapping">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\Mapping\ArcGIS.Desktop.Mapping.dll</HintPath>
<CopyLocal>false</CopyLocal>
</Reference>
<Reference Include="ArcGIS.Desktop.Catalog">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\Catalog\ArcGIS.Desktop.Catalog.dll</HintPath>
<CopyLocal>false</CopyLocal>
</Reference>
<Reference Include="ArcGIS.Desktop.Shared.Wpf">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.Shared.Wpf.dll</HintPath>
<CopyLocal>false</CopyLocal>
</Reference>
<Reference Include="ArcGIS.Desktop.Editing">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\Editing\ArcGIS.Desktop.Editing.dll</HintPath>
<CopyLocal>false</CopyLocal>
</Reference>
<Reference Include="ArcGIS.Desktop.Extensions">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\DesktopExtensions\ArcGIS.Desktop.Extensions.dll</HintPath>
<CopyLocal>false</CopyLocal>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include=".gitignore" />
<None Include="Backup-2.x.zip" />
<None Include="OliviaAddInPro.csproj.bak" />
<None Include="OliviaAddInPro.csproj.user" />
<None Include="OliviaIconPro.ico" />
<None Include="Images\config2_.png" />
<None Include="Images\config2_olv - copia.png" />
<None Include="Images\config_old.png" />
<None Include="Images\genericproperties32.png" />
<None Include="Images\help16Pro.png" />
<None Include="Images\masking32.png" />
<None Include="Images\OliviaIconPro.ico" />
<None Include="Images\OliviaIconPro32Web.png" />
<None Include="Images\open32.png" />
<None Include="Images\openfolder.png" />
<None Include="Images\openfolder32.png" />
<None Include="Images\time32.png" />
<None Include="Model\OliviaGlob.cs.bak" />
<None Include="Model\Recogida.cs.bak" />
<None Include="packages\Newtonsoft.Json.13.0.1\.signature.p7s" />
<None Include="packages\Newtonsoft.Json.13.0.1\LICENSE.md" />
<None Include="packages\Newtonsoft.Json.13.0.1\Newtonsoft.Json.13.0.1.nupkg" />
<None Include="packages\Newtonsoft.Json.13.0.1\packageIcon.png" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\net20\Newtonsoft.Json.dll" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\net20\Newtonsoft.Json.xml" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\net35\Newtonsoft.Json.dll" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\net35\Newtonsoft.Json.xml" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\net40\Newtonsoft.Json.dll" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\net40\Newtonsoft.Json.xml" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.xml" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\netstandard1.0\Newtonsoft.Json.dll" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\netstandard1.0\Newtonsoft.Json.xml" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\netstandard1.3\Newtonsoft.Json.dll" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\netstandard1.3\Newtonsoft.Json.xml" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\netstandard2.0\Newtonsoft.Json.dll" />
<None Include="packages\Newtonsoft.Json.13.0.1\lib\netstandard2.0\Newtonsoft.Json.xml" />
<None Include="Resources\inicio.png" />
<None Include="Resources\inicio24.png" />
<None Include="Resources\ptosctrl.png" />
<None Include="Resources\ptosctrl24.png" />
<None Include="Resources\time.png" />
<None Include="Resources\time24.png" />
<None Include="Resources\zonas.png" />
<None Include="Resources\zonas24.png" />
<None Include="Services\ProcesoEjecServ.cs.bak" />
<None Include="View\OliviaIconPro.ico" />
<None Include="View\OliviaIconPro16.png" />
<None Include="View\Recogida\old\PaneRecogidaSub2.xaml.NotUsed" />
<None Include="View\Recogida\old\PaneRecogidaSub2.xaml.cs.NotUsed" />
<None Include="View\Recogida\old\PaneRecogidaSub4.xaml.NotUsed" />
<None Include="View\Recogida\old\PaneRecogidaSub4.xaml.cs.NotUsed" />
<None Include="ViewModel\Limpieza\PaneLimpiezaViewModel.cs.bak" />
<None Include="ViewModel\Recogida\old\PaneRecogidaSub2ViewModel.cs.NotUsed" />
<None Include="ViewModel\Recogida\old\PaneRecogidaSub4ViewModel.cs.NotUsed" />
</ItemGroup>
<ItemGroup>
<Compile Update="Resource1.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resource1.resx</DependentUpon>
</Compile>
</ItemGroup>
<Import Project="C:\Program Files\ArcGIS\Pro\bin\Esri.ProApp.SDK.Desktop.targets" Condition="Exists('C:\Program Files\ArcGIS\Pro\bin\Esri.ProApp.SDK.Desktop.targets') AND !Exists('Esri.ArcGISPro.Extensions.targets')" />
======= =======
<ItemGroup>
<AddInContent Include="Images\config2.png" />
<AddInContent Include="Images\reco2.png" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="Images\carrito2.png" />
</ItemGroup>
>>>>>>> Elena/reco
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- <!--
PackageAction can be: PackageAction can be:
@ -352,12 +164,17 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction> <PackageAction>BuildDefault</PackageAction>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
<UsingTask AssemblyFile="$(ArcGISFolder)\bin\proapp-sdk-MSBuild.dll" TaskName="proapp_sdk_MSBuild.PackageAddIn" /> <UsingTask AssemblyFile="$(ArcGISFolder)\bin\proapp-sdk-MSBuild.dll" TaskName="proapp_sdk_MSBuild.PackageAddIn" />
<UsingTask AssemblyFile="$(ArcGISFolder)\bin\proapp-sdk-MSBuild.dll" TaskName="proapp_sdk_MSBuild.CleanAddIn" /> <UsingTask AssemblyFile="$(ArcGISFolder)\bin\proapp-sdk-MSBuild.dll" TaskName="proapp_sdk_MSBuild.CleanAddIn" />
<UsingTask AssemblyFile="$(ArcGISFolder)\bin\proapp-sdk-MSBuild.dll" TaskName="proapp_sdk_MSBuild.ConvertToRelativePath" /> <UsingTask AssemblyFile="$(ArcGISFolder)\bin\proapp-sdk-MSBuild.dll" TaskName="proapp_sdk_MSBuild.ConvertToRelativePath" />
<!--<Import Project="Esri.ArcGISPro.Extensions.targets" Condition="Exists('Esri.ArcGISPro.Extensions.targets')" />--> <!--<Import Project="Esri.ArcGISPro.Extensions.targets" Condition="Exists('Esri.ArcGISPro.Extensions.targets')" />-->
<Import Project="$(ArcGISFolder)\bin\Esri.ProApp.SDK.Desktop.targets" Condition="Exists('$(ArcGISFolder)\bin\Esri.ProApp.SDK.Desktop.targets') AND !Exists('Esri.ArcGISPro.Extensions.targets')" /> <Import Project="$(ArcGISFolder)\bin\Esri.ProApp.SDK.Desktop.targets" Condition="Exists('$(ArcGISFolder)\bin\Esri.ProApp.SDK.Desktop.targets') AND !Exists('Esri.ArcGISPro.Extensions.targets')" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
@ -368,4 +185,5 @@
<!--<Target Name="BeforeBuild"> <!--<Target Name="BeforeBuild">
<Error Text="C:\Users\Elena\AppData\Local\Programs\ArcGIS\Pro\bin\Esri.ProApp.SDK.Desktop.targets not found." Condition="!Exists('C:\Users\Elena\AppData\Local\Programs\ArcGIS\Pro\bin\Esri.ProApp.SDK.Desktop.targets') AND !Exists('Esri.ArcGISPro.Extensions.targets')" /> <Error Text="C:\Users\Elena\AppData\Local\Programs\ArcGIS\Pro\bin\Esri.ProApp.SDK.Desktop.targets not found." Condition="!Exists('C:\Users\Elena\AppData\Local\Programs\ArcGIS\Pro\bin\Esri.ProApp.SDK.Desktop.targets') AND !Exists('Esri.ArcGISPro.Extensions.targets')" />
</Target>--> </Target>-->
>>>>>>> origin/develop
</Project> </Project>

View File

@ -1,4 +1,4 @@

Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16 # Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22 VisualStudioVersion = 16.0.30011.22
@ -8,13 +8,25 @@ EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{10742570-CF59-42F2-BEA2-2A38002A06EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {10742570-CF59-42F2-BEA2-2A38002A06EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10742570-CF59-42F2-BEA2-2A38002A06EE}.Debug|Any CPU.Build.0 = Debug|Any CPU {10742570-CF59-42F2-BEA2-2A38002A06EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10742570-CF59-42F2-BEA2-2A38002A06EE}.Debug|x64.ActiveCfg = Debug|Any CPU
{10742570-CF59-42F2-BEA2-2A38002A06EE}.Debug|x64.Build.0 = Debug|Any CPU
{10742570-CF59-42F2-BEA2-2A38002A06EE}.Debug|x86.ActiveCfg = Debug|Any CPU
{10742570-CF59-42F2-BEA2-2A38002A06EE}.Debug|x86.Build.0 = Debug|Any CPU
{10742570-CF59-42F2-BEA2-2A38002A06EE}.Release|Any CPU.ActiveCfg = Release|Any CPU {10742570-CF59-42F2-BEA2-2A38002A06EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10742570-CF59-42F2-BEA2-2A38002A06EE}.Release|Any CPU.Build.0 = Release|Any CPU {10742570-CF59-42F2-BEA2-2A38002A06EE}.Release|Any CPU.Build.0 = Release|Any CPU
{10742570-CF59-42F2-BEA2-2A38002A06EE}.Release|x64.ActiveCfg = Release|Any CPU
{10742570-CF59-42F2-BEA2-2A38002A06EE}.Release|x64.Build.0 = Release|Any CPU
{10742570-CF59-42F2-BEA2-2A38002A06EE}.Release|x86.ActiveCfg = Release|Any CPU
{10742570-CF59-42F2-BEA2-2A38002A06EE}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("VSM - Narvaling")] [assembly: AssemblyCompany("VSM - Narvaling")]
[assembly: AssemblyProduct("OliviaAddInPro")] [assembly: AssemblyProduct("OliviaAddInPro")]
[assembly: AssemblyCopyright("Copyright © VSM 2022")] [assembly: AssemblyCopyright("Copyright © VSM 2024")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyFileVersion("4.0.0.0")]

View File

@ -0,0 +1,8 @@
{
"profiles": {
"OliviaAddInPro": {
"commandName": "Executable",
"executablePath": "C:\\Program Files\\ArcGIS\\Pro\\bin\\ArcGISPro.exe"
}
}
}

View File

@ -7,6 +7,7 @@ using System.Threading.Tasks;
using System.IO; using System.IO;
using Newtonsoft.Json; using Newtonsoft.Json;
using Microsoft.Win32; using Microsoft.Win32;
using static OliviaAddInPro.Model.OliviaConf;
namespace OliviaAddInPro.Services namespace OliviaAddInPro.Services
{ {
@ -15,10 +16,10 @@ namespace OliviaAddInPro.Services
private static string pathConfigDef = "C:\\Olivia"; private static string pathConfigDef = "C:\\Olivia";
private static ConfigServ configServ=null; private static ConfigServ configServ=null;
private static string nameDirWork = "%dir_work%"; private static string nameDirWork = "%dir_work%";
public const string OlvRegKey = "SOFTWARE\\Narvaling\\Olivia_3_0"; public const string OlvRegKey = "SOFTWARE\\Narvaling\\Olivia_4_0";
public const string OlvRegName = "workdir"; public const string OlvRegName = "workdir";
public const string OlvConfigName = "olv.conf"; public const string OlvConfigName = "olv.conf";
public const string VersionConfiguracion = "1.2.0.0";
public static ConfigServ Serv public static ConfigServ Serv
{ {
get { get {
@ -41,11 +42,12 @@ namespace OliviaAddInPro.Services
var ee = e; var ee = e;
res = null; res = null;
} }
if(res==null) if(res==null || res.Version==null || res.Version != VersionConfiguracion)
res = Default(); res = Default();
EnumOpsNWToString.ListaNw = res.ListaNw;
//pilla la IP //pilla la IP
if(res.Ip.CompareTo("0.0.0.0")==0) if (res.Ip.CompareTo("0.0.0.0")==0)
{ {
//coge la IP local //coge la IP local
res.Ip = OliviaGlob.Conexion.Ip; res.Ip = OliviaGlob.Conexion.Ip;
@ -60,6 +62,10 @@ namespace OliviaAddInPro.Services
res.path_exe = pon_path_absoluto(res.path_exe, res.path_work); res.path_exe = pon_path_absoluto(res.path_exe, res.path_work);
res.path_manual = pon_path_absoluto(res.path_manual, res.path_work); res.path_manual = pon_path_absoluto(res.path_manual, res.path_work);
//chapa
if (res.path_manual.Contains("Manual_Olivia_3_0.pdf"))
res.path_manual.Replace("Manual_Olivia_3_0.pdf", "Manual_Olivia.pdf");
//////////////
res.path_temp = pon_path_absoluto(res.path_temp, res.path_work); res.path_temp = pon_path_absoluto(res.path_temp, res.path_work);
res.path_data = pon_path_absoluto(res.path_data, res.path_work); res.path_data = pon_path_absoluto(res.path_data, res.path_work);
res.path_cfg_aux = @"%dir_work%cfg.ini"; res.path_cfg_aux = @"%dir_work%cfg.ini";
@ -67,8 +73,9 @@ namespace OliviaAddInPro.Services
return res; return res;
} }
public void Guardar(OliviaConf conf) public Respuesta<bool> Guardar(OliviaConf conf)
{ {
Respuesta<bool> resp = new Respuesta<bool> { Value = true };
conf.path_exe = pon_path_relativo(conf.path_exe, conf.path_work); conf.path_exe = pon_path_relativo(conf.path_exe, conf.path_work);
conf.path_manual = pon_path_relativo(conf.path_manual, conf.path_work); conf.path_manual = pon_path_relativo(conf.path_manual, conf.path_work);
conf.path_temp = pon_path_relativo(conf.path_temp, conf.path_work); conf.path_temp = pon_path_relativo(conf.path_temp, conf.path_work);
@ -80,11 +87,19 @@ namespace OliviaAddInPro.Services
conf.PathSimbESRI = pon_path_relativo(conf.PathSimbESRI, conf.path_work); conf.PathSimbESRI = pon_path_relativo(conf.PathSimbESRI, conf.path_work);
conf.PathCartela = pon_path_relativo(conf.PathCartela, conf.path_work); conf.PathCartela = pon_path_relativo(conf.PathCartela, conf.path_work);
conf.Path_Eje_via = pon_path_relativo(conf.Path_Eje_via, conf.path_work); conf.Path_Eje_via = pon_path_relativo(conf.Path_Eje_via, conf.path_work);
string jsonString = JsonConvert.SerializeObject(conf); try
var path_cfg = GetPathConfig(); {
path_cfg = Path.Combine(path_cfg, OlvConfigName); string jsonString = JsonConvert.SerializeObject(conf);
File.WriteAllText(path_cfg, jsonString); var path_cfg = GetPathConfig();
path_cfg = Path.Combine(path_cfg, OlvConfigName);
File.WriteAllText(path_cfg, jsonString);
}
catch(Exception ex)
{
resp.Error.Add("Error al guardar archivo: " + ex.Message);
resp.Value = false;
}
conf.path_exe = pon_path_absoluto(conf.path_exe, conf.path_work); conf.path_exe = pon_path_absoluto(conf.path_exe, conf.path_work);
conf.path_cfg_aux = pon_path_absoluto(conf.path_cfg_aux, conf.path_work); conf.path_cfg_aux = pon_path_absoluto(conf.path_cfg_aux, conf.path_work);
@ -96,6 +111,8 @@ namespace OliviaAddInPro.Services
conf.PathSimbESRI = pon_path_absoluto(conf.PathSimbESRI, conf.path_work); conf.PathSimbESRI = pon_path_absoluto(conf.PathSimbESRI, conf.path_work);
conf.PathCartela = pon_path_absoluto(conf.PathCartela, conf.path_work); conf.PathCartela = pon_path_absoluto(conf.PathCartela, conf.path_work);
conf.Path_Eje_via = pon_path_absoluto(conf.Path_Eje_via, conf.path_work); conf.Path_Eje_via = pon_path_absoluto(conf.Path_Eje_via, conf.path_work);
return resp;
} }
/** /**
* cambia la carpeta referida a directorio de trabajo por los caracteres OliviaDirWork (%dir_work%) * cambia la carpeta referida a directorio de trabajo por los caracteres OliviaDirWork (%dir_work%)
@ -153,8 +170,8 @@ namespace OliviaAddInPro.Services
{ {
c.path_work = "C:\\Olivia\\"; c.path_work = "C:\\Olivia\\";
} }
c.Version = VersionConfiguracion;
c.PathGdbGen = @"%dir_work%gdb\\BASE DE DATOS.gdb"; c.PathGdbGen = @"%dir_work%gdb\\BASE DE DATOS.gdb";
c.PathSimbVSM = @"%dir_work%styles\\Simbologia.style"; c.PathSimbVSM = @"%dir_work%styles\\Simbologia.style";
c.PathSimbESRI = @"%dir_work%styles\\ESRI.style"; c.PathSimbESRI = @"%dir_work%styles\\ESRI.style";
@ -170,7 +187,7 @@ namespace OliviaAddInPro.Services
c.buffer_export = 1000; c.buffer_export = 1000;
c.path_exe=@"%dir_work%bin\OliviaTasks.exe"; c.path_exe=@"%dir_work%bin\OliviaTasks.exe";
c.path_manual= @"%dir_work%Manual_Olivia_3_0.pdf"; c.path_manual= @"%dir_work%Manual_Olivia.pdf";
c.path_temp = @"%dir_work%temp\"; c.path_temp = @"%dir_work%temp\";
c.path_data=@"%dir_work%data\"; c.path_data=@"%dir_work%data\";
c.Path_Eje_via = ""; c.Path_Eje_via = "";
@ -292,13 +309,13 @@ namespace OliviaAddInPro.Services
c.v_desp_LS=0; c.v_desp_LS=0;
//Reco //Reco
c.id= "OBJECTID"; c.id= "_ID";
c.nomrec= "NOMB_TIP_REC"; c.nomrec= "NOMB_TIP_REC";
c.lateralidad= "LATERALIDAD"; c.lateralidad= "LATERALIDAD";
c.frac= "FRACCION"; c.frac= "FRACCION";
c.capac= "CAPACIDAD"; c.capac= "CAPACIDAD";
c.uds= "UNIDADES"; c.uds= "UNIDADES";
c.kgrec= "KGRECO"; c.kgrec= "Kg_Recog";
c.kgrec_val=200; c.kgrec_val=200;
c.is_lleno=false; c.is_lleno=false;
c.is_campo=false; c.is_campo=false;
@ -337,13 +354,13 @@ namespace OliviaAddInPro.Services
c.dens_vehi_org=500; c.dens_vehi_org=500;
c.dens_vehi_res=500; c.dens_vehi_res=500;
c.dens_vehi_env=120; c.dens_vehi_env=120;
c.dens_vehi_pap=250; c.dens_vehi_pap=360;
c.dens_vehi_vid=350; c.dens_vehi_vid=350;
c.dens_vehi_otr=100; c.dens_vehi_otr=100;
c.dens_cont_org=150; c.dens_cont_org=200;
c.dens_cont_res=100; c.dens_cont_res=100;
c.dens_cont_env=28; c.dens_cont_env=28;
c.dens_cont_pap=90; c.dens_cont_pap=75;
c.dens_cont_vid=250; c.dens_cont_vid=250;
c.dens_cont_otr=100; c.dens_cont_otr=100;
c.anch_vehi_3=2.4000000; c.anch_vehi_3=2.4000000;
@ -356,7 +373,7 @@ namespace OliviaAddInPro.Services
c.t_vaci_lateral=90; c.t_vaci_lateral=90;
c.t_vaci_superior=180; c.t_vaci_superior=180;
c.t_vaci_bilateral=100; c.t_vaci_bilateral=100;
c.t_vaci_bolseo=5; c.t_vaci_bolseo=5*60;
c.t_vaci_lavado=60; c.t_vaci_lavado=60;
c.t_vaci_otra=60; c.t_vaci_otra=60;
c.kgmax_max=20000; c.kgmax_max=20000;
@ -381,7 +398,87 @@ namespace OliviaAddInPro.Services
c.Giro_max_vehiculo = 175.0000000; c.Giro_max_vehiculo = 175.0000000;
c.Desv_max = 0.1500000; c.Desv_max = 0.1500000;
c.Desv_max_abs = 1800.0000000; c.Desv_max_abs = 1800.0000000;
c.Tipo_eje_via = OpsNW.nw_0;
c.ListaNw = new List<OliviaConfNW>();
c.ListaNw.Add(new OliviaConfNW()
{
nombre = "TomTom",
campo_velocidad = "$feature.KPH",
campo_nombre = "$feature.NAME",
campo_peatonal = "IIf( $feature.FOW == 14 || $feature.FOW == 15 || $feature.FOW == 19 || $feature.ONEWAY == 'N', 1, 0)",
campo_sentidoFT = "IIF($feature.ONEWAY== 'TF' || $feature.ONEWAY == 'N', 0 , 1)",
campo_sentidoTf = "IIF($feature.ONEWAY == 'FT' || $feature.ONEWAY == 'N', 0, 1)",
campo_elevacion_from = "$feature.F_ELEV",
campo_elevacion_to = "$feature.T_ELEV",
comprueba_elevacion = true,
revisa_topologia = false,
revisa_conjunciones = false,
revisa_angulos = false,
campo_angulos = "0"
}); ;
/*
c.ListaNw.Add(new OliviaConfNW()
{
nombre = "StreetMapPremiun",
campo_velocidad = "max($feature.FT_RST_SPE, $feature.TF_RST_SPE)",
campo_nombre = "$feature.FULL_STREE",
campo_peatonal = "IIF( $feature.FT_RST_AUT == 'Y' && $feature.TF_RST_AUT == 'Y', 1, 0)",
campo_sentidoFT = "IIf( $feature.FT_RST_AUT == 'N', 1, 0)",
campo_sentidoTf = "IIf( $feature.TF_RST_AUT == 'N', 1, 0)",
campo_elevacion_from = "IIf( $feature.F_ZLEV != null, $feature.F_ZLEV, 0)",
campo_elevacion_to = "IIf( $feature.T_ZLEV != null, $feature.T_ZLEV, 0)",
comprueba_elevacion = false,
revisa_topologia = false,
revisa_conjunciones = true,
revisa_angulos = true,
campo_angulos = "IIF($feature.ROAD_CLASS== '3 - Highway Ramp' || $feature.ROAD_CLASS== '6 - Major Road' || $feature.ROAD_CLASS == '1 - Surface Street', 90 , 0)"
});
*/
c.ListaMV = new List<OliviaConfMV>();
c.ListaMV.Add(new OliviaConfMV()
{
nombre = "Default",
filtro_omitir = "",
campo_prioridad = "0",
vehiculo_def_reco = -1,
vehiculo_def_lim = -1
}) ;
c.ListaMV.Add(new OliviaConfMV()
{
nombre = "Peaton",
filtro_omitir = "(FREEWAY <> 1 AND SLIPRD = 0)",
campo_prioridad = "0",
vehiculo_def_reco = -1,
vehiculo_def_lim = 0
});
c.ListaMV.Add(new OliviaConfMV()
{
nombre = "Vehiculo pequeño",
filtro_omitir = "(FREEWAY <> 1 AND SLIPRD = 0)",
campo_prioridad = "IIF($feature.PRIVATERD>1 || ($feature.FOW>13 && $feature.FOW<16) , -2 , 0)",
vehiculo_def_reco = 2,
vehiculo_def_lim = 1
});
c.ListaMV.Add(new OliviaConfMV()
{
nombre = "Vehiculo mediano",
filtro_omitir = "(ONEWAY <> 'N' AND FOW NOT IN (14, 15, 19))",
campo_prioridad = "IIF($feature.PRIVATERD>1 || $feature.RDCOND>1 , -2 , 0)",
vehiculo_def_reco = 1,
vehiculo_def_lim = -1
});
c.ListaMV.Add(new OliviaConfMV()
{
nombre = "Vehiculo grande",
filtro_omitir = "(ONEWAY <> 'N' AND FOW NOT IN (14, 15, 19))",
campo_prioridad = "IIF($feature.RDCOND>1,-3, (IIF($feature.PRIVATERD>1 , -2 , 0)))",
vehiculo_def_reco =0,
vehiculo_def_lim = -1
});
return c; return c;
} }
} }

View File

@ -10,6 +10,8 @@ using OliviaAddInPro.Helper;
using ArcGIS.Core.Internal.Data; using ArcGIS.Core.Internal.Data;
using ArcGIS.Desktop.Framework.Threading.Tasks; using ArcGIS.Desktop.Framework.Threading.Tasks;
using System.Windows; using System.Windows;
using System.IO;
using ArcGIS.Core.Data.UtilityNetwork.Trace;
namespace OliviaAddInPro.Services namespace OliviaAddInPro.Services
{ {
@ -27,6 +29,7 @@ namespace OliviaAddInPro.Services
public string PREF_NAME_EXPORT = "data_"; public string PREF_NAME_EXPORT = "data_";
public string EXT_SHP = ".shp"; public string EXT_SHP = ".shp";
public string PREF_NAME_EXPORT_NW = "nw_"; public string PREF_NAME_EXPORT_NW = "nw_";
public string PREF_NAME_EXPORT_NW_CONJ = "nw_c_";
public string NAME_CSV = "_L"; public string NAME_CSV = "_L";
public string EXT_CSV = ".csv"; public string EXT_CSV = ".csv";
public string NAME_RUTA2 = "_R2"; public string NAME_RUTA2 = "_R2";
@ -41,9 +44,10 @@ namespace OliviaAddInPro.Services
public string NAME_INSTAL = "_I"; public string NAME_INSTAL = "_I";
public string NAME_INSTAL_OUT = "_Instalacion"; public string NAME_INSTAL_OUT = "_Instalacion";
public int TipoMv { get; set; }
public string ErrStr = ""; public string ErrStr = "";
SpatialQueryFilter filtroEspacial = null; SpatialQueryFilter filtroEspacial = null;
SpatialReference spatRef = null; //SpatialReference spatRef = null;
SpatialReference spatRefData = null; SpatialReference spatRefData = null;
public TratamientoComun com; public TratamientoComun com;
@ -58,6 +62,7 @@ namespace OliviaAddInPro.Services
ErrStr = string.Empty; ErrStr = string.Empty;
OliviaGlob.Paths.PathData = string.Empty; OliviaGlob.Paths.PathData = string.Empty;
OliviaGlob.Paths.PathNW = string.Empty; OliviaGlob.Paths.PathNW = string.Empty;
OliviaGlob.Paths.PathNW_c= string.Empty;
if (com.ProgrSrc._ProgrSrc.Getcancelled()) if (com.ProgrSrc._ProgrSrc.Getcancelled())
{ {
ErrStr = Resource1.String_cancel_progreso; ErrStr = Resource1.String_cancel_progreso;
@ -69,7 +74,7 @@ namespace OliviaAddInPro.Services
//Comprueba que tiene las columnas necesarias para planificar //Comprueba que tiene las columnas necesarias para planificar
if ((modo == ModosEjec.Planifica) && !CompruebaPlanif()) if ((modo == ModosEjec.Planifica) && !CompruebaPlanif())
{ {
ErrStr = "En la capa de ámbitos seleccionada no se encuentran columnas de SECTOR y/o SECUENCIA, necesarias para planificar"; ErrStr = "En la capa de ámbitos seleccionada no se encuentran columnas de SECTOR y/o SECUENCIA, necesarias para planificar, o bien han cambiado los datos configurados";
return false; return false;
} }
if (com.ProgrSrc._ProgrSrc.Getcancelled()) if (com.ProgrSrc._ProgrSrc.Getcancelled())
@ -77,8 +82,14 @@ namespace OliviaAddInPro.Services
ErrStr = Resource1.String_cancel_progreso; ErrStr = Resource1.String_cancel_progreso;
return false; return false;
} }
//////////////////////////////////////////////
///Se guarda el nombre de los campos originales
///
com.GuardaCamposOrig(com.CapaElems);
//Cuenta las filas que cumplen la consulta //Cuenta las filas que cumplen la consulta
int nelems = HelperGdb.GetNumElemsSync(com.CapaElems, com.ConsultaAmbs); var nelems = HelperGdb.GetNumElemsSync(com.CapaElems, com.ConsultaAmbs);
if (nelems <= 0) if (nelems <= 0)
{ {
ErrStr = "No existen ámbitos que cumplan las condiciones introducidas para la exportación " + com.ConsultaAmbs; ErrStr = "No existen ámbitos que cumplan las condiciones introducidas para la exportación " + com.ConsultaAmbs;
@ -134,9 +145,18 @@ namespace OliviaAddInPro.Services
ErrStr = Resource1.String_cancel_progreso; ErrStr = Resource1.String_cancel_progreso;
return false; return false;
} }
//mira spatialreference de los datos de entrada //mira spatialreference de los datos de entrada
spatRefData = geom_export.SpatialReference; spatref = HelperGdb.GetSpatRefSync(com.CapaElemsRef);
spatRefData = spatref;
if (spatref != null)
{
geom_export = HelperGdb.ReproyectaGeom(geom_export, spatref);
}
if (geom_export == null)
{
ErrStr = "Error al reproyectar geometría para la exportacion de los ámbitos";
return false;
}
//crea el filtro de exportación //crea el filtro de exportación
filtroEspacial = HelperGdb.CreateFiler(com.ConsultaAmbs, geom_export); filtroEspacial = HelperGdb.CreateFiler(com.ConsultaAmbs, geom_export);
if (filtroEspacial == null) if (filtroEspacial == null)
@ -162,7 +182,7 @@ namespace OliviaAddInPro.Services
//Guarda el nombre //Guarda el nombre
OliviaGlob.Paths.PathData = OliviaGlob.Paths.DirData + com.NombreShpExport; OliviaGlob.Paths.PathData = OliviaGlob.Paths.DirData + com.NombreShpExport;
//exporta los datos de entrada //exporta los datos de entrada
if (!HelperGdb.ExportShp2(com.CapaElems, filtroEspacial, com.NombreShpExport, OliviaGlob.Paths.DirData, com.ProgrSrc._ProgrSrc, null, 50)) if (!HelperGdb.ExportShp2(com.CapaElems, filtroEspacial, com.NombreShpExport, OliviaGlob.Paths.DirData, com.ProgrSrc._ProgrSrc, spatref, 50))
{ {
ErrStr = "Error al exportar los ámbitos: " + HelperGdb.OutStr; ErrStr = "Error al exportar los ámbitos: " + HelperGdb.OutStr;
return false; return false;
@ -174,9 +194,17 @@ namespace OliviaAddInPro.Services
return false; return false;
} }
/////////////////////////////////////////////////////////////////////
///Comprueba si está la columna de ObjectId y si no, la crea
if(!ComprCreaColOid(OliviaGlob.Paths.PathData, com.CapaElems, null))
{
ErrStr = "Error al exportar columna " + ComunDef.CamposCom.camp_oid;
return false;
}
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
//ahora si está en modo planificación y la capa no tiene esa columna, exporta la sectorización //ahora si está en modo planificación, ya ha hecho una ejec antes y la capa no tiene esa columna pero la tiene guardada de la ejec anterior, exporta la sectorización
if (modo==ModosEjec.Planifica && !string.IsNullOrEmpty(com.CapaPlanif)) if (modo==ModosEjec.Planifica && !string.IsNullOrEmpty(com.CapaPlanif) && OliviaGlob.IsConfig2())
{ {
string capa_principal = System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathData); string capa_principal = System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathData);
HelperGdb.CloseLayer(capa_principal); HelperGdb.CloseLayer(capa_principal);
@ -235,26 +263,11 @@ namespace OliviaAddInPro.Services
//a todos los ámbitos y la instalación, ampliada un buffer, mayor si hay //a todos los ámbitos y la instalación, ampliada un buffer, mayor si hay
//restricciones de circulación //restricciones de circulación
geom_export = HelperGdb.BufferGeom(geom_export, com.BuffExport).Value; geom_export = HelperGdb.BufferGeom(geom_export, com.BuffExport).Value;
if (geom_export == null) if (geom_export == null || geom_export.IsEmpty)
{ {
ErrStr = "Error al añadir buffer a la geometría"; ErrStr = "Error al añadir buffer a la geometría";
return false; return false;
} }
//quita las restricciones
if (com.GeomRestr != null)
{
geom_export = HelperGdb.QuitaGeom(geom_export, com.GeomRestr);
if (geom_export == null)
{
ErrStr = "Error al intersecar con las restricciones.";
return false;
}
}
if (com.ProgrSrc._ProgrSrc.Getcancelled())
{
ErrStr = Resource1.String_cancel_progreso;
return false;
}
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
//comprueba si la geometría de exportación contiene a la instalación y a la planta de descarga //comprueba si la geometría de exportación contiene a la instalación y a la planta de descarga
for (int i = 0; i < coords.Length; i++) for (int i = 0; i < coords.Length; i++)
@ -287,13 +300,28 @@ namespace OliviaAddInPro.Services
else else
ErrStr = "Error al incluir punto de instalación en polígono de exportación."; ErrStr = "Error al incluir punto de instalación en polígono de exportación.";
return false; return false;
} }
//actualiza la geometría //actualiza la geometría
geom_export = respGeom.Value; geom_export = respGeom.Value;
} }
} }
} }
} }
//quita las restricciones de circ
if (com.GeomRestr != null)
{
geom_export = HelperGdb.QuitaGeom(geom_export, com.GeomRestr);
if (geom_export == null)
{
ErrStr = "Error al intersecar con las restricciones.";
return false;
}
}
if (com.ProgrSrc._ProgrSrc.Getcancelled())
{
ErrStr = Resource1.String_cancel_progreso;
return false;
}
//mira spatialreference del nw //mira spatialreference del nw
/*FeatureClass fc = HelperGdb.GetFtClass(OliviaGlob.Paths.PathGdbNw); /*FeatureClass fc = HelperGdb.GetFtClass(OliviaGlob.Paths.PathGdbNw);
@ -316,20 +344,28 @@ namespace OliviaAddInPro.Services
* / * /
} }
}*/ }*/
//////////////////////////////////////
//Hace el filtro con la geometría final //guarda la mima de la geometría de la red navegable a exportar
filtroEspacial = HelperGdb.CreateFiler(String.Empty, geom_export); com.MimaNw = geom_export.Extent;
//////////////////////////////////////
var where = String.Empty;
if (!String.IsNullOrEmpty(ComunDef.configMV.filtro_omitir))
{
where = ComunDef.configMV.filtro_omitir;
}
if (com.ProgrSrc._ProgrSrc.Getcancelled())
{
ErrStr = Resource1.String_cancel_progreso;
return false;
}
filtroEspacial = HelperGdb.CreateFiler(where, geom_export);
if (filtroEspacial == null) if (filtroEspacial == null)
{ {
ErrStr = "Error al crear el filtro de exportacion de la red navegable"; ErrStr = "Error al crear el filtro de exportacion de la red navegable";
return false; return false;
} }
if (com.ProgrSrc._ProgrSrc.Getcancelled())
{
ErrStr = Resource1.String_cancel_progreso;
return false;
}
com.ProgrSrc.IncMessage(10, "Exportando red navegable");//60% com.ProgrSrc.IncMessage(10, "Exportando red navegable");//60%
//Prepara nombre de exportación //Prepara nombre de exportación
@ -337,17 +373,54 @@ namespace OliviaAddInPro.Services
//guarda los nombres del shape //guarda los nombres del shape
OliviaGlob.Paths.PathNW = OliviaGlob.Paths.DirData + com.NombreShpExportNw; OliviaGlob.Paths.PathNW = OliviaGlob.Paths.DirData + com.NombreShpExportNw;
//exporta los datos de entrada //exporta los datos de entrada
if (!HelperGdb.ExportShp2(OliviaGlob.Paths.PathGdbNw, filtroEspacial, com.NombreShpExportNw, OliviaGlob.Paths.DirData, com.ProgrSrc._ProgrSrc, spatRefData,100)) if (!HelperGdb.ExportShp2(OliviaGlob.Paths.PathGdbNw, filtroEspacial, com.NombreShpExportNw, OliviaGlob.Paths.DirData, com.ProgrSrc._ProgrSrc, spatref,100))
{ {
ErrStr = "Error al exportar la red navegable: " + HelperGdb.OutStr; ErrStr = "Error al exportar la red navegable: " + HelperGdb.OutStr;
return false; return false;
} }
//OliviaGlob.Paths.PathGdbNw.Replace("1.", ".");
if (com.ProgrSrc._ProgrSrc.Getcancelled()) if (com.ProgrSrc._ProgrSrc.Getcancelled())
{ {
ErrStr = Resource1.String_cancel_progreso; ErrStr = Resource1.String_cancel_progreso;
return false; return false;
} }
com.ProgrSrc.IncMessage(10, "Termina de exportar red navegable");//60%
com.NombreShpExportNw_C = PREF_NAME_EXPORT_NW_CONJ + fechaHora + EXT_SHP;
OliviaGlob.Paths.PathNW_c = OliviaGlob.Paths.DirData + com.NombreShpExportNw_C;
if (ComunDef.CamposNW.config.revisa_conjunciones)
{
filtroEspacial = HelperGdb.CreateFiler(String.Empty, geom_export);
com.ProgrSrc.IncMessage(10, "Revisando conjunciones de la red");//60%
if (!HelperGdb.ExportShp2(OliviaGlob.Paths.PathGdbNw_conj, filtroEspacial, com.NombreShpExportNw_C, OliviaGlob.Paths.DirData, com.ProgrSrc._ProgrSrc, spatRefData, 100))
{
ErrStr = "Error al exportar la red navegable: " + HelperGdb.OutStr;
return false;
}
if (com.ProgrSrc._ProgrSrc.Getcancelled())
{
ErrStr = Resource1.String_cancel_progreso;
return false;
}
}
/////////////////////////////////////////////////////////////////////
///Comprueba si está la columna de ObjectId y si no, la crea
/*if (!ComprCreaColOid(OliviaGlob.Paths.PathNW, OliviaGlob.Paths.PathGdbNw, null))
{
ErrStr = "Error al exportar columna " + ComunDef.CamposCom.camp_oid;
return false;
}
//lo añade la siguiente función
*/
//prepara campos estandar
com.ProgrSrc.IncMessage(10, "Estandarizando campos de la red");//60%
if (!EstandarizaCamposNW(OliviaGlob.Paths.PathNW))
{
ErrStr = "Error al estandarizar campos red navegable: " + HelperGdb.OutStr;
return false;
}
com.ProgrSrc.IncMessage(40, "Finalizada Exportación. Conectando con Olivia Tasks.");//100% com.ProgrSrc.IncMessage(40, "Finalizada Exportación. Conectando con Olivia Tasks.");//100%
} }
catch (Exception ex) catch (Exception ex)
@ -357,6 +430,101 @@ namespace OliviaAddInPro.Services
} }
return true; return true;
} }
bool EstandarizaCamposNW(string pathNW)
{
HelperGdb.FieldToAdd[] fields = new HelperGdb.FieldToAdd[10];
//campo SECTOR
int i = 0;
fields[i].Name = ComunDef.CamposNW.cons_kph;
fields[i].Alias = ComunDef.CamposNW.cons_kph;
fields[i].Tipo = "FLOAT";
fields[i].Length = 0;
i++;
fields[i].Name = ComunDef.CamposNW.cons_ele_f;
fields[i].Alias = ComunDef.CamposNW.cons_ele_f;
fields[i].Tipo = "FLOAT";
fields[i].Length = 0;
i++;
fields[i].Name = ComunDef.CamposNW.cons_ele_t;
fields[i].Alias = ComunDef.CamposNW.cons_ele_t;
fields[i].Tipo = "FLOAT";
fields[i].Length = 0;
i++;
fields[i].Name = ComunDef.CamposNW.cons_fow;
fields[i].Alias = ComunDef.CamposNW.cons_fow;
fields[i].Tipo = "LONG";
fields[i].Length = 0;
i++;
fields[i].Name = ComunDef.CamposNW.cons_onewFT;
fields[i].Alias = ComunDef.CamposNW.cons_onewFT;
fields[i].Tipo = "LONG";
fields[i].Length = 0;
i++;
fields[i].Name = ComunDef.CamposNW.cons_onewTF;
fields[i].Alias = ComunDef.CamposNW.cons_onewTF;
fields[i].Tipo = "LONG";
fields[i].Length = 0;
i++;
fields[i].Name = ComunDef.CamposNW.cons_evit;
fields[i].Alias = ComunDef.CamposNW.cons_evit;
fields[i].Tipo = "LONG";
fields[i].Length = 0;
i++;
fields[i].Name = ComunDef.CamposNW.cons_name;
fields[i].Alias = ComunDef.CamposNW.cons_name;
fields[i].Tipo = "TEXT";
fields[i].Length = 128;
i++;
fields[i].Name = ComunDef.CamposNW.cons_angulo;
fields[i].Alias = ComunDef.CamposNW.cons_angulo;
fields[i].Tipo = "FLOAT";
fields[i].Length = 128;
i++;
fields[i].Name = ComunDef.CamposCom.camp_oid;
fields[i].Alias = ComunDef.CamposCom.camp_oid;
fields[i].Tipo = "LONG";
fields[i].Length = 0;
if (!HelperGdb.AddFieldsSync(pathNW, fields))
return false;
if (!HelperGdb.CalculateFieldsSync(pathNW, ComunDef.CamposNW.cons_kph, ComunDef.CamposNW.config.campo_velocidad))
return false;
if (!HelperGdb.CalculateFieldsSync(pathNW, ComunDef.CamposNW.cons_name, ComunDef.CamposNW.config.campo_nombre))
return false;
if (!HelperGdb.CalculateFieldsSync(pathNW, ComunDef.CamposNW.cons_fow, ComunDef.CamposNW.config.campo_peatonal))
return false;
if (!HelperGdb.CalculateFieldsSync(pathNW, ComunDef.CamposNW.cons_onewTF, ComunDef.CamposNW.config.campo_sentidoTf))
return false;
if (!HelperGdb.CalculateFieldsSync(pathNW, ComunDef.CamposNW.cons_onewFT, ComunDef.CamposNW.config.campo_sentidoFT))
return false;
if (!HelperGdb.CalculateFieldsSync(pathNW, ComunDef.CamposNW.cons_ele_t, ComunDef.CamposNW.config.campo_elevacion_to))
return false;
if (!HelperGdb.CalculateFieldsSync(pathNW, ComunDef.CamposNW.cons_ele_f, ComunDef.CamposNW.config.campo_elevacion_from))
return false;
if (!HelperGdb.CalculateFieldsSync(pathNW, ComunDef.CamposNW.cons_evit, ComunDef.configMV.campo_prioridad))
return false;
if (!HelperGdb.CalculateFieldsSync(pathNW, ComunDef.CamposNW.cons_angulo, ComunDef.CamposNW.config.campo_angulos))
return false;
using (FeatureClass fc =HelperGdb.GetFtClassSync(pathNW))
{
if (!HelperGdb.CalculateFieldsSync(pathNW, ComunDef.CamposCom.camp_oid, "$feature."+fc.GetDefinition().GetObjectIDField()))
return false;
}
return true;
}
/** /**
* Actualiza la capa dada añadiendo una columna de sector y una de secuencia * Actualiza la capa dada añadiendo una columna de sector y una de secuencia
*/ */
@ -365,13 +533,13 @@ namespace OliviaAddInPro.Services
//Añade al shp exportado la columna de sector y secuencia //Añade al shp exportado la columna de sector y secuencia
HelperGdb.FieldToAdd[] fields = new HelperGdb.FieldToAdd[2]; HelperGdb.FieldToAdd[] fields = new HelperGdb.FieldToAdd[2];
//campo SECTOR //campo SECTOR
fields[0].Name = LimpiezaDef.Campos.consulta_sector; fields[0].Name = ComunDef.CamposCom.consulta_sector;
fields[0].Alias = LimpiezaDef.Campos.consulta_sector; fields[0].Alias = ComunDef.CamposCom.consulta_sector;
fields[0].Tipo = "LONG"; fields[0].Tipo = "LONG";
fields[0].Length = 0; fields[0].Length = 0;
//campo SECUENCIA //campo SECUENCIA
fields[1].Name = LimpiezaDef.Campos.consulta_secuen; fields[1].Name = ComunDef.CamposCom.consulta_secuen;
fields[1].Alias = LimpiezaDef.Campos.consulta_secuen; fields[1].Alias = ComunDef.CamposCom.consulta_secuen;
fields[1].Tipo = "LONG"; fields[1].Tipo = "LONG";
fields[1].Length = 0; fields[1].Length = 0;
@ -412,8 +580,8 @@ namespace OliviaAddInPro.Services
{ {
//context.Invalidate(rowshp); //context.Invalidate(rowshp);
// modify and execute // modify and execute
modifyOp.Modify(rowshp, LimpiezaDef.Campos.consulta_sector, rowsecto[LimpiezaDef.Campos.consulta_sector]); modifyOp.Modify(rowshp, ComunDef.CamposCom.consulta_sector, rowsecto[ComunDef.CamposCom.consulta_sector]);
modifyOp.Modify(rowshp, LimpiezaDef.Campos.consulta_secuen, rowsecto[LimpiezaDef.Campos.consulta_secuen]); modifyOp.Modify(rowshp, ComunDef.CamposCom.consulta_secuen, rowsecto[ComunDef.CamposCom.consulta_secuen]);
rowshp.Store(); rowshp.Store();
//context.Invalidate(rowshp); //context.Invalidate(rowshp);
} }
@ -495,8 +663,155 @@ namespace OliviaAddInPro.Services
} }
/** /**
* Prepara la geometría para exportar los ámbitos * Comrpueba si existe la columna de oid y si no, la crea y la rellena
*/ */
public bool ComprCreaColOid(string pathCapa, string pathCapaOrig, SpatialQueryFilter filter=null)
{
//comprueba si está el campo
bool compCamp = HelperGdb.CheckField(pathCapa, ComunDef.CamposCom.camp_oid);
ErrStr = HelperGdb.OutStr;
if (compCamp)
return true; //tiene el campo
//no lo tiene, lo crea
//Añade al shp exportado la columna de sector y secuencia
HelperGdb.FieldToAdd[] fields = new HelperGdb.FieldToAdd[1];
//campo
fields[0].Name = ComunDef.CamposCom.camp_oid;
fields[0].Alias = ComunDef.CamposCom.camp_oid;
fields[0].Tipo = "LONG";
fields[0].Length = 0;
if (!HelperGdb.AddFieldsSync(pathCapa, fields))
return false;
//vuelve a cerrar la capa
string capa_principal = System.IO.Path.GetFileNameWithoutExtension(pathCapa);
HelperGdb.CloseLayer(capa_principal);
/////////////////////////////////////////////////////
//Coge los ids de la capa de la que ha exportado
using (FeatureClass fc_orig = HelperGdb.GetFtClassSync(pathCapaOrig))
{
using (FeatureClass fc_shp = HelperGdb.GetFtClassSync(pathCapa))
{
if (fc_orig == null)
return false;
if (fc_shp == null)
return false;
if (filter == null)
{
filter = HelperGdb.CreateFiler("", null);
//coge la geom de todos los ámbitos del shp
var geomExport = HelperGdb.GetGeomUnique(fc_shp, filter);
filter = HelperGdb.CreateFiler("", geomExport);
}
List<long> ids = new List<long>();
//Añade a la lista los ids que cumplen el filtro espacial
try
{
ids = fc_orig.Select(filter, SelectionType.ObjectID, SelectionOption.Normal).GetObjectIDs().ToList();
}
catch
{
ids = new List<long>();
}
//Comprueba que hay tantos ids como elementos en el shp
long nelem_shp = HelperGdb.GetNumElemsSync(fc_shp);
if (nelem_shp != ids.Count)
return false;
/////////////////////////////////////////////////////
//ahora rellena las columnas
try
{
using (RowCursor rc_shp = fc_shp.Search())
{
if (rc_shp == null)
return false;
var modifyOp = new ArcGIS.Desktop.Editing.EditOperation();
modifyOp.Name = "Actualiza OID";
bool ex = false;
//modifyOp.Callback((context) =>
//{
int i = 0;
while (rc_shp.MoveNext() && i < ids.Count)
{
using (Row rowshp = rc_shp.Current)
{
//context.Invalidate(rowshp);
// modify and execute
modifyOp.Modify(rowshp, ComunDef.CamposCom.camp_oid, ids[i++]);
rowshp.Store();
//context.Invalidate(rowshp);
}
}
//}, fc_shp);
ex = modifyOp.Execute();
ArcGIS.Desktop.Core.Project.Current.SaveEditsAsync();
if (ex && modifyOp.IsDone)
return true;
else
return false;
}
}
catch
{
return false;
}
//return true;
}
}
}
/**
* Prepara la geometría para exportar los ámbitos
*/
public Geometry GetZonasBuffer()
{
Geometry geomAux = null;
ErrStr = string.Empty;
//Hace la intersección de zonas y niveles
geomAux = null;
/*
if (com.GeomNiv != null || com.GeomZon != null)
{
geomAux = HelperGdb.IntersectGeom(com.GeomNiv, com.GeomZon);
if (geomAux == null)
{
ErrStr = "Error al intersecar zonas y/o niveles.";
return null;
}
if (geomAux.IsEmpty)
{
ErrStr = "No existen ámbitos en la intersección entre zonas y/o niveles.";
return null;
}
}
else
{
return null;
}*/
FeatureClass fc = HelperGdb.GetFtClassSync(OliviaGlob.Paths.PathData);
if (fc == null)
{
ErrStr = "No se ha podido abrir la clase " + OliviaGlob.Paths.PathData;
return null;
}
SpatialQueryFilter filtro = HelperGdb.CreateFiler("",null);
var geomAmbits = HelperGdb.GetGeomUnique(fc, filtro);
if (geomAmbits == null || geomAmbits.IsEmpty)
{
ErrStr = "No se ha podido generar geometría de los ámbitos" + com.ConsultaAmbs + HelperGdb.OutStr;
HelperGdb.Free(fc);
return null;
}
return geomAmbits;
}
public Geometry GetGeomAmbitsExport() public Geometry GetGeomAmbitsExport()
{ {
Geometry geomAux = null; Geometry geomAux = null;
@ -518,11 +833,13 @@ namespace OliviaAddInPro.Services
if (geomAux == null) if (geomAux == null)
{ {
ErrStr = "Error al intersecar zonas y/o niveles."; ErrStr = "Error al intersecar zonas y/o niveles.";
HelperGdb.Free(fc);
return null; return null;
} }
if (geomAux.IsEmpty) if (geomAux.IsEmpty)
{ {
ErrStr = "No existen ámbitos en la intersección entre zonas y/o niveles."; ErrStr = "No existen ámbitos en la intersección entre zonas y/o niveles.";
HelperGdb.Free(fc);
return null; return null;
} }
} }
@ -530,6 +847,7 @@ namespace OliviaAddInPro.Services
if ((geomAux == null) && (com.CapaElems == OliviaGlob.Paths.PathGdbNw)) if ((geomAux == null) && (com.CapaElems == OliviaGlob.Paths.PathGdbNw))
{ {
ErrStr = "Al emplear ejes de calle como ámbitos es necesario indicar polígono de exportación"; ErrStr = "Al emplear ejes de calle como ámbitos es necesario indicar polígono de exportación";
HelperGdb.Free(fc);
return null; return null;
} }
@ -538,10 +856,11 @@ namespace OliviaAddInPro.Services
//if (geomAux == null) //if (geomAux == null)
{ {
//Ahora hace la geometría de los ámbitos que cumplen la consulta //Ahora hace la geometría de los ámbitos que cumplen la consulta
geomAmbits = HelperGdb.GetGeomConvexHullSync(fc, filtro); geomAmbits = HelperGdb.GetGeomUnique(fc, filtro);
if (geomAmbits == null || geomAmbits.IsEmpty) if (geomAmbits == null || geomAmbits.IsEmpty)
{ {
ErrStr = "No se ha podido generar geometría de los ámbitos" + com.ConsultaAmbs + HelperGdb.OutStr; ErrStr = "No se ha podido generar geometría de los ámbitos" + com.ConsultaAmbs + HelperGdb.OutStr;
HelperGdb.Free(fc);
return null; return null;
} }
if (geomAux == null) if (geomAux == null)
@ -549,7 +868,7 @@ namespace OliviaAddInPro.Services
else else
{ {
geomAux = HelperGdb.IntersectGeom(geomAux, geomAmbits); geomAux = HelperGdb.IntersectGeom(geomAux, geomAmbits);
geomAux = GeometryEngine.Instance.ConvexHull(geomAux); //geomAux = GeometryEngine.Instance.ConvexHull(geomAux);
} }
} }
//le quita las restricciones //le quita las restricciones
@ -559,6 +878,7 @@ namespace OliviaAddInPro.Services
if (geomAux == null) if (geomAux == null)
{ {
ErrStr = "Error al intersecar con las restricciones."; ErrStr = "Error al intersecar con las restricciones.";
HelperGdb.Free(fc);
return null; return null;
} }
} }
@ -588,8 +908,8 @@ namespace OliviaAddInPro.Services
int NCAMPS = 2; int NCAMPS = 2;
string[] camps; string[] camps;
camps = new string[NCAMPS]; camps = new string[NCAMPS];
camps[0] = LimpiezaDef.Campos.consulta_sector; camps[0] = ComunDef.CamposCom.consulta_sector;
camps[1] = LimpiezaDef.Campos.consulta_secuen; camps[1] = ComunDef.CamposCom.consulta_secuen;
return HelperGdb.CheckFiledsSync(pathCapa, camps) == 0; return HelperGdb.CheckFiledsSync(pathCapa, camps) == 0;
} }
@ -615,10 +935,10 @@ namespace OliviaAddInPro.Services
/** /**
* Realiza las funciones de importación de la sectorización * Realiza las funciones de importación de la sectorización
*/ */
public Respuesta<string> ImportSecto(string GdbFileName) public Respuesta<string> ImportSecto(string GdbFileName, string FtClssName)
{ {
com.ProgrSrc.IncMessage(10,"Importando capas"); com.ProgrSrc.IncMessage(10,"Importando capas");
var res = Import(GdbFileName, 0); var res = Import(GdbFileName, 0, FtClssName);
if (res.HasError || string.IsNullOrEmpty(res.Value)) if (res.HasError || string.IsNullOrEmpty(res.Value))
{ {
return res; return res;
@ -630,7 +950,7 @@ namespace OliviaAddInPro.Services
string path_import = res.Value; string path_import = res.Value;
//abre con valor único //abre con valor único
string path_lyr = path_import; string path_lyr = path_import;
var resb = HelperGdb.OpenLayerUniqueValue(path_lyr, LimpiezaDef.Campos.consulta_sector); var resb = HelperGdb.OpenLayerUniqueValue(path_lyr, ComunDef.CamposCom.consulta_sector);
if (!resb.Value) if (!resb.Value)
{ {
res.Error.Add("Error al abrir capa "+ path_lyr + " con Valor único. " + resb.Error.FirstOrDefault()); res.Error.Add("Error al abrir capa "+ path_lyr + " con Valor único. " + resb.Error.FirstOrDefault());
@ -644,10 +964,10 @@ namespace OliviaAddInPro.Services
/** /**
* Realiza las funciones de importación de la planificación * Realiza las funciones de importación de la planificación
*/ */
public Respuesta<string> ImportPlanif(string GdbFileName) public Respuesta<string> ImportPlanif(string GdbFileName, string FtClssName)
{ {
com.ProgrSrc.IncMessage(10, "Importando capas"); com.ProgrSrc.IncMessage(10, "Importando capas");
var res = Import(GdbFileName, 1); var res = Import(GdbFileName, 1, FtClssName);
if (res.HasError || string.IsNullOrEmpty(res.Value)) if (res.HasError || string.IsNullOrEmpty(res.Value))
{ {
res.Value = string.Empty; res.Value = string.Empty;
@ -685,7 +1005,7 @@ namespace OliviaAddInPro.Services
for(i =0;i<NOPEN;i++) for(i =0;i<NOPEN;i++)
{ {
com.ProgrSrc.IncMessage((uint)(60 / NOPEN)); com.ProgrSrc.IncMessage((uint)(60 / NOPEN));
resb = HelperGdb.OpenLayerUniqueValue(path_lyr_arr[i], LimpiezaDef.Campos.consulta_sector, visible_arr[i]); resb = HelperGdb.OpenLayerUniqueValue(path_lyr_arr[i], ComunDef.CamposCom.consulta_sector, visible_arr[i]);
if (!resb.Value) if (!resb.Value)
break; break;
} }
@ -703,7 +1023,7 @@ namespace OliviaAddInPro.Services
/** /**
* Realiza las funciones de importación, modo 0 secto, modo 1 planif * Realiza las funciones de importación, modo 0 secto, modo 1 planif
*/ */
public Respuesta<string> Import(string GdbFileName, int modo) public Respuesta<string> Import(string GdbFileName, int modo, string FtClssName="")
{ {
var res = new Respuesta<string> { Value = string.Empty }; var res = new Respuesta<string> { Value = string.Empty };
@ -713,7 +1033,6 @@ namespace OliviaAddInPro.Services
string shapefile = System.IO.Path.GetFileNameWithoutExtension(path_shape); string shapefile = System.IO.Path.GetFileNameWithoutExtension(path_shape);
int ind = shapefile.IndexOf("_", 0); int ind = shapefile.IndexOf("_", 0);
string prefijo = shapefile.Substring(ind + 1, 1); string prefijo = shapefile.Substring(ind + 1, 1);
////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////
//decodifica el nombre del shapefile para asignarle el correspondiente nombre en la GDB a la que se importa el shape //decodifica el nombre del shapefile para asignarle el correspondiente nombre en la GDB a la que se importa el shape
string tratamiento = string.Empty; string tratamiento = string.Empty;
@ -734,6 +1053,8 @@ namespace OliviaAddInPro.Services
///////////////////////////////////////// /////////////////////////////////////////
/////mira a ver si tiene configurado Dataset /////mira a ver si tiene configurado Dataset
string msg_avisa = string.Empty; string msg_avisa = string.Empty;
string amb_aux = string.Empty;
bool sobreescribe = false;
if (!string.IsNullOrEmpty(OliviaGlob.Paths.PathDatasetImport)) if (!string.IsNullOrEmpty(OliviaGlob.Paths.PathDatasetImport))
{ {
var datname = new System.IO.DirectoryInfo(OliviaGlob.Paths.PathDatasetImport).Name; var datname = new System.IO.DirectoryInfo(OliviaGlob.Paths.PathDatasetImport).Name;
@ -748,10 +1069,30 @@ namespace OliviaAddInPro.Services
msg_avisa = "No se encuentra el Dataset " + datname + ". "; msg_avisa = "No se encuentra el Dataset " + datname + ". ";
} }
} }
else
{
/////////////////////////////////////////
//no tiene un dataset configurado, saca ventana para elegir uno
//saca ventana para elegir Dataset, si se cancela, se guarda en el nombre por defecto en función del tratamiento y los ámbitos
//HelperGlobal.ponMsg("A continuación, introduzca nombre de Feature Class y ubicación (Dataset) para importación. Si cancela el proceso, se establecerán el nombre y Dataset por defecto en función de los ámbitos y el tratamiento");
string path_aux = FtClssName;
//HelperGdb.SaveFileDlg("Introduzca nombre de Feature Class a importar", GdbFileName, null, ArcGIS.Desktop.Catalog.ItemFilters.featureClasses_all);
if (!string.IsNullOrEmpty(path_aux))
{
tratamiento = new DirectoryInfo(System.IO.Path.GetDirectoryName(path_aux)).Name;
//tratamiento = System.IO.Path.GetFileName(System.IO.Path.GetDirectoryName(path_aux));
amb_aux = System.IO.Path.GetFileNameWithoutExtension(path_aux);
//comprueba si ya existe ese ft class
FeatureClass ft = HelperGdb.GetFtClassSync(path_aux);
if (ft != null)
sobreescribe = true;
HelperGdb.Free(ft);
}
}
//crea el dataset o comprueba si existe //crea el dataset o comprueba si existe
string datasetNameOut = string.Empty; string datasetNameOut = string.Empty;
var resp = HelperGdb.CreateDataset(GdbFileName, tratamiento, spatRefData, out datasetNameOut); var resp = HelperGdb.CreateDataset(GdbFileName, tratamiento, spatRefData, out datasetNameOut);
string err_spatref = "Atención, no coincide la proyección de las FeatureClass del Dataset ya creado con la del FeatureClass a importar";
if(resp.Value==0) if(resp.Value==0)
{ {
//avisa //avisa
@ -764,19 +1105,33 @@ namespace OliviaAddInPro.Services
res.Error.Add("Error al crear el Dataset para importar " + tratamiento); res.Error.Add("Error al crear el Dataset para importar " + tratamiento);
return res; return res;
} }
else if (resp.Value == 2) else //2 o 4 if (resp.Value == 2)
{ {
//avisa //avisa
msg_avisa = err_spatref + ", se ha creado un nuevo dataset " + datasetNameOut; string err_spatref = string.Empty;
if (resp.Value==2)
err_spatref = "Atención, no coincide la proyección de las FeatureClass del Dataset ya creado con la del FeatureClass a importar. ";
msg_avisa = err_spatref + "Se ha creado un nuevo dataset " + datasetNameOut;
//HelperGlobal.ponMsg(err_spatref +", se ha creado un nuevo dataset "+ datasetNameOut ); //HelperGlobal.ponMsg(err_spatref +", se ha creado un nuevo dataset "+ datasetNameOut );
tratamiento = datasetNameOut; tratamiento = datasetNameOut;
} }
string dataset = tratamiento; //avisa ahora para dar tiempo?
if (!string.IsNullOrEmpty(msg_avisa))
{
if(!HelperGlobal.ponMsg(msg_avisa, MessageBoxImage.Question, "OLIVIA", MessageBoxButton.OKCancel))
{
res.Error.Add("Proceso de importación Cancelado por el usuario");
return res;
}
}
string dataset = tratamiento;
/////////////////////////////////////////
if (!string.IsNullOrEmpty(amb_aux))
ambitos = amb_aux;
///////////////////////////////////////// /////////////////////////////////////////
//todo ok, se pone a importar //todo ok, se pone a importar
string err_st =string.Empty; string err_st =string.Empty;
string name = ambitos;
string path_import = GdbFileName + "\\" + dataset + "\\" + ambitos; string path_import = GdbFileName + "\\" + dataset + "\\" + ambitos;
int NIMPORT; int NIMPORT;
string[] noms_shp = null; string[] noms_shp = null;
@ -838,8 +1193,19 @@ namespace OliviaAddInPro.Services
///////////////////////////////////////// /////////////////////////////////////////
//se embucla para hacer todas las importaciones necesarias //se embucla para hacer todas las importaciones necesarias
for (i = 0; i < NIMPORT; i++) for (i = 0; i < NIMPORT; i++)
{ {
resp2 = HelperGdb.ImportShp(dir_shp + "\\" + noms_shp[i] + HelperGdb.SHP_EXT, GdbFileName + "\\" + dataset, noms_gdb[i]); //mira a ver si hay que borrar para reemplazar
if (sobreescribe)
{
resp = HelperGdb.DeleteFeatureClassSync(GdbFileName + "\\" + dataset, noms_gdb[i]);
if (resp.Value!=-2 && resp.Value!=1) //-2 porque puede ser que no pueda abrir la capa porque no existe
{
err_st = "Error al sobreescribir la capa " + noms_gdb[i];
break;
}
}
resp2 = HelperGdb.ImportShp(dir_shp + "\\" + noms_shp[i] + HelperGdb.SHP_EXT, GdbFileName + "\\" + dataset, noms_gdb[i], spatRefData);
if (!resp2.Value) if (!resp2.Value)
{ {
err_st = "Error al importar la capa " + noms_gdb[i]; err_st = "Error al importar la capa " + noms_gdb[i];
@ -853,9 +1219,6 @@ namespace OliviaAddInPro.Services
res.Error.Add("Errores en la importación: "+err_st); res.Error.Add("Errores en la importación: "+err_st);
return res; return res;
} }
//avisa ahora para dar tiempo?
if(!string.IsNullOrEmpty(msg_avisa))
HelperGlobal.ponMsg(msg_avisa);
//cambia el nombre de los campos que había truncado a 10 caracteres al exportar a shp //cambia el nombre de los campos que había truncado a 10 caracteres al exportar a shp
//solo para la capa original //solo para la capa original
@ -896,6 +1259,11 @@ namespace OliviaAddInPro.Services
string capa_principal_nw = System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathNW); string capa_principal_nw = System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathNW);
HelperGdb.CloseLayer(capa_principal_nw); HelperGdb.CloseLayer(capa_principal_nw);
} }
if (!string.IsNullOrEmpty(OliviaGlob.Paths.PathNW_c))
{
string capa_principal_nw_c = System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathNW_c);
HelperGdb.CloseLayer(capa_principal_nw_c);
}
} }
} }
} }

View File

@ -42,7 +42,8 @@ namespace OliviaAddInPro.Services
//actualiza los flags //actualiza los flags
OliviaGlob.RemoveFlagTipEjec(TiposEjecucion.FinEjecOk); OliviaGlob.RemoveFlagTipEjec(TiposEjecucion.FinEjecOk);
//importa resultados //importa resultados
resp = IniImport(); string FtClssName = "";
resp = IniImport(out FtClssName);
if (resp.HasError) if (resp.HasError)
{ {
msg = resp.Error.First(); msg = resp.Error.First();
@ -53,13 +54,13 @@ namespace OliviaAddInPro.Services
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run((Func<bool>)(() => ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run((Func<bool>)(() =>
{ {
string GdbFileName = resp.Value; string GdbFileName = resp.Value;
string nombAmbitos = string.Empty;
if (OliviaGlob.HasFlagTipEjec(TiposEjecucion.EjecSecto)) //Ha terminado bien la sectorización if (OliviaGlob.HasFlagTipEjec(TiposEjecucion.EjecSecto)) //Ha terminado bien la sectorización
{ {
//actualiza los flags //actualiza los flags
//OliviaGlob.RemoveFlagTipEjec(TiposEjecucion.EjecSecto); //OliviaGlob.RemoveFlagTipEjec(TiposEjecucion.EjecSecto);
//acciones de importación //acciones de importación
resp2 = inst.ServCom.ImportSecto(GdbFileName); resp2 = inst.ServCom.ImportSecto(GdbFileName, FtClssName);
} }
else if (OliviaGlob.HasFlagTipEjec(TiposEjecucion.EjecPlanif)) //Ha terminado bien la planificación else if (OliviaGlob.HasFlagTipEjec(TiposEjecucion.EjecPlanif)) //Ha terminado bien la planificación
{ {
@ -68,7 +69,7 @@ namespace OliviaAddInPro.Services
//guarda csv //guarda csv
//GuardaCsv(inst); en finEjecuta3 //GuardaCsv(inst); en finEjecuta3
//acciones de importación //acciones de importación
resp2 = inst.ServCom.ImportPlanif(GdbFileName); resp2 = inst.ServCom.ImportPlanif(GdbFileName, FtClssName);
} }
Application.Current.Dispatcher.BeginInvoke(new Action<Respuesta<string>, Respuesta<string>, bool, string, TratamientoComun>((p, v, x, u, w) => finEjecuta3(p, v, x, u, w)), resp, resp2, mal, msg, inst); Application.Current.Dispatcher.BeginInvoke(new Action<Respuesta<string>, Respuesta<string>, bool, string, TratamientoComun>((p, v, x, u, w) => finEjecuta3(p, v, x, u, w)), resp, resp2, mal, msg, inst);
@ -110,6 +111,8 @@ namespace OliviaAddInPro.Services
{ {
if (string.IsNullOrEmpty(resp2.Value)) if (string.IsNullOrEmpty(resp2.Value))
{ {
//quita modo config2
OliviaGlob.RemoveFlagTipEjec(TiposEjecucion.Config2);
if (resp2.HasError) if (resp2.HasError)
{ {
msg = resp2.Error.First(); msg = resp2.Error.First();
@ -127,7 +130,7 @@ namespace OliviaAddInPro.Services
if (OliviaGlob.HasFlagTipEjec(TiposEjecucion.EjecPlanif)) //Ha terminado bien la planificación if (OliviaGlob.HasFlagTipEjec(TiposEjecucion.EjecPlanif)) //Ha terminado bien la planificación
{ {
//guarda csv //guarda csv
GuardaCsv(inst); GuardaCsv(inst,resp2.Value);
} }
msg = Resource1.String_exito; msg = Resource1.String_exito;
@ -159,7 +162,7 @@ namespace OliviaAddInPro.Services
public static void BorraFiles() public static void BorraFiles()
{ {
string[] list = null; string[] list = null;
string capa_principal, capa_principal_nw; string capa_principal, capa_principal_nw, capa_principal_nw_c;
if (!string.IsNullOrEmpty(OliviaGlob.Paths.PathData)) if (!string.IsNullOrEmpty(OliviaGlob.Paths.PathData))
capa_principal = System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathData); capa_principal = System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathData);
else else
@ -167,8 +170,11 @@ namespace OliviaAddInPro.Services
if (!string.IsNullOrEmpty(OliviaGlob.Paths.PathNW)) if (!string.IsNullOrEmpty(OliviaGlob.Paths.PathNW))
capa_principal_nw = System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathNW); capa_principal_nw = System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathNW);
else else
capa_principal_nw = null; capa_principal_nw = null;
if (!string.IsNullOrEmpty(OliviaGlob.Paths.PathNW_c))
capa_principal_nw_c = System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathNW_c);
else
capa_principal_nw_c = null;
try try
{ {
if (capa_principal != null && HelperGdb.CloseLayer(capa_principal)) if (capa_principal != null && HelperGdb.CloseLayer(capa_principal))
@ -197,6 +203,19 @@ namespace OliviaAddInPro.Services
} }
} }
} }
if (capa_principal_nw_c != null && HelperGdb.CloseLayer(capa_principal_nw_c))
{
list = System.IO.Directory.GetFiles(OliviaGlob.Paths.DirData, capa_principal_nw_c + "*");
if (list.Length > 0)
{
foreach (string f in list)
{
if (System.IO.Path.GetExtension(f) == ".lock")
continue;
System.IO.File.Delete(f);
}
}
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -206,7 +225,7 @@ namespace OliviaAddInPro.Services
/* /*
* Permite guardar el archivo CSV que contiene la secuencia que se ha llevado a cabo en las rutas en la planificación. * Permite guardar el archivo CSV que contiene la secuencia que se ha llevado a cabo en las rutas en la planificación.
*/ */
public static void GuardaCsv(TratamientoComun inst) public static void GuardaCsv(TratamientoComun inst, string pathImport)
{ {
string auxi, nombre = null; string auxi, nombre = null;
string[] nameDokL; string[] nameDokL;
@ -215,23 +234,26 @@ namespace OliviaAddInPro.Services
System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathData) + inst.ServCom.NAME_CSV + ".*"); System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathData) + inst.ServCom.NAME_CSV + ".*");
string Title = "Directorio para guardar Secuencia de la Planificación"; string Title = "Directorio para guardar Secuencia de la Planificación";
string Filter = "Secuencia en formato CSV (*.csv)|*.csv"; //string Filter = "Secuencia en formato CSV (*.csv)|*.csv";
inst.decode_gdb(System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathData), inst.decode_gdb(System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathData),
out auxi, out nombre); out auxi, out nombre);
if (!string.IsNullOrEmpty(pathImport))
{
nombre = System.IO.Path.GetFileNameWithoutExtension(pathImport);
}
//string Path = HelperGdb.SaveFileDlg(Title, DirData, inst.ServCom.EXT_CSV, Filter); //string Path = HelperGdb.SaveFileDlg(Title, DirData, inst.ServCom.EXT_CSV, Filter);
string Path = string.Empty; string Path = string.Empty;
if (OliviaGlob.CompruebaExistePath(OliviaGlob.Paths.PathGuardCsv)) if (OliviaGlob.CompruebaExistePath(OliviaGlob.Paths.PathGuardCsv))
Path = OliviaGlob.Paths.PathGuardCsv; Path = OliviaGlob.Paths.PathGuardCsv;
else else
Path = HelperGdb.SaveFileDlg(Title, DirData, null, ArcGIS.Desktop.Catalog.ItemFilters.folders); //Path = HelperGdb.SaveFileDlg(Title, DirData, null, ArcGIS.Desktop.Catalog.ItemFilters.Folders);
Path = HelperGdb.FolderBrowseDlg(Title, DirData);
if (string.IsNullOrEmpty(Path) || Path.Length == 0) if (string.IsNullOrEmpty(Path) || Path.Length == 0)
{ {
bool ok = HelperGlobal.ponMsg("Se va a perder el archivo que contiene la secuencia en planificación, ¿está seguro?", bool ok = HelperGlobal.ponMsg("Se va a perder el archivo que contiene la secuencia en planificación, ¿está seguro?",
MessageBoxImage.Question,"OLIVIA",MessageBoxButton.YesNo); MessageBoxImage.Question,"OLIVIA",MessageBoxButton.YesNo);
if (!ok) if (!ok)
GuardaCsv(inst); GuardaCsv(inst, pathImport);
} }
else else
{ {
@ -246,9 +268,10 @@ namespace OliviaAddInPro.Services
/* /*
* Inicializa la importación * Inicializa la importación
*/ */
public Respuesta<string> IniImport() public Respuesta<string> IniImport(out string FtClssName)
{ {
var res = new Respuesta<string>() { Value = string.Empty }; var res = new Respuesta<string>() { Value = string.Empty };
FtClssName = string.Empty;
//Lanza ventana para elegir gdb a la que importar resultados //Lanza ventana para elegir gdb a la que importar resultados
string GdbFileName=""; string GdbFileName="";
if (OliviaGlob.CompruebaExistePath(OliviaGlob.Paths.PathGdbImport)) if (OliviaGlob.CompruebaExistePath(OliviaGlob.Paths.PathGdbImport))
@ -273,6 +296,12 @@ namespace OliviaAddInPro.Services
return res; return res;
} }
res.Value = GdbFileName; res.Value = GdbFileName;
if (string.IsNullOrEmpty(OliviaGlob.Paths.PathDatasetImport))
{ //ahora pide elegir nombre de ftclass
FtClssName = HelperGdb.SaveFileDlg("Seleccione ubicación e introduzca nombre de Feature Class a importar", GdbFileName, null, ArcGIS.Desktop.Catalog.ItemFilters.FeatureClasses_All);
}
return res; return res;
} }
} }

View File

@ -80,6 +80,10 @@ namespace OliviaAddInPro.Services.LanzaSrv
GeneralDef.EjecGeoParamSep + GeneralDef.GG_coox + GeneralDef.EjecGeoParamIgual + limp.CoordsInstal.X + " " +//coordenadas GeneralDef.EjecGeoParamSep + GeneralDef.GG_coox + GeneralDef.EjecGeoParamIgual + limp.CoordsInstal.X + " " +//coordenadas
GeneralDef.EjecGeoParamSep + GeneralDef.GG_cooy + GeneralDef.EjecGeoParamIgual + limp.CoordsInstal.Y + " " +//coordenadas GeneralDef.EjecGeoParamSep + GeneralDef.GG_cooy + GeneralDef.EjecGeoParamIgual + limp.CoordsInstal.Y + " " +//coordenadas
GeneralDef.EjecGeoParamSep + GeneralDef.GG_ais + GeneralDef.EjecGeoParamIgual + (limp.IgnoAis ? 1 : 0) + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GG_ais + GeneralDef.EjecGeoParamIgual + (limp.IgnoAis ? 1 : 0) + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_elev + GeneralDef.EjecGeoParamIgual + (ComunDef.CamposNW.config.comprueba_elevacion ? 1 : 0) + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_topo + GeneralDef.EjecGeoParamIgual + (ComunDef.CamposNW.config.revisa_topologia ? 1 : 0) + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_conj + GeneralDef.EjecGeoParamIgual + (ComunDef.CamposNW.config.revisa_conjunciones ? 1 : 0) + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_angu + GeneralDef.EjecGeoParamIgual + (ComunDef.CamposNW.config.revisa_angulos ? 1 : 0) + " " +
//campos del dbf de limpieza para leer //campos del dbf de limpieza para leer
GeneralDef.EjecGeoParamSep + GeneralDef.GAA_obser + GeneralDef.EjecGeoParamIgual + LimpiezaDef.Campos.consulta_observ + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GAA_obser + GeneralDef.EjecGeoParamIgual + LimpiezaDef.Campos.consulta_observ + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GAA_anch_tip + GeneralDef.EjecGeoParamIgual + LimpiezaDef.Campos.consulta_anch_tip + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GAA_anch_tip + GeneralDef.EjecGeoParamIgual + LimpiezaDef.Campos.consulta_anch_tip + " " +
@ -97,7 +101,12 @@ namespace OliviaAddInPro.Services.LanzaSrv
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_anch_ace + GeneralDef.EjecGeoParamIgual + LimpiezaDef.OtrosParam.anch_ace + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GTO_anch_ace + GeneralDef.EjecGeoParamIgual + LimpiezaDef.OtrosParam.anch_ace + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_anch_aplin + GeneralDef.EjecGeoParamIgual + LimpiezaDef.OtrosParam.anch_aplin + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GTO_anch_aplin + GeneralDef.EjecGeoParamIgual + LimpiezaDef.OtrosParam.anch_aplin + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_anch_apbat + GeneralDef.EjecGeoParamIgual + LimpiezaDef.OtrosParam.anch_apbat + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GTO_anch_apbat + GeneralDef.EjecGeoParamIgual + LimpiezaDef.OtrosParam.anch_apbat + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_anch_bordlib + GeneralDef.EjecGeoParamIgual + LimpiezaDef.OtrosParam.anch_bordlib + " "; GeneralDef.EjecGeoParamSep + GeneralDef.GTO_anch_bordlib + GeneralDef.EjecGeoParamIgual + LimpiezaDef.OtrosParam.anch_bordlib + " " +
//mima de la nw
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_mima_xmin + GeneralDef.EjecGeoParamIgual + limp.MimaNw.XMin + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_mima_xmax + GeneralDef.EjecGeoParamIgual + limp.MimaNw.XMax + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_mima_ymin + GeneralDef.EjecGeoParamIgual + limp.MimaNw.YMin + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_mima_ymax + GeneralDef.EjecGeoParamIgual + limp.MimaNw.YMax + " ";
base.str_cfg = str; base.str_cfg = str;

View File

@ -61,6 +61,7 @@ namespace OliviaAddInPro.Services.LanzaSrv
{ {
str_cfg = str_cfg + str_cfg = str_cfg +
//campos de la red navegable //campos de la red navegable
/*
GeneralDef.EjecGeoParamSep + GeneralDef.GTC_onew + GeneralDef.EjecGeoParamIgual + ComunDef.CamposNW.cons_onew + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GTC_onew + GeneralDef.EjecGeoParamIgual + ComunDef.CamposNW.cons_onew + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTC_kph + GeneralDef.EjecGeoParamIgual + ComunDef.CamposNW.cons_kph + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GTC_kph + GeneralDef.EjecGeoParamIgual + ComunDef.CamposNW.cons_kph + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTC_fow + GeneralDef.EjecGeoParamIgual + ComunDef.CamposNW.cons_fow + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GTC_fow + GeneralDef.EjecGeoParamIgual + ComunDef.CamposNW.cons_fow + " " +
@ -69,15 +70,22 @@ namespace OliviaAddInPro.Services.LanzaSrv
GeneralDef.EjecGeoParamSep + GeneralDef.GTA_FT + GeneralDef.EjecGeoParamIgual + ComunDef.AtributosNW.atr_FT + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GTA_FT + GeneralDef.EjecGeoParamIgual + ComunDef.AtributosNW.atr_FT + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTA_N + GeneralDef.EjecGeoParamIgual + ComunDef.AtributosNW.atr_N + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GTA_N + GeneralDef.EjecGeoParamIgual + ComunDef.AtributosNW.atr_N + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTA_pedes + GeneralDef.EjecGeoParamIgual + ComunDef.AtributosNW.atr_pedes + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GTA_pedes + GeneralDef.EjecGeoParamIgual + ComunDef.AtributosNW.atr_pedes + " " +
*/
//nombre del tratamiento //nombre del tratamiento
GeneralDef.EjecGeoParamSep + GeneralDef.GG_strtto + GeneralDef.EjecGeoParamIgual + NombreTratamiento + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GG_strtto + GeneralDef.EjecGeoParamIgual + NombreTratamiento + " " +
//paths de archivos //paths de archivos
GeneralDef.EjecGeoParamSep + GeneralDef.GG_pd + GeneralDef.EjecGeoParamIgual + OliviaGlob.Paths.PathData + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GG_pd + GeneralDef.EjecGeoParamIgual + OliviaGlob.Paths.PathData + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_pn + GeneralDef.EjecGeoParamIgual + OliviaGlob.Paths.PathNW + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GG_pn + GeneralDef.EjecGeoParamIgual + OliviaGlob.Paths.PathNW + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_pnj + GeneralDef.EjecGeoParamIgual + OliviaGlob.Paths.PathNW_c + " " +
//nombres de cols de sector y secuencia
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_camp_sector + GeneralDef.EjecGeoParamIgual + ComunDef.CamposCom.consulta_sector + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_camp_secuencia + GeneralDef.EjecGeoParamIgual + ComunDef.CamposCom.consulta_secuen + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_camp_objectid + GeneralDef.EjecGeoParamIgual + ComunDef.CamposCom.camp_oid + " " +
//giro max y desv //giro max y desv
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_girmax + GeneralDef.EjecGeoParamIgual + LimpiezaDef.OtrosParam.giro_max + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GTO_girmax + GeneralDef.EjecGeoParamIgual + ComunDef.CamposCom.giro_max + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_desv_max + GeneralDef.EjecGeoParamIgual + LimpiezaDef.OtrosParam.desv_max + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GTO_desv_max + GeneralDef.EjecGeoParamIgual + ComunDef.CamposCom.desv_max + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_desv_max_abs + GeneralDef.EjecGeoParamIgual + LimpiezaDef.OtrosParam.desv_max_abs + " "; GeneralDef.EjecGeoParamSep + GeneralDef.GTO_desv_max_abs + GeneralDef.EjecGeoParamIgual + ComunDef.CamposCom.desv_max_abs + " ";
//LimpiezaDef.Campos.consulta_sector;
} }
/** /**

View File

@ -61,7 +61,7 @@ namespace OliviaAddInPro.Services.LanzaSrv
else if (modo == ModosEjec.SoloPlanifica) else if (modo == ModosEjec.SoloPlanifica)
modo_str = GeneralDef.SockConfTodo; modo_str = GeneralDef.SockConfTodo;
var conf = ConfigServ.Serv.Leer(); var conf = ConfigServ.Serv.Leer();
//van ParamLimpN parámetros, sin incluir "CONFIGURACION", si se añaden, incrementar ParamLimpN //van ParamLimpN parámetros, sin incluir "CONFIGURACION", si se añaden, incrementar ParamRecoN
str = GeneralDef.EjecGeoParamSep + modo_str + " " + str = GeneralDef.EjecGeoParamSep + modo_str + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_camp_cap + GeneralDef.EjecGeoParamIgual + conf.capac + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GR_camp_cap + GeneralDef.EjecGeoParamIgual + conf.capac + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_kgM + GeneralDef.EjecGeoParamIgual + reco.KgMaxVehic + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GR_kgM + GeneralDef.EjecGeoParamIgual + reco.KgMaxVehic + " " +
@ -91,7 +91,16 @@ namespace OliviaAddInPro.Services.LanzaSrv
GeneralDef.EjecGeoParamSep + GeneralDef.GR_sens_fechaf + GeneralDef.EjecGeoParamIgual + "0 " + GeneralDef.EjecGeoParamSep + GeneralDef.GR_sens_fechaf + GeneralDef.EjecGeoParamIgual + "0 " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_sens_modo + GeneralDef.EjecGeoParamIgual + "0 " + GeneralDef.EjecGeoParamSep + GeneralDef.GR_sens_modo + GeneralDef.EjecGeoParamIgual + "0 " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_ais + GeneralDef.EjecGeoParamIgual + (reco.IgnoAis?1:0) + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GG_ais + GeneralDef.EjecGeoParamIgual + (reco.IgnoAis?1:0) + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_lateral + GeneralDef.EjecGeoParamIgual + reco.TipoLate + " "; GeneralDef.EjecGeoParamSep + GeneralDef.GG_elev + GeneralDef.EjecGeoParamIgual + (ComunDef.CamposNW.config.comprueba_elevacion ? 1 : 0) + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_topo + GeneralDef.EjecGeoParamIgual + (ComunDef.CamposNW.config.revisa_topologia ? 1 : 0) + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_conj + GeneralDef.EjecGeoParamIgual + (ComunDef.CamposNW.config.revisa_conjunciones ? 1 : 0) + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GG_angu + GeneralDef.EjecGeoParamIgual + (ComunDef.CamposNW.config.revisa_angulos ? 1 : 0) + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GR_lateral + GeneralDef.EjecGeoParamIgual + reco.TipoLate + " " +
//mima de la nw
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_mima_xmin + GeneralDef.EjecGeoParamIgual + reco.MimaNw.XMin + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_mima_xmax + GeneralDef.EjecGeoParamIgual + reco.MimaNw.XMax + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_mima_ymin + GeneralDef.EjecGeoParamIgual + reco.MimaNw.YMin + " " +
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_mima_ymax + GeneralDef.EjecGeoParamIgual + reco.MimaNw.YMax + " ";
base.str_cfg = str; base.str_cfg = str;

View File

@ -1,11 +1,13 @@
using ArcGIS.Core.Data; /*using ArcGIS.Core.Data;
using ArcGIS.Core.Geometry; using ArcGIS.Core.Geometry;
using ArcGIS.Core.Internal.CIM; using ArcGIS.Core.Internal.CIM;
using ArcGIS.Desktop.Framework.Threading.Tasks; using ArcGIS.Desktop.Framework.Threading.Tasks;*/
using ActiproSoftware.Windows.Extensions;
using OliviaAddInPro.Helper; using OliviaAddInPro.Helper;
using OliviaAddInPro.Model; using OliviaAddInPro.Model;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -31,6 +33,15 @@ namespace OliviaAddInPro.Services
*/ */
public Respuesta<bool> Ejecuta(ModosEjec modo) public Respuesta<bool> Ejecuta(ModosEjec modo)
{ {
var modos_viaje = ConfigServ.Serv.Leer().ListaMV;
if (modos_viaje != null && modos_viaje.Count > TipoMv && TipoMv >= 0)
{
ComunDef.configMV = modos_viaje[TipoMv];
}
else
{
ComunDef.configMV = new OliviaConfMV();
}
var res = new Respuesta<bool>() var res = new Respuesta<bool>()
{ {
Value = false Value = false
@ -73,7 +84,7 @@ namespace OliviaAddInPro.Services
{ {
nombFileAmbs = string.Empty; nombFileAmbs = string.Empty;
limp.ConsultaAmbs = DameAmbsConsulta(out nombFileAmbs); limp.ConsultaAmbs = DameAmbsConsulta(out nombFileAmbs);
if (string.IsNullOrEmpty(limp.ConsultaAmbs)) if (null==limp.ConsultaAmbs)
{ {
return false; return false;
} }
@ -105,7 +116,44 @@ namespace OliviaAddInPro.Services
return consulta; return consulta;
} }
public ObservableCollection<string> GetNombreModosViajes()
{
var conf=ConfigServ.Serv.Leer();
var res = new ObservableCollection<string>();
if (conf.ListaMV==null || conf.ListaMV.Count<=0 )
return res;
res.AddRange(conf.ListaMV.Select(c => c.nombre));
return res;
}
public int GetModosViajesDefecto(int vehiculo)
{
var conf = ConfigServ.Serv.Leer();
var res = new ObservableCollection<string>();
if (conf.ListaMV == null || conf.ListaMV.Count <= 0)
return -1;
for(int i=0; i< conf.ListaMV.Count; i++)
{
if (conf.ListaMV[i].vehiculo_def_reco == vehiculo)
return i;
}
return 0;
}
public int GetModosViajesDefecto(bool rcircu)
{
int vehiculo= rcircu? 1: 0;
var conf = ConfigServ.Serv.Leer();
var res = new ObservableCollection<string>();
if (conf.ListaMV == null || conf.ListaMV.Count <= 0)
return -1;
for (int i = 0; i < conf.ListaMV.Count; i++)
{
if (conf.ListaMV[i].vehiculo_def_lim == vehiculo)
return i;
}
return 0;
}
/** /**
* Comprueba lo necesario para ver si hay campos para la planificación * Comprueba lo necesario para ver si hay campos para la planificación
*/ */
@ -152,7 +200,7 @@ namespace OliviaAddInPro.Services
public bool CompruebaCamposLimp(string pathCapa) public bool CompruebaCamposLimp(string pathCapa)
{ {
string[] camps = limp.GetCampos(pathCapa); string[] camps = limp.GetCampos(pathCapa);
int res = 1; //int res = 1;
if ((camps == null) || (HelperGdb.CheckFileds(pathCapa, camps) != 0)) if ((camps == null) || (HelperGdb.CheckFileds(pathCapa, camps) != 0))
{ {
ErrStr = HelperGdb.OutStr; ErrStr = HelperGdb.OutStr;
@ -166,12 +214,10 @@ namespace OliviaAddInPro.Services
public bool[] BuscAmbGdb(string pathCapa) public bool[] BuscAmbGdb(string pathCapa)
{ {
string consulta; string consulta;
int numero_lin; long numero_lin;
bool[] amb_gdb = new bool[(int)LimpiezaDef.AmbitsTra.AmbN];//se inician a false bool[] amb_gdb = new bool[(int)LimpiezaDef.AmbitsTra.AmbN];//se inician a false
string ftclass;
//mira a ver si hay ejes de calle //mira a ver si hay ejes de calle
ftclass = LimpiezaDef.ftclass[(int)LimpiezaDef.AmbitsTra.AmbEjeCalle];
consulta = LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbEjeCalle]; consulta = LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbEjeCalle];
numero_lin = HelperGdb.GetNumElems(OliviaGlob.Paths.PathGdbNw, consulta); numero_lin = HelperGdb.GetNumElems(OliviaGlob.Paths.PathGdbNw, consulta);
if (numero_lin > 0) if (numero_lin > 0)

View File

@ -14,11 +14,11 @@ namespace OliviaAddInPro.Services
public class ProcesoEjecServ public class ProcesoEjecServ
{ {
Cstr_socket soc = null; Cstr_socket soc = null;
int m_out=0; //int m_out=0;
int m_miliseconds=200; int m_miliseconds=200;
int m_tm_progr=1000; int m_tm_progr=1000;
int modo_fin = 0; int modo_fin = 0;
bool cancela = false; //bool cancela = false;
bool cancela_fin = false; bool cancela_fin = false;
bool conectado = false; bool conectado = false;
bool permu = false; bool permu = false;
@ -124,6 +124,7 @@ namespace OliviaAddInPro.Services
} }
} }
int result = Environment.TickCount & Int32.MaxValue; //para que el tickcount no sea negativo
if (cps.Getcancelled()) //mira a ver si ha cancelado el usuario if (cps.Getcancelled()) //mira a ver si ha cancelado el usuario
{ {
//se ha cancelado, lo envía al OliviaTask //se ha cancelado, lo envía al OliviaTask
@ -137,11 +138,11 @@ namespace OliviaAddInPro.Services
if(!fin) //si no ha finalizado normal, el usuario lo ha cancelado if(!fin) //si no ha finalizado normal, el usuario lo ha cancelado
res.Error.Add("Proceso Cancelado por el usuario"); res.Error.Add("Proceso Cancelado por el usuario");
} }
else if (!first_send_cfg && ((Math.Abs(Environment.TickCount) - lastprog) >= m_tm_progr) && !fin) //en caso normal, todo va bien, pide el progreso y la tarea else if (!first_send_cfg && ((result - lastprog) >= m_tm_progr) && !fin) //en caso normal, todo va bien, pide el progreso y la tarea
{ {
//solo pide la programación cada m_tm_progr milis //solo pide la programación cada m_tm_progr milis
var pp = pide_progr(); var pp = pide_progr();
if (pp .Value> TiposActu.ActuFinOk) if (pp.Value> TiposActu.ActuFinOk)
fin = true; fin = true;
if(pp.HasError) if(pp.HasError)
{ {
@ -153,8 +154,10 @@ namespace OliviaAddInPro.Services
else else
nint++; nint++;
} }
if (pp.Value == TiposActu.ActuFinNOk)
res.Error.Add("Finalizado proceso con fallos");
actualiza(pp); actualiza(pp);
lastprog = Environment.TickCount; lastprog = result;
} }
} while (!sal); } while (!sal);
@ -175,7 +178,7 @@ namespace OliviaAddInPro.Services
{ {
if (!conectado) if (!conectado)
{ {
if (!soc.conecta(Ip, Puerto)) if (!soc.conecta(Ip, Puerto, Ip))
{ {
conectado = false; conectado = false;
return false; return false;
@ -506,7 +509,7 @@ namespace OliviaAddInPro.Services
*/ */
private void pon_barstate(TiposActu actu) private void pon_barstate(TiposActu actu)
{ {
int col = 1; //int col = 1;
if ((actu == TiposActu.ActuMal) || (actu == TiposActu.ActuFinNOk)) if ((actu == TiposActu.ActuMal) || (actu == TiposActu.ActuFinNOk))

View File

@ -28,15 +28,16 @@ namespace OliviaAddInPro.Services
*/ */
public int CompruebaCamposReco(string pathCapa) public int CompruebaCamposReco(string pathCapa)
{ {
int NCAMPS = 6; int NCAMPS = 5;
string[] camps; string[] camps;
camps = new string[NCAMPS]; camps = new string[NCAMPS];
camps[0] = RecogidaDef.campos_def.cons_id;
camps[1] = RecogidaDef.campos_def.cons_fracc; camps[0] = RecogidaDef.campos_def.cons_fracc;
camps[2] = RecogidaDef.campos_def.cons_nomrec; camps[1] = RecogidaDef.campos_def.cons_nomrec;
camps[3] = RecogidaDef.campos_def.cons_lateral; camps[2] = RecogidaDef.campos_def.cons_lateral;
camps[4] = RecogidaDef.campos_def.cons_uds; camps[3] = RecogidaDef.campos_def.cons_uds;
camps[5] = RecogidaDef.campos_def.cons_kgrec; camps[4] = RecogidaDef.campos_def.cons_kgrec;
//camps[5] = RecogidaDef.campos_def.cons_id;
int compCamp = HelperGdb.CheckFileds(pathCapa, camps); int compCamp = HelperGdb.CheckFileds(pathCapa, camps);
ErrStr = HelperGdb.OutStr; ErrStr = HelperGdb.OutStr;
if (compCamp == 0) if (compCamp == 0)
@ -69,7 +70,15 @@ namespace OliviaAddInPro.Services
{ {
Value = false Value = false
}; };
var modos_viaje = ConfigServ.Serv.Leer().ListaMV;
if (modos_viaje != null && modos_viaje.Count > TipoMv && TipoMv>=0)
{
ComunDef.configMV = modos_viaje[TipoMv];
}
else
{
ComunDef.configMV = new OliviaConfMV();
}
com = (TratamientoComun)reco; com = (TratamientoComun)reco;
string nombFileAmbs = string.Empty; string nombFileAmbs = string.Empty;

View File

@ -19,9 +19,12 @@
<Button Content="Guardar" Grid.Column="0" VerticalAlignment="Top" Width="75" Style="{DynamicResource Esri_Button}" Click="OnGuardar"/> <Button Content="Guardar" Grid.Column="0" VerticalAlignment="Top" Width="75" Style="{DynamicResource Esri_Button}" Click="OnGuardar"/>
<Button Content="Releer Config." Grid.Column="1" VerticalAlignment="Top" Style="{DynamicResource Esri_Button}" Click="OnRefres"/> <Button Content="Releer Config." Grid.Column="1" VerticalAlignment="Top" Style="{DynamicResource Esri_Button}" Click="OnRefres"/>
</Grid> </Grid>
<xctk:PropertyGrid x:Name="Configuracion" SelectedObject="{Binding Configuracion}" HorizontalAlignment="Stretch" PropertyValueChanged="Configuracion_PropertyValueChanged"> <xctk:PropertyGrid x:Name="Configuracion" SelectedObject="{Binding Configuracion}" HorizontalAlignment="Stretch" PropertyValueChanged="Configuracion_PropertyValueChanged" ShowDescriptionByTooltip="True">
<!-- Only the following properties will be displayed in the PropertyGrid --> <xctk:PropertyGrid.CategoryGroupHeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Background="{DynamicResource Esri_BackgroundPressedBrush}" Foreground="{DynamicResource Esri_TextStyleDefaultBrush}"/>
</DataTemplate>
</xctk:PropertyGrid.CategoryGroupHeaderTemplate>
</xctk:PropertyGrid> </xctk:PropertyGrid>
</StackPanel> </StackPanel>

View File

@ -25,7 +25,6 @@ namespace OliviaAddInPro
public PaneConfigView() public PaneConfigView()
{ {
InitializeComponent(); InitializeComponent();
} }
private void OnGuardar(object sender, RoutedEventArgs e) private void OnGuardar(object sender, RoutedEventArgs e)
{ {

View File

@ -53,7 +53,8 @@ namespace OliviaAddInPro.View.Configuracion
private void PickFileButton_Click(object sender, RoutedEventArgs e) private void PickFileButton_Click(object sender, RoutedEventArgs e)
{ {
OpenFileDialog fd = new OpenFileDialog(); OpenFileDialog fd = new OpenFileDialog();
var st = HelperGdb.SaveFileDlg("Seleccione carpeta", null, null, ArcGIS.Desktop.Catalog.ItemFilters.folders); //var st = HelperGdb.SaveFileDlg("Seleccione carpeta", null, null, ArcGIS.Desktop.Catalog.ItemFilters.Folders);
var st = HelperGdb.FolderBrowseDlg("Seleccione carpeta", null);
if (!string.IsNullOrEmpty(st)) if (!string.IsNullOrEmpty(st))
{ {
Value = st; Value = st;

View File

@ -43,6 +43,7 @@ namespace OliviaAddInPro.View.Configuracion
public FrameworkElement ResolveEditor(PropertyItem propertyItem) public FrameworkElement ResolveEditor(PropertyItem propertyItem)
{ {
Binding binding = new Binding("Value"); Binding binding = new Binding("Value");
binding.Source = propertyItem; binding.Source = propertyItem;
binding.Mode = propertyItem.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay; binding.Mode = propertyItem.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay;

View File

@ -0,0 +1,14 @@
<UserControl x:Class="OliviaAddInPro.View.Configuracion.PropertyGridFilePickerPto"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OliviaAddInPro.View.Configuracion"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
x:Name="TheControl">
<DockPanel>
<Button x:Name="PickFileButton" Content="…" Click="PickFileButton_Click" DockPanel.Dock="Right" Width="15" />
<TextBox Text="{Binding ElementName=TheControl, Path=Value}" />
</DockPanel>
</UserControl>

View File

@ -0,0 +1,65 @@
using Microsoft.Win32;
using OliviaAddInPro.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Xceed.Wpf.Toolkit.PropertyGrid;
using Xceed.Wpf.Toolkit.PropertyGrid.Editors;
using static OliviaAddInPro.Helper.HelperGdb;
namespace OliviaAddInPro.View.Configuracion
{
/// <summary>
/// Lógica de interacción para PropertyGridFilePicker.xaml
/// </summary>
public partial class PropertyGridFilePickerPto : ITypeEditor
{
public PropertyGridFilePickerPto()
{
InitializeComponent();
}
public string Value
{
get { return (string)GetValue(ValueProperty); }
set { SetValue(ValueProperty, value); }
}
// Using a DependencyProperty as the backing store for Value. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ValueProperty =
DependencyProperty.Register("Value", typeof(string), typeof(PropertyGridFilePickerPto), new PropertyMetadata(null));
public FrameworkElement ResolveEditor(PropertyItem propertyItem)
{
Binding binding = new Binding("Value");
binding.Source = propertyItem;
binding.Mode = propertyItem.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay;
BindingOperations.SetBinding(this, ValueProperty, binding);
return this;
}
private void PickFileButton_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog fd = new OpenFileDialog();
var st = HelperGdb.OpenFileDialog(TiposOpenFileDlg.OpenFtrClassPoint, Value);
if (!string.IsNullOrEmpty(st))
{
Value = st;
}
}
}
}

View File

@ -64,20 +64,20 @@
<ContentPresenter Name="PaneEjecutar"> <ContentPresenter Name="PaneEjecutar">
<ContentPresenter.Content> <ContentPresenter.Content>
<StackPanel Orientation="Vertical"> <StackPanel Orientation="Vertical">
<Grid Margin="0,10,0,0"> <Grid Margin="0,30,0,0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/> <ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/> <ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/> <ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button x:Name="button_secto" Grid.Column="1" Style="{DynamicResource Esri_Button}" Content="Sectorizar" Margin="10,0,10,0" Click="button_secto_Click"/> <Button x:Name="button_secto" Grid.Column="1" Style="{DynamicResource Esri_Button}" Content="Sectorizar" Margin="10,0,10,0" Click="button_secto_Click"/>
<Button x:Name="button_planif" Grid.Column="2" Style="{DynamicResource Esri_Button}" Content="Planificar" Margin="10,0,10,0" Click="button_planif_Click"/> <Button x:Name="button_planif" Grid.Column="2" Style="{DynamicResource Esri_Button}" Content="Planificar" Margin="10,0,0,0" Click="button_planif_Click"/>
</Grid> </Grid>
</StackPanel> </StackPanel>
</ContentPresenter.Content> </ContentPresenter.Content>
</ContentPresenter> </ContentPresenter>
</StackPanel> </StackPanel>
<StackPanel Grid.Row="3" Margin="0,70,10,0"> <StackPanel Grid.Row="3" Margin="0,90,10,0">
<Button x:Name="button_help" Content="" Margin="274,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="16" Height="16" BorderThickness="0" RenderTransformOrigin="16.875,0.375" Click="button_help_Click"> <Button x:Name="button_help" Content="" Margin="274,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="16" Height="16" BorderThickness="0" RenderTransformOrigin="16.875,0.375" Click="button_help_Click">
<Button.Background> <Button.Background>
<ImageBrush ImageSource="../../Images/help16Pro.png"/> <ImageBrush ImageSource="../../Images/help16Pro.png"/>

View File

@ -32,8 +32,12 @@
<ComboBox x:Name="comboBox_tto" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" ItemsSource="{Binding Path=TiposTto, Mode = TwoWay}" HorizontalAlignment="Left" Margin="20,0,0,0" <ComboBox x:Name="comboBox_tto" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" ItemsSource="{Binding Path=TiposTto, Mode = TwoWay}" HorizontalAlignment="Left" Margin="20,0,0,0"
VerticalAlignment="Top" Width="260" DropDownOpened="ComboBox_DropDownOpened" SelectionChanged="comboBox_tto_SelectionChanged" VerticalAlignment="Top" Width="260" DropDownOpened="ComboBox_DropDownOpened" SelectionChanged="comboBox_tto_SelectionChanged"
SelectedIndex="{Binding Path=TipoTto, Mode = TwoWay}"/> SelectedIndex="{Binding Path=TipoTto, Mode = TwoWay}"/>
<Label Content="Ámbitos de Trabajo" HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.391,-0.203" FontWeight="DemiBold"/> <Label Content="Modos de viaje" HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Top" FontWeight="DemiBold"/>
<ComboBox x:Name="comboBox_ambitos" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" ItemsSource="{Binding Path=OpsAmbs, Mode = TwoWay}" HorizontalAlignment="Left" Margin="20,0,0,0" <ComboBox x:Name="comboBox_mv" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" ItemsSource="{Binding Path=TiposMv, Mode = TwoWay}" HorizontalAlignment="Left" Margin="20,0,0,0"
VerticalAlignment="Top" Width="260" SelectionChanged="comboBox_mv_SelectionChanged"
SelectedIndex="{Binding Path=TipoMv, Mode = TwoWay}"/>
<Label Content="Ámbitos de Trabajo" HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.391,-0.203" FontWeight="DemiBold"/>
<ComboBox x:Name="comboBox_ambitos" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" ItemsSource="{Binding Path=OpsAmbs, Mode = TwoWay}" HorizontalAlignment="Left" Margin="20,0,0,0"
VerticalAlignment="Top" Width="260" SelectionChanged="comboBox_ambitos_SelectionChanged" VerticalAlignment="Top" Width="260" SelectionChanged="comboBox_ambitos_SelectionChanged"
SelectedIndex="{Binding Path=SelOpAmb, Mode = TwoWay}"/> SelectedIndex="{Binding Path=SelOpAmb, Mode = TwoWay}"/>
<ListBox x:Name="listBox_ambitos" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" ItemsSource="{Binding Path=Ambitos, Mode = TwoWay}" HorizontalAlignment="Left" Height="100" <ListBox x:Name="listBox_ambitos" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" ItemsSource="{Binding Path=Ambitos, Mode = TwoWay}" HorizontalAlignment="Left" Height="100"

View File

@ -80,7 +80,20 @@ namespace OliviaAddInPro
} }
} }
private void comboBox_mv_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
int i = -1;
if (sender is System.Windows.Controls.ComboBox combo)
{
i = combo.SelectedIndex;
if (DataContext is PaneLimpiezaSub1ViewModel mod)
{
mod.ComboMvSel(i);
}
}
}
private void comboBox_ambitos_SelectionChanged(object sender, SelectionChangedEventArgs e) private void comboBox_ambitos_SelectionChanged(object sender, SelectionChangedEventArgs e)
{ {
int i = -1; int i = -1;

View File

@ -41,7 +41,7 @@ namespace OliviaAddInPro
private void button_caparestr_Click(object sender, RoutedEventArgs e) private void button_caparestr_Click(object sender, RoutedEventArgs e)
{ {
string texto = ""; string texto = "";
ArcGIS.Core.Geometry.Geometry geom = HelperGdb.OpenGeom(HelperGdb.TiposOpenFileDlg.OpenFtrClassPolygon, out texto); ArcGIS.Core.Geometry.Geometry geom = HelperGdb.OpenGeom(HelperGdb.TiposOpenFileDlg.OpenFtrClassPolygon, out texto, "", true);
if (DataContext is PaneLimpiezaSub2ViewModel mod) if (DataContext is PaneLimpiezaSub2ViewModel mod)
{ {
mod.GeomRestr = geom; mod.GeomRestr = geom;
@ -55,7 +55,7 @@ namespace OliviaAddInPro
private void button_capaniv_Click(object sender, RoutedEventArgs e) private void button_capaniv_Click(object sender, RoutedEventArgs e)
{ {
string texto = ""; string texto = "";
ArcGIS.Core.Geometry.Geometry geom = HelperGdb.OpenGeom(HelperGdb.TiposOpenFileDlg.OpenFtrClassPolygon, out texto); ArcGIS.Core.Geometry.Geometry geom = HelperGdb.OpenGeom(HelperGdb.TiposOpenFileDlg.OpenFtrClassPolygon, out texto, "", true);
if (DataContext is PaneLimpiezaSub2ViewModel mod) if (DataContext is PaneLimpiezaSub2ViewModel mod)
{ {
mod.GeomNiv = geom; mod.GeomNiv = geom;
@ -69,7 +69,7 @@ namespace OliviaAddInPro
private void button_capazon_Click(object sender, RoutedEventArgs e) private void button_capazon_Click(object sender, RoutedEventArgs e)
{ {
string texto = ""; string texto = "";
ArcGIS.Core.Geometry.Geometry geom = HelperGdb.OpenGeom(HelperGdb.TiposOpenFileDlg.OpenFtrClassPolygon, out texto); ArcGIS.Core.Geometry.Geometry geom = HelperGdb.OpenGeom(HelperGdb.TiposOpenFileDlg.OpenFtrClassPolygon, out texto, "", true);
if (DataContext is PaneLimpiezaSub2ViewModel mod) if (DataContext is PaneLimpiezaSub2ViewModel mod)
{ {
mod.GeomZon = geom; mod.GeomZon = geom;

View File

@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions" xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions"
xmlns:ui="clr-namespace:OliviaAddInPro" xmlns:ui="clr-namespace:OliviaAddInPro"
mc:Ignorable="d" d:DesignWidth="300" Height="390" mc:Ignorable="d" d:DesignWidth="300" Height="422"
d:DataContext="{Binding Path=ui.PaneRecogidaSub1ViewModel}" Loaded="UserControl_Loaded" Unloaded="UserControl_Unloaded" > d:DataContext="{Binding Path=ui.PaneRecogidaSub1ViewModel}" Loaded="UserControl_Loaded" Unloaded="UserControl_Unloaded" >
<UserControl.Resources> <UserControl.Resources>
<ResourceDictionary> <ResourceDictionary>
@ -49,7 +49,7 @@
</DataTemplate> </DataTemplate>
</--> </-->
</ComboBox> </ComboBox>
<TextBox x:Name="txtBox_densCont" Width="60" ToolTip="{Binding ToolTip_TextDensCont}" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" Visibility="{Binding Path=VisTextDens, Mode = TwoWay}" Grid.Column="1" Margin="10,0" TextWrapping="NoWrap" Text="{Binding Path=TextDensCont, Mode = TwoWay}" TextAlignment="Right" MaxLength="5" PreviewTextInput="txtBox_densCont_PreviewTextInput"/> <TextBox x:Name="txtBox_densCont" Width="60" ToolTip="{Binding ToolTip_TextDensCont}" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" Visibility="{Binding Path=VisTextDens, Mode = TwoWay}" Grid.Column="1" Margin="10,0" TextWrapping="NoWrap" Text="{Binding Path=TextDensCont, Mode = TwoWay}" TextAlignment="Right" MaxLength="8" PreviewTextInput="txtBox_densCont_PreviewTextInput"/>
<Label x:Name="label_densCont" Grid.Column="2" Content="kg/m3" Margin="0,-1,0,0" Visibility="{Binding Path=VisTextDens, Mode = TwoWay}"/> <Label x:Name="label_densCont" Grid.Column="2" Content="kg/m3" Margin="0,-1,0,0" Visibility="{Binding Path=VisTextDens, Mode = TwoWay}"/>
</Grid> </Grid>
<Label Content="Tipo de carga" HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.391,-0.203" FontWeight="DemiBold"/> <Label Content="Tipo de carga" HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.391,-0.203" FontWeight="DemiBold"/>
@ -91,16 +91,20 @@
<ComboBox x:Name="comboBox_tipoCapac" IsEnabled="{Binding EnabComboCapac, Mode=TwoWay}" ItemsSource="{Binding TiposCapac, Mode=TwoWay}" HorizontalAlignment="Left" Margin="0,0,0,0" <ComboBox x:Name="comboBox_tipoCapac" IsEnabled="{Binding EnabComboCapac, Mode=TwoWay}" ItemsSource="{Binding TiposCapac, Mode=TwoWay}" HorizontalAlignment="Left" Margin="0,0,0,0"
VerticalAlignment="Top" Width="75" VerticalAlignment="Top" Width="75"
SelectedIndex="{Binding TipoCapac}" SelectionChanged="comboBox_tipoCapac_SelectionChanged"/> SelectedIndex="{Binding TipoCapac}" SelectionChanged="comboBox_tipoCapac_SelectionChanged"/>
<TextBox x:Name="txtBox_kgCapac" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" Grid.Column="1" Margin="5,0,0,3" TextWrapping="NoWrap" Text="{Binding Path=TextKgCapac, Mode = TwoWay}" TextAlignment="Right" MaxLength="4" PreviewTextInput="txtBox_kgCapac_PreviewTextInput"/> <TextBox x:Name="txtBox_kgCapac" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" Grid.Column="1" Margin="5,0,0,3" TextWrapping="NoWrap" Text="{Binding Path=TextKgCapac, Mode = TwoWay}" TextAlignment="Right" MaxLength="8" PreviewTextInput="txtBox_kgCapac_PreviewTextInput"/>
<Label x:Name="label_kgmax" Grid.Column="2" Content="kg máx. por viaje" Margin="0,-1,0,0"/> <Label x:Name="label_kgmax" Grid.Column="2" Content="kg máx. por viaje" Margin="0,-1,0,0"/>
</Grid> </Grid>
<Label Content="Modos de viaje" HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Top" FontWeight="DemiBold"/>
<ComboBox x:Name="comboBox_mv" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" ItemsSource="{Binding Path=TiposMv, Mode = TwoWay}" HorizontalAlignment="Left" Margin="20,0,0,0"
VerticalAlignment="Top" Width="260" SelectionChanged="comboBox_mv_SelectionChanged"
SelectedIndex="{Binding Path=TipoMv, Mode = TwoWay}"/>
<Label Content="Tiempo de vaciado de contenedor" HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.391,-0.203" FontWeight="DemiBold"/> <Label Content="Tiempo de vaciado de contenedor" HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.391,-0.203" FontWeight="DemiBold"/>
<Grid Margin="20,0,0,0"> <Grid Margin="20,0,0,0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/> <ColumnDefinition Width="80"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBox IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" Margin="0,0,0,8" TextWrapping="NoWrap" Text="{Binding Path=TextTVaci, Mode = TwoWay}" TextAlignment="Right" MaxLength="3" PreviewTextInput="TextBox_PreviewTextInput"/> <TextBox IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" Margin="0,0,0,8" TextWrapping="NoWrap" Text="{Binding Path=TextTVaci, Mode = TwoWay}" TextAlignment="Right" MaxLength="4" PreviewTextInput="TextBox_PreviewTextInput"/>
<Label Grid.Column="1" Content="seg." Margin="0,-3,0,8"/> <Label Grid.Column="1" Content="seg." Margin="0,-3,0,8"/>
</Grid> </Grid>
<Label Margin="15,0,0,0" Content="Planta de descarga" FontWeight="DemiBold"/> <Label Margin="15,0,0,0" Content="Planta de descarga" FontWeight="DemiBold"/>

View File

@ -110,7 +110,20 @@ namespace OliviaAddInPro
} }
} }
} }
private void comboBox_mv_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
int i = -1;
if (sender is System.Windows.Controls.ComboBox combo)
{
i = combo.SelectedIndex;
if (DataContext is PaneRecogidaSub1ViewModel mod)
{
mod.ComboMvSel(i);
}
}
}
private void comboBox_tipoCapac_SelectionChanged(object sender, SelectionChangedEventArgs e) private void comboBox_tipoCapac_SelectionChanged(object sender, SelectionChangedEventArgs e)
{ {
int i = -1; int i = -1;

View File

@ -77,7 +77,9 @@ namespace OliviaAddInPro
var guardar = HelperGlobal.ponMsg("¿Desea guardar los cambios antes de salir?", System.Windows.MessageBoxImage.Information, "OLIVIA", System.Windows.MessageBoxButton.YesNo); var guardar = HelperGlobal.ponMsg("¿Desea guardar los cambios antes de salir?", System.Windows.MessageBoxImage.Information, "OLIVIA", System.Windows.MessageBoxButton.YesNo);
if (guardar) if (guardar)
{ {
ConfigServ.Serv.Guardar(paneConfig.Configuracion); Respuesta<bool> resp = ConfigServ.Serv.Guardar(paneConfig.Configuracion);
if (!resp.Value)
HelperGlobal.ponMsg(resp.Error.First());
} }
paneConfig.hay_cambios = false; paneConfig.hay_cambios = false;
} }

View File

@ -42,8 +42,11 @@ namespace OliviaAddInPro
public void OnGuardar() public void OnGuardar()
{ {
ConfigServ.Serv.Guardar(Configuracion); Respuesta<bool> resp = ConfigServ.Serv.Guardar(Configuracion);
HelperGlobal.ponMsg("Se ha guardado la configuración"); if (!resp.Value)
HelperGlobal.ponMsg(resp.Error.First());
else
HelperGlobal.ponMsg("Se ha guardado la configuración");
hay_cambios = false; hay_cambios = false;
} }

View File

@ -27,6 +27,7 @@ namespace OliviaAddInPro
{ {
private ObservableCollection<string> tiposTto = new ObservableCollection<string>(LimpiezaDef.tipos_tto_str); private ObservableCollection<string> tiposTto = new ObservableCollection<string>(LimpiezaDef.tipos_tto_str);
private ObservableCollection<string> tiposMv = new ObservableCollection<string>();
private ObservableCollection<string> opsAmbs=new ObservableCollection<string>(); private ObservableCollection<string> opsAmbs=new ObservableCollection<string>();
private int selOpAmb = -1; private int selOpAmb = -1;
private ObservableCollection<CheckedListItem<string>> ambitos = new ObservableCollection<CheckedListItem<string>>(); private ObservableCollection<CheckedListItem<string>> ambitos = new ObservableCollection<CheckedListItem<string>>();
@ -114,7 +115,27 @@ namespace OliviaAddInPro
base.NotifyPropertyChanged("TiposTto"); base.NotifyPropertyChanged("TiposTto");
} }
} }
public ObservableCollection<string> TiposMv
{
get { return tiposMv; }
set
{
tiposMv = value;
base.NotifyPropertyChanged("TiposMv");
}
}
private int tipoMv = -1;
public int TipoMv
{
get { return tipoMv; }
set
{
tipoMv = value;
base.NotifyPropertyChanged("TipoMv");
}
}
private int tipoTto = -1; private int tipoTto = -1;
private int tipoTto_old = -2;
public int TipoTto public int TipoTto
{ {
get { return tipoTto; } get { return tipoTto; }
@ -193,13 +214,14 @@ namespace OliviaAddInPro
public PaneLimpiezaSub1ViewModel() public PaneLimpiezaSub1ViewModel()
{ {
LblCapaElems = Resource1.String_selec_capa; LblCapaElems = Resource1.String_selec_capa;
timeTto = 10; timeTto = 0;
textVeloDespl = "10"; textVeloDespl = "";
lblUdsTimeTto = "min"; lblUdsTimeTto = "min";
lblUdsVeloDespl = "km/h"; lblUdsVeloDespl = "km/h";
limpServ = new LimpiezaServ(null); //no hace falta instancia limp limpServ = new LimpiezaServ(null); //no hace falta instancia limp
textAnchoVia = LimpiezaDef.Parametros.ancho_via.ToString(); textAnchoVia = LimpiezaDef.Parametros.ancho_via.ToString();
tiposMv = limpServ.GetNombreModosViajes();
tipoMv = -1;
} }
/** /**
* Realiza las comprobaciones para cuando se ha abierto una capa * Realiza las comprobaciones para cuando se ha abierto una capa
@ -212,7 +234,10 @@ namespace OliviaAddInPro
Ambitos.Clear(); Ambitos.Clear();
TipoTto = -1; TipoTto = -1;
VisTextAnchoVia = System.Windows.Visibility.Hidden; VisTextAnchoVia = System.Windows.Visibility.Hidden;
TextVeloDespl = "";
cambia_tiempo_tto();
OliviaGlob.AddFlagTipEjec(TiposEjecucion.Config); //lo reinicia, por si estaba después de planificar OliviaGlob.AddFlagTipEjec(TiposEjecucion.Config); //lo reinicia, por si estaba después de planificar
OliviaGlob.RemoveFlagTipEjec(TiposEjecucion.Config2);
if (string.IsNullOrEmpty(capa)) if (string.IsNullOrEmpty(capa))
return false; return false;
//comprueba los campos de limpieza //comprueba los campos de limpieza
@ -221,7 +246,7 @@ namespace OliviaAddInPro
HelperGlobal.ponMsg(limpServ.ErrStr, System.Windows.MessageBoxImage.Warning); HelperGlobal.ponMsg(limpServ.ErrStr, System.Windows.MessageBoxImage.Warning);
return false; return false;
} }
LimpiezaDef.forma_filtros();
amb_tra_gdb = limpServ.BuscAmbGdb(capa); amb_tra_gdb = limpServ.BuscAmbGdb(capa);
bool hay_alguno = false; bool hay_alguno = false;
foreach (bool b in amb_tra_gdb) foreach (bool b in amb_tra_gdb)
@ -243,23 +268,32 @@ namespace OliviaAddInPro
CapaAbierta = true; CapaAbierta = true;
return true; return true;
} }
/** public void ComboMvSel(int tto)
* Realiza los cambios en los ámbitos cuando se ha seleccionado un tratamiento {
*/ if (tto < 0)
public void ComboTtoSel(int tto) return;
TipoMv = tto;
}
/**
* Realiza los cambios en los ámbitos cuando se ha seleccionado un tratamiento
*/
public void ComboTtoSel(int tto)
{ {
if (tto < 0) if (tto < 0 || tto== tipoTto_old)
return; return;
TipoTto = tto; TipoTto = tto;
cambia_tiempo_tto(); cambia_tiempo_tto();
ambitosSel = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //reinicia los ambitos seleccionados ambitosSel = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //reinicia los ambitos seleccionados
tipoTto_old = tto;
//////////////////////////////////////// ////////////////////////////////////////
//Otros cambios que dependen del tratamiento //Otros cambios que dependen del tratamiento
if (TipoTto != (int)LimpiezaDef.TiposTto.TtoNoDef) if (TipoTto != (int)LimpiezaDef.TiposTto.TtoNoDef)
{ {
RespCirc = LimpiezaDef.rest_circ[TipoTto]; RespCirc = LimpiezaDef.rest_circ[TipoTto];
int tv = limpServ.GetModosViajesDefecto(RespCirc);
if (tv >= 0)
TipoMv = tv;
if (LimpiezaDef.v_desplazamiento[TipoTto] > 0) if (LimpiezaDef.v_desplazamiento[TipoTto] > 0)
{ {
TextVeloDespl = Convert.ToString(LimpiezaDef.v_desplazamiento[TipoTto]); TextVeloDespl = Convert.ToString(LimpiezaDef.v_desplazamiento[TipoTto]);

View File

@ -8,8 +8,8 @@ using System.Threading.Tasks;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using OliviaAddInPro.Helper; using OliviaAddInPro.Helper;
using static OliviaAddInPro.Model.ComunDef; using static OliviaAddInPro.Model.ComunDef;
using ArcGIS.Desktop.Framework.Threading.Tasks; //using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Desktop.Framework.Contracts; //using ArcGIS.Desktop.Framework.Contracts;
namespace OliviaAddInPro namespace OliviaAddInPro
{ {
@ -80,6 +80,7 @@ namespace OliviaAddInPro
return false; return false;
} }
limp.CapaElems = _subPanel1ViewModel.CapaElems; limp.CapaElems = _subPanel1ViewModel.CapaElems;
limp.CapaElemsRef = limp.CapaElems;
//pone que la capa de elementos es la red navegable, que es la que va a exportar //pone que la capa de elementos es la red navegable, que es la que va a exportar
if (_subPanel1ViewModel.SelOpAmb == 1) if (_subPanel1ViewModel.SelOpAmb == 1)
{ {
@ -92,6 +93,8 @@ namespace OliviaAddInPro
err_str = "No se ha seleccionado ningún Tipo de Tratamiento"; err_str = "No se ha seleccionado ningún Tipo de Tratamiento";
return false; return false;
} }
limp.TipoMV = _subPanel1ViewModel.TipoMv;
limp.TipoTto = _subPanel1ViewModel.TipoTto; limp.TipoTto = _subPanel1ViewModel.TipoTto;
limp.TipoTtoStr = LimpiezaDef.tto_gdb[_subPanel1ViewModel.TipoTto]; limp.TipoTtoStr = LimpiezaDef.tto_gdb[_subPanel1ViewModel.TipoTto];
//lee el/los ámbito seleccionado //lee el/los ámbito seleccionado

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Runtime.InteropServices.WindowsRuntime; //using System.Runtime.InteropServices.WindowsRuntime;
using OliviaAddInPro.Model; using OliviaAddInPro.Model;
using OliviaAddInPro.Helper; using OliviaAddInPro.Helper;

View File

@ -32,7 +32,7 @@ namespace OliviaAddInPro
private ObservableCollection<string> tiposVehic = new ObservableCollection<string>(); private ObservableCollection<string> tiposVehic = new ObservableCollection<string>();
private ObservableCollection<string> tiposCapac = new ObservableCollection<string>(); private ObservableCollection<string> tiposCapac = new ObservableCollection<string>();
private RecogidaServ recoServ = new RecogidaServ(null); //no hace falta instancia reco aquí private RecogidaServ recoServ = new RecogidaServ(null); //no hace falta instancia reco aquí
private ObservableCollection<string> tiposMv = new ObservableCollection<string>();
/** /**
* Array de booleanos enumerando si se existen en la capa seleccionada los tipos de fracción * Array de booleanos enumerando si se existen en la capa seleccionada los tipos de fracción
*/ */
@ -47,6 +47,31 @@ namespace OliviaAddInPro
public bool[] tipos_vehic_bool = new bool[(int)RecogidaDef.TiposVehic.N]; public bool[] tipos_vehic_bool = new bool[(int)RecogidaDef.TiposVehic.N];
#region Properties #region Properties
public ObservableCollection<string> TiposMv
{
get { return tiposMv; }
set
{
tiposMv = value;
base.NotifyPropertyChanged("TiposMv");
}
}
private int tipoMv = -1;
public int TipoMv
{
get { return tipoMv; }
set
{
tipoMv = value;
base.NotifyPropertyChanged("TipoMv");
}
}
public void ComboMvSel(int tto)
{
if (tto < 0)
return;
TipoMv = tto;
}
public override string DisplayName public override string DisplayName
{ {
@ -98,6 +123,7 @@ namespace OliviaAddInPro
} }
} }
private int tipoFrac = -1; private int tipoFrac = -1;
private int tipoFrac_old = -2;
public int TipoFrac public int TipoFrac
{ {
get { return tipoFrac; } get { return tipoFrac; }
@ -108,6 +134,7 @@ namespace OliviaAddInPro
} }
} }
private int tipoCarg = -1; private int tipoCarg = -1;
private int tipoCarg_old = -2;
public int TipoCarg public int TipoCarg
{ {
get { return tipoCarg; } get { return tipoCarg; }
@ -118,6 +145,7 @@ namespace OliviaAddInPro
} }
} }
private int tipoVehic = -1; private int tipoVehic = -1;
private int tipoVehic_old = -2;
public int TipoVehic public int TipoVehic
{ {
get { return tipoVehic; } get { return tipoVehic; }
@ -128,6 +156,7 @@ namespace OliviaAddInPro
} }
} }
private int tipoCapac = -1; private int tipoCapac = -1;
private int tipoCapac_old = -2;
public int TipoCapac public int TipoCapac
{ {
get { return tipoCapac; } get { return tipoCapac; }
@ -138,6 +167,7 @@ namespace OliviaAddInPro
} }
} }
private int tipoLate = -1; private int tipoLate = -1;
private int tipoLate_old = -2;
public int TipoLate public int TipoLate
{ {
get { return tipoLate; } get { return tipoLate; }
@ -261,6 +291,7 @@ namespace OliviaAddInPro
{ {
KgCont = RecogidaDef.kgrec_cont; KgCont = RecogidaDef.kgrec_cont;
} }
tiposMv = new LimpiezaServ(null).GetNombreModosViajes();
} }
/** /**
* Realiza las comprobaciones para cuando se ha abierto una capa * Realiza las comprobaciones para cuando se ha abierto una capa
@ -274,6 +305,7 @@ namespace OliviaAddInPro
TiposVehic.Clear(); TiposVehic.Clear();
TiposCapac.Clear(); TiposCapac.Clear();
OliviaGlob.AddFlagTipEjec(TiposEjecucion.Config); //lo reinicia, por si estaba después de planificar OliviaGlob.AddFlagTipEjec(TiposEjecucion.Config); //lo reinicia, por si estaba después de planificar
OliviaGlob.RemoveFlagTipEjec(TiposEjecucion.Config2);
if (string.IsNullOrEmpty(capa)) if (string.IsNullOrEmpty(capa))
return false; return false;
@ -408,7 +440,7 @@ namespace OliviaAddInPro
*/ */
public bool ComboFracSel(int tto) public bool ComboFracSel(int tto)
{ {
if (tto < 0) if (tto < 0 || tto== tipoFrac_old)
return false; return false;
if (!tipos_fracc_bool[tto]) if (!tipos_fracc_bool[tto])
{ {
@ -418,7 +450,8 @@ namespace OliviaAddInPro
try try
{ {
//cuando se selecciona un item pintado en gris (que no existe en la GDB) se actúa como si no se hubiera seleccionado item //cuando se selecciona un item pintado en gris (que no existe en la GDB) se actúa como si no se hubiera seleccionado item
TipoFrac = tto; TipoFrac = tto;
tipoFrac_old = tto;
if ((TipoVehic >= 0) && (TipoCarg >= 0)) if ((TipoVehic >= 0) && (TipoCarg >= 0))
{ {
//si también se ha seleccionado tipo de carga y de vehículo, se rellena la lista de capacidades //si también se ha seleccionado tipo de carga y de vehículo, se rellena la lista de capacidades
@ -521,7 +554,7 @@ namespace OliviaAddInPro
public bool ComboCargSel(int tto) public bool ComboCargSel(int tto)
{ {
VisCombLate = Visibility.Hidden; VisCombLate = Visibility.Hidden;
if (tto < 0) if (tto < 0 || tto== tipoCarg_old)
return false; return false;
if (!tipos_carg_bool[tto]) if (!tipos_carg_bool[tto])
{ {
@ -530,7 +563,9 @@ namespace OliviaAddInPro
try try
{ {
TipoCarg=tto; TipoCarg=tto;
tipoCarg_old = tto;
if (TipoCarg == (int)RecogidaDef.TiposCarga.Lateral) if (TipoCarg == (int)RecogidaDef.TiposCarga.Lateral)
VisCombLate = Visibility.Visible; VisCombLate = Visibility.Visible;
else else
@ -570,16 +605,25 @@ namespace OliviaAddInPro
*/ */
public void ComboVehicSel(int tto) public void ComboVehicSel(int tto)
{ {
if (tto < 0) if (tto < 0 )
return; return;
try try
{ {
TipoVehic = tto; TipoVehic = tto;
if (TipoVehic >= 0) if (TipoVehic >= 0)
{ {
if (tipoVehic_old != tto)
{
int tmv = new LimpiezaServ(null).GetModosViajesDefecto(TipoVehic);
if (tmv >= 0)
{
TipoMv = tmv;
}
}
//si también se ha seleccionado tipo de carga, se rellena la lista de capacidades //si también se ha seleccionado tipo de carga, se rellena la lista de capacidades
rellena_capac(); rellena_capac();
} }
tipoVehic_old = tto;
} }
catch (Exception) catch (Exception)
{ {
@ -598,6 +642,7 @@ namespace OliviaAddInPro
try try
{ {
TipoCapac = tto; TipoCapac = tto;
tipoCapac_old = tto;
rellena_kgmax(); rellena_kgmax();
} }
catch (Exception) catch (Exception)
@ -611,11 +656,12 @@ namespace OliviaAddInPro
*/ */
public void ComboLatSel(int tto) public void ComboLatSel(int tto)
{ {
if (tto < 0) if (tto < 0 || tto== tipoLate_old)
return; return;
try try
{ {
TipoLate = tto; TipoLate = tto;
tipoLate_old = tto;
} }
catch (Exception) catch (Exception)
{ {

View File

@ -104,7 +104,8 @@ namespace OliviaAddInPro
err_str = "No se ha seleccionado ninguna Capa de Limpieza"; err_str = "No se ha seleccionado ninguna Capa de Limpieza";
return false; return false;
} }
reco.CapaElems = _subPanel1ViewModel.CapaElems; reco.CapaElems = _subPanel1ViewModel.CapaElems;
reco.CapaElemsRef = reco.CapaElems;
//lee la fracción //lee la fracción
reco.TipoFrac = _subPanel1ViewModel.TipoFrac; reco.TipoFrac = _subPanel1ViewModel.TipoFrac;
if (reco.TipoFrac == -1) if (reco.TipoFrac == -1)
@ -112,6 +113,7 @@ namespace OliviaAddInPro
err_str = "No se ha seleccionado ningún Tipo de Fracción"; err_str = "No se ha seleccionado ningún Tipo de Fracción";
return false; return false;
} }
reco.TipoMV = _subPanel1ViewModel.TipoMv;
reco.TipoFracStr = RecogidaDef.tipos_fracc_str[reco.TipoFrac]; reco.TipoFracStr = RecogidaDef.tipos_fracc_str[reco.TipoFrac];
reco.TipoTto = reco.TipoFrac; reco.TipoTto = reco.TipoFrac;
reco.TipoTtoStr = RecogidaDef.tipos_fracc_str[reco.TipoFrac]; reco.TipoTtoStr = RecogidaDef.tipos_fracc_str[reco.TipoFrac];