Avances ventana limpieza
parent
9f2c7d035e
commit
b8d856ceee
|
|
@ -13,16 +13,18 @@ namespace OliviaAddInPro.Helper
|
||||||
|
|
||||||
private bool isChecked;
|
private bool isChecked;
|
||||||
private bool isEnabled;
|
private bool isEnabled;
|
||||||
|
private bool isVisible;
|
||||||
private T item;
|
private T item;
|
||||||
|
|
||||||
public CheckedListItem()
|
public CheckedListItem()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public CheckedListItem(T item, bool isChecked = false, bool isEnabled = true)
|
public CheckedListItem(T item, bool isChecked = false, bool isEnabled = true, bool isVisible=true)
|
||||||
{
|
{
|
||||||
this.item = item;
|
this.item = item;
|
||||||
this.isChecked = isChecked;
|
this.isChecked = isChecked;
|
||||||
this.isEnabled = isEnabled;
|
this.isEnabled = isEnabled;
|
||||||
|
this.isVisible = isVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
public T Item
|
public T Item
|
||||||
|
|
@ -54,5 +56,14 @@ namespace OliviaAddInPro.Helper
|
||||||
if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("IsEnabled"));
|
if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("IsEnabled"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public bool IsVisible
|
||||||
|
{
|
||||||
|
get { return isVisible; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
isVisible = value;
|
||||||
|
if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("IsVisible"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ using ArcGIS.Core.Geometry;
|
||||||
using ArcGIS.Core.Data;
|
using ArcGIS.Core.Data;
|
||||||
using ArcGIS.Desktop.Mapping;
|
using ArcGIS.Desktop.Mapping;
|
||||||
using ArcGIS.Core.Internal.CIM;
|
using ArcGIS.Core.Internal.CIM;
|
||||||
|
using ArcGIS.Desktop.Internal.Layouts.Utilities;
|
||||||
|
|
||||||
namespace OliviaAddInPro.Helper
|
namespace OliviaAddInPro.Helper
|
||||||
{
|
{
|
||||||
|
|
@ -21,7 +22,8 @@ namespace OliviaAddInPro.Helper
|
||||||
public static string OutStr {
|
public static string OutStr {
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
string val = out_str;
|
string val = "";
|
||||||
|
val.CopyFrom(out_str);
|
||||||
out_str = string.Empty; //lo borra cada vez que se consulta
|
out_str = string.Empty; //lo borra cada vez que se consulta
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
@ -31,7 +33,8 @@ namespace OliviaAddInPro.Helper
|
||||||
public static string TextoSal
|
public static string TextoSal
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
string val = texto_sal;
|
string val = "";
|
||||||
|
val.CopyFrom(texto_sal);
|
||||||
texto_sal = string.Empty; //lo borra cada vez que se consulta
|
texto_sal = string.Empty; //lo borra cada vez que se consulta
|
||||||
return val; }
|
return val; }
|
||||||
set { texto_sal = value; }
|
set { texto_sal = value; }
|
||||||
|
|
@ -263,6 +266,8 @@ namespace OliviaAddInPro.Helper
|
||||||
ObservableCollection<string> fields_st = new ObservableCollection<string>();
|
ObservableCollection<string> fields_st = new ObservableCollection<string>();
|
||||||
return ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run((Func<ObservableCollection<string>>)(() =>
|
return ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run((Func<ObservableCollection<string>>)(() =>
|
||||||
{
|
{
|
||||||
|
if (fc == null)
|
||||||
|
return null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ftcldef = fc.GetDefinition();
|
ftcldef = fc.GetDefinition();
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using ArcGIS.Core.Geometry;
|
using ArcGIS.Core.Geometry;
|
||||||
|
using ArcGIS.Desktop.Internal.Layouts.Utilities;
|
||||||
|
|
||||||
namespace OliviaAddInPro.Model
|
namespace OliviaAddInPro.Model
|
||||||
{
|
{
|
||||||
|
|
@ -73,5 +74,18 @@ namespace OliviaAddInPro.Model
|
||||||
* Número de sectores, si es 0, se calcula automáticamente, si es negativo, se ajusta a jornada
|
* Número de sectores, si es 0, se calcula automáticamente, si es negativo, se ajusta a jornada
|
||||||
*/
|
*/
|
||||||
public int NSect = 3;
|
public int NSect = 3;
|
||||||
|
/**
|
||||||
|
* String para errores o mensajes
|
||||||
|
*/
|
||||||
|
private string err_str = string.Empty;
|
||||||
|
public string ErrStr
|
||||||
|
{
|
||||||
|
get {
|
||||||
|
string val = string.Empty;
|
||||||
|
val.CopyFrom(err_str);
|
||||||
|
err_str = string.Empty;
|
||||||
|
return val; }
|
||||||
|
set { err_str = value;}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using OliviaAddInPro.Helper;
|
using OliviaAddInPro.Helper;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using ArcGIS.Core.CIM;
|
||||||
|
using ArcGIS.Core.Data;
|
||||||
|
|
||||||
namespace OliviaAddInPro.Model
|
namespace OliviaAddInPro.Model
|
||||||
{
|
{
|
||||||
|
|
@ -29,6 +32,10 @@ namespace OliviaAddInPro.Model
|
||||||
*/
|
*/
|
||||||
public int UdsTTto = (int)GeneralDef.OlvTiposTto.OlvTipTtoNoDef;
|
public int UdsTTto = (int)GeneralDef.OlvTiposTto.OlvTipTtoNoDef;
|
||||||
|
|
||||||
|
public Limpieza()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Lee la gdb y devuelve el array de ámbitos en función de si hay en la gdb o no
|
* Lee la gdb y devuelve el array de ámbitos en función de si hay en la gdb o no
|
||||||
*/
|
*/
|
||||||
|
|
@ -61,5 +68,61 @@ namespace OliviaAddInPro.Model
|
||||||
|
|
||||||
return amb_gdb;
|
return amb_gdb;
|
||||||
}
|
}
|
||||||
|
/**Devuelve el array de los ámbitos comunes y no comunes de las opciones de un tratamiento tto
|
||||||
|
* Es un array de longitud el número de ámbitos totales, con true en las posiciones en los que el ámbito sea común o
|
||||||
|
* no común en las opciones
|
||||||
|
*/
|
||||||
|
public bool[] DameAmbTto(int tto)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
bool sig;
|
||||||
|
bool[] amb_com = new bool[(int)LimpiezaDef.AmbitsTra.AmbN];
|
||||||
|
|
||||||
|
for (int j = 0; j < (int)LimpiezaDef.AmbitsTra.AmbN; j++)
|
||||||
|
{
|
||||||
|
sig = false;
|
||||||
|
for (i = 0; i < LimpiezaDef.ambs_val[tto].n_ops && !sig; i++)
|
||||||
|
{
|
||||||
|
if (LimpiezaDef.ambs_val[tto].ambs_ops[i].ambs[j]) //con que encuentre uno true lo pone y pasa al siguiente
|
||||||
|
{
|
||||||
|
amb_com[j] = sig = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return amb_com;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Lee la capa que se ha seleccionzdo de limpieza y se comprueba que los campos que se han editado corresponden con la capa
|
||||||
|
* (es decir, se puede leer la capa con los campos configurados)
|
||||||
|
*/
|
||||||
|
public bool CompruebaCamposLimp()
|
||||||
|
{
|
||||||
|
int NCAMPS = 2;
|
||||||
|
string[] camps;
|
||||||
|
int i;
|
||||||
|
camps = new string[NCAMPS];
|
||||||
|
camps[0] = LimpiezaDef.Campos.consulta_entidad;
|
||||||
|
camps[1] = LimpiezaDef.Campos.consulta_mecan;
|
||||||
|
FeatureClass fc = HelperGdb.GetFtClass(CapaElems);
|
||||||
|
if (fc == null)
|
||||||
|
{
|
||||||
|
ErrStr = "No se puede abrir la capa";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ObservableCollection<string> fields = HelperGdb.GetFields(fc).Result;
|
||||||
|
for (i = 0; i < NCAMPS; i++)
|
||||||
|
{
|
||||||
|
if (!fields.Contains(camps[i]))
|
||||||
|
{
|
||||||
|
ErrStr = "No se encuentra el campo " + camps[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (i < NCAMPS)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -248,11 +248,11 @@ namespace OliviaAddInPro.Model
|
||||||
/**
|
/**
|
||||||
* Array de cadenas de doubles enumerando los tiempos de tratamiento para los diferentes tipos de tratamiento.
|
* Array de cadenas de doubles enumerando los tiempos de tratamiento para los diferentes tipos de tratamiento.
|
||||||
*/
|
*/
|
||||||
public static double[] tiempos_tto = new double[(int)LimpiezaDef.TiposTto.TtoN - 1];
|
public static int[] tiempos_tto = new int[(int)LimpiezaDef.TiposTto.TtoN - 1];
|
||||||
/**
|
/**
|
||||||
* Array de cadenas de doubles enumerando las velocidades de desplazamiento para los diferentes tipos de tratamiento.
|
* Array de cadenas de doubles enumerando las velocidades de desplazamiento para los diferentes tipos de tratamiento.
|
||||||
*/
|
*/
|
||||||
public static double[] v_desplazamiento = new double[(int)LimpiezaDef.TiposTto.TtoN - 1];
|
public static int[] v_desplazamiento = new int[(int)LimpiezaDef.TiposTto.TtoN - 1];
|
||||||
/**
|
/**
|
||||||
* Array de cadenas de caracteres enumerando los tipos de tratamiento
|
* Array de cadenas de caracteres enumerando los tipos de tratamiento
|
||||||
*/
|
*/
|
||||||
|
|
@ -295,6 +295,7 @@ namespace OliviaAddInPro.Model
|
||||||
inicia_matr_restr();
|
inicia_matr_restr();
|
||||||
inicia_matr_amb();
|
inicia_matr_amb();
|
||||||
inicia_matr_carg_desc();
|
inicia_matr_carg_desc();
|
||||||
|
forma_filtros();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Inicializa la matriz de strings con los nombres (tipos de tratamiento) que llevarán los grupos de la geodatabase importada a ArcGIS una vez realizada la sectorización y la planificación
|
* Inicializa la matriz de strings con los nombres (tipos de tratamiento) que llevarán los grupos de la geodatabase importada a ArcGIS una vez realizada la sectorización y la planificación
|
||||||
|
|
@ -764,28 +765,26 @@ namespace OliviaAddInPro.Model
|
||||||
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoLimpSane] = false;
|
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoLimpSane] = false;
|
||||||
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoCustom] = true;
|
t_carg_desc[(int)LimpiezaDef.TiposTto.TtoCustom] = true;
|
||||||
}
|
}
|
||||||
/**Devuelve el array de los ámbitos comunes y no comunes de las opciones de un tratamiento tto
|
/**
|
||||||
* Es un array de longitud el número de ámbitos totales, con true en las posiciones en los que el ámbito sea común o
|
* Forma los filtros con las consultas y atributos
|
||||||
* no común en las opciones
|
|
||||||
*/
|
*/
|
||||||
public static bool[] dame_amb(int tto)
|
public static void forma_filtros()
|
||||||
{
|
{
|
||||||
int i;
|
LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbEjeCalle] = "";
|
||||||
bool sig;
|
LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbBordLibreMec] = LimpiezaDef.Campos.consulta_entidad + " = '" + LimpiezaDef.Atributos.atr_bord + "' AND " + LimpiezaDef.Campos.consulta_mecan + " = 'Si'";
|
||||||
bool[] amb_com = new bool[(int)LimpiezaDef.AmbitsTra.AmbN];
|
LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbBordLibreNoMec] = LimpiezaDef.Campos.consulta_entidad + " = '" + LimpiezaDef.Atributos.atr_bord + "' AND " + LimpiezaDef.Campos.consulta_mecan + " = 'No'";
|
||||||
|
LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbBordAparc] = LimpiezaDef.Campos.consulta_entidad + " = '" + LimpiezaDef.Atributos.atr_aparc + "'";
|
||||||
for (int j = 0; j < (int)LimpiezaDef.AmbitsTra.AmbN; j++)
|
LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbAceMec] = LimpiezaDef.Campos.consulta_entidad + " = '" + LimpiezaDef.Atributos.atr_acera + "' AND " + LimpiezaDef.Campos.consulta_mecan + " = 'Si'";
|
||||||
{
|
LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbAceNoMec] = LimpiezaDef.Campos.consulta_entidad + " = '" + LimpiezaDef.Atributos.atr_acera + "' AND " + LimpiezaDef.Campos.consulta_mecan + " = 'No'";
|
||||||
sig = false;
|
LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbCallePeatMec] = LimpiezaDef.Campos.consulta_entidad + " = '" + LimpiezaDef.Atributos.atr_peat + "' AND " + LimpiezaDef.Campos.consulta_mecan + " = 'Si'";
|
||||||
for (i = 0; i < ambs_val[tto].n_ops && !sig; i++)
|
LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbCallePeatNoMec] = LimpiezaDef.Campos.consulta_entidad + " = '" + LimpiezaDef.Atributos.atr_peat + "' AND " + LimpiezaDef.Campos.consulta_mecan + " = 'No'";
|
||||||
{
|
LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbBordHojaMec] = LimpiezaDef.Campos.consulta_entidad + " = '" + LimpiezaDef.Atributos.atr_hoja + "' AND " + LimpiezaDef.Campos.consulta_mecan + " = 'Si'";
|
||||||
if (ambs_val[tto].ambs_ops[i].ambs[j]) //con que encuentre uno true lo pone y pasa al siguiente
|
LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbBordHojaNoMec] = LimpiezaDef.Campos.consulta_entidad + " = '" + LimpiezaDef.Atributos.atr_hoja + "' AND " + LimpiezaDef.Campos.consulta_mecan + " = 'No'";
|
||||||
{
|
LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbConte] = "";
|
||||||
amb_com[j] = sig = true;
|
LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbPape] = LimpiezaDef.Campos.consulta_entidad + " = '" + LimpiezaDef.Atributos.atr_pape + "'";
|
||||||
}
|
LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbZInf] = LimpiezaDef.Campos.consulta_entidad + " = '" + LimpiezaDef.Atributos.atr_infan + "'";
|
||||||
}
|
LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbPipi] = LimpiezaDef.Campos.consulta_entidad + " = '" + LimpiezaDef.Atributos.atr_pipi + "'";
|
||||||
}
|
LimpiezaDef.filtro_str[(int)LimpiezaDef.AmbitsTra.AmbSane] = LimpiezaDef.Campos.consulta_entidad + " = '" + LimpiezaDef.Atributos.atr_sane + "'";
|
||||||
return amb_com;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ namespace OliviaAddInPro.Model
|
||||||
OlvTipTtoM2h,
|
OlvTipTtoM2h,
|
||||||
OlvTipTtoM2h_eje,
|
OlvTipTtoM2h_eje,
|
||||||
};
|
};
|
||||||
|
public static string[] UdsTto = new string[] {"min","m/h","m/h","m2/h","m2/h"};
|
||||||
//*************************************************************************************
|
//*************************************************************************************
|
||||||
//Variables generales
|
//Variables generales
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -53,5 +53,248 @@ namespace OliviaAddInPro.Model
|
||||||
//set { limp = value; }
|
//set { limp = value; }
|
||||||
}
|
}
|
||||||
#endregion Properties
|
#endregion Properties
|
||||||
|
|
||||||
|
public static void Inicia()
|
||||||
|
{
|
||||||
|
IniDefault();
|
||||||
|
LimpiezaDef.iniciaLimpDef();
|
||||||
|
limp = new Limpieza();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inicializa los nombres por defecto de las variables, para debug por si no hay instalador
|
||||||
|
*/
|
||||||
|
public static void IniDefault()
|
||||||
|
{
|
||||||
|
Paths.PathWork = "C:\\Olivia\\";
|
||||||
|
Paths.PathExeOlivia = "C:\\Olivia\\release\\OliviaTasks.exe";
|
||||||
|
Paths.DirData = "C:\\Olivia\\data\\";
|
||||||
|
Paths.PathTemp = "C:\\Olivia\\temp\\";
|
||||||
|
Paths.PathCartela = "C:\\olivia\\data\\Plantilla.mxd";
|
||||||
|
|
||||||
|
Paths.PathGdbGen = "C:\\Olivia\\gdb\\BASE DE DATOS.gdb";
|
||||||
|
Paths.PathGdbNw = "C:\\Datos ejemplo\\BUENO\\Multinet_Q4_2015\\TomTom_Q4_2015.gdb";
|
||||||
|
Paths.PathSimbVSM = "C:\\Olivia\\styles\\Simbologia.style";
|
||||||
|
Paths.PathSimbESRI = "C:\\Olivia\\styles\\ESRI.style";
|
||||||
|
//puerto = 19995;
|
||||||
|
//buff_export = 1000;
|
||||||
|
|
||||||
|
///////////////////////////////////////
|
||||||
|
//Capas, consultas y filtros GENERALES
|
||||||
|
/*Capas.ftclass_ejes = "TomTom_Q4_2015___nw";
|
||||||
|
Capas.ftclass_zonas = "SubNiveles";
|
||||||
|
Capas.ftclass_restri = "TomTom_Q4_2015___rs";
|
||||||
|
Capas.ftclass_muni = "TomTom_Q4_2015___a8";*/
|
||||||
|
|
||||||
|
///////////////////////////////////////
|
||||||
|
//Capas, consultas, atributos y filtros de LIMPIEZA
|
||||||
|
LimpiezaDef.Capas.ftclass_niveles = "a2_Niveles_Limpieza";
|
||||||
|
LimpiezaDef.Capas.ftclass_cont = "a_Contendores";
|
||||||
|
LimpiezaDef.Capas.ftclass_mobi = "a_Mobiliario";
|
||||||
|
LimpiezaDef.Capas.ftclass_limp_mec = "b_LimpMececanica";
|
||||||
|
LimpiezaDef.Capas.ftclass_instala = "c_Instalaciones";
|
||||||
|
|
||||||
|
LimpiezaDef.Campos.consulta_entidad = "NOM_TIPO_ENTIDAD";
|
||||||
|
LimpiezaDef.Campos.consulta_mecan = "MECANIZABLE";
|
||||||
|
LimpiezaDef.Campos.consulta_observ = "OBSERVACIONES";
|
||||||
|
LimpiezaDef.Campos.consulta_anch_tip = "ANCHO_TIPO";
|
||||||
|
LimpiezaDef.Campos.consulta_tipolo = "TIPOLOGIA";
|
||||||
|
|
||||||
|
LimpiezaDef.Atributos.atr_esca = "Escaleras";
|
||||||
|
LimpiezaDef.Atributos.atr_fuent = "Fuentes";
|
||||||
|
LimpiezaDef.Atributos.atr_infan = "JuegosInfantiles";
|
||||||
|
LimpiezaDef.Atributos.atr_pape = "Papelera";
|
||||||
|
LimpiezaDef.Atributos.atr_paso_niv = "Paso_Dist_Nivel";
|
||||||
|
LimpiezaDef.Atributos.atr_pipi = "Pipican";
|
||||||
|
LimpiezaDef.Atributos.atr_sane = "Sanecan";
|
||||||
|
LimpiezaDef.Atributos.atr_acera = "Aceras";
|
||||||
|
LimpiezaDef.Atributos.atr_aparc = "Banda Aparcamiento";
|
||||||
|
LimpiezaDef.Atributos.atr_bord = "Bordillo Libre";
|
||||||
|
LimpiezaDef.Atributos.atr_hoja = "Caida Hoja";
|
||||||
|
LimpiezaDef.Atributos.atr_peat = "Peatonales";
|
||||||
|
LimpiezaDef.Atributos.atr_terri = "Areas Terrizas";
|
||||||
|
LimpiezaDef.Atributos.atr_ocio = "Ocio";
|
||||||
|
LimpiezaDef.Atributos.atr_org_ofi = "Organismos_Oficiales";
|
||||||
|
LimpiezaDef.Atributos.atr_parq = "Parques";
|
||||||
|
LimpiezaDef.Atributos.atr_park = "Parquin";
|
||||||
|
LimpiezaDef.Atributos.atr_play = "Playa";
|
||||||
|
LimpiezaDef.Atributos.atr_polid = "Polideportivo";
|
||||||
|
LimpiezaDef.Atributos.atr_turis = "Puntos_Interes_Turistico";
|
||||||
|
LimpiezaDef.Atributos.atr_solar = "Solares";
|
||||||
|
LimpiezaDef.Atributos.atr_suelo = "Uso_Suelos";
|
||||||
|
LimpiezaDef.Atributos.atr_ap_lin = "Linea";
|
||||||
|
LimpiezaDef.Atributos.atr_ap_bat = "Bateria";
|
||||||
|
|
||||||
|
//para el grupo PARAMETROS de LIMPIEZA
|
||||||
|
LimpiezaDef.Parametros.t_ttoM = 40000;
|
||||||
|
LimpiezaDef.Parametros.t_ttom = 0;
|
||||||
|
LimpiezaDef.Parametros.v_despM = 40000;
|
||||||
|
LimpiezaDef.Parametros.v_despm = 0;
|
||||||
|
LimpiezaDef.Parametros.t_cardescM = 40000;
|
||||||
|
LimpiezaDef.Parametros.t_cardescm = 0;
|
||||||
|
LimpiezaDef.Parametros.t_cardesc = 40;
|
||||||
|
LimpiezaDef.Parametros.t_despM = 40000;
|
||||||
|
LimpiezaDef.Parametros.t_despm = 0;
|
||||||
|
LimpiezaDef.Parametros.t_desp = 25;
|
||||||
|
LimpiezaDef.Parametros.t_convM = 40000;
|
||||||
|
LimpiezaDef.Parametros.t_convm = 0;
|
||||||
|
LimpiezaDef.Parametros.t_conv = 60 * 8;
|
||||||
|
LimpiezaDef.Parametros.t_descansoM = 40000;
|
||||||
|
LimpiezaDef.Parametros.t_descansom = 0;
|
||||||
|
LimpiezaDef.Parametros.t_descanso = 30;
|
||||||
|
LimpiezaDef.Parametros.h_inicio = 420;
|
||||||
|
LimpiezaDef.Parametros.ancho_viaM = 2000;
|
||||||
|
LimpiezaDef.Parametros.ancho_viam = 0;
|
||||||
|
LimpiezaDef.Parametros.ancho_via = 2;
|
||||||
|
LimpiezaDef.Parametros.ttoBarMan = 2900;
|
||||||
|
LimpiezaDef.Parametros.ttoBarManMant = 2900;
|
||||||
|
LimpiezaDef.Parametros.ttoBarMMot = 3500;
|
||||||
|
LimpiezaDef.Parametros.ttoBarMC = 4000;
|
||||||
|
LimpiezaDef.Parametros.ttoBarMAP = 4200;
|
||||||
|
LimpiezaDef.Parametros.ttoBarMix = 5600;
|
||||||
|
LimpiezaDef.Parametros.ttoBalMan = 4000;
|
||||||
|
LimpiezaDef.Parametros.ttoBalMC = 5000;
|
||||||
|
LimpiezaDef.Parametros.ttoBalMAP = 4200;
|
||||||
|
LimpiezaDef.Parametros.ttoBalMix = 5600;
|
||||||
|
LimpiezaDef.Parametros.ttoBL = 4000;
|
||||||
|
LimpiezaDef.Parametros.ttoCH = 5600;
|
||||||
|
LimpiezaDef.Parametros.ttoVPap = 1;
|
||||||
|
LimpiezaDef.Parametros.ttoLPap = 5;
|
||||||
|
LimpiezaDef.Parametros.ttoLC = 5;
|
||||||
|
LimpiezaDef.Parametros.ttoLZI = 30;
|
||||||
|
LimpiezaDef.Parametros.ttoLPip = 30;
|
||||||
|
LimpiezaDef.Parametros.ttoLS = 5;
|
||||||
|
LimpiezaDef.Parametros.vdespBarMan = 5;
|
||||||
|
LimpiezaDef.Parametros.vdespBarManMant = 5;
|
||||||
|
LimpiezaDef.Parametros.vdespBarMMot = 25;
|
||||||
|
LimpiezaDef.Parametros.vdespBarMC = 15;
|
||||||
|
LimpiezaDef.Parametros.vdespBarMAP = 15;
|
||||||
|
LimpiezaDef.Parametros.vdespBarMix = 15;
|
||||||
|
LimpiezaDef.Parametros.vdespBalMan = 15;
|
||||||
|
LimpiezaDef.Parametros.vdespBalMC = 0;
|
||||||
|
LimpiezaDef.Parametros.vdespBalMAP = 15;
|
||||||
|
LimpiezaDef.Parametros.vdespBalMix = 15;
|
||||||
|
LimpiezaDef.Parametros.vdespBL = 5;
|
||||||
|
LimpiezaDef.Parametros.vdespCH = 15;
|
||||||
|
LimpiezaDef.Parametros.vdespVPap = 0;
|
||||||
|
LimpiezaDef.Parametros.vdespLPap = 0;
|
||||||
|
LimpiezaDef.Parametros.vdespLC = 0;
|
||||||
|
LimpiezaDef.Parametros.vdespLZI = 0;
|
||||||
|
LimpiezaDef.Parametros.vdespLPip = 0;
|
||||||
|
LimpiezaDef.Parametros.vdespLS = 0;
|
||||||
|
LimpiezaDef.Parametros.umbral_reco = 80;
|
||||||
|
|
||||||
|
LimpiezaDef.OtrosParam.giro_max = 175;
|
||||||
|
LimpiezaDef.OtrosParam.anch_peat = 6;
|
||||||
|
LimpiezaDef.OtrosParam.anch_ace = 1.5;
|
||||||
|
LimpiezaDef.OtrosParam.anch_aplin = 2;
|
||||||
|
LimpiezaDef.OtrosParam.anch_apbat = 4;
|
||||||
|
LimpiezaDef.OtrosParam.anch_bordlib = 1.5;
|
||||||
|
LimpiezaDef.OtrosParam.desv_max = 0.15;
|
||||||
|
LimpiezaDef.OtrosParam.desv_max_abs = 1800;
|
||||||
|
|
||||||
|
///////////////////////////////////////
|
||||||
|
//Capas, consultas, atributos y filtros de RECOGIDA
|
||||||
|
/*
|
||||||
|
RecogidaDef.campos_def.cons_id = RecogidaDef.campos.cons_id = "OBJECTID";
|
||||||
|
RecogidaDef.campos_def.cons_nomrec = RecogidaDef.campos.cons_nomrec = "NOMB_TIP_REC";
|
||||||
|
RecogidaDef.campos_def.cons_lateral = RecogidaDef.campos.cons_lateral = "LATERALIDAD";
|
||||||
|
RecogidaDef.campos_def.cons_fracc = RecogidaDef.campos.cons_fracc = "FRACCION";
|
||||||
|
RecogidaDef.campos_def.cons_capac = RecogidaDef.campos.cons_capac = "CAPACIDAD";
|
||||||
|
RecogidaDef.campos_def.cons_uds = RecogidaDef.campos.cons_uds = "UNIDADES";
|
||||||
|
RecogidaDef.campos_def.cons_kgrec = RecogidaDef.campos.cons_kgrec = "KGRECO";
|
||||||
|
RecogidaDef.kgrec_cont = RecogidaDef.kgrec_cont = 200;
|
||||||
|
|
||||||
|
//Rellena los tipos de fracción
|
||||||
|
RecogidaDef.tipos_fracc_str[(int)RecogidaDef.TiposFracción.Organica] = "Organica";
|
||||||
|
RecogidaDef.tipos_fracc_str[(int)RecogidaDef.TiposFracción.Resto] = "Resto";
|
||||||
|
RecogidaDef.tipos_fracc_str[(int)RecogidaDef.TiposFracción.Envases] = "Envases";
|
||||||
|
RecogidaDef.tipos_fracc_str[(int)RecogidaDef.TiposFracción.Papel] = "PapelCarton";
|
||||||
|
RecogidaDef.tipos_fracc_str[(int)RecogidaDef.TiposFracción.Vidrio] = "Vidrio";
|
||||||
|
//Rellena los tipos de carga
|
||||||
|
RecogidaDef.tipos_carg_str[(int)RecogidaDef.TiposCarga.Trasera] = "Carga Trasera";
|
||||||
|
RecogidaDef.tipos_carg_str[(int)RecogidaDef.TiposCarga.Lateral] = "Carga Lateral";
|
||||||
|
RecogidaDef.tipos_carg_str[(int)RecogidaDef.TiposCarga.Superior] = "Carga Superior";
|
||||||
|
RecogidaDef.tipos_carg_str[(int)RecogidaDef.TiposCarga.Bilateral] = "Carga Bilateral";
|
||||||
|
RecogidaDef.tipos_carg_str[(int)RecogidaDef.TiposCarga.BolseoPtaPta] = "Bolseo";
|
||||||
|
RecogidaDef.tipos_carg_str[(int)RecogidaDef.TiposCarga.Lavado] = "Lavado de cont";
|
||||||
|
|
||||||
|
RecogidaDef.Parametros.t_vaciM = 40000;
|
||||||
|
RecogidaDef.Parametros.t_vacim = 0;
|
||||||
|
RecogidaDef.Parametros.t_llegsalM = 40000;
|
||||||
|
RecogidaDef.Parametros.t_llegsalm = 0;
|
||||||
|
RecogidaDef.Parametros.t_llegsal = 5;
|
||||||
|
RecogidaDef.Parametros.t_descM = 40000;
|
||||||
|
RecogidaDef.Parametros.t_descm = 0;
|
||||||
|
RecogidaDef.Parametros.t_desc = 40;
|
||||||
|
RecogidaDef.Parametros.t_convM = 40000;
|
||||||
|
RecogidaDef.Parametros.t_convm = 0;
|
||||||
|
RecogidaDef.Parametros.t_conv = 60 * 8;
|
||||||
|
RecogidaDef.Parametros.t_descansoM = 40000;
|
||||||
|
RecogidaDef.Parametros.t_descansom = 0;
|
||||||
|
RecogidaDef.Parametros.t_descanso = 30;
|
||||||
|
RecogidaDef.Parametros.h_inicio = 420;
|
||||||
|
RecogidaDef.Parametros.dens_vehi_org = 500;
|
||||||
|
RecogidaDef.Parametros.dens_vehi_res = 500;
|
||||||
|
RecogidaDef.Parametros.dens_vehi_env = 120;
|
||||||
|
RecogidaDef.Parametros.dens_vehi_pap = 250;
|
||||||
|
RecogidaDef.Parametros.dens_vehi_vid = 350;
|
||||||
|
RecogidaDef.Parametros.dens_vehi_otr = 100;
|
||||||
|
RecogidaDef.Parametros.dens_cont_org = 150;
|
||||||
|
RecogidaDef.Parametros.dens_cont_res = 100;
|
||||||
|
RecogidaDef.Parametros.dens_cont_env = 28;
|
||||||
|
RecogidaDef.Parametros.dens_cont_pap = 90;
|
||||||
|
RecogidaDef.Parametros.dens_cont_vid = 250;
|
||||||
|
RecogidaDef.Parametros.dens_cont_otr = 100;
|
||||||
|
RecogidaDef.Parametros.anch_vehi_3 = 2.4;
|
||||||
|
RecogidaDef.Parametros.anch_vehi_2 = 2.2;
|
||||||
|
RecogidaDef.Parametros.anch_vehi_s = 2;
|
||||||
|
RecogidaDef.Parametros.rad_giro_3 = 175;
|
||||||
|
RecogidaDef.Parametros.rad_giro_2 = 175;
|
||||||
|
RecogidaDef.Parametros.rad_giro_s = 175;
|
||||||
|
RecogidaDef.Parametros.t_vaci_tra = 30;
|
||||||
|
RecogidaDef.Parametros.t_vaci_lat = 90;
|
||||||
|
RecogidaDef.Parametros.t_vaci_sup = 180;
|
||||||
|
RecogidaDef.Parametros.t_vaci_bi = 100;
|
||||||
|
RecogidaDef.Parametros.t_vaci_bol = 5;
|
||||||
|
RecogidaDef.Parametros.t_vaci_lav = 60;
|
||||||
|
RecogidaDef.Parametros.t_vaci_otr = 60;
|
||||||
|
RecogidaDef.Parametros.kgmaxM = 20000;
|
||||||
|
RecogidaDef.Parametros.kgmaxm = 0;
|
||||||
|
RecogidaDef.Parametros.carga_maxM = 100;
|
||||||
|
RecogidaDef.Parametros.carga_maxm = 50;
|
||||||
|
|
||||||
|
//Atributos LATERALIDAD
|
||||||
|
RecogidaDef.tipos_lateralidad[(int)RecogidaDef.Lateralidad.Ambos] = "Ambos";
|
||||||
|
RecogidaDef.tipos_lateralidad[(int)RecogidaDef.Lateralidad.Dcha] = "Derecha";
|
||||||
|
RecogidaDef.tipos_lateralidad[(int)RecogidaDef.Lateralidad.Izqda] = "Izquierda";
|
||||||
|
|
||||||
|
//Campos de SENSORES
|
||||||
|
RecogidaDef.campos_def.cons_id_sens = RecogidaDef.campos.cons_id_sens = "OBJECTID";
|
||||||
|
RecogidaDef.campos_def.cons_url_sens = RecogidaDef.campos.cons_url_sens = "http://localiza.info/Utilidades/APIManager.aspx";
|
||||||
|
RecogidaDef.campos_def.cons_fecha_sens = RecogidaDef.campos.cons_fecha_sens = "2000-01-01T00:00:00";
|
||||||
|
RecogidaDef.campos_def.cons_fechaf_sens = RecogidaDef.campos.cons_fechaf_sens = "2050-01-01T00:00:00";
|
||||||
|
|
||||||
|
//Campos de CSV
|
||||||
|
RecogidaDef.campos_def.cons_id_csv = RecogidaDef.campos.cons_id_csv = "Nº";
|
||||||
|
RecogidaDef.campos_def.cons_llen_csv = RecogidaDef.campos.cons_llen_csv = "Lectura";
|
||||||
|
RecogidaDef.campos_def.cons_fecha_csv = RecogidaDef.campos.cons_fecha_csv = "Fecha";
|
||||||
|
RecogidaDef.campos_def.cons_fechai_csv = RecogidaDef.campos.cons_fechai_csv = "01/01/2000 0:01";
|
||||||
|
RecogidaDef.campos_def.cons_fechaf_csv = RecogidaDef.campos.cons_fechaf_csv = "01/01/2049 0:00";
|
||||||
|
|
||||||
|
//Campos de la red navegable que se leen
|
||||||
|
ComunDef.CamposNW.cons_onew = "ONEWAY";
|
||||||
|
ComunDef.CamposNW.cons_kph = "KPH";
|
||||||
|
ComunDef.CamposNW.cons_fow = "FOW";
|
||||||
|
ComunDef.CamposNW.cons_name = "NAME";
|
||||||
|
//Atributos de la red navegable que se leen
|
||||||
|
ComunDef.AtributosNW.atr_TF = "TF";
|
||||||
|
ComunDef.AtributosNW.atr_FT = "FT";
|
||||||
|
ComunDef.AtributosNW.atr_N = "N";
|
||||||
|
ComunDef.AtributosNW.atr_pedes = "14";
|
||||||
|
|
||||||
|
//Nombre de simbolos VSM
|
||||||
|
RecogidaDef.rellena_simbrec_vsm();*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ using ArcGIS.Desktop.Framework.Contracts;
|
||||||
using ArcGIS.Desktop.Framework.Dialogs;
|
using ArcGIS.Desktop.Framework.Dialogs;
|
||||||
using ArcGIS.Desktop.Framework.Threading.Tasks;
|
using ArcGIS.Desktop.Framework.Threading.Tasks;
|
||||||
using ArcGIS.Desktop.Mapping;
|
using ArcGIS.Desktop.Mapping;
|
||||||
|
using OliviaAddInPro.Model;
|
||||||
|
|
||||||
namespace OliviaAddInPro
|
namespace OliviaAddInPro
|
||||||
{
|
{
|
||||||
|
|
@ -48,7 +49,8 @@ namespace OliviaAddInPro
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool Initialize()
|
protected override bool Initialize()
|
||||||
{
|
{
|
||||||
|
OliviaGlob.Inicia();
|
||||||
ProjectClosedEvent.Subscribe(OnProjectClosed);
|
ProjectClosedEvent.Subscribe(OnProjectClosed);
|
||||||
return base.Initialize();
|
return base.Initialize();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,24 @@ namespace OliviaAddInPro {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Busca una cadena traducida similar a Tiempo de tratamiento.
|
||||||
|
/// </summary>
|
||||||
|
internal static string String_lbl_timetto {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("String_lbl_timetto", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Busca una cadena traducida similar a Veloci. de tratamiento.
|
||||||
|
/// </summary>
|
||||||
|
internal static string String_lbl_velotto {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("String_lbl_velotto", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Busca una cadena traducida similar a Seleccionar capa ....
|
/// Busca una cadena traducida similar a Seleccionar capa ....
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -123,6 +141,15 @@ namespace OliviaAddInPro {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Busca una cadena traducida similar a Def. Vías..
|
||||||
|
/// </summary>
|
||||||
|
internal static string String_velo_nodef {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("String_velo_nodef", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Busca una cadena traducida similar a Zonificación.
|
/// Busca una cadena traducida similar a Zonificación.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,12 @@
|
||||||
<data name="String_header_limpieza" xml:space="preserve">
|
<data name="String_header_limpieza" xml:space="preserve">
|
||||||
<value>OLIVIA | Limpieza</value>
|
<value>OLIVIA | Limpieza</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="String_lbl_timetto" xml:space="preserve">
|
||||||
|
<value>Tiempo de tratamiento</value>
|
||||||
|
</data>
|
||||||
|
<data name="String_lbl_velotto" xml:space="preserve">
|
||||||
|
<value>Veloci. de tratamiento</value>
|
||||||
|
</data>
|
||||||
<data name="String_selec_capa" xml:space="preserve">
|
<data name="String_selec_capa" xml:space="preserve">
|
||||||
<value>Seleccionar capa ...</value>
|
<value>Seleccionar capa ...</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
@ -138,6 +144,9 @@
|
||||||
<data name="String_tto" xml:space="preserve">
|
<data name="String_tto" xml:space="preserve">
|
||||||
<value>Tratamiento</value>
|
<value>Tratamiento</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="String_velo_nodef" xml:space="preserve">
|
||||||
|
<value>Def. Vías.</value>
|
||||||
|
</data>
|
||||||
<data name="String_zonif" xml:space="preserve">
|
<data name="String_zonif" xml:space="preserve">
|
||||||
<value>Zonificación</value>
|
<value>Zonificación</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
<!--TextBlock Text="Add your custom content here" VerticalAlignment="Center" HorizontalAlignment="Center"></-->
|
<!--TextBlock Text="Add your custom content here" VerticalAlignment="Center" HorizontalAlignment="Center"></-->
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="350"/>
|
<RowDefinition Height="380"/>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<StackPanel Grid.Row="0">
|
<StackPanel Grid.Row="0">
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
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"
|
mc:Ignorable="d" d:DesignWidth="300" Height="380"
|
||||||
d:DataContext="{Binding Path=ui.PaneLimpiezaSub1ViewModel}" Height="350">
|
d:DataContext="{Binding Path=ui.PaneLimpiezaSub1ViewModel}" >
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<StackPanel Orientation="Vertical" Height="Auto" Margin="0,0,0,10">
|
<StackPanel Orientation="Vertical" Height="Auto">
|
||||||
<Label Content="Capa de Limpieza" HorizontalAlignment="Left" Margin="15,5,0,0" VerticalAlignment="Top" FontWeight="DemiBold"/>
|
<Label Content="Capa de Limpieza" HorizontalAlignment="Left" Margin="15,5,0,0" VerticalAlignment="Top" FontWeight="DemiBold"/>
|
||||||
<Grid Margin="0,5,0,0">
|
<Grid Margin="0,5,0,0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
|
@ -29,9 +29,9 @@
|
||||||
<Label x:Name="label_capalimp" Content="{Binding Path=LblCapaLimp, Mode = TwoWay}" Grid.Column="1" HorizontalAlignment="Left" Margin="13,0,0,0" VerticalAlignment="Top" Width="221" Height="30" Grid.ColumnSpan="3"/>
|
<Label x:Name="label_capalimp" Content="{Binding Path=LblCapaLimp, Mode = TwoWay}" Grid.Column="1" HorizontalAlignment="Left" Margin="13,0,0,0" VerticalAlignment="Top" Width="221" Height="30" Grid.ColumnSpan="3"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Label Content="Tipo de Tratamiento" HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Top" FontWeight="DemiBold"/>
|
<Label Content="Tipo de Tratamiento" HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Top" FontWeight="DemiBold"/>
|
||||||
<ComboBox x:Name="comboBox_tto" ItemsSource="{Binding Path=TiposTto, Mode = TwoWay}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Top" Width="260" DropDownOpened="ComboBox_DropDownOpened"/>
|
<ComboBox x:Name="comboBox_tto" ItemsSource="{Binding Path=TiposTto, Mode = TwoWay}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Top" Width="260" DropDownOpened="ComboBox_DropDownOpened" SelectionChanged="comboBox_tto_SelectionChanged"/>
|
||||||
<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" ItemsSource="{Binding Path=OpsAmbs, Mode = TwoWay}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Top" Width="260"/>
|
<ComboBox x:Name="comboBox_ambitos" ItemsSource="{Binding Path=OpsAmbs, Mode = TwoWay}" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Top" Width="260" SelectionChanged="comboBox_ambitos_SelectionChanged"/>
|
||||||
<ListBox x:Name="listBox_ambitos" ItemsSource="{Binding Path=Ambitos, Mode = TwoWay}" HorizontalAlignment="Left" Height="100" Margin="20,2,0,0" VerticalAlignment="Top" Width="260">
|
<ListBox x:Name="listBox_ambitos" ItemsSource="{Binding Path=Ambitos, Mode = TwoWay}" HorizontalAlignment="Left" Height="100" Margin="20,2,0,0" VerticalAlignment="Top" Width="260">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
|
|
@ -41,12 +41,12 @@
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
<CheckBox x:Name="checkBox_sentidocirc" Content="Respeta el sentido de circulación" HorizontalAlignment="Left" Margin="20,2,0,0" VerticalAlignment="Top"/>
|
<CheckBox x:Name="checkBox_sentidocirc" Content="Respeta el sentido de circulación" IsChecked="{Binding RespSentCirc}" HorizontalAlignment="Left" Margin="20,2,0,0" VerticalAlignment="Top"/>
|
||||||
<Grid Margin="0,5,0,0">
|
<Grid Margin="0,5,0,0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="6*"/>
|
<ColumnDefinition Width="6*"/>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="3*"/>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Label x:Name="label_velodespl" Margin="15,0,0,0" Content="Velocidad de desplazamiento"/>
|
<Label x:Name="label_velodespl" Margin="15,0,0,0" Content="Velocidad de desplazamiento"/>
|
||||||
<TextBox x:Name="txtBox_velodespl" Grid.Column="1" Margin="10,2,10,4" TextWrapping="Wrap" Text="{Binding Path=TextVeloDespl, Mode = TwoWay}" TextAlignment="Right" MaxLength="4" PreviewTextInput="TextBox_velodespl_PreviewTextInput"/>
|
<TextBox x:Name="txtBox_velodespl" Grid.Column="1" Margin="10,2,10,4" TextWrapping="Wrap" Text="{Binding Path=TextVeloDespl, Mode = TwoWay}" TextAlignment="Right" MaxLength="4" PreviewTextInput="TextBox_velodespl_PreviewTextInput"/>
|
||||||
|
|
@ -55,10 +55,10 @@
|
||||||
<Grid Margin="0,5,0,0">
|
<Grid Margin="0,5,0,0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="6*"/>
|
<ColumnDefinition Width="6*"/>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="3*"/>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Label x:Name="label_tiempotto" Margin="15,0,0,0" Content="Tiempo de tratamiento"/>
|
<Label x:Name="label_tiempotto" Margin="15,0,0,0" Content="{Binding LblTimeTto}"/>
|
||||||
<TextBox x:Name="txtBox_tiempotto" Grid.Column="1" Margin="10,2,10,4" TextWrapping="Wrap" Text="{Binding Path=TimeTto, Mode = TwoWay}" TextAlignment="Right" MaxLength="4" PreviewTextInput="TextBox_tiempotto_PreviewTextInput"/>
|
<TextBox x:Name="txtBox_tiempotto" Grid.Column="1" Margin="10,2,10,4" TextWrapping="Wrap" Text="{Binding Path=TimeTto, Mode = TwoWay}" TextAlignment="Right" MaxLength="4" PreviewTextInput="TextBox_tiempotto_PreviewTextInput"/>
|
||||||
<Label x:Name="label_udstiempotto" Grid.Column="2" Content="{Binding LblUdsTimeTto}" Margin="0,0,0,0"/>
|
<Label x:Name="label_udstiempotto" Grid.Column="2" Content="{Binding LblUdsTimeTto}" Margin="0,0,0,0"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
|
||||||
|
|
@ -44,10 +44,30 @@ namespace OliviaAddInPro
|
||||||
private void Button_Click(object sender, RoutedEventArgs e)
|
private void Button_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
string capa=HelperGdb.OpenFileDialog(HelperGdb.TiposOpenFileDlg.OpenFtrClassLine | HelperGdb.TiposOpenFileDlg.OpenFtrClassPoint);
|
string capa=HelperGdb.OpenFileDialog(HelperGdb.TiposOpenFileDlg.OpenFtrClassLine | HelperGdb.TiposOpenFileDlg.OpenFtrClassPoint);
|
||||||
if(!string.IsNullOrEmpty(capa))
|
if (!string.IsNullOrEmpty(capa))
|
||||||
|
{
|
||||||
label_capalimp.Content = System.IO.Path.GetFileNameWithoutExtension(capa);
|
label_capalimp.Content = System.IO.Path.GetFileNameWithoutExtension(capa);
|
||||||
|
((PaneLimpiezaSub1ViewModel)DataContext).AbiertaCapa(capa);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
label_capalimp.Content = Resource1.String_selec_capa;
|
label_capalimp.Content = Resource1.String_selec_capa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void comboBox_tto_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
int i = -1;
|
||||||
|
if (sender is ComboBox combo)
|
||||||
|
i = combo.SelectedIndex;
|
||||||
|
((PaneLimpiezaSub1ViewModel)DataContext).ComboTtoSel(i);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void comboBox_ambitos_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
int i = -1;
|
||||||
|
if (sender is ComboBox combo)
|
||||||
|
i = combo.SelectedIndex;
|
||||||
|
((PaneLimpiezaSub1ViewModel)DataContext).ComboAmbSel(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
</Button>
|
</Button>
|
||||||
<Label x:Name="label_capainst" Content="{Binding Path=LblCapaInst, Mode = TwoWay}" Grid.Column="1" HorizontalAlignment="Left" Margin="13,0,-33,0" VerticalAlignment="Top" Width="221" Height="30" Grid.ColumnSpan="2"/>
|
<Label x:Name="label_capainst" Content="{Binding Path=LblCapaInst, Mode = TwoWay}" Grid.Column="1" HorizontalAlignment="Left" Margin="13,0,-33,0" VerticalAlignment="Top" Width="221" Height="30" Grid.ColumnSpan="2"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid Margin="0,5,0,0">
|
<Grid Margin="0,15,0,0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="140"/>
|
<ColumnDefinition Width="140"/>
|
||||||
<ColumnDefinition Width="110"/>
|
<ColumnDefinition Width="110"/>
|
||||||
|
|
|
||||||
|
|
@ -18,31 +18,43 @@ using ArcGIS.Desktop.Mapping;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using OliviaAddInPro.Model;
|
using OliviaAddInPro.Model;
|
||||||
using OliviaAddInPro.Helper;
|
using OliviaAddInPro.Helper;
|
||||||
|
using ArcGIS.Desktop.Internal.Layouts.Utilities;
|
||||||
|
|
||||||
namespace OliviaAddInPro
|
namespace OliviaAddInPro
|
||||||
{
|
{
|
||||||
internal class PaneLimpiezaSub1ViewModel : PanelViewModelBase
|
internal class PaneLimpiezaSub1ViewModel : PanelViewModelBase
|
||||||
{
|
{
|
||||||
|
|
||||||
private ObservableCollection<string> tiposTto;
|
private ObservableCollection<string> tiposTto = new ObservableCollection<string>(LimpiezaDef.tipos_tto_str);
|
||||||
private int selTto = -1;
|
private int selTto = -1;
|
||||||
private ObservableCollection<string> opsAmbs;
|
private ObservableCollection<string> opsAmbs=new ObservableCollection<string>();
|
||||||
private int selOpAmb = -1;
|
private int selOpAmb = -1;
|
||||||
private ObservableCollection<CheckedListItem<string>> ambitos;
|
private ObservableCollection<CheckedListItem<string>> ambitos = new ObservableCollection<CheckedListItem<string>>();
|
||||||
|
private bool[] ambitosSel;
|
||||||
|
|
||||||
|
|
||||||
public PaneLimpiezaSub1ViewModel ()
|
/**
|
||||||
{
|
* Array de variables de tipo AmbitsList para mostrar en la lista, se rellena al elegir el tipo de tratamiento
|
||||||
lblCapaLimp = Resource1.String_selec_capa;
|
*/
|
||||||
timeTto = 10;
|
private ObservableCollection<AmbitsList> ambs_list = null;
|
||||||
textVeloDespl = 10;
|
/**
|
||||||
lblUdsTimeTto = "min";
|
* Array de variables de tipo AmbitsList para mostrar en la lista, para la opción editable (puedes elegir cualquier ámbito)
|
||||||
lblUdsVeloDespl = "km/h";
|
*/
|
||||||
|
private ObservableCollection<AmbitsList> ambs_list_tod_lin = null;
|
||||||
|
/**
|
||||||
|
* Array de variables de tipo AmbitsList para mostrar en la lista, para la opción editable (puedes elegir cualquier ámbito)
|
||||||
|
*/
|
||||||
|
private ObservableCollection<AmbitsList> ambs_list_tod_pto = null;
|
||||||
|
/**
|
||||||
|
* Array de variables de tipo AmbitsList para mostrar en la lista, para la opción genérica (puedes elegir los ejes de las calles)
|
||||||
|
*/
|
||||||
|
private ObservableCollection<AmbitsList> ambs_list_eje = null;
|
||||||
|
/**
|
||||||
|
* Matriz que da true aquellos ámbitos de trabajo que están contemplados en .gdb una vez leida
|
||||||
|
*/
|
||||||
|
bool[] amb_tra_gdb = null;
|
||||||
|
|
||||||
tiposTto = new ObservableCollection<string>(LimpiezaDef.tipos_tto_str);
|
private Limpieza limp;
|
||||||
ambitos = new ObservableCollection<CheckedListItem<string>>();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
|
|
@ -58,8 +70,8 @@ namespace OliviaAddInPro
|
||||||
set { base.SetProperty(ref lblCapaLimp, value, () => LblCapaLimp); }
|
set { base.SetProperty(ref lblCapaLimp, value, () => LblCapaLimp); }
|
||||||
}
|
}
|
||||||
|
|
||||||
private int textVeloDespl;
|
private string textVeloDespl;
|
||||||
public int TextVeloDespl
|
public string TextVeloDespl
|
||||||
{
|
{
|
||||||
get { return textVeloDespl; }
|
get { return textVeloDespl; }
|
||||||
set { base.SetProperty(ref textVeloDespl, value, () => TextVeloDespl); }
|
set { base.SetProperty(ref textVeloDespl, value, () => TextVeloDespl); }
|
||||||
|
|
@ -83,7 +95,25 @@ namespace OliviaAddInPro
|
||||||
get { return lblUdsTimeTto; }
|
get { return lblUdsTimeTto; }
|
||||||
set { base.SetProperty(ref lblUdsTimeTto, value, () => LblUdsTimeTto); }
|
set { base.SetProperty(ref lblUdsTimeTto, value, () => LblUdsTimeTto); }
|
||||||
}
|
}
|
||||||
|
private int udsTTto;
|
||||||
|
public int UdsTTto
|
||||||
|
{
|
||||||
|
get { return udsTTto; }
|
||||||
|
set { base.SetProperty(ref udsTTto, value, () => UdsTTto); }
|
||||||
|
}
|
||||||
|
private string lblTimeTto;
|
||||||
|
public string LblTimeTto
|
||||||
|
{
|
||||||
|
get { return lblTimeTto; }
|
||||||
|
set { base.SetProperty(ref lblTimeTto, value, () => LblTimeTto); }
|
||||||
|
}
|
||||||
|
private bool respSentCirc;
|
||||||
|
public bool RespSentCirc
|
||||||
|
{
|
||||||
|
get { return respSentCirc; }
|
||||||
|
set { base.SetProperty(ref respSentCirc, value, () => RespSentCirc); }
|
||||||
|
}
|
||||||
|
|
||||||
public ObservableCollection<string> TiposTto
|
public ObservableCollection<string> TiposTto
|
||||||
{
|
{
|
||||||
get { return tiposTto; }
|
get { return tiposTto; }
|
||||||
|
|
@ -131,7 +161,299 @@ namespace OliviaAddInPro
|
||||||
}
|
}
|
||||||
#endregion Properties
|
#endregion Properties
|
||||||
|
|
||||||
|
public PaneLimpiezaSub1ViewModel(Limpieza _limp)
|
||||||
|
{
|
||||||
|
limp = _limp;
|
||||||
|
lblCapaLimp = Resource1.String_selec_capa;
|
||||||
|
timeTto = 10;
|
||||||
|
textVeloDespl = "10";
|
||||||
|
lblUdsTimeTto = "min";
|
||||||
|
lblUdsVeloDespl = "km/h";
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Realiza las comprobaciones para cuando se ha abierto una capa
|
||||||
|
*/
|
||||||
|
public void AbiertaCapa(string capa)
|
||||||
|
{
|
||||||
|
limp.CapaElems = capa;
|
||||||
|
//comprueba los campos de limpieza
|
||||||
|
if (!limp.CompruebaCamposLimp())
|
||||||
|
{
|
||||||
|
string ss = limp.ErrStr;
|
||||||
|
HelperGlobal.ponMsg(ss, ArcGIS.Desktop.Internal.Framework.Controls.MessageType.Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
amb_tra_gdb = limp.BuscAmbGdb();
|
||||||
|
bool hay_alguno = false;
|
||||||
|
foreach (bool b in amb_tra_gdb)
|
||||||
|
{
|
||||||
|
if (b)
|
||||||
|
{
|
||||||
|
hay_alguno = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!hay_alguno)
|
||||||
|
{
|
||||||
|
HelperGlobal.ponMsg(Resource1.String_error_elems_tabla,
|
||||||
|
ArcGIS.Desktop.Internal.Framework.Controls.MessageType.Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//hay elementos en la gdb
|
||||||
|
OpsAmbs.Clear();
|
||||||
|
Ambitos.Clear();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Realiza los cambios en los ámbitos cuando se ha seleccionado un tratamiento
|
||||||
|
*/
|
||||||
|
public void ComboTtoSel(int tto)
|
||||||
|
{
|
||||||
|
if (tto < 0)
|
||||||
|
return;
|
||||||
|
SelTto = tto;
|
||||||
|
cambia_tiempo_tto();
|
||||||
|
ambitosSel = new bool[(int)LimpiezaDef.AmbitsTra.AmbN]; //reinicia los ambitos seleccionados
|
||||||
|
|
||||||
|
////////////////////////////////////////
|
||||||
|
//Otros cambios que dependen del tratamiento
|
||||||
|
if (SelTto != (int)LimpiezaDef.TiposTto.TtoNoDef)
|
||||||
|
{
|
||||||
|
RespSentCirc = LimpiezaDef.rest_circ[SelTto];
|
||||||
|
|
||||||
|
if (LimpiezaDef.v_desplazamiento[SelTto] > 0)
|
||||||
|
TextVeloDespl = Convert.ToString(LimpiezaDef.v_desplazamiento[SelTto]);
|
||||||
|
else
|
||||||
|
TextVeloDespl = Resource1.String_velo_nodef;
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////
|
||||||
|
//rellena el combo de opciones de los ambitos
|
||||||
|
Ambitos.Clear();
|
||||||
|
OpsAmbs.Clear();
|
||||||
|
OpsAmbs.Add("Editable");
|
||||||
|
OpsAmbs.Add("Genérico");
|
||||||
|
//en el caso del tratamiento customizable no se pondrán sus opciones particulares, sólo interesan las opciones globales a todos los tratamientos.
|
||||||
|
//las opciones particulares del tratamiento customizable, son realemnte las opciones globales a todos los ttos.
|
||||||
|
if ((SelTto != (int)LimpiezaDef.TiposTto.TtoNoDef) && (SelTto < (int)LimpiezaDef.TiposTto.TtoCustom))
|
||||||
|
{
|
||||||
|
for (int i = 0; i < (LimpiezaDef.ambs_val[SelTto].n_ops); i++)
|
||||||
|
OpsAmbs.Add("Opción " + (i + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cambio el tiempo del tratamiento en función del tipo de tratamiento seleccionado
|
||||||
|
*/
|
||||||
|
private void cambia_tiempo_tto()
|
||||||
|
{
|
||||||
|
if (SelTto == (int)LimpiezaDef.TiposTto.TtoNoDef)
|
||||||
|
{
|
||||||
|
//no está definido
|
||||||
|
LblTimeTto = Resource1.String_lbl_timetto;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (SelTto >= (int)LimpiezaDef.TiposTto.TtoPapeVaci)
|
||||||
|
{
|
||||||
|
//tipo puntual, el tiempo es en minutos
|
||||||
|
LblTimeTto = Resource1.String_lbl_timetto;
|
||||||
|
UdsTTto = (int)GeneralDef.OlvTiposTto.OlvTipTtoMin;
|
||||||
|
}
|
||||||
|
else if ((SelTto == (int)LimpiezaDef.TiposTto.TtoBarrMecCalz) ||
|
||||||
|
(SelTto == (int)LimpiezaDef.TiposTto.TtoBaldMecCalz))
|
||||||
|
{
|
||||||
|
//tipo lineal, es velocidad en m/h
|
||||||
|
LblTimeTto = Resource1.String_lbl_velotto;
|
||||||
|
UdsTTto = (int)GeneralDef.OlvTiposTto.OlvTipTtoMh;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//tipo lineal, es velocidad en m2/h
|
||||||
|
LblTimeTto = Resource1.String_lbl_velotto;
|
||||||
|
UdsTTto = (int)GeneralDef.OlvTiposTto.OlvTipTtoM2h;
|
||||||
|
}
|
||||||
|
LblUdsTimeTto = GeneralDef.UdsTto[UdsTTto];
|
||||||
|
TimeTto = (int)LimpiezaDef.tiempos_tto[(int)SelTto];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Realiza los cambios en los ámbitos cuando se ha seleccionado un tratamiento
|
||||||
|
*/
|
||||||
|
public void ComboAmbSel(int opAmb)
|
||||||
|
{
|
||||||
|
if (opAmb < 0)
|
||||||
|
return;
|
||||||
|
Ambitos.Clear();
|
||||||
|
SelOpAmb = opAmb;
|
||||||
|
ObservableCollection<AmbitsList> lista;
|
||||||
|
lista = pon_ambitos();
|
||||||
|
//checkea los ámbitos de esta opción
|
||||||
|
check_ambitos(SelOpAmb, lista);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**Checkea de la lista los ámbitos de trabajo en función del tipo de tratamiento
|
||||||
|
* y la opción elegida
|
||||||
|
*/
|
||||||
|
private void check_ambitos(int iop, ObservableCollection<AmbitsList> lista)
|
||||||
|
{
|
||||||
|
bool check = false;
|
||||||
|
if (lista == null)
|
||||||
|
return;
|
||||||
|
for (int i = 0; i < lista.Count; i++)
|
||||||
|
{
|
||||||
|
check = false;
|
||||||
|
if (iop < 0)
|
||||||
|
{
|
||||||
|
//para reseteo
|
||||||
|
check=false;
|
||||||
|
}
|
||||||
|
else if (iop == 0)
|
||||||
|
{
|
||||||
|
//dependiendo del tratamiento seleccionado en la opción 0(Editable) se seleccionarán diferentes opciones del TtoCustom(diferenciando entre ttos lineales o puntuales)
|
||||||
|
//para ámbitos lineales
|
||||||
|
if (SelTto < (int)LimpiezaDef.TiposTto.TtoPapeVaci)
|
||||||
|
{
|
||||||
|
check = LimpiezaDef.ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[iop].ambs[(int)((AmbitsList)lista[i]).amb_i]
|
||||||
|
&& amb_tra_gdb[(int)((AmbitsList)lista[i]).amb_i];
|
||||||
|
}
|
||||||
|
//para ámbitos puntuales
|
||||||
|
else if ((SelTto > (int)LimpiezaDef.TiposTto.TtoCaidaHoja) && (SelTto < (int)LimpiezaDef.TiposTto.TtoCustom))
|
||||||
|
{
|
||||||
|
//es la opción Genérica que es la opción 1 del TtoCustom, de ahi que el índice sea [iop + 1]
|
||||||
|
check = LimpiezaDef.ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[iop + 1].ambs[(int)((AmbitsList)lista[i]).amb_i]
|
||||||
|
&& amb_tra_gdb[(int)((AmbitsList)lista[i]).amb_i];
|
||||||
|
}
|
||||||
|
//para ámbito custom
|
||||||
|
else
|
||||||
|
{
|
||||||
|
check = LimpiezaDef.ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[iop].ambs[(int)((AmbitsList)lista[i]).amb_i]
|
||||||
|
&& amb_tra_gdb[(int)((AmbitsList)lista[i]).amb_i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (iop == 1)
|
||||||
|
{
|
||||||
|
//es la opción Genérica que es la opción 2 del TtoCustom, de ahi que el índice sea [iop + 1]
|
||||||
|
check = LimpiezaDef.ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[iop + 1].ambs[(int)((AmbitsList)lista[i]).amb_i]
|
||||||
|
&& amb_tra_gdb[(int)((AmbitsList)lista[i]).amb_i];
|
||||||
|
}
|
||||||
|
else if ((iop - 2) < (LimpiezaDef.ambs_val[SelTto].n_ops))
|
||||||
|
{
|
||||||
|
//pone el check si el elemento que aparece en la lista porque es común o no común
|
||||||
|
//esa opción en concreto le tiene
|
||||||
|
check = LimpiezaDef.ambs_val[SelTto].ambs_ops[iop - 2].ambs[(int)((AmbitsList)lista[i]).amb_i]
|
||||||
|
&& amb_tra_gdb[(int)((AmbitsList)lista[i]).amb_i];
|
||||||
|
}
|
||||||
|
Ambitos.ElementAt(i).IsChecked = check;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Rellena una lista con los ámbitos comunes y no comunes para mostrar en el listbox en función del tipo de tratamiento
|
||||||
|
*/
|
||||||
|
private void rellena_amb_list()
|
||||||
|
{
|
||||||
|
bool[] amb_val;
|
||||||
|
bool[] amb_val_tod;
|
||||||
|
bool[] amb_val_eje;
|
||||||
|
|
||||||
|
//lo hace para todos los tratamientos excepto para el Customizble ya que sólo se quieren mostrar las opciones alternaitvas al tratamiento
|
||||||
|
if (SelTto < (int)LimpiezaDef.TiposTto.TtoCustom)
|
||||||
|
{
|
||||||
|
//pide un array de booleanos donde es true en las posiciones de los ámbitos comunes
|
||||||
|
amb_val = limp.DameAmbTto(SelTto);
|
||||||
|
//crea un array con el número de elementos del array anterior que sean true
|
||||||
|
ambs_list = new ObservableCollection<AmbitsList>();//cuenta los trues
|
||||||
|
//rellena el array apuntando los índices y los textos correspondientes a los trues
|
||||||
|
for (int i = 0; i < amb_val.Length; i++)
|
||||||
|
{
|
||||||
|
if (amb_val[i])
|
||||||
|
{
|
||||||
|
ambs_list.Add(new AmbitsList((LimpiezaDef.AmbitsTra)i, LimpiezaDef.ambits_tra_str[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//se hace lo mismo para la opción que da la posibilidad de seleccionar cualquier ámbito lineal
|
||||||
|
amb_val_tod = LimpiezaDef.ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[0].ambs;
|
||||||
|
ambs_list_tod_lin = new ObservableCollection<AmbitsList>();
|
||||||
|
for (int i = 0; i < amb_val_tod.Length; i++)
|
||||||
|
{
|
||||||
|
if (amb_val_tod[i])
|
||||||
|
{
|
||||||
|
ambs_list_tod_lin.Add(new AmbitsList((LimpiezaDef.AmbitsTra)i, LimpiezaDef.ambits_tra_str[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//se hace lo mismo para la opción que da la posibilidad de seleccionar cualquier ámbito puntual
|
||||||
|
amb_val_tod = LimpiezaDef.ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[1].ambs;
|
||||||
|
ambs_list_tod_pto = new ObservableCollection<AmbitsList>();
|
||||||
|
for (int i = 0; i < amb_val_tod.Length; i++)
|
||||||
|
{
|
||||||
|
if (amb_val_tod[i])
|
||||||
|
{
|
||||||
|
ambs_list_tod_pto.Add(new AmbitsList((LimpiezaDef.AmbitsTra)i, LimpiezaDef.ambits_tra_str[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//se hace lo mismo para la opción que permite seleccionar únicamente los ejes de calle
|
||||||
|
amb_val_eje = LimpiezaDef.ambs_val[(int)LimpiezaDef.TiposTto.TtoCustom].ambs_ops[2].ambs;
|
||||||
|
ambs_list_eje = new ObservableCollection<AmbitsList>();
|
||||||
|
for (int i = 0; i < amb_val_eje.Length; i++)
|
||||||
|
{
|
||||||
|
if (amb_val_eje[i])
|
||||||
|
{
|
||||||
|
ambs_list_eje.Add(new AmbitsList((LimpiezaDef.AmbitsTra)i, LimpiezaDef.ambits_tra_str[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**Pone en la lista los ámbitos de trabajo en función del tipo de tratamiento
|
||||||
|
* Los comunes y no comunes a sus opciones. Luego checkea los correspondientes a la opción
|
||||||
|
*/
|
||||||
|
private ObservableCollection<AmbitsList> pon_ambitos()
|
||||||
|
{
|
||||||
|
ObservableCollection<AmbitsList> lista = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (SelTto == (int)LimpiezaDef.TiposTto.TtoNoDef)
|
||||||
|
{
|
||||||
|
return lista;
|
||||||
|
}
|
||||||
|
|
||||||
|
rellena_amb_list();
|
||||||
|
if ((SelOpAmb == 0) && ((SelTto < (int)LimpiezaDef.TiposTto.TtoPapeVaci) ||
|
||||||
|
(SelTto >= (int)LimpiezaDef.TiposTto.TtoCustom)))
|
||||||
|
{
|
||||||
|
lista = ambs_list_tod_lin;
|
||||||
|
}
|
||||||
|
else if ((SelOpAmb == 0) && (SelTto > (int)LimpiezaDef.TiposTto.TtoCaidaHoja))
|
||||||
|
{
|
||||||
|
lista = ambs_list_tod_pto;
|
||||||
|
}
|
||||||
|
else if (SelOpAmb == 1)
|
||||||
|
{
|
||||||
|
lista = ambs_list_eje;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lista = ambs_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
AmbitsList al;
|
||||||
|
for (int i = 0; i < lista.Count; i++)
|
||||||
|
{
|
||||||
|
al = lista.ElementAt(i);
|
||||||
|
Ambitos.Add(new CheckedListItem<string>(al.amb_str));
|
||||||
|
}
|
||||||
|
return lista;
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
//MessageBox.Show("Error al poner los ámbitos", "Olivia", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using OliviaAddInPro.Model;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
|
@ -16,7 +17,7 @@ namespace OliviaAddInPro
|
||||||
private PaneLimpiezaSub4ViewModel _subPanel4ViewModel;
|
private PaneLimpiezaSub4ViewModel _subPanel4ViewModel;
|
||||||
public PaneLimpiezaViewModel()
|
public PaneLimpiezaViewModel()
|
||||||
{
|
{
|
||||||
_subPanel1ViewModel = new PaneLimpiezaSub1ViewModel();
|
_subPanel1ViewModel = new PaneLimpiezaSub1ViewModel(OliviaGlob.Limp);
|
||||||
_subPanel2ViewModel = new PaneLimpiezaSub2ViewModel();
|
_subPanel2ViewModel = new PaneLimpiezaSub2ViewModel();
|
||||||
_subPanel3ViewModel = new PaneLimpiezaSub3ViewModel();
|
_subPanel3ViewModel = new PaneLimpiezaSub3ViewModel();
|
||||||
_subPanel4ViewModel = new PaneLimpiezaSub4ViewModel();
|
_subPanel4ViewModel = new PaneLimpiezaSub4ViewModel();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue