Compare commits

..

No commits in common. "9273611e3f3a5fb22db06be54f8bf252a2344a44" and "dcc3040ceffed29bfcb8af20289ef46c41d2a7a5" have entirely different histories.

14 changed files with 22 additions and 145 deletions

View File

@ -673,7 +673,7 @@ namespace OliviaAddInPro.Helper
public static ArcGIS.Core.Data.SpatialQueryFilter CreateFiler(string consulta, ArcGIS.Core.Geometry.Geometry geom, SpatialRelationship rel = SpatialRelationship.Contains)
{
ArcGIS.Core.Data.SpatialQueryFilter filt = null;
if (geom != null && !geom.IsEmpty)
if (geom != null)
{
SpatialQueryFilter filtSpat = new SpatialQueryFilter
{
@ -1445,7 +1445,7 @@ namespace OliviaAddInPro.Helper
if (!System.IO.Directory.Exists(outpath))
System.IO.Directory.CreateDirectory(outpath);
FeatureClass fc = null;
bool debug = true;
bool debug = false;
/////////////////////////////////////////////////////////
//Prepara una where_clause con las entidades que cumplen el filtro
//Abre la featureclass
@ -1467,11 +1467,7 @@ namespace OliviaAddInPro.Helper
//Añade a la lista los ids que cumplen el filtro espacial
try
{
var aux = fc.Select(filter, SelectionType.ObjectID, SelectionOption.Normal);
var aux2 = aux.GetObjectIDs();
//ids = fc.Select(filter, SelectionType.ObjectID, SelectionOption.Normal).GetObjectIDs().ToList();
ids = aux2.ToList();
ids = fc.Select(filter, SelectionType.ObjectID, SelectionOption.Normal).GetObjectIDs().ToList();
}
catch(Exception ex)
{
@ -1494,8 +1490,6 @@ namespace OliviaAddInPro.Helper
OutStr = "Error al aplicar filtro espacial en exportación: "+ OutStr;
return false;
}
if (debug)
HelperGlobal.ponMsg("Número de líneas a exportar "+ids.Count);
/////////////////////////////////////////////////////////
if (cps.Getcancelled())
{
@ -1505,8 +1499,7 @@ namespace OliviaAddInPro.Helper
//convierte la lista de ids a string para la clause de la forma
//(id1, id2, id3..)
string whereClause = GetWhereClauseFromIds(ids,fc.GetDefinition().GetObjectIDField());
if (debug)
HelperGlobal.ponMsg(whereClause);
///////////////////////////////////////////////////////////
///Exporta
string[] args = { pathLayerIn, outpath, nameShp, whereClause };

View File

@ -10,9 +10,8 @@ namespace OliviaAddInPro.Model
//*************************************************************************************
//Enums y structs generales
public static int BuffExport = 1000;
//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
*/

View File

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

View File

@ -12,10 +12,6 @@ namespace OliviaAddInPro.Model
{
public OliviaConfMV()
{
nombre = "default";
filtro_omitir = "";
campo_prioridad = "0";
}
public string nombre { get; set; }

View File

@ -253,7 +253,7 @@ namespace OliviaAddInPro.Services
//a todos los ámbitos y la instalación, ampliada un buffer, mayor si hay
//restricciones de circulación
geom_export = HelperGdb.BufferGeom(geom_export, com.BuffExport).Value;
if (geom_export == null || geom_export.IsEmpty)
if (geom_export == null)
{
ErrStr = "Error al añadir buffer a la geometría";
return false;
@ -340,13 +340,7 @@ namespace OliviaAddInPro.Services
//////////////////////////////////////
///
//Hace el filtro con la geometría final
//ComunDef.configMV
var where = String.Empty;
if (!String.IsNullOrEmpty(ComunDef.configMV.filtro_omitir))
{
where = "not(" + ComunDef.configMV.filtro_omitir + ")";
}
filtroEspacial = HelperGdb.CreateFiler(where, geom_export);
filtroEspacial = HelperGdb.CreateFiler(String.Empty, geom_export);
if (filtroEspacial == null)
{
ErrStr = "Error al crear el filtro de exportacion de la red navegable";
@ -375,13 +369,10 @@ namespace OliviaAddInPro.Services
ErrStr = Resource1.String_cancel_progreso;
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)
{
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;
@ -395,7 +386,6 @@ namespace OliviaAddInPro.Services
}
//prepara campos estandar
com.ProgrSrc.IncMessage(10, "Estandarizando campos de la red");//60%
if(!EstandarizaCamposNW(OliviaGlob.Paths.DirData+com.NombreShpExportNw))
{
ErrStr = "Error al estandarizar campos red navegable: " + HelperGdb.OutStr;
@ -483,7 +473,7 @@ namespace OliviaAddInPro.Services
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))
if (!HelperGdb.CalculateFieldsSync(pathNW, ComunDef.CamposNW.cons_evit, "0"))
return false;
return true;
}

View File

@ -2,7 +2,6 @@
using ArcGIS.Core.Geometry;
using ArcGIS.Core.Internal.CIM;
using ArcGIS.Desktop.Framework.Threading.Tasks;*/
using ActiproSoftware.Windows.Extensions;
using OliviaAddInPro.Helper;
using OliviaAddInPro.Model;
using System;
@ -33,15 +32,6 @@ namespace OliviaAddInPro.Services
*/
public Respuesta<bool> Ejecuta(ModosEjec modo)
{
var modos_viaje = ConfigServ.Serv.Leer().ListaMV;
if (modos_viaje != null && modos_viaje.Count > TipoMv)
{
ComunDef.configMV = modos_viaje[TipoMv];
}
else
{
ComunDef.configMV = new OliviaConfMV();
}
var res = new Respuesta<bool>()
{
Value = false
@ -84,7 +74,7 @@ namespace OliviaAddInPro.Services
{
nombFileAmbs = string.Empty;
limp.ConsultaAmbs = DameAmbsConsulta(out nombFileAmbs);
if (null==limp.ConsultaAmbs)
if (string.IsNullOrEmpty(limp.ConsultaAmbs))
{
return false;
}
@ -120,11 +110,9 @@ namespace OliviaAddInPro.Services
{
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;
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

View File

@ -32,12 +32,8 @@
<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"
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"/>
<ComboBox x:Name="comboBox_ambitos" IsEnabled="{Binding Path=CapaAbierta, Mode = TwoWay}" ItemsSource="{Binding Path=tiposMv, Mode = TwoWay}" HorizontalAlignment="Left" Margin="20,0,0,0"
<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"
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"

View File

@ -80,20 +80,7 @@ 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)
{
int i = -1;

View File

@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions"
xmlns:ui="clr-namespace:OliviaAddInPro"
mc:Ignorable="d" d:DesignWidth="300" Height="422"
mc:Ignorable="d" d:DesignWidth="300" Height="390"
d:DataContext="{Binding Path=ui.PaneRecogidaSub1ViewModel}" Loaded="UserControl_Loaded" Unloaded="UserControl_Unloaded" >
<UserControl.Resources>
<ResourceDictionary>
@ -94,10 +94,6 @@
<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"/>
</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"/>
<Grid Margin="20,0,0,0">
<Grid.ColumnDefinitions>

View File

@ -110,20 +110,7 @@ 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)
{
int i = -1;

View File

@ -27,7 +27,6 @@ namespace OliviaAddInPro
{
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 int selOpAmb = -1;
private ObservableCollection<CheckedListItem<string>> ambitos = new ObservableCollection<CheckedListItem<string>>();
@ -115,25 +114,6 @@ namespace OliviaAddInPro
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;
public int TipoTto
{
@ -219,8 +199,6 @@ namespace OliviaAddInPro
lblUdsVeloDespl = "km/h";
limpServ = new LimpiezaServ(null); //no hace falta instancia limp
textAnchoVia = LimpiezaDef.Parametros.ancho_via.ToString();
tiposMv = limpServ.GetNombreModosViajes();
tipoMv = -1;
}
/**
* Realiza las comprobaciones para cuando se ha abierto una capa
@ -266,10 +244,6 @@ namespace OliviaAddInPro
CapaElems = capa;
CapaAbierta = true;
return true;
}
public void ComboMvSel(int tto)
{
tipoMv = tto;
}
/**
* Realiza los cambios en los ámbitos cuando se ha seleccionado un tratamiento

View File

@ -92,8 +92,6 @@ namespace OliviaAddInPro
err_str = "No se ha seleccionado ningún Tipo de Tratamiento";
return false;
}
limp.TipoMV = _subPanel1ViewModel.TipoMv;
limp.TipoTto = _subPanel1ViewModel.TipoTto;
limp.TipoTtoStr = LimpiezaDef.tto_gdb[_subPanel1ViewModel.TipoTto];
//lee el/los ámbito seleccionado

View File

@ -32,7 +32,7 @@ namespace OliviaAddInPro
private ObservableCollection<string> tiposVehic = new ObservableCollection<string>();
private ObservableCollection<string> tiposCapac = new ObservableCollection<string>();
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
*/
@ -47,29 +47,6 @@ namespace OliviaAddInPro
public bool[] tipos_vehic_bool = new bool[(int)RecogidaDef.TiposVehic.N];
#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
{
@ -284,7 +261,6 @@ namespace OliviaAddInPro
{
KgCont = RecogidaDef.kgrec_cont;
}
tiposMv = new LimpiezaServ(null).GetNombreModosViajes();
}
/**
* Realiza las comprobaciones para cuando se ha abierto una capa

View File

@ -112,7 +112,6 @@ namespace OliviaAddInPro
err_str = "No se ha seleccionado ningún Tipo de Fracción";
return false;
}
reco.TipoMV = _subPanel1ViewModel.TipoMv;
reco.TipoFracStr = RecogidaDef.tipos_fracc_str[reco.TipoFrac];
reco.TipoTto = reco.TipoFrac;
reco.TipoTtoStr = RecogidaDef.tipos_fracc_str[reco.TipoFrac];