Ciclo limpieza lo hace completo, sectoriza y planifica. Falta probar instalación. Recogida a medias de probar.
parent
663e6f058f
commit
f29b52f995
|
|
@ -38,7 +38,7 @@
|
||||||
<tooltip heading="OLIVIA - Recogida de Residuos">
|
<tooltip heading="OLIVIA - Recogida de Residuos">
|
||||||
Add-In de ArcGIS Pro para la herramienta de optimización de la limpieza viaria, OLIVIA<disabledText /></tooltip>
|
Add-In de ArcGIS Pro para la herramienta de optimización de la limpieza viaria, OLIVIA<disabledText /></tooltip>
|
||||||
</button>
|
</button>
|
||||||
<button id="OliviaAddInPro_ButtonConfig" caption="Configuración" className="ButtonConfig" loadOnClick="true" largeImage="Images/config2.png">
|
<button id="OliviaAddInPro_ButtonConfig" caption="Configuración" className="ButtonConfig" loadOnClick="true" largeImage="Images/config2_olv.png">
|
||||||
<tooltip heading="OLIVIA - Configuración">
|
<tooltip heading="OLIVIA - Configuración">
|
||||||
Add-In de ArcGIS Pro para la herramienta de optimización de la limpieza viaria, OLIVIA<disabledText /></tooltip>
|
Add-In de ArcGIS Pro para la herramienta de optimización de la limpieza viaria, OLIVIA<disabledText /></tooltip>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -739,9 +739,10 @@ namespace OliviaAddInPro.Helper
|
||||||
if (!fields.Contains(field))
|
if (!fields.Contains(field))
|
||||||
{
|
{
|
||||||
HelperGdb.OutStr = "No se encuentra el campo " + field;
|
HelperGdb.OutStr = "No se encuentra el campo " + field;
|
||||||
|
Free(fc);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Free(fc);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
@ -757,13 +758,14 @@ namespace OliviaAddInPro.Helper
|
||||||
}
|
}
|
||||||
|
|
||||||
ObservableCollection<string> fields = GetFieldsSync(fc);
|
ObservableCollection<string> fields = GetFieldsSync(fc);
|
||||||
|
bool encuentra = true;
|
||||||
if (!fields.Contains(field))
|
if (!fields.Contains(field))
|
||||||
{
|
{
|
||||||
HelperGdb.OutStr = "No se encuentra el campo " + field;
|
HelperGdb.OutStr = "No se encuentra el campo " + field;
|
||||||
return false;
|
encuentra= false;
|
||||||
}
|
}
|
||||||
|
Free(fc);
|
||||||
return true;
|
return encuentra;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Lee la capa que se ha seleccionzdo de recogida y se comprueba que contiene los campos necesarios
|
* Lee la capa que se ha seleccionzdo de recogida y se comprueba que contiene los campos necesarios
|
||||||
|
|
@ -1942,6 +1944,8 @@ namespace OliviaAddInPro.Helper
|
||||||
if (brwsFilt != null)
|
if (brwsFilt != null)
|
||||||
dlg.BrowseFilter = brwsFilt;
|
dlg.BrowseFilter = brwsFilt;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
bool? ok = dlg.ShowDialog();
|
bool? ok = dlg.ShowDialog();
|
||||||
|
|
||||||
if ((ok ?? true) && dlg.FilePath.Length > 0)
|
if ((ok ?? true) && dlg.FilePath.Length > 0)
|
||||||
|
|
@ -1949,6 +1953,19 @@ namespace OliviaAddInPro.Helper
|
||||||
else
|
else
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Saca diálogo para elegir directorio
|
||||||
|
*/
|
||||||
|
public static string FolderBrowseDlg(string title_, string initloc_)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Comprueva si una GDB contiene un Dataset
|
* Comprueva si una GDB contiene un Dataset
|
||||||
|
|
@ -2442,8 +2459,13 @@ namespace OliviaAddInPro.Helper
|
||||||
|
|
||||||
// set up the arguments
|
// set up the arguments
|
||||||
string fields_str = "";
|
string fields_str = "";
|
||||||
|
int camps = 0;
|
||||||
for(int i=0;i<fields.Length;i++)
|
for(int i=0;i<fields.Length;i++)
|
||||||
{
|
{
|
||||||
|
if (CheckFieldSync(fcname, fields[i].Name))
|
||||||
|
continue;
|
||||||
|
camps++;
|
||||||
|
|
||||||
fields_str += fields[i].Name + " " + fields[i].Tipo + " ";
|
fields_str += fields[i].Name + " " + fields[i].Tipo + " ";
|
||||||
if (!string.IsNullOrEmpty(fields[i].Alias))
|
if (!string.IsNullOrEmpty(fields[i].Alias))
|
||||||
fields_str += fields[i].Alias;
|
fields_str += fields[i].Alias;
|
||||||
|
|
@ -2460,6 +2482,9 @@ namespace OliviaAddInPro.Helper
|
||||||
if (i < fields.Length - 1)
|
if (i < fields.Length - 1)
|
||||||
fields_str += ";";
|
fields_str += ";";
|
||||||
}
|
}
|
||||||
|
if (camps == 0)
|
||||||
|
return true;//no tiene que añadir ningún campo porque los tiene
|
||||||
|
|
||||||
//var f1 = "field1 long field1 # #;field2 Text # 255 myDefaultValue"; //los # son opciones sin rellenar el orden es: Nombre Tipo Alias Longitud Valor Defecto
|
//var f1 = "field1 long field1 # #;field2 Text # 255 myDefaultValue"; //los # son opciones sin rellenar el orden es: Nombre Tipo Alias Longitud Valor Defecto
|
||||||
|
|
||||||
var args = Geoprocessing.MakeValueArray(fcname, fields_str);
|
var args = Geoprocessing.MakeValueArray(fcname, fields_str);
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
|
|
@ -66,9 +66,12 @@ namespace OliviaAddInPro.Model
|
||||||
/////
|
/////
|
||||||
///DEBUG
|
///DEBUG
|
||||||
///
|
///
|
||||||
/*Respuesta<TiposEjecucion> res1 = new Respuesta<TiposEjecucion> { Value = TiposEjecucion.FinEjecOk };
|
//Respuesta<TiposEjecucion> res1 = new Respuesta<TiposEjecucion> { Value = TiposEjecucion.FinEjecOk };
|
||||||
HelperGdb.OpenLayer(@"C:\Users\Elena\Documents\ArcGIS\Projects\MyProject3\MyProject3.gdb\Barrido_man\BarMan_AceM_AceNM_20220529_134336", "SECTOR", true);
|
//HelperGdb.OpenLayer(@"C:\Users\Elena\Documents\ArcGIS\Projects\MyProject3\MyProject3.gdb\Barrido_man\BarMan_AceM_AceNM_20220529_134336", "SECTOR", true);
|
||||||
return res1;*/
|
//Serv.ActualizaSecto(@"D:\Proyectos\Olivia\Instal2.0\data\data_T00_A0405_20220628_214902.shp", @"C:\\Users\\Elena\\Documents\\ArcGIS\\Projects\\MyProject3\\MyProject3.gdb\\Barrido_man\\BarMan_AceM_AceNM_20220628_214613");
|
||||||
|
//return res1;
|
||||||
|
|
||||||
|
//////////////////
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
|
|
||||||
Respuesta<bool> res = new Respuesta<bool> { Value=false};
|
Respuesta<bool> res = new Respuesta<bool> { Value=false};
|
||||||
|
|
|
||||||
|
|
@ -171,5 +171,26 @@ namespace OliviaAddInPro.Model
|
||||||
RecogidaDef.campos_def.cons_kgrec };
|
RecogidaDef.campos_def.cons_kgrec };
|
||||||
return camps;
|
return camps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rellena el array de filtros en base a la config
|
||||||
|
*/
|
||||||
|
public void RellenaFiltrosReco()
|
||||||
|
{
|
||||||
|
//se rellena el array de filtros
|
||||||
|
RecogidaDef.filtro_str = new string[RecogidaDef.tipos_fracc_str.Length + RecogidaDef.tipos_carg_str.Length];
|
||||||
|
for (int i = 0; i < RecogidaDef.tipos_fracc_str.Length; i++)
|
||||||
|
{
|
||||||
|
//se comprueba que tipo de fracción se ha seleccionado. Si se ha seleccionado una fracción sin nombre (el campo en la capa es NULL, y en el comboBox de fracciiones aparece como "-") hay que modificar el filtro
|
||||||
|
if (RecogidaDef.tipos_fracc_str[i] == "-")
|
||||||
|
RecogidaDef.filtro_str[i] = RecogidaDef.campos_def.cons_fracc + " IS NULL";
|
||||||
|
else
|
||||||
|
RecogidaDef.filtro_str[i] = RecogidaDef.campos_def.cons_fracc + "= '" + RecogidaDef.tipos_fracc_str[i] + "'";
|
||||||
|
}
|
||||||
|
for (int i = RecogidaDef.tipos_fracc_str.Length; i < RecogidaDef.filtro_str.Length; i++)
|
||||||
|
{
|
||||||
|
RecogidaDef.filtro_str[i] = RecogidaDef.campos_def.cons_nomrec + "= '" + RecogidaDef.tipos_carg_str[i - RecogidaDef.tipos_fracc_str.Length] + "'";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>0</WarningLevel>
|
||||||
<StartAction>Program</StartAction>
|
<StartAction>Program</StartAction>
|
||||||
<StartProgram>$(ArcGISFolder)\bin\ArcGISPro.exe</StartProgram>
|
<StartProgram>$(ArcGISFolder)\bin\ArcGISPro.exe</StartProgram>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
|
@ -357,6 +357,9 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AddInContent Include="Images\carrito2.png" />
|
<AddInContent Include="Images\carrito2.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<AddInContent Include="Images\config2_olv.png" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!--
|
<!--
|
||||||
PackageAction can be:
|
PackageAction can be:
|
||||||
|
|
|
||||||
|
|
@ -298,53 +298,103 @@ namespace OliviaAddInPro.Services
|
||||||
if (!HelperGdb.AddFieldsSync(path_shp, fields))
|
if (!HelperGdb.AddFieldsSync(path_shp, fields))
|
||||||
return false;
|
return false;
|
||||||
//vuelve a cerrar la capa
|
//vuelve a cerrar la capa
|
||||||
string capa_principal = System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathData);
|
string capa_principal = System.IO.Path.GetFileNameWithoutExtension(path_shp);
|
||||||
HelperGdb.CloseLayer(capa_principal);
|
HelperGdb.CloseLayer(capa_principal);
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
RowCursor rc_shp = null;
|
|
||||||
RowCursor rc_secto = null;
|
//ahora rellena las columnas
|
||||||
Row rowshp = null;
|
using (FeatureClass fc_secto = HelperGdb.GetFtClassSync(path_secto))
|
||||||
Row rowsecto = null;
|
{
|
||||||
FeatureClass fc_secto = null;
|
using (FeatureClass fc_shp = HelperGdb.GetFtClassSync(path_shp))
|
||||||
FeatureClass fc_shp = null;
|
{
|
||||||
bool bien = false;
|
if (fc_secto == null || fc_shp == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//ahora rellena las columnas
|
using (RowCursor rc_shp = fc_shp.Search())
|
||||||
fc_secto = HelperGdb.GetFtClassSync(path_secto);
|
{
|
||||||
fc_shp = HelperGdb.GetFtClassSync(path_shp);
|
using (RowCursor rc_secto = fc_secto.Search())
|
||||||
if (fc_secto == null || fc_shp == null)
|
{
|
||||||
|
if (rc_shp == null || rc_secto == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var modifyOp = new ArcGIS.Desktop.Editing.EditOperation();
|
var modifyOp = new ArcGIS.Desktop.Editing.EditOperation();
|
||||||
modifyOp.Name = "Actualiza SECTOR y SECUENCIA";
|
modifyOp.Name = "Actualiza SECTOR y SECUENCIA";
|
||||||
|
bool ex = false;
|
||||||
//modifyOp.Callback((context) =>
|
//modifyOp.Callback((context) =>
|
||||||
//{
|
//{
|
||||||
rc_shp = fc_shp.Search();
|
|
||||||
rc_secto = fc_secto.Search();
|
|
||||||
|
|
||||||
if (rc_shp == null || rc_secto == null)
|
|
||||||
{
|
|
||||||
HelperGdb.Free(rc_shp);
|
|
||||||
HelperGdb.Free(rc_secto);
|
|
||||||
HelperGdb.Free(fc_secto);
|
|
||||||
HelperGdb.Free(fc_shp);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (rc_shp.MoveNext() && rc_secto.MoveNext())
|
while (rc_shp.MoveNext() && rc_secto.MoveNext())
|
||||||
{
|
{
|
||||||
rowsecto = rc_secto.Current;
|
using (Row rowsecto = rc_secto.Current)
|
||||||
rowshp = rc_shp.Current;
|
{
|
||||||
|
using (Row rowshp = rc_shp.Current)
|
||||||
|
{
|
||||||
|
//context.Invalidate(rowshp);
|
||||||
// modify and execute
|
// modify and execute
|
||||||
modifyOp.Modify(rowshp, LimpiezaDef.Campos.consulta_sector, rowsecto[LimpiezaDef.Campos.consulta_sector]);
|
modifyOp.Modify(rowshp, LimpiezaDef.Campos.consulta_sector, rowsecto[LimpiezaDef.Campos.consulta_sector]);
|
||||||
modifyOp.Modify(rowshp, LimpiezaDef.Campos.consulta_secuen, rowsecto[LimpiezaDef.Campos.consulta_secuen]);
|
modifyOp.Modify(rowshp, LimpiezaDef.Campos.consulta_secuen, rowsecto[LimpiezaDef.Campos.consulta_secuen]);
|
||||||
|
rowshp.Store();
|
||||||
|
//context.Invalidate(rowshp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//}, fc_shp);
|
||||||
|
ex = modifyOp.Execute();
|
||||||
|
ArcGIS.Desktop.Core.Project.Current.SaveEditsAsync();
|
||||||
|
if (ex && modifyOp.IsDone)
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
var modifyOp = new ArcGIS.Desktop.Editing.EditOperation();
|
||||||
|
modifyOp.Name = "Actualiza SECTOR y SECUENCIA";
|
||||||
|
bool ex=false;
|
||||||
|
modifyOp.Callback((context) =>
|
||||||
|
{
|
||||||
|
using (RowCursor rc_shp = fc_shp.Search())
|
||||||
|
{
|
||||||
|
using (RowCursor rc_secto = fc_secto.Search())
|
||||||
|
{
|
||||||
|
|
||||||
|
if (rc_shp != null && rc_secto != null)
|
||||||
|
{
|
||||||
|
while (rc_shp.MoveNext() && rc_secto.MoveNext())
|
||||||
|
{
|
||||||
|
using (Row rowsecto = rc_secto.Current)
|
||||||
|
{
|
||||||
|
using (Row rowshp = rc_shp.Current)
|
||||||
|
{
|
||||||
|
context.Invalidate(rowshp);
|
||||||
|
// modify and execute
|
||||||
|
modifyOp.Modify(rowshp, LimpiezaDef.Campos.consulta_sector, rowsecto[LimpiezaDef.Campos.consulta_sector]);
|
||||||
|
modifyOp.Modify(rowshp, LimpiezaDef.Campos.consulta_secuen, rowsecto[LimpiezaDef.Campos.consulta_secuen]);
|
||||||
|
rowshp.Store();
|
||||||
|
context.Invalidate(rowshp);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
bien = true;
|
bien = true;
|
||||||
//}, fc_shp.GetFeatureDataset());
|
rc_secto.Dispose();
|
||||||
|
rc_shp.Dispose();
|
||||||
modifyOp.Execute();
|
}
|
||||||
if (bien)
|
}
|
||||||
|
}
|
||||||
|
}, fc_shp);
|
||||||
|
ex = modifyOp.Execute();
|
||||||
|
if (bien && ex && modifyOp.IsDone)
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -355,15 +405,13 @@ namespace OliviaAddInPro.Services
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
HelperGdb.Free(rowsecto);
|
fc_secto.Dispose();
|
||||||
HelperGdb.Free(rowshp);
|
fc_shp.Dispose();
|
||||||
HelperGdb.Free(rc_shp);
|
|
||||||
HelperGdb.Free(rc_secto);
|
|
||||||
HelperGdb.Free(fc_secto);
|
HelperGdb.Free(fc_secto);
|
||||||
HelperGdb.Free(fc_shp);
|
HelperGdb.Free(fc_shp);
|
||||||
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -120,19 +120,15 @@ namespace OliviaAddInPro.Services
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//actualiza la capa de la que tiene que leer ahora para planificar
|
||||||
|
inst.CapaPlanif = resp2.Value;
|
||||||
if (OliviaGlob.HasFlagTipEjec(TiposEjecucion.EjecPlanif)) //Ha terminado bien la planificación
|
if (OliviaGlob.HasFlagTipEjec(TiposEjecucion.EjecPlanif)) //Ha terminado bien la planificación
|
||||||
{
|
{
|
||||||
//guarda csv
|
//guarda csv
|
||||||
GuardaCsv(inst);
|
GuardaCsv(inst);
|
||||||
}
|
}
|
||||||
msg = Resource1.String_exito;
|
msg = Resource1.String_exito;
|
||||||
//actualiza los flags
|
|
||||||
OliviaGlob.RemoveFlagTipEjec(TiposEjecucion.EjecPlanif);
|
|
||||||
OliviaGlob.RemoveFlagTipEjec(TiposEjecucion.EjecSecto);
|
|
||||||
//pone modo config2
|
|
||||||
OliviaGlob.AddFlagTipEjec(TiposEjecucion.Config2);
|
|
||||||
//actualiza la capa de la que tiene que leer ahora para planificar
|
|
||||||
inst.CapaPlanif = resp2.Value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
@ -141,7 +137,7 @@ namespace OliviaAddInPro.Services
|
||||||
mal = true;
|
mal = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mal)
|
/*if (mal)
|
||||||
{
|
{
|
||||||
//reinicia flags
|
//reinicia flags
|
||||||
if (OliviaGlob.IsLimp())
|
if (OliviaGlob.IsLimp())
|
||||||
|
|
@ -149,7 +145,13 @@ namespace OliviaAddInPro.Services
|
||||||
else if (OliviaGlob.IsReco())
|
else if (OliviaGlob.IsReco())
|
||||||
OliviaGlob.SetFlagTipEjec(TiposEjecucion.Reco);
|
OliviaGlob.SetFlagTipEjec(TiposEjecucion.Reco);
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
//actualiza los flags
|
||||||
|
OliviaGlob.RemoveFlagTipEjec(TiposEjecucion.EjecPlanif);
|
||||||
|
OliviaGlob.RemoveFlagTipEjec(TiposEjecucion.EjecSecto);
|
||||||
|
//pone modo config2
|
||||||
|
OliviaGlob.AddFlagTipEjec(TiposEjecucion.Config2);
|
||||||
|
///////////////////////////////////////////////////
|
||||||
HelperGlobal.ponMsg(msg);
|
HelperGlobal.ponMsg(msg);
|
||||||
OliviaGlob.progrDialog.Hide();
|
OliviaGlob.progrDialog.Hide();
|
||||||
//muestra la ventana
|
//muestra la ventana
|
||||||
|
|
@ -214,16 +216,15 @@ namespace OliviaAddInPro.Services
|
||||||
nameDokL = Directory.GetFiles(DirData,
|
nameDokL = Directory.GetFiles(DirData,
|
||||||
System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathData) + inst.ServCom.NAME_CSV + ".*");
|
System.IO.Path.GetFileNameWithoutExtension(OliviaGlob.Paths.PathData) + inst.ServCom.NAME_CSV + ".*");
|
||||||
|
|
||||||
string Title = "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);
|
||||||
string InitialDirectory = System.IO.Path.Combine(DirData, nombre);
|
|
||||||
|
|
||||||
|
//string Path = HelperGdb.SaveFileDlg(Title, DirData, inst.ServCom.EXT_CSV, Filter);
|
||||||
|
string Path = HelperGdb.SaveFileDlg(Title, DirData, null, ArcGIS.Desktop.Catalog.ItemFilters.folders);
|
||||||
|
|
||||||
string FileName = HelperGdb.SaveFileDlg(Title, InitialDirectory, inst.ServCom.EXT_CSV, Filter);
|
if (string.IsNullOrEmpty(Path) || Path.Length == 0)
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(FileName) || FileName.Length == 0)
|
|
||||||
{
|
{
|
||||||
bool ok = HelperGlobal.ponMsg("Se va a perder el archivo que contiene la secuencia en planificación, ¿está seguro?",
|
bool ok = HelperGlobal.ponMsg("Se va a perder el archivo que contiene la secuencia en planificación, ¿está seguro?",
|
||||||
MessageBoxImage.Question,"OLIVIA",MessageBoxButton.YesNo);
|
MessageBoxImage.Question,"OLIVIA",MessageBoxButton.YesNo);
|
||||||
|
|
@ -232,6 +233,8 @@ namespace OliviaAddInPro.Services
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
var FileName = System.IO.Path.Combine(Path, nombre);
|
||||||
|
FileName += inst.ServCom.EXT_CSV;
|
||||||
if (File.Exists(FileName))
|
if (File.Exists(FileName))
|
||||||
File.Delete(FileName);
|
File.Delete(FileName);
|
||||||
File.Move(nameDokL[0], FileName);
|
File.Move(nameDokL[0], FileName);
|
||||||
|
|
@ -253,7 +256,7 @@ namespace OliviaAddInPro.Services
|
||||||
//repite por si se ha equivocado hasta que elige la gdb
|
//repite por si se ha equivocado hasta que elige la gdb
|
||||||
GdbFileName = HelperGdb.OpenFileDialog(HelperGdb.TiposOpenFileDlg.OpenGdb,"", "Seleccionar GDB a la que importar los resultados");
|
GdbFileName = HelperGdb.OpenFileDialog(HelperGdb.TiposOpenFileDlg.OpenGdb,"", "Seleccionar GDB a la que importar los resultados");
|
||||||
if(string.IsNullOrEmpty(GdbFileName))
|
if(string.IsNullOrEmpty(GdbFileName))
|
||||||
sal= HelperGlobal.ponMsg("¿Desea cancelar el proceso de imporación?",
|
sal= HelperGlobal.ponMsg("¿Desea cancelar el proceso de importación?",
|
||||||
MessageBoxImage.Question, "OLIVIA", MessageBoxButton.YesNo);
|
MessageBoxImage.Question, "OLIVIA", MessageBoxButton.YesNo);
|
||||||
} while (!sal);
|
} while (!sal);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ namespace OliviaAddInPro.Services
|
||||||
public RecogidaServ(Recogida _reco)
|
public RecogidaServ(Recogida _reco)
|
||||||
{
|
{
|
||||||
reco = _reco;
|
reco = _reco;
|
||||||
RellenaFiltrosReco();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -95,7 +94,7 @@ namespace OliviaAddInPro.Services
|
||||||
|
|
||||||
//cierra las capas que se han abierto durante la exportación
|
//cierra las capas que se han abierto durante la exportación
|
||||||
CierraCapas();
|
CierraCapas();
|
||||||
|
res.Value = true;
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -147,25 +146,5 @@ namespace OliviaAddInPro.Services
|
||||||
return consulta;
|
return consulta;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Rellena el array de filtros en base a la config
|
|
||||||
*/
|
|
||||||
public void RellenaFiltrosReco()
|
|
||||||
{
|
|
||||||
//se rellena el array de filtros
|
|
||||||
RecogidaDef.filtro_str = new string[RecogidaDef.tipos_fracc_str.Length + RecogidaDef.tipos_carg_str.Length];
|
|
||||||
for (int i = 0; i < RecogidaDef.tipos_fracc_str.Length; i++)
|
|
||||||
{
|
|
||||||
//se comprueba que tipo de fracción se ha seleccionado. Si se ha seleccionado una fracción sin nombre (el campo en la capa es NULL, y en el comboBox de fracciiones aparece como "-") hay que modificar el filtro
|
|
||||||
if (RecogidaDef.tipos_fracc_str[i] == "-")
|
|
||||||
RecogidaDef.filtro_str[i] = RecogidaDef.campos_def.cons_fracc + " IS NULL";
|
|
||||||
else
|
|
||||||
RecogidaDef.filtro_str[i] = RecogidaDef.campos_def.cons_fracc + "= '" + RecogidaDef.tipos_fracc_str[i] + "'";
|
|
||||||
}
|
|
||||||
for (int i = RecogidaDef.tipos_fracc_str.Length; i < RecogidaDef.filtro_str.Length; i++)
|
|
||||||
{
|
|
||||||
RecogidaDef.filtro_str[i] = RecogidaDef.campos_def.cons_nomrec + "= '" + RecogidaDef.tipos_carg_str[i - RecogidaDef.tipos_fracc_str.Length] + "'";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ namespace OliviaAddInPro
|
||||||
}
|
}
|
||||||
else if (DataContext is PaneRecogidaViewModel modrec)
|
else if (DataContext is PaneRecogidaViewModel modrec)
|
||||||
{
|
{
|
||||||
modrec.Ejecuta(OliviaAddInPro.Services.ModosEjec.Planifica);
|
modrec.Ejecuta(OliviaAddInPro.Services.ModosEjec.SoloPlanifica);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,9 @@ namespace OliviaAddInPro
|
||||||
err_str = "";
|
err_str = "";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
//Rellena el array de filtros
|
||||||
|
reco.RellenaFiltrosReco();
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
///Lee el panel 1
|
///Lee el panel 1
|
||||||
if (!_subPanel1ViewModel.CapaAbierta || string.IsNullOrEmpty(_subPanel1ViewModel.CapaElems))
|
if (!_subPanel1ViewModel.CapaAbierta || string.IsNullOrEmpty(_subPanel1ViewModel.CapaElems))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue