Compare commits

...

8 Commits

30 changed files with 680 additions and 2841 deletions

View File

@ -30,13 +30,13 @@ 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,
System.Windows.MessageBoxImage.Warning); System.Windows.MessageBoxImage.Warning);
} }
else else
{ {*/
OliviaGlob.SetFlagTipEjec(TiposEjecucion.Limp); OliviaGlob.SetFlagTipEjec(TiposEjecucion.Limp);
OliviaGlob.ViewSetFlagTipEjec(TiposEjecucion.Limp); OliviaGlob.ViewSetFlagTipEjec(TiposEjecucion.Limp);
@ -44,7 +44,7 @@ namespace OliviaAddInPro
OliviaGlob.Limp = new Limpieza(); OliviaGlob.Limp = new Limpieza();
DockpaneLimpiezaViewModel.Reset(); DockpaneLimpiezaViewModel.Reset();
DockpaneLimpiezaViewModel.Show(); DockpaneLimpiezaViewModel.Show();
} //}
} }
else if(OliviaGlob.ViewIsProps()) else if(OliviaGlob.ViewIsProps())
{ {

View File

@ -28,13 +28,13 @@ 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,
System.Windows.MessageBoxImage.Warning); System.Windows.MessageBoxImage.Warning);
} }
else else
{ {*/
OliviaGlob.SetFlagTipEjec(TiposEjecucion.Reco); OliviaGlob.SetFlagTipEjec(TiposEjecucion.Reco);
OliviaGlob.ViewSetFlagTipEjec(TiposEjecucion.Reco); OliviaGlob.ViewSetFlagTipEjec(TiposEjecucion.Reco);
@ -42,7 +42,7 @@ namespace OliviaAddInPro
OliviaGlob.Reco = new Recogida(); OliviaGlob.Reco = new Recogida();
DockpaneRecogidaViewModel.Reset(); DockpaneRecogidaViewModel.Reset();
DockpaneRecogidaViewModel.Show(); DockpaneRecogidaViewModel.Show();
} //}
} }
else if (OliviaGlob.ViewIsProps()) else if (OliviaGlob.ViewIsProps())
{ {

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<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"> <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="3.2" desktopVersion="3.0.3.36057"> <AddInInfo id="{10742570-cf59-42f2-bea2-2a38002a06ee}" version="3.4" 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>18/04/2023 12:00:00, 2023</Date> <Date>27/11/2023 12:00:00, 2023</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 -->

View File

@ -28,6 +28,7 @@ using System.Threading;
using ArcGIS.Core.Data.Exceptions; using ArcGIS.Core.Data.Exceptions;
using Microsoft.Win32; using Microsoft.Win32;
using Microsoft.WindowsAPICodePack.Dialogs; using Microsoft.WindowsAPICodePack.Dialogs;
using System.Security.Cryptography;
namespace OliviaAddInPro.Helper namespace OliviaAddInPro.Helper
{ {
@ -466,7 +467,7 @@ namespace OliviaAddInPro.Helper
{ {
ftclss = dtset.OpenDataset<FeatureClass>(ftclassName); ftclss = dtset.OpenDataset<FeatureClass>(ftclassName);
} }
catch (Exception ex) catch/* (Exception ex)*/
{ {
ftclss = null; ftclss = null;
} }
@ -477,7 +478,7 @@ namespace OliviaAddInPro.Helper
{ {
ftclss = gdb.OpenDataset<FeatureClass>(ftclassName); ftclss = gdb.OpenDataset<FeatureClass>(ftclassName);
} }
catch (Exception ex) catch /*(Exception ex)*/
{ {
ftclss = null; ftclss = null;
} }
@ -525,7 +526,7 @@ namespace OliviaAddInPro.Helper
{ {
ftclss = dtset.OpenDataset<FeatureClass>(ftclassName); ftclss = dtset.OpenDataset<FeatureClass>(ftclassName);
} }
catch (Exception ex) catch /*(Exception ex)*/
{ {
ftclss = null; ftclss = null;
} }
@ -536,7 +537,7 @@ namespace OliviaAddInPro.Helper
{ {
ftclss = gdb.OpenDataset<FeatureClass>(ftclassName); ftclss = gdb.OpenDataset<FeatureClass>(ftclassName);
} }
catch (Exception ex) catch /*(Exception ex)*/
{ {
ftclss = null; ftclss = null;
} }
@ -1444,7 +1445,7 @@ 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 = true; 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
@ -1758,7 +1759,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
{ {
@ -2069,7 +2070,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;
} }
@ -2129,7 +2130,7 @@ namespace OliviaAddInPro.Helper
else else
return string.Empty; return string.Empty;
} }
catch(Exception ex) catch/*(Exception ex)*/
{ {
return string.Empty; return string.Empty;
} }
@ -2217,7 +2218,7 @@ namespace OliviaAddInPro.Helper
return 0; return 0;
return 2; return 2;
} }
catch (Exception ex) catch /*(Exception ex)*/
{ {
return 1; return 1;
} }
@ -2247,8 +2248,8 @@ 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; bool refspatdif = false;
@ -2360,7 +2361,7 @@ namespace OliviaAddInPro.Helper
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
{ {
@ -2675,7 +2676,7 @@ namespace OliviaAddInPro.Helper
featureLayer.SetRenderer(uniqueValueRenderer); featureLayer.SetRenderer(uniqueValueRenderer);
} }
catch (Exception ex) catch /*(Exception ex)*/
{ {
} }
@ -2807,6 +2808,69 @@ namespace OliviaAddInPro.Helper
{ {
} }
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;
}
catch
{
}
return res; return res;
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -17,11 +17,18 @@ namespace OliviaAddInPro.Model
*/ */
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 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
*/ */

View File

@ -65,6 +65,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)
{ {

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,
nw_1,
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 = "127.0.0.1"; 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)]
@ -218,6 +246,19 @@ namespace OliviaAddInPro.Model
[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)]
@ -589,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")]
@ -611,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")]
@ -1327,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)));

21
Model/OliviaConfMV.cs Normal file
View File

@ -0,0 +1,21 @@
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()
{
}
public string nombre { get; set; }
public string filtro_omitir { get; set; }
public string campo_prioridad { get; set; }
}
}

29
Model/OliviaConfNW.cs Normal file
View File

@ -0,0 +1,29 @@
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; }
}
}

View File

@ -142,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";
@ -160,7 +161,9 @@ 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";
/** /**
* Define las propiedades de limpieza a enviar a oliviatasks * Define las propiedades de limpieza a enviar a oliviatasks
*/ */
@ -599,6 +602,16 @@ 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;
@ -273,13 +275,14 @@ namespace OliviaAddInPro.Model
if (ft == null) if (ft == null)
return false; return false;
HelperGdb.Free(ft); 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;
camps[4] = ComunDef.CamposNW.cons_fow;
return HelperGdb.CheckFileds(OliviaGlob.Paths.PathGdbNw, camps) == 0; return HelperGdb.CheckFileds(OliviaGlob.Paths.PathGdbNw, camps) == 0;
} }
@ -389,7 +392,7 @@ namespace OliviaAddInPro.Model
*/ */
public static void OpenManual() public static void OpenManual()
{ {
string[] archivos = null; //string[] archivos = null;
try try
{ {
@ -429,6 +432,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;
@ -440,6 +444,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;
@ -493,6 +498,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;
@ -620,16 +626,16 @@ 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.camp_oid = c.id;
ComunDef.CamposCom.consulta_sector = c.consulta_sector; ComunDef.CamposCom.consulta_sector = c.consulta_sector;
ComunDef.CamposCom.consulta_secuen = c.consulta_secuen; ComunDef.CamposCom.consulta_secuen = c.consulta_secuen;

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)
{ {

View File

@ -25,6 +25,10 @@ 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
*/ */
@ -45,6 +49,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
*/ */

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
{ {
@ -18,7 +19,7 @@ namespace OliviaAddInPro.Services
public const string OlvRegKey = "SOFTWARE\\Narvaling\\Olivia_3_1"; public const string OlvRegKey = "SOFTWARE\\Narvaling\\Olivia_3_1";
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.1.0.2";
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;
@ -169,7 +171,7 @@ 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";
@ -396,7 +398,72 @@ 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_1;
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.ONEWAY == 'N', 1, 0)",
campo_sentidoFT= "IIF($feature.ONEWAY== 'FT' || $feature.ONEWAY == '', 1 , 0)",
campo_sentidoTf= "IIF($feature.ONEWAY == 'TF' || $feature.ONEWAY == '', 1, 0)",
campo_elevacion_from= "$feature.F_ELEV",
campo_elevacion_to= "$feature.T_ELEV",
comprueba_elevacion =true,
revisa_topologia=false,
revisa_conjunciones = false
});
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
});
c.ListaMV = new List<OliviaConfMV>();
c.ListaMV.Add(new OliviaConfMV()
{
nombre = "Default",
filtro_omitir = "",
campo_prioridad = "0"
});
c.ListaMV.Add(new OliviaConfMV()
{
nombre = "Peaton",
filtro_omitir = "",
campo_prioridad = "0"
});
c.ListaMV.Add(new OliviaConfMV()
{
nombre = "Vehiculo pequeño",
filtro_omitir = "",
campo_prioridad = "0"
});
c.ListaMV.Add(new OliviaConfMV()
{
nombre = "Vehiculo mediano",
filtro_omitir = "",
campo_prioridad = "0"
});
c.ListaMV.Add(new OliviaConfMV()
{
nombre = "Vehiculo grande",
filtro_omitir = "",
campo_prioridad = "0"
});
return c; return c;
} }
} }

View File

@ -28,6 +28,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";
@ -42,9 +43,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;
@ -59,6 +61,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;
@ -366,7 +369,28 @@ namespace OliviaAddInPro.Services
ErrStr = Resource1.String_cancel_progreso; ErrStr = Resource1.String_cancel_progreso;
return false; return false;
} }
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)
{
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;
}
}
//prepara campos estandar
if(!EstandarizaCamposNW(OliviaGlob.Paths.DirData+com.NombreShpExportNw))
{
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)
@ -376,6 +400,83 @@ namespace OliviaAddInPro.Services
} }
return true; return true;
} }
bool EstandarizaCamposNW(string pathNW)
{
HelperGdb.FieldToAdd[] fields = new HelperGdb.FieldToAdd[8];
//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;
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, "0"))
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
*/ */
@ -603,7 +704,7 @@ namespace OliviaAddInPro.Services
{ {
return false; return false;
} }
return true; //return true;
} }
} }
} }
@ -1058,6 +1159,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

@ -162,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
@ -171,7 +171,10 @@ namespace OliviaAddInPro.Services
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))
@ -200,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)
{ {
@ -218,7 +234,7 @@ 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)) if (!string.IsNullOrEmpty(pathImport))

View File

@ -80,6 +80,9 @@ 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) + " " +
//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 + " " +

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,11 +70,13 @@ 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 //nombres de cols de sector y secuencia
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_camp_sector + GeneralDef.EjecGeoParamIgual + ComunDef.CamposCom.consulta_sector + " " + 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_secuencia + GeneralDef.EjecGeoParamIgual + ComunDef.CamposCom.consulta_secuen + " " +

View File

@ -91,6 +91,9 @@ 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.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.GR_lateral + GeneralDef.EjecGeoParamIgual + reco.TipoLate + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GR_lateral + GeneralDef.EjecGeoParamIgual + reco.TipoLate + " " +
//mima de la nw //mima de la nw
GeneralDef.EjecGeoParamSep + GeneralDef.GTO_mima_xmin + GeneralDef.EjecGeoParamIgual + reco.MimaNw.XMin + " " + GeneralDef.EjecGeoParamSep + GeneralDef.GTO_mima_xmin + GeneralDef.EjecGeoParamIgual + reco.MimaNw.XMin + " " +

View File

@ -6,6 +6,7 @@ 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;
@ -105,7 +106,14 @@ namespace OliviaAddInPro.Services
return consulta; return consulta;
} }
public ObservableCollection<string> GetNombreModosViajes()
{
var conf=ConfigServ.Serv.Leer();
if(conf.ListaMV==null || conf.ListaMV.Count<=0 )
return new ObservableCollection<string>();
return (ObservableCollection<string>)conf.ListaMV.Select(c => c.nombre);
}
/** /**
* 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 +160,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;

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;
@ -509,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

@ -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

@ -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="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="Ámbitos de Trabajo" HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.391,-0.203" FontWeight="DemiBold"/> <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" <ComboBox x:Name="comboBox_ambitos" 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_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

@ -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>
@ -94,6 +94,10 @@
<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"/> <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>

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

@ -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,6 +115,25 @@ 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;
public int TipoTto public int TipoTto
{ {
@ -199,6 +219,7 @@ namespace OliviaAddInPro
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();
} }
/** /**
* Realiza las comprobaciones para cuando se ha abierto una capa * Realiza las comprobaciones para cuando se ha abierto una capa
@ -244,6 +265,10 @@ namespace OliviaAddInPro
CapaElems = capa; CapaElems = capa;
CapaAbierta = true; CapaAbierta = true;
return true; return true;
}
public void ComboMvSel(int tto)
{
tipoMv = tto;
} }
/** /**
* Realiza los cambios en los ámbitos cuando se ha seleccionado un tratamiento * Realiza los cambios en los ámbitos cuando se ha seleccionado un tratamiento

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,29 @@ 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)
{
tipoMv = tto;
}
public override string DisplayName public override string DisplayName
{ {
@ -261,6 +284,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