Versión inicial en v2017 entrega Valoriza version 2.0.0.3
commit
89d5b97c8e
Binary file not shown.
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.329
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Olivia", "Olivia\Olivia.vcxproj", "{192BCB82-D8B4-4FB0-807A-7CC9B6EA623B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OliviaTasks", "OliviaTasks\OliviaTasks.vcxproj", "{A8C66186-EDEF-4041-B7DD-B4FAFCC528EA}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{192BCB82-D8B4-4FB0-807A-7CC9B6EA623B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{192BCB82-D8B4-4FB0-807A-7CC9B6EA623B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{192BCB82-D8B4-4FB0-807A-7CC9B6EA623B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{192BCB82-D8B4-4FB0-807A-7CC9B6EA623B}.Debug|x64.Build.0 = Debug|x64
|
||||
{192BCB82-D8B4-4FB0-807A-7CC9B6EA623B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{192BCB82-D8B4-4FB0-807A-7CC9B6EA623B}.Release|Win32.Build.0 = Release|Win32
|
||||
{192BCB82-D8B4-4FB0-807A-7CC9B6EA623B}.Release|x64.ActiveCfg = Release|x64
|
||||
{192BCB82-D8B4-4FB0-807A-7CC9B6EA623B}.Release|x64.Build.0 = Release|x64
|
||||
{A8C66186-EDEF-4041-B7DD-B4FAFCC528EA}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{A8C66186-EDEF-4041-B7DD-B4FAFCC528EA}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{A8C66186-EDEF-4041-B7DD-B4FAFCC528EA}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A8C66186-EDEF-4041-B7DD-B4FAFCC528EA}.Debug|x64.Build.0 = Debug|x64
|
||||
{A8C66186-EDEF-4041-B7DD-B4FAFCC528EA}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{A8C66186-EDEF-4041-B7DD-B4FAFCC528EA}.Release|Win32.Build.0 = Release|Win32
|
||||
{A8C66186-EDEF-4041-B7DD-B4FAFCC528EA}.Release|x64.ActiveCfg = Release|x64
|
||||
{A8C66186-EDEF-4041-B7DD-B4FAFCC528EA}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {4CAC4A77-AD66-4285-A26F-4551AB036F5C}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
#include "StdAfx.h"
|
||||
#include "Msmain.h"
|
||||
#include "_log.h"
|
||||
#include "olv.h"
|
||||
//*******************************************************************************************
|
||||
Msmain::Msmain(void)
|
||||
{
|
||||
pirate =false;
|
||||
}
|
||||
//*******************************************************************************************
|
||||
Msmain::~Msmain(void)
|
||||
{
|
||||
}
|
||||
//*******************************************************************************************
|
||||
bool Msmain::Despacha_log()
|
||||
{
|
||||
StrArray msgs;
|
||||
if(log.dame(msgs))
|
||||
{
|
||||
#if _DEBUG
|
||||
//logea mensages();
|
||||
for(int i = 0; i<msgs.n_i; i++)
|
||||
//cout << "You entered " << iVar << endl;
|
||||
{
|
||||
TRACE(msgs.get(i));
|
||||
|
||||
char*st1, *st2=0;
|
||||
st1 = msgs.get(i);
|
||||
int n = (int)strlen(st1);
|
||||
std::string ms;
|
||||
for (int i =0; i<n; i++)
|
||||
{
|
||||
if(!st2 && st1[i])
|
||||
st2 = &st1[i];
|
||||
if(st1[i]== '\n')
|
||||
{
|
||||
st1[i] =0;
|
||||
if(st2 && strlen(st2)>0)
|
||||
{
|
||||
ms = "echo " + std::string(st2);
|
||||
system(ms.c_str());
|
||||
}
|
||||
st2 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(st2)
|
||||
{
|
||||
ms = "echo " + std::string(st2);
|
||||
system(ms.c_str());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
//*******************************************************************************************
|
||||
void Msmain::Despacha()
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
while (!pirate)
|
||||
{
|
||||
while ( PeekMessage (&msg,NULL,NULL,NULL,
|
||||
PM_NOREMOVE) )
|
||||
{
|
||||
PeekMessage (&msg,NULL,NULL,NULL,
|
||||
PM_REMOVE);
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
if(!Despacha_log())
|
||||
Sleep(100);
|
||||
if(olv->isDebug && (olv->tarea == OLV_TAREA_FIN_SEC || olv->tarea == OLV_TAREA_FIN_PLANIF))
|
||||
{
|
||||
//C_log::log("Msmain", olv->msg_proce);
|
||||
olv->cancela();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//*******************************************************************************************
|
||||
void Msmain::log_ext( __time64_t tiemp, char *modulo, char *fmt )
|
||||
{
|
||||
char tiem[32];
|
||||
char str[1024];
|
||||
strftime(tiem, 20, "%Y-%m-%d %H:%M:%S", localtime(&tiemp));
|
||||
sprintf_s(str,1024, "%s %-12s %s\r\n",
|
||||
(char *) LPCTSTR (tiem),
|
||||
(char *) LPCTSTR (modulo),
|
||||
(char *) LPCTSTR (fmt));
|
||||
log.pon(str);
|
||||
}
|
||||
//*******************************************************************************************
|
||||
bool Cstr_Msg::dame( StrArray& stout )
|
||||
{
|
||||
if(n_i<=0)
|
||||
return false;
|
||||
|
||||
if(stout.ind)
|
||||
free(stout.ind);
|
||||
if(stout.str)
|
||||
free(stout.str);
|
||||
lock_cola.entro();
|
||||
|
||||
stout.ind=ind;
|
||||
stout.str=str;
|
||||
stout.m_str=m_str;
|
||||
stout.m_i=m_i;
|
||||
stout.n_str=n_str;
|
||||
stout.n_i=n_i;
|
||||
|
||||
m_str=m_i=n_i=n_str=0;
|
||||
str=NULL;
|
||||
ind=NULL;
|
||||
lock_cola.salgo();
|
||||
return true;
|
||||
}
|
||||
//************************************************************************************
|
||||
void Cstr_Msg::pon( char* str)
|
||||
{
|
||||
lock_cola.entro();
|
||||
add(str);
|
||||
lock_cola.salgo();
|
||||
}
|
||||
//************************************************************************************
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
#pragma once
|
||||
#include "olv_dll.h"
|
||||
#include "gcola.h"
|
||||
#include "lock.h"
|
||||
#include "StrArray.h"
|
||||
|
||||
typedef struct Msdata{
|
||||
UINT id;
|
||||
WPARAM wParam;
|
||||
LPARAM lParam;
|
||||
bool *proces;
|
||||
}Msdata;
|
||||
|
||||
//! Clase extendida para manejo de la cola de mensajes del log
|
||||
/**
|
||||
* Clase extendida para manejo de la cola de mensajes del log
|
||||
*/
|
||||
class Cstr_Msg: public StrArray
|
||||
{
|
||||
Clock lock_cola;//lock de la cola
|
||||
public:
|
||||
bool dame(StrArray& stout);
|
||||
void pon(char* str);
|
||||
};
|
||||
class COlivia;
|
||||
|
||||
//! Clase manager de mensajes enviados para el main
|
||||
/**
|
||||
* Clase manager de mensajes enviados para el main
|
||||
*/
|
||||
class OLV_EXPORT Msmain
|
||||
{
|
||||
Cstr_Msg log;
|
||||
public:
|
||||
COlivia *olv;
|
||||
|
||||
bool pirate;
|
||||
Msmain(void);
|
||||
~Msmain(void);
|
||||
void log_ext( __time64_t tiemp, char *modulo, char *fmt );
|
||||
void Despacha();
|
||||
bool Despacha_log();
|
||||
|
||||
private:
|
||||
};
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
// Olivia.cpp : Defines the initialization routines for the DLL.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Olivia.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file Olivia.cpp
|
||||
* DLL creada por IGT para VSM con el fin de independizar el código
|
||||
* fuente del software Olivia
|
||||
* en fecha abril de 2018
|
||||
*/
|
||||
|
||||
// COliviaApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(COliviaApp, CWinApp)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// COliviaApp construction
|
||||
|
||||
COliviaApp::COliviaApp()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
// The one and only COliviaApp object
|
||||
|
||||
COliviaApp theApp;
|
||||
|
||||
|
||||
// COliviaApp initialization
|
||||
|
||||
BOOL COliviaApp::InitInstance()
|
||||
{
|
||||
CWinApp::InitInstance();
|
||||
|
||||
if (!AfxSocketInit())
|
||||
{
|
||||
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
; Olivia.def : Declares the module parameters for the DLL.
|
||||
|
||||
LIBRARY "Olivia"
|
||||
|
||||
EXPORTS
|
||||
; Explicit exports can go here
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
// Olivia.h : main header file for the Olivia DLL
|
||||
//
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error "include 'stdafx.h' before including this file for PCH"
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
/**
|
||||
* @file Olivia.h
|
||||
* DLL de Olivia
|
||||
*/
|
||||
|
||||
class COliviaApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
COliviaApp();
|
||||
|
||||
// Overrides
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
|
@ -0,0 +1,140 @@
|
|||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
#include "targetver.h"
|
||||
#endif
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 2,0,0,3
|
||||
PRODUCTVERSION 2,0,0,3
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040a04e4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "VSM"
|
||||
VALUE "FileDescription", "Librería de la aplicación Olivia"
|
||||
VALUE "FileVersion", "2.0.0.3"
|
||||
VALUE "InternalName", "Olivia.dll"
|
||||
VALUE "LegalCopyright", "OLIVIA (c) VSM 2020. All rights reserved."
|
||||
VALUE "OriginalFilename", "Olivia.dll"
|
||||
VALUE "ProductName", "OLIVIA"
|
||||
VALUE "ProductVersion", "2.0.0.3"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x40a, 1252
|
||||
END
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Spanish resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ESN)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_MODERN
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#ifndef APSTUDIO_INVOKED\r\n"
|
||||
"#include ""targetver.h""\r\n"
|
||||
"#endif\r\n"
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||
"LANGUAGE 9, 1\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#include ""res\\Olivia.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"#include ""afxres.rc"" // Standard components\r\n"
|
||||
"#endif\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // Spanish resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
#include "res\Olivia.rc2" // non-Microsoft Visual C++ edited resources
|
||||
#include "afxres.rc" // Standard components
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
|
|
@ -0,0 +1,397 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{192BCB82-D8B4-4FB0-807A-7CC9B6EA623B}</ProjectGuid>
|
||||
<RootNamespace>Olivia</RootNamespace>
|
||||
<Keyword>MFCDLLProj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>15.0.28127.55</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules />
|
||||
<CodeAnalysisRuleAssemblies />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules />
|
||||
<CodeAnalysisRuleAssemblies />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules />
|
||||
<CodeAnalysisRuleAssemblies />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules />
|
||||
<CodeAnalysisRuleAssemblies />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<PreBuildEvent>
|
||||
<Command>copy ..\..\bin\$(IntDir)utiles.dll ..\bin\$(IntDir)
|
||||
copy ..\..\lib\$(IntDir)utiles.lib ..\bin\$(IntDir)
|
||||
copy ..\..\bin\$(IntDir)LicUtiles.dll ..\bin\$(IntDir)
|
||||
copy ..\..\lib\$(IntDir)LicUtiles.lib ..\bin\$(IntDir)
|
||||
copy ..\..\bin\$(IntDir)ClientLic.dll ..\bin\$(IntDir)
|
||||
copy ..\..\ib\$(IntDir)ClientLic.lib ..\bin\$(IntDir)
|
||||
copy ..\..\bin\$(IntDir)FileTransfer.dll ..\bin\$(IntDir)
|
||||
copy ..\..\lib\$(IntDir)FileTransfer.lib ..\bin\$(IntDir)
|
||||
copy ..\..\bin\$(IntDir)sqlite3.dll ..\bin\$(IntDir)
|
||||
copy ..\..\lib\$(IntDir)sqlite3.lib ..\bin\$(IntDir)
|
||||
|
||||
copy ..\bin\$(IntDir)utiles.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)utiles.lib $(OutDir)
|
||||
copy ..\bin\$(IntDir)LicUtiles.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)LicUtiles.lib $(OutDir)
|
||||
copy ..\bin\$(IntDir)ClientLic.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)ClientLic.lib $(OutDir)
|
||||
copy ..\bin\$(IntDir)FileTransfer.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)FileTransfer.lib $(OutDir)
|
||||
copy ..\bin\$(IntDir)sqlite3.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)sqlite3.lib $(OutDir)</Command>
|
||||
</PreBuildEvent>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\includes\Utiles;..\includes\olivia;..\includes\ClientLic;..\includes\FileTransfer;..\includes\LicUtiles</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;OLIVIA_COMPILA;OLIVIA_NSENS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>utiles.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\lib\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<ModuleDefinitionFile>.\Olivia.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy $(OutDir)$(TargetFileName) ..\bin\$(IntDir)
|
||||
copy $(OutDir)Olivia.lib ..\lib\$(IntDir)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PreBuildEvent>
|
||||
<Command>copy ..\..\bin\$(IntDir)utiles.dll ..\bin\$(IntDir)
|
||||
copy ..\..\lib\$(IntDir)utiles.lib ..\bin\$(IntDir)
|
||||
copy ..\..\bin\$(IntDir)LicUtiles.dll ..\bin\$(IntDir)
|
||||
copy ..\..\lib\$(IntDir)LicUtiles.lib ..\bin\$(IntDir)
|
||||
copy ..\..\bin\$(IntDir)ClientLic.dll ..\bin\$(IntDir)
|
||||
copy ..\..\ib\$(IntDir)ClientLic.lib ..\bin\$(IntDir)
|
||||
copy ..\..\bin\$(IntDir)FileTransfer.dll ..\bin\$(IntDir)
|
||||
copy ..\..\lib\$(IntDir)FileTransfer.lib ..\bin\$(IntDir)
|
||||
copy ..\..\bin\$(IntDir)sqlite3.dll ..\bin\$(IntDir)
|
||||
copy ..\..\lib\$(IntDir)sqlite3.lib ..\bin\$(IntDir)
|
||||
|
||||
copy ..\bin\$(IntDir)utiles.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)utiles.lib $(OutDir)
|
||||
copy ..\bin\$(IntDir)LicUtiles.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)LicUtiles.lib $(OutDir)
|
||||
copy ..\bin\$(IntDir)ClientLic.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)ClientLic.lib $(OutDir)
|
||||
copy ..\bin\$(IntDir)FileTransfer.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)FileTransfer.lib $(OutDir)
|
||||
copy ..\bin\$(IntDir)sqlite3.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)sqlite3.lib $(OutDir)</Command>
|
||||
</PreBuildEvent>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\includes\Utiles;..\includes\olivia;..\includes\ClientLic;..\includes\FileTransfer;..\includes\LicUtiles</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;OLIVIA_COMPILA;OLIVIA_NSENS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>utiles.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\lib\x64\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<ModuleDefinitionFile>.\Olivia.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy $(OutDir)$(TargetFileName) ..\bin\$(IntDir)
|
||||
copy $(OutDir)Olivia.lib ..\lib\$(IntDir)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<PreBuildEvent>
|
||||
<Command>copy ..\..\bin\$(IntDir)utiles.dll ..\bin\$(IntDir)
|
||||
copy ..\..\lib\$(IntDir)utiles.lib ..\bin\$(IntDir)
|
||||
copy ..\..\bin\$(IntDir)LicUtiles.dll ..\bin\$(IntDir)
|
||||
copy ..\..\lib\$(IntDir)LicUtiles.lib ..\bin\$(IntDir)
|
||||
copy ..\..\bin\$(IntDir)ClientLic.dll ..\bin\$(IntDir)
|
||||
copy ..\..\ib\$(IntDir)ClientLic.lib ..\bin\$(IntDir)
|
||||
copy ..\..\bin\$(IntDir)FileTransfer.dll ..\bin\$(IntDir)
|
||||
copy ..\..\lib\$(IntDir)FileTransfer.lib ..\bin\$(IntDir)
|
||||
copy ..\..\bin\$(IntDir)sqlite3.dll ..\bin\$(IntDir)
|
||||
copy ..\..\lib\$(IntDir)sqlite3.lib ..\bin\$(IntDir)
|
||||
|
||||
copy ..\bin\$(IntDir)utiles.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)utiles.lib $(OutDir)
|
||||
copy ..\bin\$(IntDir)LicUtiles.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)LicUtiles.lib $(OutDir)
|
||||
copy ..\bin\$(IntDir)ClientLic.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)ClientLic.lib $(OutDir)
|
||||
copy ..\bin\$(IntDir)FileTransfer.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)FileTransfer.lib $(OutDir)
|
||||
copy ..\bin\$(IntDir)sqlite3.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)sqlite3.lib $(OutDir)</Command>
|
||||
</PreBuildEvent>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\includes\Utiles;..\includes\olivia;..\includes\ClientLic;..\includes\FileTransfer;..\includes\LicUtiles</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;OLIVIA_COMPILA;OLIVIA_NSENS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>utiles.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\lib\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<ModuleDefinitionFile>.\Olivia.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy $(OutDir)$(TargetFileName) ..\bin\$(IntDir)
|
||||
copy $(OutDir)Olivia.lib ..\lib\$(IntDir)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PreBuildEvent>
|
||||
<Command>copy ..\..\bin\$(IntDir)utiles.dll ..\bin\$(IntDir)
|
||||
copy ..\..\lib\$(IntDir)utiles.lib ..\bin\$(IntDir)
|
||||
copy ..\..\bin\$(IntDir)LicUtiles.dll ..\bin\$(IntDir)
|
||||
copy ..\..\lib\$(IntDir)LicUtiles.lib ..\bin\$(IntDir)
|
||||
copy ..\..\bin\$(IntDir)ClientLic.dll ..\bin\$(IntDir)
|
||||
copy ..\..\ib\$(IntDir)ClientLic.lib ..\bin\$(IntDir)
|
||||
copy ..\..\bin\$(IntDir)FileTransfer.dll ..\bin\$(IntDir)
|
||||
copy ..\..\lib\$(IntDir)FileTransfer.lib ..\bin\$(IntDir)
|
||||
copy ..\..\bin\$(IntDir)sqlite3.dll ..\bin\$(IntDir)
|
||||
copy ..\..\lib\$(IntDir)sqlite3.lib ..\bin\$(IntDir)
|
||||
|
||||
copy ..\bin\$(IntDir)utiles.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)utiles.lib $(OutDir)
|
||||
copy ..\bin\$(IntDir)LicUtiles.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)LicUtiles.lib $(OutDir)
|
||||
copy ..\bin\$(IntDir)ClientLic.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)ClientLic.lib $(OutDir)
|
||||
copy ..\bin\$(IntDir)FileTransfer.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)FileTransfer.lib $(OutDir)
|
||||
copy ..\bin\$(IntDir)sqlite3.dll $(OutDir)
|
||||
copy ..\lib\$(IntDir)sqlite3.lib $(OutDir)</Command>
|
||||
</PreBuildEvent>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\includes\Utiles;..\includes\olivia;..\includes\ClientLic;..\includes\FileTransfer;..\includes\LicUtiles</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;OLIVIA_COMPILA;OLIVIA_NSENS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>utiles.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\lib\x64\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<ModuleDefinitionFile>.\Olivia.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy $(OutDir)$(TargetFileName) ..\bin\$(IntDir)
|
||||
copy $(OutDir)Olivia.lib ..\lib\$(IntDir)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Msmain.cpp" />
|
||||
<ClCompile Include="Olivia.cpp" />
|
||||
<ClCompile Include="olv.cpp" />
|
||||
<ClCompile Include="olv_csv.cpp" />
|
||||
<ClCompile Include="olv_geom.cpp" />
|
||||
<ClCompile Include="olv_limp.cpp" />
|
||||
<ClCompile Include="olv_limp_thr.cpp" />
|
||||
<ClCompile Include="olv_reco.cpp" />
|
||||
<ClCompile Include="olv_reco_thr.cpp" />
|
||||
<ClCompile Include="olv_sens_ws.cpp" />
|
||||
<ClCompile Include="olv_sock.cpp" />
|
||||
<ClCompile Include="olv_tasks.cpp" />
|
||||
<ClCompile Include="olv_thr.cpp" />
|
||||
<ClCompile Include="sock_task.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Olivia.def" />
|
||||
<None Include="ReadMe.txt" />
|
||||
<None Include="res\Olivia.rc2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Msmain.h" />
|
||||
<ClInclude Include="Olivia.h" />
|
||||
<ClInclude Include="olv.h" />
|
||||
<ClInclude Include="olv_csv.h" />
|
||||
<ClInclude Include="olv_dll.h" />
|
||||
<ClInclude Include="olv_geom.h" />
|
||||
<ClInclude Include="olv_limp.h" />
|
||||
<ClInclude Include="olv_limp_def.h" />
|
||||
<ClInclude Include="olv_limp_thr.h" />
|
||||
<ClInclude Include="olv_reco.h" />
|
||||
<ClInclude Include="olv_reco_thr.h" />
|
||||
<ClInclude Include="olv_sens_ws.h" />
|
||||
<ClInclude Include="olv_sock.h" />
|
||||
<ClInclude Include="olv_tasks.h" />
|
||||
<ClInclude Include="olv_thr.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="sock_task.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Olivia.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties RESOURCE_FILE="Olivia.rc" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Msmain.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Olivia.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="olv.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="olv_csv.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="olv_geom.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="olv_limp.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="olv_limp_thr.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="olv_reco.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="olv_reco_thr.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="olv_sens_ws.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="olv_sock.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="olv_tasks.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="olv_thr.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="sock_task.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Olivia.def">
|
||||
<Filter>Source Files</Filter>
|
||||
</None>
|
||||
<None Include="res\Olivia.rc2">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Msmain.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Olivia.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="olv.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="olv_csv.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="olv_dll.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="olv_geom.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="olv_limp.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="olv_limp_def.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="olv_limp_thr.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="olv_reco.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="olv_reco_thr.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="olv_sens_ws.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="olv_sock.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="olv_tasks.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="olv_thr.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="sock_task.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="stdafx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Olivia.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
#pragma once
|
||||
#include "th_cola.h"
|
||||
template <typename T>
|
||||
class DataOlvAsync_cola{
|
||||
public:
|
||||
int id;
|
||||
T data;
|
||||
};
|
||||
|
||||
template <typename P>
|
||||
class OlvAsync_cola : public Cth_cola<DataOlvAsync_cola<P>>
|
||||
{
|
||||
|
||||
void (*func_proc)( int, OlvAsync_cola<P>*, P *);
|
||||
public:
|
||||
OlvAsync_cola(void){};
|
||||
~OlvAsync_cola(void){};
|
||||
|
||||
void inicia(int miliseconds,void (*func)( int, OlvAsync_cola<P>*, P *), int fin =-1, char* nombre=NULL)
|
||||
{
|
||||
func_proc =func;
|
||||
time_sleep = miliseconds;
|
||||
pirate=FALSE;
|
||||
lanza(nombre);
|
||||
}
|
||||
|
||||
virtual void procesa(DataOlvAsync_cola<P> &t)//override de procesado que hay que sobreescribir
|
||||
{
|
||||
func_proc(t.id,this,&t.data);
|
||||
};
|
||||
void encola(int tarea, P *argumentos, BOOL forzar)
|
||||
{
|
||||
DataOlvAsync_cola<P> t;
|
||||
t.id = tarea;
|
||||
if(argumentos)
|
||||
t.data = *argumentos;
|
||||
(*this)+t;
|
||||
}
|
||||
void termina()
|
||||
{
|
||||
fin();
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
========================================================================
|
||||
MICROSOFT FOUNDATION CLASS LIBRARY : Olivia Project Overview
|
||||
========================================================================
|
||||
|
||||
|
||||
AppWizard has created this Olivia DLL for you. This DLL not only
|
||||
demonstrates the basics of using the Microsoft Foundation classes but
|
||||
is also a starting point for writing your DLL.
|
||||
|
||||
This file contains a summary of what you will find in each of the files that
|
||||
make up your Olivia DLL.
|
||||
|
||||
Olivia.vcproj
|
||||
This is the main project file for VC++ projects generated using an Application Wizard.
|
||||
It contains information about the version of Visual C++ that generated the file, and
|
||||
information about the platforms, configurations, and project features selected with the
|
||||
Application Wizard.
|
||||
|
||||
Olivia.h
|
||||
This is the main header file for the DLL. It declares the
|
||||
COliviaApp class.
|
||||
|
||||
Olivia.cpp
|
||||
This is the main DLL source file. It contains the class COliviaApp.
|
||||
|
||||
Olivia.rc
|
||||
This is a listing of all of the Microsoft Windows resources that the
|
||||
program uses. It includes the icons, bitmaps, and cursors that are stored
|
||||
in the RES subdirectory. This file can be directly edited in Microsoft
|
||||
Visual C++.
|
||||
|
||||
res\Olivia.rc2
|
||||
This file contains resources that are not edited by Microsoft
|
||||
Visual C++. You should place all resources not editable by
|
||||
the resource editor in this file.
|
||||
|
||||
Olivia.def
|
||||
This file contains information about the DLL that must be
|
||||
provided to run with Microsoft Windows. It defines parameters
|
||||
such as the name and description of the DLL. It also exports
|
||||
functions from the DLL.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other standard files:
|
||||
|
||||
StdAfx.h, StdAfx.cpp
|
||||
These files are used to build a precompiled header (PCH) file
|
||||
named Olivia.pch and a precompiled types file named StdAfx.obj.
|
||||
|
||||
Resource.h
|
||||
This is the standard header file, which defines new resource IDs.
|
||||
Microsoft Visual C++ reads and updates this file.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other notes:
|
||||
|
||||
AppWizard uses "TODO:" to indicate parts of the source code you
|
||||
should add to or customize.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by Olivia.rc
|
||||
//
|
||||
#define IDP_SOCKETS_INIT_FAILED 101
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
#define _APS_NEXT_RESOURCE_VALUE 1000
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 1000
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -0,0 +1,608 @@
|
|||
#include "stdafx.h"
|
||||
#ifdef OLIVIA_COMPILA
|
||||
//olivia
|
||||
#include "olv.h"
|
||||
#include "olv_limp.h"
|
||||
#include "olv_sock.h"
|
||||
#include "olv_limp_thr.h"
|
||||
#include "olv_reco.h"
|
||||
#include "olv_tasks_def.h"
|
||||
//utiles
|
||||
#include "ini_file.h"
|
||||
#include "_error.h"
|
||||
#include "lock.h"
|
||||
#include "Msmain.h"
|
||||
#include "utl.h"
|
||||
|
||||
/**
|
||||
* Una vez configurada la herramienta OLIVIA a través del Addin para ArcGIS desarrollado
|
||||
* a tal efecto en c# vc2010, se llama al proceso OliviaTasks.exe que se encontrará en el directorio
|
||||
* de instalación "\bin"
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file olv.cpp
|
||||
* Archivo de implementaciones generales de la herramienta Olivia de OliviaTasks.
|
||||
*/
|
||||
|
||||
COlivia::COlivia(void)
|
||||
{
|
||||
isDebug = false;
|
||||
tipo_oliv = OliviaDef::GeneralDef::OlivNoDef;
|
||||
memset(&paths, 0, &paths.pfin-(char*)&paths);
|
||||
olv_limp = NULL;
|
||||
ya_config=FALSE;
|
||||
fin=FALSE;
|
||||
tarea=progreso=0;
|
||||
rellena_tareas(); //Rellena los textos de las tareas
|
||||
msg_proce[0]=0;
|
||||
modo_ejec=OLV_EJEC_NDEBUG;
|
||||
olv_reco=NULL;
|
||||
olv_sock = new Colv_sock(this);
|
||||
lock = new Clock();
|
||||
strcpy_s(paths.path_cfg_geo,"C:\\olivia\\cfg_geo.ini");
|
||||
|
||||
modo_multitask=FALSE;
|
||||
memset(&infotask,0,sizeof(InfoIniTask));
|
||||
log.l_lisener = this;
|
||||
}
|
||||
|
||||
COlivia::~COlivia(void)
|
||||
{
|
||||
if(olv_limp)
|
||||
delete olv_limp;
|
||||
if(olv_reco)
|
||||
delete olv_reco;
|
||||
|
||||
delete (olv_sock);
|
||||
delete (lock);
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Rellena la matriz de textos de tareas
|
||||
*/
|
||||
void COlivia::rellena_tareas()
|
||||
{
|
||||
sprintf_s(tareas_str[OLV_TAREA_CALC],OLV_MAX_TAREA,"Conectado, comenzando cálculos\n");
|
||||
sprintf_s(tareas_str[OLV_TAREA_IMP],OLV_MAX_TAREA,"Importando datos\n");
|
||||
sprintf_s(tareas_str[OLV_TAREA_SENS],OLV_MAX_TAREA,"Leyendo información de carga de los sensores\n");
|
||||
sprintf_s(tareas_str[OLV_TAREA_UNE_NW_AMB],OLV_MAX_TAREA,"Uniendo ámbitos a red navegable\n");
|
||||
sprintf_s(tareas_str[OLV_TAREA_TOPO_NW],OLV_MAX_TAREA,"Generando topologías en la red\n");
|
||||
sprintf_s(tareas_str[OLV_TAREA_COST_AMB],OLV_MAX_TAREA,"Calculando matriz de costes entre ámbitos\n");
|
||||
sprintf_s(tareas_str[OLV_TAREA_GUARD_MAT],OLV_MAX_TAREA,"Guardando matrices\n");
|
||||
sprintf_s(tareas_str[OLV_TAREA_MULTITASK],OLV_MAX_TAREA,"Calculando costes entre ámbitos en multitask...\n");
|
||||
sprintf_s(tareas_str[OLV_TAREA_SECTORIZ],OLV_MAX_TAREA,"Sectorizando\n");
|
||||
sprintf_s(tareas_str[OLV_TAREA_CALC_SEC],OLV_MAX_TAREA,"Calculando número de sectores\n");
|
||||
sprintf_s(tareas_str[OLV_TAREA_PERMU],OLV_MAX_TAREA,"Calculando permutaciones para mejorar...Puede tardar unos minutos\n");
|
||||
sprintf_s(tareas_str[OLV_TAREA_LEE_SECTO],OLV_MAX_TAREA,"Leyendo sectorización\n");
|
||||
sprintf_s(tareas_str[OLV_TAREA_PLANIF],OLV_MAX_TAREA,"Planificando\n");
|
||||
sprintf_s(tareas_str[OLV_TAREA_FIN_SEC],OLV_MAX_TAREA,OliviaDef::GeneralDef::SockSectFin);
|
||||
sprintf_s(tareas_str[OLV_TAREA_FIN_PLANIF],OLV_MAX_TAREA,OliviaDef::GeneralDef::SockPlanFin);
|
||||
sprintf_s(tareas_str[OLV_TAREA_FIN_OK],OLV_MAX_TAREA,OliviaDef::GeneralDef::SockFinOk);
|
||||
sprintf_s(tareas_str[OLV_TAREA_FIN_NOK],OLV_MAX_TAREA,OliviaDef::GeneralDef::SockFinNOk);
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Función llamada por el mainframe para delete el socket ppal
|
||||
*/
|
||||
void COlivia::destruye_socket(LPARAM lp)
|
||||
{
|
||||
delete ((Colv_sock*)lp);
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Dada la línea de comandos, la divide en los parámetros necesarios
|
||||
*/
|
||||
BOOL COlivia::coge_param(char *param)
|
||||
{
|
||||
char *token;
|
||||
int j;
|
||||
|
||||
//los parámetros son:
|
||||
//\olivia \tipo_oliv \cfg.ini \ip \puerto \toutsock
|
||||
token = strtok(param, OliviaDef::GeneralDef::EjecGeoParamSep);
|
||||
|
||||
//Lee parámetros
|
||||
j=0;
|
||||
while (token != NULL)
|
||||
{
|
||||
if(strstr(token,OliviaDef::GeneralDef::GG_tipo))
|
||||
{
|
||||
if(!dame_param(token,&tipo_oliv))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_ip))
|
||||
{
|
||||
if(!dame_param(token, olv_sock->ip,sizeof(olv_sock->ip)))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_port))
|
||||
{
|
||||
if(!dame_param(token, &olv_sock->puerto))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_tout))
|
||||
{
|
||||
int t_out;
|
||||
if(!dame_param(token, &t_out))
|
||||
break;
|
||||
olv_sock->pon_tout(t_out);
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_pt))
|
||||
{
|
||||
if(!dame_param(token, paths.path_temp,sizeof(paths.path_temp)))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_pcfg))
|
||||
{
|
||||
if(!dame_param(token, paths.path_cfg_geo,sizeof(paths.path_cfg_geo)))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token, "debug"))
|
||||
isDebug = true;
|
||||
else
|
||||
break;
|
||||
token = strtok(NULL, OliviaDef::GeneralDef::EjecGeoParamSep);
|
||||
j++;
|
||||
}
|
||||
if(j<OliviaDef::GeneralDef::ParamN)
|
||||
return FALSE; //no ha leído los param suficientes
|
||||
return TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Borra archivos de log antiguos para que no se acumulen
|
||||
*/
|
||||
void COlivia::borra_log_old()
|
||||
{
|
||||
char*f;
|
||||
int n=0;
|
||||
|
||||
__int64 t = _time64(NULL);
|
||||
int dia,mes,ano, i;
|
||||
t-=60*60*24*15;
|
||||
CTime tt(t);
|
||||
|
||||
dia=tt.GetDay();
|
||||
mes=tt.GetMonth();
|
||||
ano=tt.GetYear();
|
||||
|
||||
//pilla archivos-----------------
|
||||
StrArray fils, filsa, buf;
|
||||
Cdir_manager::lista_files(C_app::GetApp()->log.path,&fils);
|
||||
fils.filtra(&filsa,".log");
|
||||
n = filsa.size()-1;
|
||||
|
||||
//borra log antiguo-----------------------
|
||||
while(n>=0)
|
||||
{
|
||||
buf.n_i = buf.n_str =0;
|
||||
f =filsa.get(n--);
|
||||
if(Cutl::stringSplit(f,"_", &buf)->n_i<5)
|
||||
continue;
|
||||
if(!strstr(buf.get(0),C_app::GetApp()->log.nombre))
|
||||
continue;
|
||||
|
||||
i=atoi(buf.get(1));
|
||||
if(i<ano)
|
||||
goto borra;
|
||||
else if(i>ano)
|
||||
continue;
|
||||
|
||||
//busca mes-----------------
|
||||
i=atoi(buf.get(2));
|
||||
if(i<mes)
|
||||
goto borra;
|
||||
else if(i>mes)
|
||||
continue;
|
||||
|
||||
//busca dia--------------------
|
||||
if(atoi(buf.get(3))<dia)
|
||||
goto borra;
|
||||
continue;
|
||||
borra:
|
||||
DeleteFile(f);
|
||||
}
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Inicia la instancia de la herramienta Olivia, en modo limpieza o residuos
|
||||
*/
|
||||
BOOL COlivia::inicia(char *cmdline,char *err, int nerr)
|
||||
{
|
||||
BOOL ret = TRUE;
|
||||
|
||||
borra_log_old();//borra log antiguo-----
|
||||
|
||||
if(!coge_param(cmdline))
|
||||
{
|
||||
sprintf_s(err,nerr,"Error al iniciar OliviaTasks para OLIVIA:\nError al leer parámetros, menos de los esperados");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
switch(tipo_oliv)
|
||||
{
|
||||
case OliviaDef::GeneralDef::OlivLimp:
|
||||
olv_limp = new Colv_limp(this);
|
||||
break;
|
||||
case OliviaDef::GeneralDef::OlivResi:
|
||||
olv_reco = new Colv_reco(this);
|
||||
break;
|
||||
default:
|
||||
sprintf_s(err,nerr,"Error al iniciar OliviaTasks para OLIVIA:\nTipo recibido no esperado");
|
||||
ret=FALSE;
|
||||
break;
|
||||
}
|
||||
if(ret)
|
||||
{
|
||||
//////////////////////////////
|
||||
//si ha ido bien, inicia socket de comunicaciones
|
||||
if(!olv_sock->pon_escucha(olv_sock->ip,olv_sock->puerto))
|
||||
{
|
||||
olv_sock->cierra();
|
||||
sprintf_s(err,nerr,"Error al iniciar OliviaTasks para OLIVIA:\nError al iniciar socket");
|
||||
ret=FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Devuelve la tarea por la que se va ejecutando
|
||||
*/
|
||||
int COlivia::dame_tarea()
|
||||
{
|
||||
return tarea;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Devuelve el progreso de ejecución de la tarea, de 0 a 100
|
||||
*/
|
||||
int COlivia::dame_progre()
|
||||
{
|
||||
return progreso;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Pone las opciones de configuración de lo que recibe por el socket
|
||||
*/
|
||||
BOOL COlivia::pon_config(char *config)
|
||||
{
|
||||
BOOL ret=FALSE;
|
||||
|
||||
ya_config=TRUE;
|
||||
|
||||
if(strstr(config,OliviaDef::GeneralDef::SockConfPlan))
|
||||
modo_ejec=OLV_EJEC_PLAN;
|
||||
else if(strstr(config,OliviaDef::GeneralDef::SockConfTodo))
|
||||
modo_ejec=OLV_EJEC_TODO;
|
||||
else if(strstr(config,OliviaDef::GeneralDef::SockConf))
|
||||
modo_ejec=OLV_EJEC_SECT;
|
||||
|
||||
switch(tipo_oliv)
|
||||
{
|
||||
case OliviaDef::GeneralDef::OlivLimp:
|
||||
if(olv_limp->pon_config(config)==OliviaDef::GeneralDef::ParamLimpN)
|
||||
ret = olv_limp->inicia();
|
||||
break;
|
||||
case OliviaDef::GeneralDef::OlivResi:
|
||||
if(olv_reco->pon_config(config)==OliviaDef::GeneralDef::ParamRecoN)
|
||||
ret = olv_reco->inicia();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Cancela el proceso, borra archivos temporales y cierra
|
||||
*/
|
||||
void COlivia::cancela()
|
||||
{
|
||||
|
||||
switch(tipo_oliv)
|
||||
{
|
||||
case OliviaDef::GeneralDef::OlivLimp:
|
||||
olv_limp->cancela();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/*if(olv_limp && olv_limp->thr_limp && !olv_limp->thr_limp->fin_permu)
|
||||
{
|
||||
//manda cerrar
|
||||
//SendMessage(mfrm,WM_CLOSE,0,0);
|
||||
mfrm->pirate = true;
|
||||
}*/
|
||||
mfrm->pirate = true;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Devuelve el parámetro, char*
|
||||
*/
|
||||
BOOL COlivia::dame_param(char *token, char *param, int sizeparam)
|
||||
{
|
||||
char *c;
|
||||
int ss;
|
||||
|
||||
c=strstr(token,OliviaDef::GeneralDef::EjecGeoParamIgual);
|
||||
if(!c)
|
||||
return FALSE;
|
||||
|
||||
strcpy_s(param,sizeparam,(c+1));
|
||||
|
||||
ss=(int)strlen(param);
|
||||
param[ss-1]=0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Devuelve el parámetro, int
|
||||
*/
|
||||
BOOL COlivia::dame_param(char *token, int *param)
|
||||
{
|
||||
char *c;
|
||||
|
||||
c=strstr(token,OliviaDef::GeneralDef::EjecGeoParamIgual);
|
||||
if(!c)
|
||||
return FALSE;
|
||||
|
||||
*param=atoi(c+1); //el valor está a continuación del separador
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Devuelve el parámetro, double
|
||||
*/
|
||||
BOOL COlivia::dame_param(char *token, double *param)
|
||||
{
|
||||
char *c;
|
||||
|
||||
c=strstr(token,OliviaDef::GeneralDef::EjecGeoParamIgual);
|
||||
if(!c)
|
||||
return FALSE;
|
||||
|
||||
*param=atof(c+1); //el valor está a continuación del separador
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Función de ejecución de prueba para Debug
|
||||
*/
|
||||
void COlivia::prueba()
|
||||
{
|
||||
int i;
|
||||
const int max_char_cap=3048;
|
||||
char config[max_char_cap];
|
||||
|
||||
///////////////////
|
||||
//solo para debug elena olivia
|
||||
i=1;
|
||||
|
||||
if(fin)
|
||||
{
|
||||
//cerrar_cartografia();
|
||||
if(tipo_oliv==0)
|
||||
{
|
||||
delete olv_limp;
|
||||
olv_limp = new Colv_limp(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete olv_reco;
|
||||
olv_reco = new Colv_reco(this);
|
||||
}
|
||||
}
|
||||
|
||||
switch(i)
|
||||
{
|
||||
case 1://coor_inst_x:542996.13 /coor_inst_y:4624509.22
|
||||
sprintf_s(config, max_char_cap,"/CONFIG_TODO /t_tto:2900 /restr_cir:0 /u_tto:1 /v_despl:3 /t_conv:480 /t_descan:30 /t_despl:30 /t_carg:30 /aislados:0 "\
|
||||
"/h_inicio:450 /trafico:80 "\
|
||||
"/n_ptsctrl:3 /n_secdef:2 /anch_med:0 /coor_inst_x:0 /coor_inst_y:0 /path_data:C:\\Proyectos\\Olivia\\Instal\\data_barrMix2Ejes_Todo\\data_T05_20190605_234043.shp "\
|
||||
"/path_nw:C:\\Proyectos\\Olivia\\Instal\\data_barrMix2Ejes_Todo\\nw_20190605_234043.shp "\
|
||||
"/cons_obser:OBSERVACIONES /cons_anch_tip:ANCHO_TIPO /cons_tipolo:TIPOLOGIA /cons_tip_ent:NOM_TIPO_ENTIDAD "\
|
||||
"/atr_aparc:Banda Aparcamiento /atr_bord:Bordillo Libre /atr_acera:Aceras /atr_peat:Peatonales"\
|
||||
"/atr_ap_lin:Linea /atr_ap_bat:Bateria /cons_onew:ONEWAY /cons_kph:KPH /cons_fow:FOW "\
|
||||
"/cons_name:NAME /atr_TF:TF /atr_FT:FT /atr_N:N /atr_pedes:14 /str_tto:Barrido_mixto ");
|
||||
break;
|
||||
case 2:
|
||||
sprintf_s(config, max_char_cap,"/CONFIG_TODO /campo_capaci:CAPACIDAD /kg_max:11500 /campo_kgrecog:KGRECO /campo_uds:UNIDADES "\
|
||||
"/recogida_kg:200 /carga_cont:-1 /densidad:-1 /t_conv:480 /t_descan:30 /t_vacia:60 /t_descarg:20 /t_sallleg:5 /h_inicio:420 "\
|
||||
"/trafico:80 /n_ptsctrl:3 /n_secdef:3 /anch_vehi:2,5 /giro_vehi:175 /coor_inst_x:545024,4974 /coor_inst_y:4623840,8944 "\
|
||||
"/coor_desc_x:545024,4974 /coor_desc_y:4623840,8944 /sens_id: /sens_url: /sens_fechai: /sens_fechaf: /md_pet:-1 "\
|
||||
"/aislados:0 /lateralidad:-1 /cons_onew:ONEWAY /cons_kph:KPH /cons_fow:FOW /cons_name:NAME /atr_TF:TF /atr_FT:FT "\
|
||||
"/atr_N:N /atr_pedes:14 /str_tto:Resto /path_data:C:\\Proyectos\\Olivia\\Instal\\data_reco\\data_F01_C06_T1603_20190624_130559.shp "\
|
||||
"/path_nw:C:\\Proyectos\\Olivia\\Instal\\data_reco\\nw_20190624_130559.shp ");
|
||||
break;
|
||||
case 3: //coor_inst_x:542996.13 /coor_inst_y:4624509.22
|
||||
sprintf_s(config, max_char_cap,"/CONFIG_TODO /t_tto:2900 /restr_cir:0 /u_tto:3 /v_despl:5 /t_conv:480 /t_descan:30 /t_despl:25 /t_carg:40 /h_inicio:420"
|
||||
"/trafico:80 /n_ptsctrl:3 /n_secdef:4 /anch_med:2 /coor_inst_x:0 /coor_inst_y:0 /aislados:0 /cons_obser:OBSERVACIONES /cons_anch_tip:ANCHO_TIPO "
|
||||
"/cons_tipolo:TIPOLOGIA /cons_tip_ent:NOM_TIPO_ENTIDAD /atr_aparc:Banda Aparcamiento /atr_bord:Bordillo Libre /atr_acera:Aceras /atr_peat:Peatonales "
|
||||
"/atr_ap_lin:Linea /atr_ap_bat:Bateria /cons_onew:ONEWAY /cons_kph:KPH /cons_fow:FOW /cons_name:NAME /atr_TF:TF /atr_FT:FT /atr_N:N /atr_pedes:14 "
|
||||
"/str_tto:Barrido_manual /path_data:C:\\Proyectos\\Olivia\\Instal\\data_limp_grande\\data_T00_A04050607_NNivel3_20191020_01228.shp "
|
||||
"/path_nw:C:\\Proyectos\\Olivia\\Instal\\data_limp_grande\\nw_20191020_01228.shp ");
|
||||
break;
|
||||
case(4):///coor_inst_x:545184,9643 /coor_inst_y:4624026,7103
|
||||
sprintf_s(config, max_char_cap,"/CONFIG_TODO /t_tto:5600 /restr_cir:1 /u_tto:3 /v_despl:15 /t_conv:480 /t_descan:30 /t_despl:25 /t_carg:40 /h_inicio:420 /trafico:80 "\
|
||||
"/n_ptsctrl:3 /n_secdef:2 /anch_med:2 /coor_inst_x:545184,9643 /coor_inst_y:4624026,7103 /aislados:0 /cons_obser:OBSERVACIONES /cons_anch_tip:ANCHO_TIPO "\
|
||||
"/cons_tipolo:TIPOLOGIA /cons_tip_ent:NOM_TIPO_ENTIDAD /atr_aparc:Banda Aparcamiento /atr_bord:Bordillo Libre /atr_acera:Aceras /atr_peat:Peatonales "\
|
||||
"/atr_ap_lin:Linea /atr_ap_bat:Bateria /cons_onew:ONEWAY /cons_kph:KPH /cons_fow:FOW /cons_name:NAME /atr_TF:TF /atr_FT:FT /atr_N:N /atr_pedes:14 "\
|
||||
"/str_tto:Barrido_mixto /path_data:C:\\Proyectos\\Olivia\\Instal\\data_barrmix\\data_T05_A01030405_NVehículosSatelite_20191019_120727.shp "\
|
||||
"/path_nw:C:\\Proyectos\\Olivia\\Instal\\data_barrmix\\nw_20191019_120727.shp ");
|
||||
break;
|
||||
case(5):///coor_desc_x:543385,702 /coor_desc_y:4622930,4
|
||||
sprintf_s(config, max_char_cap,"/CONFIG_TODO /campo_capaci:CAPACIDAD /kg_max:850 /campo_kgrecog:KGRECO /campo_uds:UNIDADES /recogida_kg:200 "\
|
||||
"/carga_cont:-1 /densidad:-1 /t_conv:480 /t_descan:30 /t_vacia:60 /t_descarg:20 /t_sallleg:5 /h_inicio:420 /trafico:80 /n_ptsctrl:3 "\
|
||||
"/n_secdef:2 /anch_vehi:2,5 /giro_vehi:175 /coor_inst_x:545184,9643 /coor_inst_y:4624026,7103 /coor_desc_x:543385,702 /coor_desc_y:4622930,4 "\
|
||||
"/sens_id: /sens_url: /sens_fechai: /sens_fechaf: /md_pet:-1 /aislados:0 /lateralidad:-1 /cons_onew:ONEWAY /cons_kph:KPH /cons_fow:FOW /cons_name:NAME "\
|
||||
"/atr_TF:TF /atr_FT:FT /atr_N:N /atr_pedes:14 /str_tto:Resto /path_data:C:\\Proyectos\\Olivia\\Instal\\data_reco\\data_F01_C06_TVehículosSatelite_20191019_120001.shp "\
|
||||
"/path_nw:C:\\Proyectos\\Olivia\\Instal\\data_reco\\nw_20191019_120001.shp ");
|
||||
break;
|
||||
case(6):///coor_desc_x:543385,702 /coor_desc_y:4622930,4
|
||||
sprintf_s(config, max_char_cap,"/CONFIG_TODO /campo_capaci:CAPACIDAD /kg_max:850 /campo_kgrecog:KGRECO /campo_uds:UNIDADES /recogida_kg:200 "\
|
||||
"/carga_cont:-1 /densidad:-1 /t_conv:480 /t_descan:30 /t_vacia:60 /t_descarg:20 /t_sallleg:5 /h_inicio:420 /trafico:80 /n_ptsctrl:3 "\
|
||||
"/n_secdef:3 /anch_vehi:2,5 /giro_vehi:175 /coor_inst_x:545184,9643 /coor_inst_y:4624026,7103 /coor_desc_x:543385,702 /coor_desc_y:4622930,4 "\
|
||||
"/sens_id: /sens_url: /sens_fechai: /sens_fechaf: /md_pet:-1 /aislados:0 /lateralidad:-1 /cons_onew:ONEWAY /cons_kph:KPH /cons_fow:FOW /cons_name:NAME "\
|
||||
"/atr_TF:TF /atr_FT:FT /atr_N:N /atr_pedes:14 /str_tto:Resto /path_data:C:\\Proyectos\\Olivia\\Instal\\data_comp_reco\\data_F01_C01_TNivel3_20191026_234244.shp "\
|
||||
"/path_nw:C:\\Proyectos\\Olivia\\Instal\\data_comp_reco\\nw_20191026_234244.shp ");
|
||||
break;
|
||||
case(51): //ger
|
||||
strcpy(config, "/CONFIG_TODO /campo_capaci:CAPACIDAD /kg_max:8500 "
|
||||
"/campo_kgrecog:KGRECO /campo_uds:UNIDADES /recogida_kg:200 /carga_cont:-1 "
|
||||
"/densidad:-1 /t_conv:480 /t_descan:30 /t_vacia:60 /t_descarg:20 "
|
||||
"/t_sallleg:5 /h_inicio:420 /trafico:80 /n_ptsctrl:3 /n_secdef:2 "
|
||||
"/anch_vehi:2,5 /giro_vehi:175 /coor_inst_x:545184,9643 "
|
||||
"/coor_inst_y:4624026,7103 /coor_desc_x:545184,9643 /coor_desc_y:4624026,7103 "
|
||||
"/sens_id: /sens_url: /sens_fechai: /sens_fechaf: /md_pet:-1 /aislados:0 "
|
||||
"/lateralidad:-1 /cons_onew:ONEWAY /cons_kph:KPH /cons_fow:FOW /cons_name:NAME "
|
||||
"/atr_TF:TF /atr_FT:FT /atr_N:N /atr_pedes:14 /str_tto:Resto "
|
||||
"/path_data:D:\\DatosOlivia\\data_reco\\data_F01_C06_TVehículosSatelite_20191019_120001.shp "
|
||||
"/path_nw:D:\\DatosOlivia\\data_reco\\nw_20191019_120001.shp ");
|
||||
break;
|
||||
case(52): //ger
|
||||
strcpy(config, "/CONFIG /t_tto:2900 /restr_cir:0 /u_tto:3 /v_despl:5 /t_conv:480 "
|
||||
"/t_descan:30 /t_despl:25 /t_carg:40 /h_inicio:420 /trafico:80 /n_ptsctrl:3 /n_secdef:2 "
|
||||
"/anch_med:2 /coor_inst_x:0 /coor_inst_y:0 /aislados:0 /cons_obser:OBSERVACIONES /cons_anch_tip:ANCHO_TIPO"
|
||||
" /cons_tipolo:TIPOLOGIA /cons_tip_ent:NOM_TIPO_ENTIDAD /atr_aparc:Banda Aparcamiento /atr_bord:Bordillo Libre"
|
||||
" /atr_acera:Aceras /atr_peat:Peatonales /atr_ap_lin:Linea /atr_ap_bat:Bateria /cons_onew:ONEWAY /cons_kph:KPH"
|
||||
" /cons_fow:FOW /cons_name:NAME /atr_TF:TF /atr_FT:FT /atr_N:N /atr_pedes:14 /str_tto:Barrido_manual "
|
||||
"/path_data:D:\\DatosOlivia\\data_limp\\data_T00_A04050607_NVehiculosSatelite_20191019_115600.shp "
|
||||
"/path_nw:D:\\DatosOlivia\\data_limp\\nw_20191019_115600.shp ");
|
||||
break;
|
||||
|
||||
case(53): //ger
|
||||
strcpy(config, "/CONFIG /t_tto:2900 /restr_cir:0 /u_tto:3 /v_despl:5 "
|
||||
"/t_conv:480 /t_descan:30 /t_despl:25 /t_carg:40 /h_inicio:420 "
|
||||
"/trafico:80 /n_ptsctrl:3 /n_secdef:3 /anch_med:2 /coor_inst_x:0 "
|
||||
"/coor_inst_y:0 /aislados:0 /cons_obser:OBSERVACIONES /cons_anch_tip:ANCHO_TIPO "
|
||||
"/cons_tipolo:TIPOLOGIA /cons_tip_ent:NOM_TIPO_ENTIDAD "
|
||||
"/atr_aparc:Banda Aparcamiento /atr_bord:Bordillo Libre /atr_acera:Aceras "
|
||||
"/atr_peat:Peatonales /atr_ap_lin:Linea /atr_ap_bat:Bateria /cons_onew:ONEWAY "
|
||||
"/cons_kph:KPH /cons_fow:FOW /cons_name:NAME /atr_TF:TF /atr_FT:FT /atr_N:N "
|
||||
"/atr_pedes:14 /str_tto:Barrido_manual "
|
||||
"/path_data:D:\\DatosOlivia\\data_limp_grande\\data_T00_A04050607_NNivel3_20191020_01228.shp "
|
||||
"/path_nw:D:\\DatosOlivia\\data_limp_grande\\nw_20191020_01228.shp ");
|
||||
break;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////
|
||||
/*CoptiMemo oo;
|
||||
int nvect = oo.calc_nvect_master(20000);
|
||||
BOOL is = oo.is_multi(20000,8,12); */
|
||||
///////////////////////////////////////////////
|
||||
|
||||
|
||||
modo_ejec=OLV_EJEC_DEBUG_SIGUE;
|
||||
pon_config(config);
|
||||
|
||||
if(!fin)
|
||||
fin=TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
BOOL COlivia::creaSocProces( Colv_limp *olv_limp )
|
||||
{
|
||||
//SendMessage(mfrm,WMS_CMD,WMS_CMD_OLV_CREA_SOCK_MULTI, (LPARAM)olv_limp);
|
||||
return olv_limp->soc != NULL;
|
||||
//crea socket
|
||||
}
|
||||
//*************************************************************************************
|
||||
BOOL COlivia::destruyeSocProces( Colv_limp *olv_limp )
|
||||
{
|
||||
//SendMessage(mfrm,WMS_CMD,WMS_CMD_OLV_DEST_SOCK_MULTI, (LPARAM)olv_limp);
|
||||
return olv_limp->soc != NULL;
|
||||
//crea socket
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Funcion llamada por el mainframe para crear el socket multitask
|
||||
*/
|
||||
void COlivia::crea_socket_multi( LPARAM lp )
|
||||
{
|
||||
/*
|
||||
Colv_limp *limp = (Colv_limp*)lp;
|
||||
limp->soc = new Csock_sv();
|
||||
limp->soc->escucha=(Cescucha_sock_sv*)limp->olv_tasks;
|
||||
if(!limp->soc->Create(TASKS_PORT,
|
||||
SOCK_STREAM,FD_ACCEPT | FD_READ | FD_CLOSE,
|
||||
limp->olv->olv_sock->ip))
|
||||
{
|
||||
goto mal;
|
||||
}
|
||||
if(!limp->soc->Listen())
|
||||
goto mal;
|
||||
return;
|
||||
mal:
|
||||
limp->soc->Close();
|
||||
delete limp->soc;
|
||||
limp->soc=NULL;*/
|
||||
}
|
||||
//*************************************************************************************
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Funcion llamada por el mainframe para delete el socket multitask
|
||||
*/
|
||||
void COlivia::destruye_socket_multi( LPARAM lp )
|
||||
{
|
||||
/*
|
||||
Colv_limp *olv_limp = (Colv_limp*)lp;
|
||||
olv_limp->soc->Close();
|
||||
delete olv_limp->soc;
|
||||
olv_limp->soc=NULL;*/
|
||||
|
||||
}
|
||||
//*************************************************************************************
|
||||
void COlivia::log_ext( __time64_t tiemp, char *modulo, char *fmt )
|
||||
{
|
||||
if(mfrm)
|
||||
mfrm->log_ext( tiemp, modulo, fmt );
|
||||
/*
|
||||
class CMsgdocOlv : public CObject
|
||||
{
|
||||
public:
|
||||
// Construction....
|
||||
CMsgdocOlv(){};
|
||||
~CMsgdocOlv(){};
|
||||
|
||||
// Attributes....
|
||||
CString m_modulo;
|
||||
CString m_texto;
|
||||
int m_nivel;
|
||||
CTime m_time;
|
||||
|
||||
// access routines....
|
||||
|
||||
};
|
||||
CMsgdocOlv* msg = new CMsgdocOlv();
|
||||
msg->m_nivel = 1;
|
||||
msg->m_modulo = modulo;
|
||||
msg->m_texto = fmt;
|
||||
//msg->smsg(nivel, modulo,buf);
|
||||
//SendMessage(mfrm,(WM_USER+1), 0, (LPARAM) msg );*/
|
||||
}
|
||||
//*************************************************************************************
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Función global para log
|
||||
*/
|
||||
void olvlog (int nivel, char * modulo, char *fmt, ...)
|
||||
{
|
||||
char buf[1024];
|
||||
int k;
|
||||
va_list arg_ptr;
|
||||
|
||||
va_start(arg_ptr, fmt);
|
||||
k = _vsnprintf(buf,1000, fmt, arg_ptr);
|
||||
va_end(arg_ptr);
|
||||
if (k<0)
|
||||
strcpy(&buf[200],"HAY MAS");
|
||||
C_log::log(modulo,buf);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
#pragma once
|
||||
|
||||
/**
|
||||
* @file olv.h
|
||||
* Archivo de definiciones generales de la herramienta Olivia de OliviaTasks.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Includes para archivo de definiciones OliviaDef.cs
|
||||
*/
|
||||
#ifdef OLIVIA_COMPILA
|
||||
#define class namespace
|
||||
#define public
|
||||
#define static
|
||||
#define string CString
|
||||
#include "OliviaDef.cs"
|
||||
#undef class
|
||||
#undef public
|
||||
#undef static
|
||||
#undef string
|
||||
#include "olv_tasks_def.h"
|
||||
#include "_log.h"
|
||||
#include "_app.h"
|
||||
#include "olv_limp_def.h"
|
||||
|
||||
/**
|
||||
* Tareas de ejecución para la ventana de progreso
|
||||
*/
|
||||
enum TareasProgr
|
||||
{
|
||||
OLV_TAREA_CALC, ///<Indica que está calculando el tiempo restante
|
||||
OLV_TAREA_IMP, ///<Indica que está importando
|
||||
OLV_TAREA_SENS, ///<Indica que está leyendo de los sensores
|
||||
OLV_TAREA_UNE_NW_AMB, ///<Indica que está uniendo la red navegable a los ámbitos
|
||||
OLV_TAREA_TOPO_NW, ///<Indica que está generando topología
|
||||
OLV_TAREA_COST_AMB, ///<Indica que está calculando los costes entre ámbitos
|
||||
OLV_TAREA_GUARD_MAT, ///<Indica que está guardando las matrices
|
||||
OLV_TAREA_MULTITASK, ///<Indica que está en proceso multitask
|
||||
OLV_TAREA_CALC_SEC, ///<Indica que está calculando el número de sectores
|
||||
OLV_TAREA_PERMU, ///<Indica que está calculando permutaciones
|
||||
OLV_TAREA_SECTORIZ, ///<Indica que está sectorizando
|
||||
OLV_TAREA_PLANIF, ///<Indica que está planificando
|
||||
OLV_TAREA_LEE_SECTO, ///<Indica que está leyendo sectorización
|
||||
OLV_TAREA_FIN_SEC, ///<Indica que ha finalizado la sectorización
|
||||
OLV_TAREA_FIN_PLANIF, ///<Indica que ha finalizado la planificación
|
||||
OLV_TAREA_FIN_OK, ///<Indica que ha finalizado bien
|
||||
OLV_TAREA_FIN_NOK, ///<Indica que ha finalizado mal
|
||||
OLV_TAREA_N ///<Número tareas
|
||||
};
|
||||
|
||||
/**
|
||||
* Tipos de ejecución de Olivia
|
||||
*/
|
||||
enum TiposEjecOlv
|
||||
{
|
||||
OLV_EJEC_NDEBUG,
|
||||
OLV_EJEC_SECT,
|
||||
OLV_EJEC_PLAN,
|
||||
OLV_EJEC_DEBUG_SIGUE,
|
||||
OLV_EJEC_TODO,
|
||||
OLV_EJEC_DEBUG_SIGUE_NOPLAN,
|
||||
OLV_EJEC_DEBUG_NOSIGUE,
|
||||
};
|
||||
|
||||
/**
|
||||
* Paths de la configuración
|
||||
*/
|
||||
typedef struct PathsOlv{
|
||||
char path_temp[MAX_PATH]; ///<Path temporal de generación de archivos intermedios
|
||||
char path_res_rut[MAX_PATH]; ///<Path del shp con el resultado de las rutas
|
||||
char path_res_pt[MAX_PATH]; ///<Path del shp con el resultado de los puntos de control
|
||||
char path_res_sec[MAX_PATH]; ///<Path del shp con el resultado de las entidades de los ámbitos de trabajo asociada la info de sector
|
||||
char path_data[MAX_PATH]; ///<Path del shp con datos a planificar, ya filtrados e intersecados con las zonas y niveles
|
||||
char path_nw[MAX_PATH]; ///<Path del shp con la red navegable
|
||||
char path_cfg_geo[MAX_PATH];
|
||||
char pfin; ///<Para marcar el final de la estructura
|
||||
}PathsOlv;
|
||||
|
||||
class Colv_limp;
|
||||
class Colv_reco;
|
||||
class Colv_shp;
|
||||
class Colv_sock;
|
||||
class Clock;
|
||||
class Msmain;
|
||||
/**
|
||||
* Clase general de la herramienta Olivia de OliviaTasks.
|
||||
*/
|
||||
class OLV_EXPORT COlivia : public C_app, public C_escucha_log
|
||||
{
|
||||
public:
|
||||
//*************************************************************************************
|
||||
//Variables
|
||||
int tipo_oliv; ///<Tipo de ejecución de la herramienta
|
||||
int tarea; ///<Índice de la tarea por la que va
|
||||
int progreso; ///<Progreso, de 0 a 100
|
||||
int modo_ejec;
|
||||
BOOL ya_config;
|
||||
BOOL fin; ///<Indica si ha finalizado la ejecución
|
||||
BOOL modo_multitask;
|
||||
char tareas_str[OLV_TAREA_N][OLV_MAX_TAREA];
|
||||
char msg_proce[OLV_MAX_MSG_PROCE];///<Mensaje de error general
|
||||
Msmain *mfrm; ///<Puntero al MainFrame
|
||||
PathsOlv paths; ///<Estructura con los paths de trabajo
|
||||
Clock *lock; ///<Interlock para gestión de memoria
|
||||
Colv_limp *olv_limp; ///<Instancia para la utilidad de la limpieza viaria
|
||||
Colv_reco *olv_reco; ///<Instancia para la utilidad de la recogida de residuos
|
||||
Colv_sock *olv_sock; ///<Instancia para socket de comunicaciones con Olivia AddIn
|
||||
InfoIniTask infotask;
|
||||
bool isDebug;
|
||||
|
||||
//*************************************************************************************
|
||||
//Funciones
|
||||
COlivia(void);
|
||||
~COlivia(void);
|
||||
////////////////
|
||||
void prueba();
|
||||
|
||||
BOOL coge_param(char *param);
|
||||
BOOL inicia(char *cmdline, char *err, int nerr);
|
||||
int dame_tarea();
|
||||
int dame_progre();
|
||||
BOOL pon_config(char *config);
|
||||
void cancela();
|
||||
BOOL dame_param(char *token, char *param, int sizeparam);
|
||||
BOOL dame_param(char *token, int *param);
|
||||
BOOL dame_param(char *token, double *param);
|
||||
void destruye_socket(LPARAM lp);
|
||||
void rellena_tareas();
|
||||
void borra_log_old();
|
||||
|
||||
BOOL creaSocProces( Colv_limp *olv );
|
||||
void crea_socket_multi( LPARAM lp );
|
||||
BOOL destruyeSocProces( Colv_limp *olv );
|
||||
void destruye_socket_multi( LPARAM lp );
|
||||
void log_ext( __time64_t tiemp, char *modulo, char *fmt );
|
||||
};
|
||||
OLV_EXPORT void olvlog (int nivel, char * modulo, char *fmt, ...);
|
||||
#endif
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
#include "stdafx.h"
|
||||
#ifdef OLIVIA_COMPILA
|
||||
#include "olv_csv.h"
|
||||
#include "_error.h"
|
||||
/**
|
||||
* @file olv_csv.cpp
|
||||
* Archivo de implementaciones para manejo de archivos csv para lectura y escritura
|
||||
*/
|
||||
Colv_csv::Colv_csv(void)
|
||||
{
|
||||
file=INVALID_HANDLE_VALUE;
|
||||
nb=0;
|
||||
}
|
||||
|
||||
Colv_csv::~Colv_csv(void)
|
||||
{
|
||||
if(file!=INVALID_HANDLE_VALUE)
|
||||
CloseHandle(file);
|
||||
}
|
||||
//*************************************************************************************
|
||||
BOOL Colv_csv::inicia(char *nom_file)
|
||||
{
|
||||
file = CreateFile(nom_file, GENERIC_WRITE, 0, NULL,
|
||||
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
|
||||
if (file == INVALID_HANDLE_VALUE)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
void Colv_csv::cierra()
|
||||
{
|
||||
if(file!=INVALID_HANDLE_VALUE)
|
||||
CloseHandle(file);
|
||||
file=INVALID_HANDLE_VALUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
BOOL Colv_csv::escribe(char *fila)
|
||||
{
|
||||
//Convierte a w_char para escribir en codificación utf-16
|
||||
wchar_t wstr[512];
|
||||
int size,sw;
|
||||
C_error err;
|
||||
|
||||
size = MultiByteToWideChar(CP_UTF8,MB_ERR_INVALID_CHARS,fila,(int)strlen(fila)+1,wstr,512);
|
||||
|
||||
if(size==0)
|
||||
{
|
||||
err.pon_win("OLV_SHP");
|
||||
sw=(int)wcslen(wstr)+1;
|
||||
}
|
||||
|
||||
if ( ! WriteFile(file, wstr ,size*sizeof(wchar_t),&nb,NULL))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
BOOL Colv_csv::lee(char *file_name)
|
||||
{
|
||||
file = CreateFile(file_name, GENERIC_READ, 0, NULL,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
|
||||
char buff[1024];
|
||||
int i=1;
|
||||
ReadFile(file,buff,1024,&nb,0);
|
||||
|
||||
CloseHandle(file);
|
||||
file=INVALID_HANDLE_VALUE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
#ifdef OLIVIA_COMPILA
|
||||
/**
|
||||
* @file olv_csv.h
|
||||
* Archivo de definiciones para manejo de archivos csv para lectura y escritura
|
||||
*/
|
||||
/**
|
||||
* Clase de manejo de archivos csv para lectura y escritura
|
||||
*/
|
||||
class Colv_csv
|
||||
{
|
||||
public:
|
||||
//*************************************************************************************
|
||||
//Variables
|
||||
HANDLE file;
|
||||
DWORD nb;
|
||||
//*************************************************************************************
|
||||
//Funciones
|
||||
Colv_csv(void);
|
||||
~Colv_csv(void);
|
||||
BOOL inicia(char *nom_file);
|
||||
void cierra();
|
||||
BOOL escribe(char *fila);
|
||||
BOOL lee(char *file_name);
|
||||
};
|
||||
#endif
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
#ifndef OLV_EXPORT
|
||||
#ifdef _WINDLL
|
||||
#define OLV_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define OLV_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _WINDLL
|
||||
#define WIN_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define WIN_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,181 @@
|
|||
#pragma once
|
||||
#ifdef OLIVIA_COMPILA
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
#include "mapmatrix.h"
|
||||
#include <map>
|
||||
|
||||
#ifndef EXT_ARCH_DIJ_DEFAULT
|
||||
#define EXT_ARCH_DIJ_DEFAULT "ndj"
|
||||
#define NOMB_ARCH_DIJ_DEF "snodos_dj"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file olv_geom.h
|
||||
* Archivo de declaraciones de clase de varias utilidades geométricas del programa Olivia.
|
||||
*/
|
||||
#define OLV_PI 4.0*atan(1.0)
|
||||
//**************************************************************************************************************************
|
||||
/**
|
||||
* Estructura de nodo para el cálculo de caminos óptimos por Dijkstra
|
||||
*/
|
||||
struct Djkt_nodo_0
|
||||
{
|
||||
int id_padre; //<Indice al nodo padre, o nodo hijo en el cálculo del dijsktra invertido
|
||||
float dis; //<Distancia
|
||||
BOOL visto; //<Indica si se ha pasado ya por el nodo
|
||||
};
|
||||
|
||||
/**
|
||||
* Estructura de elemento de la cola para el cálculo de caminos óptimos por Dijkstra
|
||||
*/
|
||||
struct Djkt_elem_cola
|
||||
{
|
||||
int id; //<Id de elemento
|
||||
int id_inci; //<Id del elemento desde el que se ha llegado a id
|
||||
Djkt_elem_cola *sig; //<Puntero al siguiente elemento
|
||||
};
|
||||
struct Djkt_nodo;
|
||||
/**
|
||||
* Estructura de cola con prioridad para el cálculo de caminos óptimos por Dijkstra
|
||||
*/
|
||||
struct Djkt_cola
|
||||
{
|
||||
int nn;
|
||||
Djkt_nodo *nodos; //<Puntero a matriz de nodos
|
||||
Djkt_elem_cola *elem; //<Puntero a elementos almacenados
|
||||
//Funciones
|
||||
void inicia(Djkt_nodo *n);
|
||||
BOOL pon(int i);
|
||||
BOOL pon(int i,int i_inci);
|
||||
int dame();
|
||||
int dame(int *id_inci);
|
||||
};
|
||||
/*
|
||||
* Estructura de ángulos entre conjunciones adyacentes para añadir al Dijkstra el ángulo de giro
|
||||
*/
|
||||
typedef struct Djkt_ids_pdr
|
||||
{
|
||||
int id; //id padre al que tienes que ir
|
||||
float dis; //distancia que vas a recorrer
|
||||
}Djkt_ids_pdr;
|
||||
struct HeadCostAng;
|
||||
/*
|
||||
* Estructura de ángulos entre conjunciones adyacentes para añadir al Dijkstra el ángulo de giro
|
||||
*/
|
||||
typedef struct Djkt_ang_ady
|
||||
{
|
||||
int nady;
|
||||
Djkt_ids_pdr *ids_padre;
|
||||
int bas1;
|
||||
int *i_conjs;
|
||||
int bas2;
|
||||
BYTE **angs;
|
||||
int bas3;
|
||||
//*******************************************
|
||||
Djkt_ang_ady();
|
||||
void libera();
|
||||
BOOL inicia(int n, BOOL no_angs=FALSE);
|
||||
BOOL dame_ii_jj(int i, int j, int *ii_,int *jj_);
|
||||
BOOL pon_ang_i_j(int i,int j, BYTE ang);
|
||||
BOOL dame_ang_i_j(int i,int j, BYTE *ang, BOOL inds_abs);
|
||||
BOOL pon_padre(int i_orig,int j_padre, double dis, BOOL inds_abs);
|
||||
BOOL dame_padre(int i_orig,int *j_padre, double *dis, BOOL inds_abs);
|
||||
BOOL inicia_ids();
|
||||
void libera_ex();
|
||||
BOOL guarda(HeadCostAng hd, int ic, char *path , char *ext);
|
||||
BOOL lee(int ic, char *path , char *ext);
|
||||
}Djkt_ang_ady;
|
||||
//*************************************************************************************
|
||||
struct Djkt_nodo: public Djkt_nodo_0
|
||||
{
|
||||
Djkt_ang_ady ids_ady;
|
||||
//Funciones
|
||||
void inicia();
|
||||
BOOL inicia_ex(Djkt_ang_ady *ang);
|
||||
void libera( );
|
||||
};
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Clase de varias utilidades geométricas del programa Olivia.
|
||||
*/
|
||||
class Colv_geom
|
||||
{
|
||||
public:
|
||||
//*************************************************************************************
|
||||
//Variables
|
||||
|
||||
//*************************************************************************************
|
||||
//Funciones
|
||||
Colv_geom(void);
|
||||
~Colv_geom(void);
|
||||
static double ang_vect(double v1[2], double v2[2]);
|
||||
static BOOL pto_equals(double pt1[3], double pt2[3], BOOL d3 =FALSE);
|
||||
static BOOL haz_paralela(double (*ptos_orig)[3],int np,double dis,double (**ptos_par)[3]);
|
||||
static int dame_ind_per(int i, int iold, int inew);
|
||||
static int dame_n_nucleos();
|
||||
static int fact(int i);
|
||||
|
||||
static BOOL dijkstra_ang_inv_ok(CmapMatFloat &costes, Djkt_ang_ady *angs, int n, int fin, Djkt_nodo **nodos, BYTE **visto_ang_);
|
||||
static double ruta_dj_inv(int id_ini, int *secu, Djkt_nodo *nodos, int nmax, int *n);
|
||||
static double ruta_dj_inv_ok(int id_ini, int *secu, Djkt_nodo *nodos, int nmax, int *n);
|
||||
};
|
||||
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Clase de manejo de archivos de nodos djtra
|
||||
* cada archivo tiene un numero de bloques o array de nodos de longitud fija "nnod"
|
||||
*/
|
||||
//estructura cabecera de archivo
|
||||
typedef struct Head_dj_arch
|
||||
{
|
||||
int version; //version del archivo
|
||||
int nn; //numero de nodos por bloque
|
||||
int nb; //numero de bloques del dj
|
||||
int max_conex; //maximo de conexiones por nodo
|
||||
|
||||
}Head_dj_arch;
|
||||
#define VERSION_DJ_ARCHI 100
|
||||
#define MAX_CONEX_DJ_ARCHI 16
|
||||
struct Info_aso2;
|
||||
class Cdijkstra_arch
|
||||
{
|
||||
public:
|
||||
char path[MAX_PATH];//nombre sin extension
|
||||
Head_dj_arch hd;//cabecera de archivo
|
||||
int sizn;//tamaño en BYTES de cada nodo
|
||||
BOOL salta_ids_padres;
|
||||
//int flags;//0x1-->modo escritura 0x2-->modo lectura
|
||||
//info de distancias ambitos
|
||||
float *dis;//distancia de un nodo a otro (matriz de nnod*nnod)
|
||||
int nod_amb;//nodos por ambito
|
||||
int nambi;//numero de ambitos
|
||||
int nnod;//numero de nodos por fila
|
||||
int id_instal;//fila planta
|
||||
int id_plan;//fila instal
|
||||
int nod_instal;//nodo instalacion
|
||||
int nod_plan;//nodo planta
|
||||
int tip_ambitos;
|
||||
|
||||
std::map<int,Info_aso2> *ia;//puntero a info asoc
|
||||
|
||||
//funciones--------------------------------------------------------------------------
|
||||
Cdijkstra_arch();
|
||||
~Cdijkstra_arch();
|
||||
|
||||
BOOL inicia(char* path_arch, BOOL nuevo=FALSE, int n_nod=0, int max_conex=MAX_CONEX_DJ_ARCHI);//si nuevo -> crea vacio
|
||||
BOOL add_b(Djkt_nodo* blq, int iref, int inod, BOOL pon_inf=FALSE);//añade un bloque a el archivo
|
||||
BOOL inicia_inf_amb(std::map<int,Info_aso2>* ina, int namb,int tip_amb, int id_instal=-1, int id_plan=-1);
|
||||
void pon_info_amb(Djkt_nodo* nodos, int iref,int ib);
|
||||
Djkt_nodo* get_b(int iref, int ibloq, Djkt_nodo* buf=NULL);//develve el bloque ibloq-esimo
|
||||
float dame_dis(int aorig,int norig, int ades, int n_des);
|
||||
|
||||
Djkt_nodo* dame_buf_nodos(BOOL angulos=FALSE );
|
||||
void libera_buf(Djkt_nodo* buf );
|
||||
BOOL lee_dis();
|
||||
BOOL graba_dis(int id);
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,847 @@
|
|||
#include "stdafx.h"
|
||||
#ifdef OLIVIA_COMPILA
|
||||
#include "olv_limp.h"
|
||||
#include "olv.h"
|
||||
#include "olv_limp_thr.h"
|
||||
#include "olv_geom.h"
|
||||
#include "math.h"
|
||||
#include "ini_file.h"
|
||||
#include "olv_tasks.h"
|
||||
#include "sock_sv.h"
|
||||
|
||||
/**
|
||||
* @file olv_limp.cpp
|
||||
* Archivo de implementaciones de la utilidad de limpieza viaria del programa Olivia.
|
||||
*/
|
||||
//*******************************************************************************************************************************************
|
||||
Colv_limp::Colv_limp(COlivia *olv)
|
||||
{
|
||||
nod_plant=-1;
|
||||
this->olv = olv;
|
||||
res_circ=OLV_RES_NO;
|
||||
npts_ctrl = 3;
|
||||
uds_tto = OliviaDef::GeneralDef::OlvTipTtoNoDef;
|
||||
v_despl = 5;
|
||||
t_tto = 5*60;
|
||||
t_carg = 60*30;
|
||||
t_conv = 3600*8;
|
||||
t_desc = 60*40;
|
||||
t_despl = 60*25/2;
|
||||
t_sal=0;
|
||||
nsec=4;
|
||||
ancho_via = 2; //m
|
||||
memset(coor_instal,0,3*sizeof(double));
|
||||
thr_limp = new Colv_limp_thr(this);
|
||||
//cost_amb=NULL;
|
||||
n_nw=n_amb=0;
|
||||
pp=-1;
|
||||
tipo_ambit=-1;
|
||||
inww_amb=NULL;
|
||||
memset(&conjs,0,sizeof(Info_conjs));
|
||||
cost_conj.clear();
|
||||
sec=NULL;
|
||||
amb_sec=NULL;
|
||||
rellena_campos();
|
||||
margen_sect=0.04;
|
||||
plan=NULL;
|
||||
calc_nsec=0;
|
||||
ang_conj=NULL;
|
||||
tip_conj.clear();
|
||||
ang_lim=OLV_LIMP_GIRO_VEHIC*OLV_PI/180;
|
||||
ord_sec=NULL;
|
||||
nod_instal=-1;
|
||||
ord_sec_plan=NULL;
|
||||
t_ini=7*3600; //7 de la mañana
|
||||
igno_ais=FALSE;
|
||||
lateral=0;
|
||||
nsec_act=0;
|
||||
olv_tasks = new Colv_tasks(olv);
|
||||
soc=NULL;
|
||||
tipo_shp_viaj=OLV_SHPRUTINST;//OLV_SHPRUT_SHPINST
|
||||
nomb_tto[0]=0;
|
||||
barr_mix=FALSE;
|
||||
}
|
||||
//*******************************************************************************************************************************************
|
||||
Colv_limp::~Colv_limp(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
cancela();
|
||||
delete(thr_limp);
|
||||
|
||||
if(inww_amb)
|
||||
{
|
||||
for(i=0;i<n_amb*tipo_ambit;i++)
|
||||
{
|
||||
if(inww_amb[i].inw_old)
|
||||
free(inww_amb[i].inw_old);
|
||||
}
|
||||
free(inww_amb);
|
||||
}
|
||||
inww_amb=NULL;
|
||||
|
||||
if(conjs.coor)
|
||||
free(conjs.coor);
|
||||
conjs.coor=NULL;
|
||||
if(conjs.inc)
|
||||
free(conjs.inc);
|
||||
conjs.inc=NULL;
|
||||
|
||||
cost_amb.clear();
|
||||
|
||||
|
||||
if(plan)
|
||||
{
|
||||
int j;
|
||||
for(i=0;i<nsec;i++)
|
||||
{
|
||||
if(plan[i].nelem)
|
||||
{
|
||||
if(plan[i].elem)
|
||||
free(plan[i].elem);
|
||||
if(plan[i].pts_ctrl)
|
||||
free(plan[i].pts_ctrl);
|
||||
}
|
||||
for(j=0;j<plan[i].ninsta;j++)
|
||||
{
|
||||
if(plan[i].planif_insta[j].nelem)
|
||||
{
|
||||
if(plan[i].planif_insta[j].elem)
|
||||
free(plan[i].planif_insta[j].elem);
|
||||
if(plan[i].planif_insta[j].pts_ctrl)
|
||||
free(plan[i].planif_insta[j].pts_ctrl);
|
||||
}
|
||||
}
|
||||
if(plan[i].planif_insta)
|
||||
free(plan[i].planif_insta);
|
||||
}
|
||||
free(plan);
|
||||
}
|
||||
|
||||
|
||||
if(ang_conj)
|
||||
{
|
||||
for(i=0;i<conjs.n;i++)
|
||||
{
|
||||
ang_conj[i].libera();
|
||||
}
|
||||
free(ang_conj);
|
||||
ang_conj=NULL;
|
||||
}
|
||||
if(ord_sec)
|
||||
{
|
||||
for(i=0;i<n_amb;i++)
|
||||
{
|
||||
if(ord_sec[i].ctnod[1] && (ord_sec[i].ctnod[1]!=ord_sec[i].ctnod[0]))
|
||||
{
|
||||
ord_sec[i].libera(1,conjs.n);
|
||||
free(ord_sec[i].ctnod[1]);
|
||||
ord_sec[i].ctnod[1]=NULL;
|
||||
}
|
||||
|
||||
if(ord_sec[i].ctnod[0])
|
||||
{
|
||||
ord_sec[i].libera(0,conjs.n);
|
||||
free(ord_sec[i].ctnod[0]);
|
||||
}
|
||||
ord_sec[i].ctnod[0]=NULL;
|
||||
}
|
||||
free(ord_sec);
|
||||
ord_sec=NULL;
|
||||
}
|
||||
|
||||
if(ord_sec_plan)
|
||||
{
|
||||
for(int i=0;i<1;i++)//solo libera la primera parte
|
||||
{
|
||||
if(ord_sec_plan[i].ctnod[0])
|
||||
{
|
||||
ord_sec_plan[i].libera(0,conjs.n);
|
||||
free(ord_sec_plan[i].ctnod[0]);
|
||||
}
|
||||
ord_sec_plan[i].ctnod[0]=NULL;
|
||||
}
|
||||
free(ord_sec_plan);
|
||||
ord_sec_plan=NULL;
|
||||
}
|
||||
if(olv_tasks)
|
||||
delete olv_tasks;
|
||||
if(soc)
|
||||
{
|
||||
soc->close();
|
||||
delete soc;
|
||||
soc=NULL;
|
||||
}
|
||||
|
||||
for (std::map<int,Info_aso2>::iterator it=iaso.begin(); it!=iaso.end(); ++it)
|
||||
{
|
||||
it->second.del();
|
||||
}
|
||||
|
||||
libera_memo_secto();
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Libera la memoria de las matrices de sectorización
|
||||
*/
|
||||
void Colv_limp::libera_memo_secto()
|
||||
{
|
||||
if(sec)
|
||||
{
|
||||
for(int i=0;i<nsec_orig;i++)
|
||||
{
|
||||
if(sec[i].cost_amb_sec)
|
||||
free(sec[i].cost_amb_sec);
|
||||
if(sec[i].cost_amb_sec_aux)
|
||||
free(sec[i].cost_amb_sec_aux);
|
||||
if(sec[i].iamb)
|
||||
free(sec[i].iamb);
|
||||
}
|
||||
free(sec);
|
||||
sec=NULL;
|
||||
}
|
||||
|
||||
if(amb_sec)
|
||||
free(amb_sec);
|
||||
amb_sec=NULL;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Inicia las tareas de la utilidad de limpieza viaria
|
||||
*/
|
||||
BOOL Colv_limp::inicia()
|
||||
{
|
||||
//arranca el thread
|
||||
thr_limp->inicia_th();
|
||||
//empieza importando
|
||||
thr_limp->encola(thr_limp->OLV_LIMP_EV_ABRE_DAT,NULL,FALSE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Pone las opciones de configuración de lo que recibe por el socket
|
||||
*/
|
||||
int Colv_limp::pon_config(char *config_)
|
||||
{
|
||||
int j;
|
||||
char *token;
|
||||
const int SZCONF = 8192;
|
||||
char config[SZCONF];
|
||||
|
||||
if(!config)
|
||||
return 0;
|
||||
|
||||
memset(config,0,SZCONF);
|
||||
strcpy_s(config,SZCONF,config_);
|
||||
|
||||
//los parámetros son:
|
||||
token = strtok(config, OliviaDef::GeneralDef::EjecGeoParamSep);
|
||||
//avanza al siguiente token, el primero indica "\CONFIGURACION"
|
||||
token = strtok(NULL, OliviaDef::GeneralDef::EjecGeoParamSep);
|
||||
|
||||
//Lee parámetros
|
||||
j=0;
|
||||
while (token != NULL)
|
||||
{
|
||||
if(strstr(token,OliviaDef::GeneralDef::GL_tto))
|
||||
{
|
||||
if(!olv->dame_param(token, &t_tto))
|
||||
break;
|
||||
if(t_tto==0)
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GL_res))
|
||||
{
|
||||
if(!olv->dame_param(token, &res_circ))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GL_uto))
|
||||
{
|
||||
if(!olv->dame_param(token, &uds_tto))
|
||||
break;
|
||||
if(uds_tto==OliviaDef::GeneralDef::OlvTipTtoMin)
|
||||
{
|
||||
tipo_ambit=OLV_AMB_PUN;
|
||||
t_tto=t_tto*60;//porque viene en minutos
|
||||
}
|
||||
else if(uds_tto>OliviaDef::GeneralDef::OlvTipTtoMin)
|
||||
tipo_ambit=OLV_AMB_LIN;
|
||||
else
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GL_vdp))
|
||||
{
|
||||
if(!olv->dame_param(token, &v_despl))
|
||||
break;
|
||||
if(v_despl<0)
|
||||
break;
|
||||
v_despl=v_despl*OLV_KMH2MS;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GL_tdp))
|
||||
{
|
||||
if(!olv->dame_param(token, &t_despl))
|
||||
break;
|
||||
t_despl=t_despl*60/2;//porque viene en minutos
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GL_tca))
|
||||
{
|
||||
if(!olv->dame_param(token, &t_carg))
|
||||
break;
|
||||
t_carg=t_carg*60;//porque viene en minutos
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GL_anc))
|
||||
{
|
||||
if(!olv->dame_param(token, &ancho_via))
|
||||
break;
|
||||
if(ancho_via<0)
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_tco))
|
||||
{
|
||||
if(!olv->dame_param(token, &t_conv))
|
||||
break;
|
||||
t_conv=t_conv*60;//porque viene en minutos
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_tdc))
|
||||
{
|
||||
if(!olv->dame_param(token, &t_desc))
|
||||
break;
|
||||
t_desc=t_desc*60;//porque viene en minutos
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_npt))
|
||||
{
|
||||
if(!olv->dame_param(token, &npts_ctrl))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_sec))
|
||||
{
|
||||
if(!olv->dame_param(token, &nsec))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_coox))
|
||||
{
|
||||
if(!olv->dame_param(token, &coor_instal[0]))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_cooy))
|
||||
{
|
||||
if(!olv->dame_param(token, &coor_instal[1]))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_hini))
|
||||
{
|
||||
if(!olv->dame_param(token, &t_ini))
|
||||
break;
|
||||
t_ini=t_ini*60;//porque viene en minutos
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_trafic))
|
||||
{
|
||||
if(!olv->dame_param(token, &f_trafic))
|
||||
break;
|
||||
f_trafic=f_trafic/100;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_ais))
|
||||
{
|
||||
if(!olv->dame_param(token, (int*)&igno_ais))
|
||||
break;
|
||||
}
|
||||
//el nombre del tto
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_strtto))
|
||||
{
|
||||
if(!olv->dame_param(token, nomb_tto, sizeof(nomb_tto)))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_pd))
|
||||
{
|
||||
if(!olv->dame_param(token, olv->paths.path_data, sizeof(olv->paths.path_data)))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GG_pn))
|
||||
{
|
||||
if(!olv->dame_param(token, olv->paths.path_nw, sizeof(olv->paths.path_nw)))
|
||||
break;
|
||||
}
|
||||
//los campos a leer de la dbf
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GAA_obser))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.campo_obs, sizeof(camps.campo_obs)))
|
||||
break;
|
||||
if(strlen(camps.campo_obs)>OLV_MAX_COL_SHP)//10 porque el shp solo pasa con 10 caracteres en los nombres de columna
|
||||
camps.campo_obs[OLV_MAX_COL_SHP]=0;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GAA_anch_tip))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.campo_anch, sizeof(camps.campo_anch)))
|
||||
break;
|
||||
if(strlen(camps.campo_anch)>OLV_MAX_COL_SHP)//10 porque el shp solo pasa con 10 caracteres en los nombres de columna
|
||||
camps.campo_anch[OLV_MAX_COL_SHP]=0;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GAA_tipolo))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.campo_tipo_ap, sizeof(camps.campo_tipo_ap)))
|
||||
break;
|
||||
if(strlen(camps.campo_tipo_ap)>OLV_MAX_COL_SHP)//10 porque el shp solo pasa con 10 caracteres en los nombres de columna
|
||||
camps.campo_tipo_ap[OLV_MAX_COL_SHP]=0;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GAA_entid))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.campo_tipo_ent, sizeof(camps.campo_tipo_ent)))
|
||||
break;
|
||||
if(strlen(camps.campo_tipo_ent)>OLV_MAX_COL_SHP)//10 porque el shp solo pasa con 10 caracteres en los nombres de columna
|
||||
camps.campo_tipo_ent[OLV_MAX_COL_SHP]=0;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GAL_aparc))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_AP], sizeof(camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_AP])))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GAL_bord))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_BORD], sizeof(camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_BORD])))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GAL_acera))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_ACERA], sizeof(camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_ACERA])))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GAL_peat))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_PEAT], sizeof(camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_PEAT])))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GAL_ap_lin))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.atr_tip_apa[OLV_ATR_TIP_AP_LIN], sizeof(camps.atr_tip_apa[OLV_ATR_TIP_AP_LIN])))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GAL_ap_bat))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.atr_tip_apa[OLV_ATR_TIP_AP_BAT], sizeof(camps.atr_tip_apa[OLV_ATR_TIP_AP_BAT])))
|
||||
break;
|
||||
}
|
||||
//los campos a leer de la dbf de la red navegable
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GTC_onew))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.campo_circ, sizeof(camps.campo_circ)))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GTC_kph))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.campo_velo, sizeof(camps.campo_velo)))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GTC_fow))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.campo_fow, sizeof(camps.campo_fow)))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GTC_name))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.campo_name, sizeof(camps.campo_name)))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GTA_TF))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.atr_circ[OLV_ATR_CIRC_TF], sizeof(camps.atr_circ[OLV_ATR_CIRC_TF])))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GTA_FT))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.atr_circ[OLV_ATR_CIRC_FT], sizeof(camps.atr_circ[OLV_ATR_CIRC_FT])))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GTA_N))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.atr_circ[OLV_ATR_CIRC_NONE], sizeof(camps.atr_circ[OLV_ATR_CIRC_NONE])))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GTA_pedes))
|
||||
{
|
||||
if(!olv->dame_param(token, camps.atr_circ[OLV_ATR_CIRC_PEDES], sizeof(camps.atr_circ[OLV_ATR_CIRC_PEDES])))
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
token = strtok(NULL, OliviaDef::GeneralDef::EjecGeoParamSep);
|
||||
continue;
|
||||
}
|
||||
token = strtok(NULL, OliviaDef::GeneralDef::EjecGeoParamSep);
|
||||
j++;
|
||||
}
|
||||
|
||||
strcpy_s(olv->paths.path_res_rut,MAX_PATH,olv->paths.path_data);
|
||||
strcpy_s(olv->paths.path_res_pt,MAX_PATH,olv->paths.path_data);
|
||||
|
||||
return j;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Termina las tareas
|
||||
*/
|
||||
void Colv_limp::cancela()
|
||||
{
|
||||
thr_limp->termina_th();
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Lee el ini y rellena los campos que lee, o bien por defecto
|
||||
*/
|
||||
BOOL Colv_limp::rellena_campos_ini(char *path)
|
||||
{
|
||||
Cini_file ini;
|
||||
int ig;
|
||||
CString param;
|
||||
|
||||
if(!ini.lee(path))
|
||||
return FALSE;
|
||||
|
||||
param=OliviaDef::GeneralDef::GrupoCampoLimp;
|
||||
ig=ini.get_grupo(param.GetBuffer(param.GetLength()));
|
||||
if(ig>=0)
|
||||
{
|
||||
//leer campos del ini
|
||||
param=OliviaDef::GeneralDef::GAA_obser;
|
||||
strcpy_s(camps.campo_obs,OLV_LIMP_MAX_CAMP,ini.get(ig,param.GetBuffer(param.GetLength()),camps.campo_obs));
|
||||
camps.campo_obs[10]=0;
|
||||
|
||||
param=OliviaDef::GeneralDef::GAA_anch_tip;
|
||||
strcpy_s(camps.campo_anch,OLV_LIMP_MAX_CAMP,ini.get(ig,param.GetBuffer(param.GetLength()),camps.campo_anch));
|
||||
camps.campo_anch[10]=0;
|
||||
|
||||
param=OliviaDef::GeneralDef::GAA_tipolo;
|
||||
strcpy_s(camps.campo_tipo_ap,OLV_LIMP_MAX_CAMP,ini.get(ig,param.GetBuffer(param.GetLength()),camps.campo_tipo_ap));
|
||||
camps.campo_tipo_ap[10]=0;
|
||||
|
||||
param=OliviaDef::GeneralDef::GAA_entid;
|
||||
strcpy_s(camps.campo_tipo_ent,OLV_LIMP_MAX_CAMP,ini.get(ig,param.GetBuffer(param.GetLength()),camps.campo_tipo_ent));
|
||||
camps.campo_tipo_ent[10]=0;
|
||||
}
|
||||
param=OliviaDef::GeneralDef::GrupoAtribLimp;
|
||||
ig=ini.get_grupo(param.GetBuffer(param.GetLength()));
|
||||
if(ig>=0)
|
||||
{
|
||||
|
||||
param=OliviaDef::GeneralDef::GAL_aparc;
|
||||
strcpy_s(camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_AP],OLV_LIMP_MAX_CAMP,ini.get(ig,param.GetBuffer(param.GetLength()),camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_AP]));
|
||||
|
||||
param=OliviaDef::GeneralDef::GAL_bord;
|
||||
strcpy_s(camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_BORD],OLV_LIMP_MAX_CAMP,ini.get(ig,param.GetBuffer(param.GetLength()),camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_BORD]));
|
||||
|
||||
param=OliviaDef::GeneralDef::GAL_peat;
|
||||
strcpy_s(camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_PEAT],OLV_LIMP_MAX_CAMP,ini.get(ig,param.GetBuffer(param.GetLength()),camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_PEAT]));
|
||||
|
||||
param=OliviaDef::GeneralDef::GAL_acera;
|
||||
strcpy_s(camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_ACERA],OLV_LIMP_MAX_CAMP,ini.get(ig,param.GetBuffer(param.GetLength()),camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_ACERA]));
|
||||
|
||||
param=OliviaDef::GeneralDef::GAL_ap_lin;
|
||||
strcpy_s(camps.atr_tip_apa[OLV_ATR_TIP_AP_LIN],OLV_LIMP_MAX_CAMP,ini.get(ig,param.GetBuffer(param.GetLength()),camps.atr_tip_apa[OLV_ATR_TIP_AP_LIN]));
|
||||
|
||||
param=OliviaDef::GeneralDef::GAL_ap_bat;
|
||||
strcpy_s(camps.atr_tip_apa[OLV_ATR_TIP_AP_BAT],OLV_LIMP_MAX_CAMP,ini.get(ig,param.GetBuffer(param.GetLength()),camps.atr_tip_apa[OLV_ATR_TIP_AP_BAT]));
|
||||
}
|
||||
//////////////////////////////////////////////////////
|
||||
param=OliviaDef::GeneralDef::GrupoCampoOtros;
|
||||
ig=ini.get_grupo(param.GetBuffer(param.GetLength()));
|
||||
if(ig>=0)
|
||||
{
|
||||
double ang;
|
||||
param=OliviaDef::GeneralDef::GTO_girmax;
|
||||
ang=ini.get(ig,param.GetBuffer(param.GetLength()),OLV_LIMP_GIRO_VEHIC);
|
||||
ang_lim = ang*OLV_PI/180;
|
||||
|
||||
param=OliviaDef::GeneralDef::GTO_anch_peat;
|
||||
anchos_def[OLV_ANCH_DEF_PEAT]=ini.get(ig,param.GetBuffer(param.GetLength()),anchos_def[OLV_ANCH_DEF_PEAT]);
|
||||
|
||||
param=OliviaDef::GeneralDef::GTO_anch_ace;
|
||||
anchos_def[OLV_ANCH_DEF_ACE]=ini.get(ig,param.GetBuffer(param.GetLength()),anchos_def[OLV_ANCH_DEF_ACE]);
|
||||
|
||||
param=OliviaDef::GeneralDef::GTO_anch_aplin;
|
||||
anchos_def[OLV_ANCH_DEF_APLIN]=ini.get(ig,param.GetBuffer(param.GetLength()),anchos_def[OLV_ANCH_DEF_APLIN]);
|
||||
|
||||
param=OliviaDef::GeneralDef::GTO_anch_apbat;
|
||||
anchos_def[OLV_ANCH_DEF_APBAT]=ini.get(ig,param.GetBuffer(param.GetLength()),anchos_def[OLV_ANCH_DEF_APBAT]);
|
||||
|
||||
param=OliviaDef::GeneralDef::GTO_anch_bordlib;
|
||||
anchos_def[OLV_ANCH_DEF_BORD]=ini.get(ig,param.GetBuffer(param.GetLength()),anchos_def[OLV_ANCH_DEF_BORD]);
|
||||
|
||||
param=OliviaDef::GeneralDef::GTO_desv_max;
|
||||
DESV_MAX=ini.get(ig,param.GetBuffer(param.GetLength()),OLV_DESV_MAX);
|
||||
|
||||
param=OliviaDef::GeneralDef::GTO_desv_max_abs;
|
||||
DESV_MAX_ABS=ini.get(ig,param.GetBuffer(param.GetLength()),OLV_DESV_MAX_ABS);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Actualiza el ini
|
||||
*/
|
||||
BOOL Colv_limp::guarda_campos_ini(char *path)
|
||||
{
|
||||
Cini_file ini;
|
||||
int ig;
|
||||
|
||||
ig =ini.add_grupo(OLV_LIMP_GRUPO_DBF);
|
||||
if(ig<0)
|
||||
return FALSE;
|
||||
|
||||
ini.add(ig,OLV_LIMP_PARAM_OBS,camps.campo_obs);
|
||||
ini.add(ig,OLV_LIMP_PARAM_ANCHO,camps.campo_anch);
|
||||
ini.add(ig,OLV_LIMP_PARAM_TIPO_AP,camps.campo_tipo_ap);
|
||||
ini.add(ig,OLV_LIMP_PARAM_TIPO_ENT,camps.campo_tipo_ent);
|
||||
|
||||
ini.add(ig,OLV_LIMP_PARAM_TIPO_ENT_APARCA,camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_AP]);
|
||||
ini.add(ig,OLV_LIMP_PARAM_TIPO_ENT_BORD,camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_BORD]);
|
||||
ini.add(ig,OLV_LIMP_PARAM_TIPO_ENT_PEATO,camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_PEAT]);
|
||||
ini.add(ig,OLV_LIMP_PARAM_TIPO_ENT_ACERA,camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_ACERA]);
|
||||
|
||||
ini.add(ig,OLV_LIMP_PARAM_TIPO_AP_LIN,camps.atr_tip_apa[OLV_ATR_TIP_AP_LIN]);
|
||||
ini.add(ig,OLV_LIMP_PARAM_TIPO_AP_BAT,camps.atr_tip_apa[OLV_ATR_TIP_AP_BAT]);
|
||||
|
||||
ig =ini.add_grupo(OLV_LIMP_GRUPO_OTROS);
|
||||
if(ig<0)
|
||||
return FALSE;
|
||||
ini.add(ig,OLV_LIMP_PARAM_GIRO_VEHIC,OLV_LIMP_GIRO_VEHIC);
|
||||
ini.add(ig,OLV_LIMP_PARAM_ANCH_DEF_PEAT,anchos_def[OLV_ANCH_DEF_PEAT]);
|
||||
ini.add(ig,OLV_LIMP_PARAM_ANCH_DEF_ACE,anchos_def[OLV_ANCH_DEF_ACE]);
|
||||
ini.add(ig,OLV_LIMP_PARAM_ANCH_DEF_APLIN,anchos_def[OLV_ANCH_DEF_APLIN]);
|
||||
ini.add(ig,OLV_LIMP_PARAM_ANCH_DEF_APBAT,anchos_def[OLV_ANCH_DEF_APBAT]);
|
||||
ini.add(ig,OLV_LIMP_PARAM_ANCH_DEF_BORD,anchos_def[OLV_ANCH_DEF_BORD]);
|
||||
|
||||
ini.add(ig,OLV_LIMP_PARAM_DESV_MAX,DESV_MAX);
|
||||
ini.add(ig,OLV_LIMP_PARAM_DESV_MAX_ABS,DESV_MAX_ABS);
|
||||
|
||||
if(!ini.guarda(path))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Rellena los nombres de los campos de la dbf
|
||||
*/
|
||||
void Colv_limp::rellena_campos()
|
||||
{
|
||||
//TOM TOM
|
||||
sprintf_s(camps.campo_circ,OLV_LIMP_MAX_CAMP,"ONEWAY");
|
||||
sprintf_s(camps.campo_velo,OLV_LIMP_MAX_CAMP,"KPH");
|
||||
sprintf_s(camps.campo_fow,OLV_LIMP_MAX_CAMP,"FOW");
|
||||
sprintf_s(camps.campo_name,OLV_LIMP_MAX_CAMP,"NAME");
|
||||
|
||||
//VSM
|
||||
sprintf_s(camps.campo_obs,OLV_LIMP_MAX_CAMP,"OBSERVACIO");
|
||||
sprintf_s(camps.campo_anch,OLV_LIMP_MAX_CAMP,"ANCHO_TIPO");
|
||||
sprintf_s(camps.campo_tipo_ap,OLV_LIMP_MAX_CAMP,"TIPOLOGIA");
|
||||
sprintf_s(camps.campo_tipo_ent,OLV_LIMP_MAX_CAMP,"NOM_TIPO_E");
|
||||
|
||||
//IGT
|
||||
sprintf_s(camps.campo_secto,OLV_LIMP_MAX_CAMP,OliviaDef::GeneralDef::NombColSector);
|
||||
|
||||
///////rellena los atributos
|
||||
//TOMTOM
|
||||
sprintf_s(camps.atr_circ[OLV_ATR_CIRC_TF],OLV_LIMP_MAX_CAMP,"TF");
|
||||
sprintf_s(camps.atr_circ[OLV_ATR_CIRC_FT],OLV_LIMP_MAX_CAMP,"FT");
|
||||
sprintf_s(camps.atr_circ[OLV_ATR_CIRC_NONE],OLV_LIMP_MAX_CAMP,"N");
|
||||
sprintf_s(camps.atr_circ[OLV_ATR_CIRC_PEDES],OLV_LIMP_MAX_CAMP,"14");
|
||||
//VSM
|
||||
sprintf_s(camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_AP],OLV_LIMP_MAX_CAMP,"Banda_Aparcamiento");
|
||||
sprintf_s(camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_BORD],"Bordillo_Libre");
|
||||
sprintf_s(camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_PEAT],OLV_LIMP_MAX_CAMP,"Peatonales");
|
||||
sprintf_s(camps.atr_tip_ent[OLV_ATR_NOM_TIP_ENT_ACERA],OLV_LIMP_MAX_CAMP,"Acera");
|
||||
//
|
||||
sprintf_s(camps.atr_tip_apa[OLV_ATR_TIP_AP_LIN],OLV_LIMP_MAX_CAMP,"Linea");
|
||||
sprintf_s(camps.atr_tip_apa[OLV_ATR_TIP_AP_BAT],OLV_LIMP_MAX_CAMP,"Bateria");
|
||||
|
||||
///////rellena los valores de anchos por defecto
|
||||
anchos_def[OLV_ANCH_DEF_PEAT]=6;
|
||||
anchos_def[OLV_ANCH_DEF_ACE]=1.5;
|
||||
anchos_def[OLV_ANCH_DEF_APLIN]=2;
|
||||
anchos_def[OLV_ANCH_DEF_APBAT]=4;
|
||||
anchos_def[OLV_ANCH_DEF_BORD]=1.5;
|
||||
//rellena datos de desviación
|
||||
DESV_MAX=OLV_DESV_MAX;
|
||||
DESV_MAX_ABS=OLV_DESV_MAX_ABS;
|
||||
|
||||
if(olv->paths.path_cfg_geo[0])
|
||||
{
|
||||
rellena_campos_ini(olv->paths.path_cfg_geo);
|
||||
}
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Prueba debug
|
||||
*/
|
||||
void Colv_limp::prueba()
|
||||
{
|
||||
Param_olv_limp_thr par;
|
||||
pp++;
|
||||
par.id_e=-1;
|
||||
|
||||
int i =thr_limp->OLV_LIMP_EV_UNE_AMB_NW;
|
||||
thr_limp->encola(i,&par,FALSE);
|
||||
i ++;
|
||||
thr_limp->encola(i,&par,FALSE);
|
||||
i ++;
|
||||
thr_limp->encola(i,&par,FALSE);
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Devuelve el coste de recorrer un segmento en función de si es ámbito, segmento o carretera
|
||||
*/
|
||||
double Colv_limp::dame_ancho(char *observ, char *tipo)
|
||||
{
|
||||
double aux, ancho,aux2;
|
||||
char *token;
|
||||
int i,ii,ff;
|
||||
|
||||
ancho=0;
|
||||
aux=aux2=0;
|
||||
//El formato de observaciones tiene la forma "n metros", y el ancho es 'n'.
|
||||
//Si no lo encontrara, tiene que ver el "ancho tipo"
|
||||
if(strlen(observ)>0)
|
||||
{
|
||||
//busca los números
|
||||
ii=-1;
|
||||
for(i=0;i<(int)strlen(observ);i++)
|
||||
{
|
||||
if((observ[i]>='1') && (observ[i]<='9'))
|
||||
{
|
||||
if(ii<0)
|
||||
ii=i;
|
||||
ff=i;
|
||||
}
|
||||
}
|
||||
if(ii>=0)
|
||||
{
|
||||
if(ff<((int)strlen(observ)-1))//delimita el número, donde acaba pone un null
|
||||
observ[ff+1]=0;
|
||||
aux = atof(&observ[ii]);
|
||||
}
|
||||
if(aux>0)
|
||||
ancho=aux;
|
||||
}
|
||||
if(aux==0 && (strlen(tipo)>0))//bien porque no había campo observ o porque no se ha conseguido calcular
|
||||
{
|
||||
//se coge el campo de tipo, con el formato de "2-4" o "<2" o ">4"
|
||||
if(token=strstr(tipo,"-"))//El ancho es tipo "2-4"
|
||||
{
|
||||
if((token-1)>0)
|
||||
aux=atof(token-1);
|
||||
if((token+1)>0)
|
||||
aux2=atof(token+1);
|
||||
aux=(aux+aux2)/2;
|
||||
if(aux)
|
||||
ancho=aux;
|
||||
}
|
||||
else if(token=strstr(tipo,"<"))//El ancho es tipo "<2"
|
||||
{
|
||||
if((token+1)>0)
|
||||
aux=atof(token+1);
|
||||
if(aux>1)
|
||||
ancho=aux-1;
|
||||
}
|
||||
else if(token=strstr(tipo,">"))//El ancho es tipo ">4"
|
||||
{
|
||||
if((token+1)>0)
|
||||
aux=atof(token+1);
|
||||
if(aux)
|
||||
ancho=aux+1;
|
||||
}
|
||||
}
|
||||
|
||||
return ancho;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Devuelve el coste de recorrer un segmento en función de si es ámbito, segmento o carretera
|
||||
*/
|
||||
void Colv_limp::dame_cost(double ltot, int ia, float *cost, float *cost2)
|
||||
{
|
||||
double velo;
|
||||
double ancho;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//Calcula el coste en función de si es carretera, segmento o ámbito
|
||||
//Posibilidades:
|
||||
//Se le da el coste al propio ámbito.
|
||||
//Si es ámbito lineal, y t_tto es en km/h, cost=ltot/t_tto, pasando t_tto a m/s
|
||||
//Si es ámbito lineal, y t_tto es km2/h, si ancho_via==0 entonces el ancho es el leído de la dbf
|
||||
//y el coste de ida y de vuelta es cost=ltot*anch/t_tto, donde anch puede ser ancho_via o el de la info asociada
|
||||
//Si es ámbito puntual, el coste es directamente t_tto, pasando t_tto de min a seg
|
||||
//Si es segmento, ambos costes son 0
|
||||
//Si es carretera, la velocidad puede ser definida por la vía o v_despl si no es 0
|
||||
//y el cost=ltot/velo
|
||||
//también hay que mirar si se puede en los dos sentidos o no
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
if(iaso[ia].flgs & OLV_LIMP_FLG_AMB)
|
||||
{
|
||||
//calculamos el coste del ámbito
|
||||
if(tipo_ambit==OLV_AMB_LIN)
|
||||
{
|
||||
if((uds_tto==OliviaDef::GeneralDef::OlvTipTtoMh) || (uds_tto==OliviaDef::GeneralDef::OlvTipTtoMh_eje))
|
||||
ancho=1;
|
||||
else if(uds_tto==OliviaDef::GeneralDef::OlvTipTtoM2h)
|
||||
ancho=iaso[ia].inf_l.ancho;
|
||||
else if(uds_tto==OliviaDef::GeneralDef::OlvTipTtoM2h_eje)
|
||||
ancho=ancho_via;
|
||||
|
||||
*cost2=*cost=(float)(ltot*ancho*3600/t_tto); //en segundos
|
||||
}
|
||||
else if(tipo_ambit==OLV_AMB_PUN)
|
||||
{
|
||||
*cost=*cost2=(float)t_tto; //en segundos
|
||||
}
|
||||
}
|
||||
else if(iaso[ia].flgs & OLV_LIMP_FLG_SEG_AMB)
|
||||
{
|
||||
//coste fijo para los segmentos que unen ambitos, proporcional a su longitud
|
||||
*cost2=*cost=0;//(float)(ltot/(3*OLV_KMH2MS));//OLV_LIMP_COST_SEGM
|
||||
}
|
||||
else if(iaso[ia].flgs & (OLV_LIMP_FLG_SEG_LIN | OLV_LIMP_FLG_SEG_PUN))
|
||||
{
|
||||
//coste fijo para los segmentos
|
||||
*cost2=*cost=(float)(ltot/(3*OLV_KMH2MS));//OLV_LIMP_COST_SEGM
|
||||
}
|
||||
else if(iaso[ia].flgs & OLV_LIMP_FLG_PEAT_REP)
|
||||
{
|
||||
//coste de desplazarse andando por las peatonales, no trabajando
|
||||
if(v_despl==0)
|
||||
velo=OLV_LIMP_VELO_DESP_PEAT*OLV_KMH2MS;
|
||||
else
|
||||
velo=v_despl; //velocidad que se haya configurado
|
||||
*cost2=*cost=float(ltot/velo);
|
||||
}
|
||||
else if(iaso[ia].flgs & OLV_LIMP_FLG_NW)//es carretera
|
||||
{
|
||||
//calculamos el coste de la carretera
|
||||
if(v_despl==0)
|
||||
velo=iaso[ia].inf_n.velo; //velocidad definida por las vías, la que se ha leído del dbf
|
||||
else
|
||||
{
|
||||
velo=v_despl*f_trafic; //velocidad que se haya configurado
|
||||
}
|
||||
//////////////////////////////////////////////////////////
|
||||
/*if(iaso[ia].flgs & OLV_LIMP_FLG_CIRC_NONE)//es pedestrian o prohibido, no se puede circular
|
||||
*cost=*cost2=(float)MAYUSCULO;
|
||||
else*/
|
||||
{
|
||||
*cost=*cost2=(float)(ltot/velo); //en ambos sentidos
|
||||
if(iaso[ia].flgs & OLV_LIMP_FLG_CIRC_FT)
|
||||
*cost2=(float)MAYUSCULO;
|
||||
else if(iaso[ia].flgs & OLV_LIMP_FLG_CIRC_TF)
|
||||
*cost=(float)MAYUSCULO;
|
||||
}
|
||||
}
|
||||
}
|
||||
//*************************************************************************************
|
||||
void Secu_amb::libera(int i, int n)
|
||||
{
|
||||
for(int j=0;j<n;j++)
|
||||
{
|
||||
ctnod[i][j].libera();
|
||||
}
|
||||
}
|
||||
//*************************************************************************************
|
||||
#endif
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
#pragma once
|
||||
#ifdef OLIVIA_COMPILA
|
||||
/**
|
||||
* @file olv_limp.h
|
||||
* Archivo de definiciones y variables de la utilidad de limpieza viaria del programa Olivia.
|
||||
*/
|
||||
#include "olv_limp_def.h"
|
||||
#include "olv_geom.h"
|
||||
#include "mapmatrix.h"
|
||||
#include "CartoBase.h"
|
||||
|
||||
class COlivia;
|
||||
class Colv_limp_thr;
|
||||
class Colv_limp_thr_aux;
|
||||
class Colv_tasks;
|
||||
class Csock_svThread;
|
||||
class Colv_limp_thr;
|
||||
|
||||
struct Secu_amb;
|
||||
struct Djkt_ang_ady;
|
||||
struct Info_conjs;
|
||||
struct Campos_dbf;
|
||||
struct Info_tramos;
|
||||
//////////////////////////////////////////////////
|
||||
/**
|
||||
* Clase de definiciones y variables de la utilidad de limpieza viaria del programa Olivia.
|
||||
*/
|
||||
class Colv_limp
|
||||
{
|
||||
public:
|
||||
//*************************************************************************************
|
||||
//Variables
|
||||
bool socCreado;
|
||||
char nomb_tto[64]; ///<Nombre del tratamiento para escribir en el shp
|
||||
int pp; ///<Entero para pruebas
|
||||
int tipo_ambit; ///<Indica si los ámbitos son lineales o puntuales
|
||||
int n_amb; ///<Número de entidades de ámbitos, la cuenta empieza en 0 porque es la primera capa que se carga
|
||||
int n_nw; ///<Número de entidades de la red navegable, la cuenta empieza en ini_nw porque no es la primera que se carga
|
||||
int uds_tto; ///<Unidades de tratamiento: m/h, m2/h, min
|
||||
int npts_ctrl; ///<Número de puntos de control
|
||||
int nsec; ///<Número de sectores
|
||||
int nsec_act; ///<Número de sectores activos, siempre <= que nsec
|
||||
int nsec_orig; ///<Número de sectores original, se usa por si se corrige el num de sectores porque haya alguno vacío
|
||||
int res_circ; ///<Restricción de circulación
|
||||
int lateral; ///<Lateralidad, 0 o -1 ambos, 1 derecha, 2 izda
|
||||
int tipo_shp_viaj; ///<Indica la forma en que se guardan los viajes según la enum TipoViajes
|
||||
int t_sal; ///<Tiempo de salida/llegada a la instalación, en segundos
|
||||
int nod_instal; ///<Nodos en la red de la instalación
|
||||
int nod_plant; ///<Nodos en la red de la planta donde va a descargar
|
||||
BOOL igno_ais; ///<Indica si ignorar aislados
|
||||
BOOL barr_mix; ///<Indica si es barrido mixto
|
||||
double f_trafic; ///<Factor de reducción de la velocidad en calles por el tráfico en tanto por 1
|
||||
double calc_nsec; ///<Indica si el número de sectores es calculado (almacena el coste del sector) o impuesto (0)
|
||||
double margen_sect; ///<Margen de diferencia entre sectores, en tanto por uno
|
||||
double t_ini; ///<Tiempo inicial en el que comienza la ruta, en segundos, en base 24 h
|
||||
double t_tto; ///<Tiempo de tratamiento, en minutos
|
||||
double v_despl; ///<Velocidad de desplazamiento, en km/h. Si es 0, es determinada por la vía.
|
||||
double t_conv; ///<Tiempo de trabajo por convenio, en segundos
|
||||
double t_desc; ///<Tiempo de descanso de personal, en segundos
|
||||
double t_despl; ///<Tiempo de desplazamiento, en segundos, sólo ida, si es ida y vuelta, x2
|
||||
double t_carg; ///<Tiempo de carga y descarga, en segundos
|
||||
double ancho_via; ///<Ancho medio de la vía
|
||||
double coor_instal[3]; ///<Coordenadas de la instalación
|
||||
double ang_lim; ///<Ángulo límite de giro, en radianes
|
||||
double anchos_def[OLV_ANCH_DEF_N]; ///<Anchos por defecto de las entidades de limpieza, los lee del ini
|
||||
double DESV_MAX; ///<Desviación máxima entre sectores para dejar de igualar sectores, en porcentaje
|
||||
double DESV_MAX_ABS; ///<Desviación máxima para dejar de igualar, en segundos
|
||||
CmapMatInt tip_conj; ///<Matriz de NconjxNconj con 1 si es nw entre conjunciones. La rellena el thread
|
||||
COlivia *olv; ///<Instancia general de la utilidad
|
||||
Colv_limp_thr *thr_limp; ///<Instancia del thread de limpieza, que hace las operaciones
|
||||
Colv_tasks *olv_tasks;
|
||||
Csock_svThread *soc;
|
||||
Matrix2d<float> cost_amb; ///<Matriz de NambxNamb con los costes (seg) entre ámbitos. La rellena el thread
|
||||
Cdijkstra_arch arch_dj; ///<Archivo de nodos dj
|
||||
CmapMatFloat cost_conj; ///<Matriz de NconjxNconj con los costes (seg) entre conjunciones. La rellena el thread
|
||||
Secu_amb *ord_sec_plan; ///<Array con la información de la secuencia y distancias de la planta a los ámbitos
|
||||
Secu_amb *ord_sec; ///<Array de Namb con la información de la secuencia y distancias entre ámbitos
|
||||
Djkt_ang_ady *ang_conj; ///<Matriz de Nconj, con los ángulos (º) de giro entre conjunciones. La rellena el thread
|
||||
Campos_dbf camps; ///<Campos de la dbf a leer, se rellenan en constructor o con info de socket
|
||||
Info_sec *sec; ///<Array de Nsec con la info de cada sector. Lo rellena el thread
|
||||
Info_amb_sec *amb_sec; ///<Array de Namb con la info de los ámbitos ya asigandos a un sector. Lo rellena el thread
|
||||
Info_conjs conjs; ///<Conjunciones, contiene el array de conjunciones de la red y su tamaño
|
||||
Info_planif *plan; ///<Array de planificaciones, una por cada sector
|
||||
Info_inw_dmin *inww_amb; ///<Array de Namb que almacena la carretera más cercana al punto inicial y al final (Nambx2)
|
||||
///<del ámbito si es lineal o la más cercana si es puntual. La rellena el thread.
|
||||
CartoBase carto;
|
||||
std::map<int,Info_aso2> iaso; ///<Map con mismos elementos que entidades la carto, con la información asociada
|
||||
std::vector<Info_tramos> *tramos;
|
||||
|
||||
//*************************************************************************************
|
||||
//Funciones
|
||||
Colv_limp(COlivia *olv);
|
||||
virtual ~Colv_limp(void);
|
||||
////////////////
|
||||
void libera_memo_secto();
|
||||
void prueba();
|
||||
virtual BOOL inicia();
|
||||
virtual int pon_config(char *config);
|
||||
virtual void cancela();
|
||||
virtual void rellena_campos();
|
||||
virtual void dame_cost(double ltot, int ia, float *cost, float *cost2);
|
||||
double dame_ancho(char *observ, char *tipo);
|
||||
BOOL rellena_campos_ini(char *path);
|
||||
BOOL guarda_campos_ini(char *path);
|
||||
};
|
||||
#endif
|
||||
|
|
@ -0,0 +1,521 @@
|
|||
#pragma once
|
||||
#include <float.h>
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
/**
|
||||
* @file olv_limp_def.h
|
||||
* Archivo de definiciones generales de Olivia.
|
||||
*/
|
||||
//Defines
|
||||
#define OLV_LIMP_AMB_NW_NODEF USHRT_MAX//-1 //<Indica que no hay índice del ámbito a la carretera asignada
|
||||
#define OLV_LIMP_MILIS_PROGRE 500 ///<Milisegundos cada los que se actualiza el progreso de la tarea
|
||||
#define OLV_LIMP_N_DMIN_NW 3 ///<Número de carreteras que almacena más cercanas
|
||||
#define OLV_LIMP_N_PTOS_MED 4 ///<Número de puntos con los que calcular distancia media entre ámbito y carretera
|
||||
#define OLV_LIMP_N_PTOS_DIST 2.5 ///<Distancia entre los puntos de la media
|
||||
#define OLV_LIMP_M_CONJ 32 ///<Incrementos de memoria en el array de conjunciones
|
||||
#define OLV_LIMP_MAX_CAMP 32 ///<Longitud máxima de la cadena de caracteres del campo de la dbf
|
||||
#define OLV_LIMP_ANCH_DEF 2.2 ///<El ancho por defecto por si hubiera algún error
|
||||
#define OLV_LIMP_COST_SEGM 3 ///<El coste asignado a los segmentos de unión, en segundos
|
||||
#define OLV_LIMP_VELO_CIRC_PEAT 1 ///<La velocidad de circulación en calles prohibidas y peatonales, muy bajita, en km/h
|
||||
#define OLV_LIMP_VELO_DESP_PEAT 3 ///<La velocidad de desplazamiento por las réplicas de peatonales, en km/h
|
||||
#define OLV_LIMP_VELO_CIRC_NW 30 ///<La velocidad de desplazamiento por la nw cuando la velo es la de las vías, en km/h
|
||||
#define OLV_LIMP_VELO_DEF 10 ///<La velocidad por defecto cuando viene a 0 en la nw, en km/h
|
||||
#define OLV_LIMP_GIRO_VEHIC 175 ///<El giro máximo del vehículo por defecto
|
||||
#define OLV_LIMP_THR_N 1 ///<Número de threads para los cálculos multiproceso
|
||||
#define OLV_LIMP_FACT_PERM 4 ///<Número de elementos contiguos para permutar
|
||||
#define OLV_DESV_MAX 0.15 ///<Desviación relativa con la que deja de iterar
|
||||
#define OLV_DESV_MAX_ABS_MIN 1800. ///<Desviación en segundos con la que, si es menor que esa, se deja de iterar si se cumple la relativa
|
||||
#define OLV_DESV_MAX_ABS 1800. ///<Desviación en segundos con la que deja de iterar
|
||||
#define OLV_DESV_MAX_NAMB 0.1 ///
|
||||
#define OLV_DESV_MAX_NAMB_MIN 400 //
|
||||
#define OLV_T_SLEEP_MSG 6000 ///<ms a dormir después del mensaje para que se pueda leer
|
||||
#define MAX_LEN_BUF_CERCANAS 24
|
||||
#define OLV_DIST_PARALELAS 0.2 ///<En metros, lo que se distancia la paralela del eje al hacer la ruta
|
||||
#define OLV_DIST_MAX_AMB_NW 25 ///<En metros, la dist max deseable entre un ámbito y su inw asignado, si es más, se busca otro ámbito más cercano
|
||||
#define OLV_DIST_MAX_AMB_NW_MAX 30 ///<En metros, la dist max para que se quede la unión con la nw, si no la desecha completamente
|
||||
#define OLV_BARRMIX_DMAX_DESC 20
|
||||
#define OLV_BARRMIX_DMED_MAX 3
|
||||
#define OLV_BARRMIX_DESV_MAX 1
|
||||
#define OLV_PORC_LINRECT 0.5
|
||||
#define OLV_TOMTOM_PEDESTRIAN 14
|
||||
#define OLV_NOMB_OID "OBJECTID"
|
||||
#define OLV_SHP_SZ_CAMP_CHAR 32
|
||||
#define OLV_DIF_MAX_MISMA_COOR 0.01
|
||||
//defines para ini de configuracion campos dbf-------------------------
|
||||
#define OLV_LIMP_GRUPO_DBF "CONF_CAMPOS_DBF"
|
||||
#define OLV_LIMP_PARAM_OBS "Observaciones"
|
||||
#define OLV_LIMP_PARAM_ANCHO "Ancho_tipo"
|
||||
#define OLV_LIMP_PARAM_TIPO_AP "Tipo_ap"
|
||||
#define OLV_LIMP_PARAM_TIPO_ENT "Tipo_entrada"
|
||||
#define OLV_LIMP_PARAM_TIPO_ENT_APARCA "Banda_aparcamiento"
|
||||
#define OLV_LIMP_PARAM_TIPO_ENT_BORD "Bordillo_Libre"
|
||||
#define OLV_LIMP_PARAM_TIPO_ENT_PEATO "Entidad_peatonal"
|
||||
#define OLV_LIMP_PARAM_TIPO_ENT_ACERA "Entidad_acera"
|
||||
#define OLV_LIMP_PARAM_TIPO_AP_LIN "Aparcamiento_linea"
|
||||
#define OLV_LIMP_PARAM_TIPO_AP_BAT "Aparcamiento_bateria"
|
||||
#define OLV_LIMP_GRUPO_OTROS "OTROS_PARAM"
|
||||
#define OLV_LIMP_PARAM_GIRO_VEHIC "Giro_max_vehiculo"
|
||||
#define OLV_LIMP_PARAM_ANCH_DEF_PEAT "Ancho_peat_def"
|
||||
#define OLV_LIMP_PARAM_ANCH_DEF_ACE "Ancho_acera_def"
|
||||
#define OLV_LIMP_PARAM_ANCH_DEF_APLIN "Ancho_ap_lin_def"
|
||||
#define OLV_LIMP_PARAM_ANCH_DEF_APBAT "Ancho_ap_bat_def"
|
||||
#define OLV_LIMP_PARAM_ANCH_DEF_BORD "Ancho_bord_lib_def"
|
||||
#define OLV_LIMP_PARAM_DESV_MAX "Desv_max"
|
||||
#define OLV_LIMP_PARAM_DESV_MAX_ABS "Desv_max_abs"
|
||||
//flags de la info de la inw-------------------------
|
||||
#define OLV_LIMP_FLG_CIRC_FT 0x00000001 ///<Indica sentido de circulación FT , ningún flag indica sentido BOTH
|
||||
#define OLV_LIMP_FLG_CIRC_TF 0x00000002 ///<Indica sentido de circulación TF
|
||||
#define OLV_LIMP_FLG_CIRC_NONE 0x00000004 ///<Indica sentido de circulación NONE
|
||||
#define OLV_LIMP_FLG_CIRC_NO_DOB 0x00000007 ///<Indica sentido de circulación FT+TF+NONE
|
||||
#define OLV_LIMP_FLG_NW_REP 0x00000008 ///<Indica si la entidad es una réplica de calle de nw
|
||||
#define OLV_LIMP_FLG_AMB 0x00000020 ///<Indica si la entidad es un ámbito, ausencia de este y el de seg indica que es nw
|
||||
#define OLV_LIMP_FLG_DER 0x00000010 ///<Indica que el ámbito está a la derecha de la carretera asignada, tomado su sentido FT
|
||||
#define OLV_LIMP_FLG_SEG_LIN 0x00000040 ///<Indica si la entidad es un segmento de unión con los ámbitos lineales
|
||||
#define OLV_LIMP_FLG_SEG_PUN 0x00000080 ///<Indica si la entidad es un segmento de unión con los ámbitos puntuales
|
||||
#define OLV_LIMP_FLG_PEAT_REP 0x00000200 ///<Indica si la entidad es un ámbito peatonal replicado
|
||||
#define OLV_LIMP_FLG_EJE 0x00000800 ///<Indica si la entidad es un ámbito tipo eje de calle
|
||||
#define OLV_LIMP_FLG_EJE_SEG 0x00001000 ///<Indica si la entidad es un segmento de ámbito tipo eje de calle
|
||||
#define OLV_LIMP_FLG_FIN 0x00002000 ///<Indica que es final del ámbito
|
||||
#define OLV_LIMP_FLG_SEG_AMB 0x00004000 ///<Indica que es segmento de unión entre ámbitos
|
||||
#define OLV_LIMP_FLG_AMB_NO 0x00008000 ///<indica que el ambito no se va a usar para la secto ni planif
|
||||
#define OLV_LIMP_FLG_NW 0x00010000 ///<Indica que es red navegable
|
||||
#define OLV_LIMP_FLG_AMB_APA 0x00020000 ///<Indica que es aparcamiento
|
||||
#define OLV_LIMP_FLG_AMB_BORD 0x00040000 ///<Indica que es bordillo
|
||||
#define OLV_LIMP_FLG_AMB_ACE 0x00080000 ///<Indica que es acera
|
||||
#define OLV_LIMP_FLG_AMB_PEAT 0x00100000 ///<Indica que es peatonal
|
||||
#define OLV_LIMP_FLG_PEAT_SEG 0x00200000 ///<Indica segmento de peatonal
|
||||
|
||||
#define OLV_MAX_ERR 256
|
||||
#define OLV_MAX_TAREA 256
|
||||
#define OLV_MAX_MSG_PROCE 1024
|
||||
#define OLV_KMH2MS 1.0*1000/3600
|
||||
#define OLV_MAX_IP 32
|
||||
#define OLV_MAX_COL_SHP 10
|
||||
|
||||
#ifndef LOG_TODO
|
||||
#define LOG_TODO 1
|
||||
#endif
|
||||
|
||||
//Flags para sectores
|
||||
#define OLV_LIMP_FLG_SEC_INFO_BLOCK 0x0001 //<Indica que ese sector esta bloqueado (no se puede quitar ni poner ambitos)
|
||||
#define OLV_LIMP_FLG_SEC_DISTINTO 0x0002 //<Indica que ese sector puede ser distinto a los demás para cuadrar jornadas
|
||||
#define OLV_LIMP_FLG_SEC_CAMB 0x0004 //<Indica que ese sector se ha cambiado
|
||||
//****************************************************
|
||||
#ifndef MAYUSCULO
|
||||
#define MAYUSCULO (double) 1.e+30
|
||||
|
||||
#endif
|
||||
#ifndef MINUSCULO
|
||||
#define MINUSCULO (double) 1.e-20
|
||||
#endif
|
||||
//****************************************************
|
||||
//Enums
|
||||
/**
|
||||
* Para distinguir si se guardan los viajes a descargar y vuelta por separado, o junto a su recogida correspondiente
|
||||
*/
|
||||
enum TipoShpViaj
|
||||
{
|
||||
OLV_SHPRUT_SHPINST=0, //Guarda en un shp Ruta cada viaje de cada sector,
|
||||
//sin incluir los viajes a instalación, que se guardan en un shp aparte
|
||||
OLV_SHPRUTINST, //Guarda en un único shp cada viaje de cada sector, incluida la ida a descargar y la vuelta de la descarga anterior
|
||||
//Oferta barcelona
|
||||
};
|
||||
/**
|
||||
* Para identificar los tipos de ámbitos
|
||||
*/
|
||||
enum TipoAmbit
|
||||
{
|
||||
OLV_AMB_PUN=1, //tiene que empezar siempre en 1 porque se usa para multiplicar, y el lineal ser el 2, no cambiar!
|
||||
OLV_AMB_LIN,
|
||||
};
|
||||
;
|
||||
/**
|
||||
* Para los tipos de viaje a las instalaciones
|
||||
*/
|
||||
enum DesplTto{
|
||||
OLV_DESP,
|
||||
OLV_TTO,
|
||||
OLV_DT_N
|
||||
};
|
||||
/**
|
||||
* Para identificar los tipos de atributos de circulación
|
||||
*/
|
||||
enum AtrCirc
|
||||
{
|
||||
OLV_ATR_CIRC_TF,
|
||||
OLV_ATR_CIRC_FT,
|
||||
OLV_ATR_CIRC_NONE,
|
||||
OLV_ATR_CIRC_PEDES,
|
||||
OLV_ATR_CIRC_N
|
||||
};
|
||||
/**
|
||||
* Para identificar los tipos de atributos de tipos de entidad
|
||||
*/
|
||||
enum AtrTipEnt
|
||||
{
|
||||
OLV_ATR_NOM_TIP_ENT_AP,
|
||||
OLV_ATR_NOM_TIP_ENT_BORD,
|
||||
OLV_ATR_NOM_TIP_ENT_PEAT,
|
||||
OLV_ATR_NOM_TIP_ENT_ACERA,
|
||||
OLV_ATR_NOM_TIP_ENT_N
|
||||
};
|
||||
/**
|
||||
* Para identificar los tipos de atributos de tipos de aparcamiento
|
||||
*/
|
||||
enum AtrTipAp
|
||||
{
|
||||
OLV_ATR_TIP_AP_LIN,
|
||||
OLV_ATR_TIP_AP_BAT,
|
||||
OLV_ATR_TIP_AP_N
|
||||
};
|
||||
/**
|
||||
* Para identificar los tipos de anchos por defecto
|
||||
*/
|
||||
enum AnchosDef
|
||||
{
|
||||
OLV_ANCH_DEF_PEAT,
|
||||
OLV_ANCH_DEF_ACE,
|
||||
OLV_ANCH_DEF_APLIN,
|
||||
OLV_ANCH_DEF_APBAT,
|
||||
OLV_ANCH_DEF_BORD,
|
||||
OLV_ANCH_DEF_N
|
||||
};
|
||||
/**
|
||||
* Para identificar los tipos de atributos de tipos de elementos en la planificación
|
||||
*/
|
||||
enum TipElemPlan
|
||||
{
|
||||
OLV_PLAN_TIP_NW,
|
||||
OLV_PLAN_TIP_AMB,
|
||||
OLV_PLAN_TIP_AMB_PEAT,
|
||||
OLV_PLAN_TIP_AMB_PEAT_DESP,
|
||||
OLV_PLAN_TIP_SEG_LIN,
|
||||
OLV_PLAN_TIP_SEG_PUN,
|
||||
};
|
||||
/**
|
||||
* Para los tipos de restricciones de circulación
|
||||
*/
|
||||
enum TipRestr
|
||||
{
|
||||
OLV_RES_NO,
|
||||
OLV_RES_SENTIDOS_CIRC,
|
||||
OLV_RES_RECOGER_SOLO_LADO_Y_GIROS,
|
||||
};
|
||||
/**
|
||||
* Para los tipos de viaje a las instalaciones
|
||||
*/
|
||||
enum ViajesInsta{
|
||||
OLV_IDA_INST,
|
||||
OLV_VUELTA_INST,
|
||||
OLV_IDA_PLANT,
|
||||
OLV_VUELTA_PLANT,
|
||||
OLV_IDA_PLANT_ULT,
|
||||
};
|
||||
/**
|
||||
* Para los tipos de llamadas a la generación de la planificación
|
||||
*/
|
||||
enum TiposPlan{
|
||||
OLV_PLAN_NORMAL,
|
||||
OLV_PLAN_INST,
|
||||
OLV_PLAN_RECO,
|
||||
};
|
||||
//****************************************************
|
||||
//****************************************************
|
||||
//Structs
|
||||
/**
|
||||
* Nueva Estructura que contiene la información asociada de la nw
|
||||
*/
|
||||
typedef struct Info_aso_nw
|
||||
{
|
||||
double velo; //velocidad de la vía, en km/h
|
||||
char *nomb; //nombre de la vía
|
||||
//int refe2; //en replicas, la calle orig
|
||||
}Info_aso_nw;
|
||||
/**
|
||||
* Nueva Estructura que contiene la información asociada de las entidades de limpieza (aceras, bordillos, peatonales...)
|
||||
*/
|
||||
typedef struct Info_aso_limp
|
||||
{
|
||||
//int refe2; //en barrido mixto, el bordillo que es equivalente
|
||||
//en las peatonales replicadas, la peatonal original
|
||||
double ancho; //el ancho de la entidad
|
||||
}Info_aso_limp;
|
||||
/**
|
||||
* Nueva Estructura que contiene la información asociada de los contenedores
|
||||
*/
|
||||
typedef struct Info_aso_reco
|
||||
{
|
||||
double kg; //kg de carga en total en esa ubicación
|
||||
char *id; //id en texto del contenedor para llamadas a sensores
|
||||
int uds; //num de cont en esa ubicación
|
||||
}Info_aso_reco;
|
||||
/**
|
||||
* Nueva Estructura que contiene la información asociada de la carto
|
||||
* se accede como map, según la clave de la referencia de la carto, pero en los ámbitos se puede
|
||||
* acceder por el i del ámbito directamente porque están los primeros en el map
|
||||
*/
|
||||
typedef struct Info_aso2
|
||||
{
|
||||
INT64 flgs; //flags
|
||||
int inod[2]; //índice a los nodos ini y final de la entidad
|
||||
int oid; //objetct id de la carto
|
||||
int refe2; //en los segmentos o replicadas, el ámbito original
|
||||
int refe; //referencia en la carto a ese elemento
|
||||
int iamb; //índice al ámbito que es
|
||||
union
|
||||
{
|
||||
Info_aso_nw inf_n;
|
||||
Info_aso_limp inf_l;
|
||||
Info_aso_reco inf_r;
|
||||
};
|
||||
|
||||
Info_aso2()
|
||||
{
|
||||
reset();
|
||||
};
|
||||
|
||||
void reset()
|
||||
{
|
||||
flgs=0;
|
||||
iamb=-1;
|
||||
inod[0]=inod[1]=oid=refe2=refe=-1;
|
||||
inf_r.id=inf_n.nomb=0;
|
||||
inf_n.velo=inf_l.ancho=inf_r.kg=-1;
|
||||
inf_r.uds=0;
|
||||
};
|
||||
void del()
|
||||
{
|
||||
if(inf_n.nomb)
|
||||
free(inf_n.nomb); //solo lo hace para este porque comparte direccion de memoria con el id de reco
|
||||
inf_n.nomb=NULL;
|
||||
};
|
||||
}Info_aso2;
|
||||
/**
|
||||
* Contiene la info de los tramos de la planificación
|
||||
*/
|
||||
typedef struct Info_tramos
|
||||
{
|
||||
short ie[2]; //el ind al elemento incial y final del tramo
|
||||
short iins[2]; //el ind al viaje a la inst inicial y final que corresponden a ese tramo
|
||||
short namb; //el número de ámbitos del tramo
|
||||
short ncont; //el número de contenedores del tramo
|
||||
float long_tr; //la longitud en metros del tramo
|
||||
float t_total_tr; //el tiempo total del tramo en segundos
|
||||
float t_tto_tr; //el tiempo de tto en segundos del tramo
|
||||
float t_ini; //el tiempo inicial del tramo
|
||||
float t_fin; //el tiempo final del tramo
|
||||
}Info_tramos;
|
||||
/**
|
||||
* Estructura que contiene la información de la carretera más cercana a un ámbito
|
||||
*/
|
||||
typedef struct Info_inw_dmin
|
||||
{
|
||||
short flgs; //<Flags, para almacenar información variada
|
||||
unsigned short refamb; //<La referencia de la carto del ámbito, para cuando el array no esté ordenado por ámbito sino por inw
|
||||
unsigned short ip; //<El índice al punto de la carretera donde se da la distancia mínima
|
||||
unsigned short refnw; //<La referencia de la carretera (la ref de la carto), entidad de la capa nw, más cercana al ámbito dado
|
||||
float dmin; //<Distancia mínima encontrada entre el ámbito y la carretera en el punto más cercano
|
||||
float lamb; //<Parámetro de la recta del punto más cercano: pnw[ip] + (pnw[ip+1]-pnw[ip])*lamb
|
||||
float alpha; //<Diferencia con pi/2 del ángulo que forman el ámbito con el segmento que une
|
||||
//<el extremo del ámbito con la carretera elegida
|
||||
double pt[3]; //<Punto de la carretera donde se da la distancia mínima al ámbito
|
||||
Info_inw_dmin *inw_old; //<Para cuando reapunta
|
||||
Info_inw_dmin(){reset();}
|
||||
void reset(int refamb=-1)
|
||||
{
|
||||
refnw=0;
|
||||
refamb=0;
|
||||
dmin=(float)FLT_MAX;
|
||||
inw_old=NULL;
|
||||
ip=flgs=0;
|
||||
lamb=alpha=0;
|
||||
pt[0]=pt[1]=pt[2]=0;
|
||||
}
|
||||
}Info_inw_dmin;
|
||||
/**
|
||||
* Estructura que contiene la información de las carreteras que llegan a una intersección
|
||||
*/
|
||||
typedef struct Info_conjs_inw
|
||||
{
|
||||
int n; //<Número de incidencias de entidades tipo carretera en la conjunción, o -1 si es conjunción de ámbito o segmento
|
||||
int refnw0; //<Índice a la primera carretera que incide, que es interesante por si sólo hay una
|
||||
}Info_conjs_inw;
|
||||
/**
|
||||
* Estructura que contiene la información de las intersecciones
|
||||
*/
|
||||
typedef struct Info_conjs
|
||||
{
|
||||
int n; //<Tamaño del array
|
||||
int m; //<Memoria reservada para el array
|
||||
double (*coor)[3]; //<Array de conjunciones de la red navegable y los ámbitos, de tamaño n
|
||||
Info_conjs_inw *inc; //<Array de carreteras que inciden en dicha conjunción, o -1 si es una conjunción de ámbito o segmento
|
||||
}Info_conjs;
|
||||
/**
|
||||
* Estructura que contiene la información de los sectores
|
||||
*/
|
||||
typedef struct Info_sec
|
||||
{
|
||||
short namb; //<Número de ámbitos del sector
|
||||
short *iamb; //<Array de índices de los ámbitos asignados al sector
|
||||
short iamb_cen; //<Índice a el ambito central del sector. Después de planificar, el número de elementos del sector
|
||||
short flags_tem; //<Flags temporales usados para igualar setores
|
||||
short iamb_ini_def; //<Índice al ámbito inicial de la planificación del sector, si se define en la columna "secuencia"
|
||||
float t_despl[2]; //<Tiempos de desplazamiento de la instalación al inicio, y del final a la planta
|
||||
float cost_ac; //<Coste acumulado del sector
|
||||
float cost_despl_aux; //<Coste de desplazamiento auxiliar del sector (para almacenar medio, mínimo, máximo..)
|
||||
float dis_med; //<Distancia media entre ambitos del sector y su ambito central
|
||||
float *cost_amb_sec; //<Array de distancias del sector a todos los ámbitos
|
||||
float *cost_amb_sec_aux; //<Array de distancias del sector a todos los ámbitos, ponderado con las distancias al resto de sectores
|
||||
}Info_sec;
|
||||
/**
|
||||
* Estructura que contiene la información de los ámbitos en los sectores
|
||||
*/
|
||||
typedef struct Info_amb_sec
|
||||
{
|
||||
short sec; //<Sector al que pertenece el ámbito
|
||||
short iseq; //<Secuencia con la que se recorre el ámbito en su sector
|
||||
short namb_cerca; //indica numero de ambitos cerca de este
|
||||
short res;
|
||||
int iamb_cerca[MAX_LEN_BUF_CERCANAS];
|
||||
float t; //<Tiempo de trabajo acumulado hasta este ámbito dentro del sector
|
||||
|
||||
}Info_amb_sec;
|
||||
/**
|
||||
* Estructura que contiene la informacion de cada ambito correspondiente para poder recostruir el estado de sectorizacion
|
||||
*/
|
||||
typedef struct Info_est_amb
|
||||
{
|
||||
short sec; //<Sector al que pertenece el ámbito
|
||||
short iseq; //<Secuencia con la que se recorre el ámbito en su sector
|
||||
float t; //<Tiempo de trabajo acumulado hasta este ámbito dentro del sector
|
||||
}Info_est_amb;
|
||||
/**
|
||||
* Estructura que contiene la información de cada elemento de la planificación.
|
||||
*/
|
||||
typedef struct Info_elem_planif
|
||||
{
|
||||
short aux; //<Variable auxiliar, indica en recogida si es ámbito en el que se va o vuelve a descargar
|
||||
int refe; //<Referencia de la línea dentro de la carto
|
||||
int k; //<Indica k=0 si es entrada, k=1 si es salida
|
||||
int tp; //<Tipo de elemento TipElemPlan
|
||||
int ref_nw; //<referencia a qué carretera está asociado el elemento
|
||||
double coste; //<Coste acumulado hasta ese elemento
|
||||
double ltot; //<Longitud del elemento
|
||||
}Info_elem_planif;
|
||||
/**
|
||||
* Estructura que contiene la información de los puntos de control de la información
|
||||
*/
|
||||
typedef struct Info_planif_ctrl
|
||||
{
|
||||
int ipt; //<Punto de la planificación tras el que está el punto de control
|
||||
double cost; //<Coste acumulado hasta el punto de control
|
||||
}Info_planif_ctrl;
|
||||
/**
|
||||
* Estructura que contiene la información de la planificación. Hay una por sector
|
||||
*/
|
||||
typedef struct Info_planif
|
||||
{
|
||||
int nelem; //<Número de elementos en la secuencia de la planificación
|
||||
int ninsta; //<Número de viajes que hace a la instalación
|
||||
double m[OLV_DT_N]; //<Metros de desplazamiento/tratamiento de la ruta
|
||||
double t[OLV_DT_N]; //<Tiempos de desplazamiento/tratamiento de la ruta, en segundos
|
||||
Info_planif_ctrl *pts_ctrl; //<Array de tamaño npts_ctrl-2 contiene índices al final de qué elemento hay un punto de control intermedio
|
||||
Info_elem_planif *elem; //<Array de elementos
|
||||
Info_planif *planif_insta; //<Planificaciones de los viajes que hace a las instalaciones
|
||||
}Info_planif;
|
||||
|
||||
/**
|
||||
* Estructura que contiene los nombres de los campos a leer
|
||||
*/
|
||||
typedef struct Campos_dbf
|
||||
{
|
||||
char campo_circ[OLV_LIMP_MAX_CAMP];
|
||||
char campo_velo[OLV_LIMP_MAX_CAMP];
|
||||
char campo_name[OLV_LIMP_MAX_CAMP];
|
||||
char campo_fow[OLV_LIMP_MAX_CAMP];
|
||||
char campo_obs[OLV_LIMP_MAX_CAMP];
|
||||
char campo_anch[OLV_LIMP_MAX_CAMP];
|
||||
char campo_tipo_ap[OLV_LIMP_MAX_CAMP];
|
||||
char campo_tipo_ent[OLV_LIMP_MAX_CAMP];
|
||||
char campo_secto[OLV_LIMP_MAX_CAMP];
|
||||
char atr_circ[OLV_ATR_CIRC_N][OLV_LIMP_MAX_CAMP];
|
||||
char atr_tip_ent[OLV_ATR_NOM_TIP_ENT_N][OLV_LIMP_MAX_CAMP];
|
||||
char atr_tip_apa[OLV_ATR_TIP_AP_N][OLV_LIMP_MAX_CAMP];
|
||||
}Campos_dbf;
|
||||
struct Djkt_nodo;
|
||||
/*
|
||||
* Estructura de secuencia de ambitos usada para la planificacion
|
||||
*/
|
||||
typedef struct Secu_amb
|
||||
{
|
||||
short iamb;
|
||||
short entrada;//indice a nodo entrada
|
||||
short flags;
|
||||
int res;
|
||||
Djkt_nodo *ctnod[2];
|
||||
void libera(int i, int n);
|
||||
}Secu_amb;
|
||||
//****************************************************************
|
||||
/**
|
||||
* Datos de los thead que prueban combinaciones de planificacion
|
||||
*/
|
||||
typedef struct th_data_planif
|
||||
{
|
||||
BOOL currando;
|
||||
BOOL activo;
|
||||
int pos[2];//utilizado en sustitucion de posiciones
|
||||
double coste;//coste minimo alcanzado
|
||||
Secu_amb*sec;//secuencia de coste minimo alcanzado
|
||||
}th_data_planif;
|
||||
class Colv_limp_thr;
|
||||
/**
|
||||
* Parametros de los thead que prueban combinaciones de planificacion
|
||||
*/
|
||||
typedef struct th_param_planif
|
||||
{
|
||||
BOOL pirate;//indica a los thread que hay que irse
|
||||
BOOL abs;
|
||||
int id_curro;//id de curro
|
||||
int modo;//indica el modo de curro
|
||||
long nth;//numero de thread currando
|
||||
int id_th;//indica al thread el id que tiene
|
||||
int namb;
|
||||
int param[2];
|
||||
int namb_t;//numero de ambitos totales
|
||||
int milis_sleep;
|
||||
th_data_planif *dth;//datos obtenidos por los thread
|
||||
Secu_amb*sec;
|
||||
Info_sec *s;
|
||||
Colv_limp_thr* tl;
|
||||
//*******************************************
|
||||
void a_currar()
|
||||
{
|
||||
for (int i=0; i<nth; i++)
|
||||
{
|
||||
dth[i].currando=dth[i].activo;
|
||||
}
|
||||
id_curro=(id_curro+1)%1000;
|
||||
};
|
||||
//*******************************************
|
||||
BOOL terminado()
|
||||
{
|
||||
for (int i=0; i<nth; i++)
|
||||
{
|
||||
if(dth[i].currando)
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
int dame_min()
|
||||
{
|
||||
int j=0;
|
||||
for (int i=1; i<nth; i++)
|
||||
{
|
||||
if(dth[j].coste>dth[i].coste)
|
||||
j=i;
|
||||
}
|
||||
return j;
|
||||
};
|
||||
}th_param_planif;
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,303 @@
|
|||
#pragma once
|
||||
#ifdef OLIVIA_COMPILA
|
||||
#include "olv_thr.h"
|
||||
#include "olv_limp_def.h"
|
||||
//utiles
|
||||
#include "OlvAsync_cola.h"
|
||||
#include "CartoBaseElements.h"
|
||||
#include "CartoBase.h"
|
||||
#include "Fdbf.h"
|
||||
#include "b_file.h"
|
||||
#include "ManagerDbfGdataTable.h"
|
||||
|
||||
/**
|
||||
* @file olv_limp_thr.h
|
||||
* Archivo de definiciones del thread de control de la utilidad de limpieza viaria del programa Olivia.
|
||||
*/
|
||||
|
||||
class Colv_limp;
|
||||
class Colv_csv;
|
||||
class Colv_limp_thr;
|
||||
class Colv_tasks;
|
||||
struct Info_inw_dmin;
|
||||
struct Info_conjs;
|
||||
struct Info_sec;
|
||||
struct Info_amb_sec;
|
||||
struct Info_amb_arbol;
|
||||
struct Info_rut;
|
||||
struct Info_est_amb;
|
||||
struct Djkt_nodo;
|
||||
struct Secu_amb;
|
||||
struct Info_planif;
|
||||
struct th_param_planif;
|
||||
struct Djkt_ang_ady;
|
||||
struct HeadCostConj;
|
||||
struct HeadCostAng;
|
||||
/**
|
||||
* Estructura de parámetros de comunicación con el thread de cálculo de limpieza
|
||||
*/
|
||||
typedef struct Param_olv_limp_thr
|
||||
{
|
||||
int id_e;
|
||||
}Param_olv_limp_thr;
|
||||
//*******************************************
|
||||
/**
|
||||
* Clase extendida para rellenar los datos del dbf
|
||||
*/
|
||||
class AddColsDbf : public IAddColDbf
|
||||
{
|
||||
public:
|
||||
char *info;
|
||||
|
||||
AddColsDbf(char *info)
|
||||
{
|
||||
this->info=info;
|
||||
}
|
||||
virtual void setData(int i, void *data)
|
||||
{
|
||||
if(data)
|
||||
{
|
||||
memcpy(data,(void*)&info[i*OLV_SHP_SZ_CAMP_CHAR],OLV_SHP_SZ_CAMP_CHAR);
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
//*******************************************
|
||||
/**
|
||||
* Clase del thread de control de la utilidad de limpieza viaria del programa Olivia.\n
|
||||
* Contiene el grueso de cálculos, tanto de la parte de limpieza como de recogida de residuos, todos los algoritmos de\n
|
||||
* sectorización y planificación, cálculo de costes, etc.
|
||||
*/
|
||||
//******************************************************************************************************
|
||||
class Colv_limp_thr : public Colv_thr, public OlvAsync_cola<Param_olv_limp_thr>
|
||||
{
|
||||
public:
|
||||
//*************************************************************************************
|
||||
//Variables
|
||||
enum Ev_olv_limp_thr ///<Tipos de eventos de la cola de ejecución del proceso
|
||||
{
|
||||
OLV_LIMP_EV_ABRE_DAT,
|
||||
OLV_LIMP_EV_RELL_DAT,
|
||||
OLV_LIMP_EV_UNE_AMB_NW,
|
||||
OLV_LIMP_EV_TOPO_NW,
|
||||
OLV_LIMP_EV_COST_CONJ,
|
||||
OLV_LIMP_EV_ANG_CONJ,
|
||||
OLV_LIMP_EV_COST_AMB,
|
||||
OLV_LIMP_EV_CALC_NSEC,
|
||||
OLV_LIMP_EV_CALC_NSEC_FIN,
|
||||
OLV_LIMP_EV_SECTORIZA,
|
||||
OLV_LIMP_EV_PLANIFICA,
|
||||
OLV_LIMP_EV_LEE_SECTO,
|
||||
OLV_LIMP_EV_COST_CONJ_SUB,
|
||||
OLV_LIMP_EV_COST_CONJ_FIN,
|
||||
OLV_LIMP_EV_ANG_CONJ_SUB,
|
||||
OLV_LIMP_EV_ANG_CONJ_FIN,
|
||||
OLV_LIMP_EV_COST_AMB_SUB,
|
||||
OLV_LIMP_EV_COST_AMB_FIN,
|
||||
OLV_LIMP_EV_PLANIFICA_SUB,
|
||||
OLV_LIMP_EV_PLANIFICA_FIN,
|
||||
OLV_LIMP_EV_SUBTHR_PROG,
|
||||
OLV_LIMP_EV_GUARD_MATS,
|
||||
OLV_LIMP_EV_GUARD_MATS_SUB,
|
||||
OLV_LIMP_EV_GUARD_MATS_FIN,
|
||||
OLV_LIMP_EV_TASK_ESCUCHA,
|
||||
OLV_LIMP_EV_TASK_FIN,
|
||||
OLV_LIMP_EV_BARRMIX,
|
||||
OLV_LIMP_EV_BARRMIX_SUB,
|
||||
OLV_LIMP_EV_BARRMIX_FIN,
|
||||
OLV_LIMP_EV_COMPCORT,
|
||||
OLV_LIMP_EV_COMPCORT_SUB,
|
||||
OLV_LIMP_EV_COMPCORT_FIN,
|
||||
|
||||
OLV_LIMP_EV_N
|
||||
}Ev_olv_limp_thr;
|
||||
|
||||
BYTE *visto_ang;
|
||||
int n_subthr_fin;
|
||||
int n_subthr;
|
||||
int n_subthr_mal;
|
||||
double prog_subthr;
|
||||
BOOL pirate;
|
||||
BOOL fin_permu;
|
||||
char err_str[OLV_MAX_ERR];
|
||||
CartoBase carto_rut, carto_ctrl,carto_flech, carto_inst;
|
||||
Fdbf dbf_cols;
|
||||
Cb_file f_cols;
|
||||
Colv_limp *olv_limp;
|
||||
Colv_limp_thr *thr_padre;
|
||||
Colv_limp_thr **subthrs; ///<Array de threads
|
||||
|
||||
//*************************************************************************************
|
||||
//Funciones
|
||||
Colv_limp_thr(Colv_limp *olv_limp);
|
||||
virtual ~Colv_limp_thr(void);
|
||||
/////////////////////
|
||||
void inicia_th();
|
||||
void termina_th();
|
||||
static void cola_proc(int evento,OlvAsync_cola<Param_olv_limp_thr> *clase,Param_olv_limp_thr *e);
|
||||
|
||||
//Apertura de los datos de partida
|
||||
BOOL abre_datos();
|
||||
|
||||
//Rellena la info de los datos de partida
|
||||
virtual BOOL rellena_datos();
|
||||
BOOL rellena_info_nw();
|
||||
BOOL rellena_info_amb();
|
||||
BOOL replica_peat();
|
||||
void mejora_barr_mix();
|
||||
void mejora_barr_mix_sub(int ithr);
|
||||
BOOL mejora_barr_mix_fin();
|
||||
BOOL barr_mix_paralelas(CartoBaseInfoEntity ient1, CartoBaseInfoEntity ient2);
|
||||
void copia_info_barr_mix();
|
||||
//Unión de ámbitos a la red navegable
|
||||
BOOL une_amb_nw(int soloi=-1);
|
||||
int is_dmin(double daux, Info_inw_dmin *inww);
|
||||
BOOL busca_inw_dmin(int i_amb);
|
||||
BOOL busca_inw_dmin_ejes(int i_amb);
|
||||
void add_uniones_obj(int i_amb);
|
||||
void comprueba_amb_lejos(int i_amb );
|
||||
void comprueba_aislados(Info_inw_dmin *inww);
|
||||
BOOL comprueba_latelaridad();
|
||||
void compr_cortes_amb();
|
||||
void compr_cortes_amb_sub(int ithr);
|
||||
BOOL compr_cortes_amb_sub_fin();
|
||||
//Generación de topología
|
||||
BOOL replica_doble_sent(Info_inw_dmin *inww_ord);
|
||||
BOOL topo_nw();
|
||||
static int compara_inww_amb (const void * a, const void * b);
|
||||
void borra_rep();
|
||||
|
||||
//Métodos para multithread
|
||||
virtual void lanza_subthrs(int tar, int nthr_def=-1);
|
||||
void para_subthrs();
|
||||
|
||||
//Cálculo del coste entre conjunciones
|
||||
BOOL calcula_cost_conj();
|
||||
BOOL add_conj(Info_conjs *conjs, double coor[3]);
|
||||
BOOL cuida_memo_conj(Info_conjs *conjs);
|
||||
BOOL busca_conjs();
|
||||
void calcula_cost_conj_sub(int ithr);
|
||||
BOOL calcula_cost_conj_fin();
|
||||
void calcula_cost(int refent, float *cost, float *cost2);
|
||||
//Cálculo de ángulos entre conjunciones
|
||||
BOOL calcula_ang_conj();
|
||||
void calcula_ang_conj_sub(int ithr);
|
||||
double dame_ang_conj(int ic, int i, int j);
|
||||
BOOL calcula_ang_conj_fin();
|
||||
void revisa_calles_cortadas();
|
||||
|
||||
//Cálculo del coste entre ámbitos
|
||||
void invierte_nodos(int nn, int KK,Secu_amb * ord_sec, BOOL *pirate);
|
||||
BOOL calcula_cost_amb();
|
||||
BOOL inicia_cost_amb();
|
||||
BOOL calcula_cost_amb_fin();
|
||||
void calcula_cost_amb_sub(int ithr);
|
||||
BOOL avisa_aislados();
|
||||
void prueba_costs();
|
||||
|
||||
//Sectorización
|
||||
BOOL sectoriza();
|
||||
BOOL pide_memo_secto();
|
||||
|
||||
//Métodos auxiliares para sectorización
|
||||
BOOL add_amb_sec(int i_amb, int namb, int i_sec, Info_sec *ss, Info_amb_sec *aa, Matrix2d<float> &cost_amb, double cost_tot, int i_amb_p=-1);
|
||||
void quita_amb_sec(int i_amb, int namb, int i_sec, Info_sec *ss, Info_amb_sec *aa, Matrix2d<float> &cost_amb, int i_amb_p=-1);
|
||||
BOOL sectoriza_1();
|
||||
double dame_desv_sec(int nsec, Info_sec *ss, BOOL porc =FALSE, double *absol=NULL);
|
||||
BOOL sectoriza_2(double *cost_ac_);
|
||||
double iguala_sectores3(int n_amb, int n_sec, Matrix2d<float> &cost_amb, Info_sec *ss, Info_amb_sec *aa, Secu_amb * ord_sec=NULL, th_param_planif *thp=NULL);
|
||||
double iguala_sectores4(int n_amb, int n_sec, Matrix2d<float> &cost_amb, Info_sec *ss, Info_amb_sec *aa);
|
||||
double iguala_sectores5(int iamb, int n_amb, int n_sec, Matrix2d<float> &cost_amb, Info_sec *ss, Info_amb_sec *aa);
|
||||
BOOL calcula_coste_sectores(Secu_amb * ord_sec,Info_sec *ss,int n_sec, th_param_planif *thp=NULL, BOOL loguear=FALSE );
|
||||
BOOL calcula_coste_1sec( Secu_amb * ord_sec, Info_sec *ss, th_param_planif *thp, BOOL loguear );
|
||||
int asigna_padres(int amb_central, int namb, Matrix2d<float> &cost_amb, Info_sec *ss, Info_amb_sec *aa, int *buf, int nhijos_fron);
|
||||
int busca_sec_cerca_amb(Info_amb_sec *aa,int iamb, int id_sec, int modo=0);
|
||||
BOOL genera_sectores3(int iamb_extr, int n_amb, int n_sec, Matrix2d<float> &cost_amb, Info_sec *ss, Info_amb_sec *aa);
|
||||
BOOL genera_sectores(int iamb_extr, int n_amb, int n_sec, Matrix2d<float> &cost_amb, Info_sec *ss, Info_amb_sec *aa);
|
||||
double dame_dmed_amb_sec(int iamb, int isec);
|
||||
double dame_dmed_amb(int iamb1, int iamb2);
|
||||
BOOL genera_sectores_pro(int n_sec, Matrix2d<float> &cost_amb, Info_sec *ss, Info_amb_sec *aa);
|
||||
BOOL add_amb_sec_cost(int i_amb, int namb, int i_sec, Info_sec *ss, Info_amb_sec *aa, Matrix2d<float> &cost_amb);
|
||||
BYTE* guarda_estado(int namb,int n_sec, Info_amb_sec *aa, Info_sec *ss,BYTE *buf );
|
||||
BOOL pon_estado(int namb,int n_sec, Info_amb_sec *aa, Info_sec *ss, Matrix2d<float> &cost_amb, BYTE *st );
|
||||
int* ordena_sec(int n_sec, Info_sec *ss, int *buf);//ordena sectores de mayor a menor coste
|
||||
int recorre_hijos(int iamb, int namb, Info_amb_sec *aa, int *iamb_r, int namb_r, Matrix2d<float> &cost_amb, double *cost, BOOL inicia=TRUE);
|
||||
BOOL actualiza_costes(int namb,int n_sec, Info_amb_sec *aa, Info_sec *ss, Matrix2d<float> &cost_amb);
|
||||
static int compara_dist_cerc (const void * a, const void * b);
|
||||
|
||||
//Lee secto
|
||||
BOOL lee_secto();
|
||||
|
||||
//Calcula el número de sectores
|
||||
BOOL calcula_n_sec();
|
||||
virtual double dame_cost_jornada();
|
||||
double calcula_cost_1sec_total(int n_amb, Info_sec *ss, Djkt_ang_ady *ang_conj);
|
||||
|
||||
//Planificación
|
||||
BOOL planifica();
|
||||
virtual void planifica_sub_1(int ithr, Matrix2d<float> &cost_amb);
|
||||
BOOL planifica_fin();
|
||||
|
||||
//Métodos para guardado post-planificación
|
||||
BOOL genera_planif(int is, double cost_sec, int nsecu, int *secu, int tip_plan);
|
||||
BOOL genera_planif_aux(int is, Info_sec *ss, Info_planif *pp, int nsecu, int *secu, int tip_plan);
|
||||
BOOL genera_planif_instala(int is, int nvaciados, int ini, int fin, int *secu, int tip_viaje);
|
||||
BOOL guarda_shp_rut_ctrl();
|
||||
BOOL genera_list_rut_ctrl();
|
||||
virtual void quita_t_ult_desc(int s, double *t);
|
||||
virtual BOOL genera_list_fila_vaci(Colv_csv *cc, char *fila0,int ielem, int s, int ii, double tt, double *t0,BOOL is_fin);
|
||||
BOOL guarda_dbf_sector(int modo);
|
||||
virtual BOOL gen_guard_subtramos();
|
||||
BOOL genera_rut_aux(Info_planif *pp, int is, BOOL is_insta, int ie_ini, int ie_fin);
|
||||
BOOL genera_rut_ctrl(int ns, Info_planif *planif, BOOL tramos);
|
||||
|
||||
//Métodos auxiliares para Planificación
|
||||
short dame_planif_iamb_ini(Info_sec *s,Matrix2d<float> &cost_amb, short *ent=NULL);
|
||||
Secu_amb * planifica_sect(Info_sec *s, Djkt_ang_ady *ang_conj, int npermu);
|
||||
BOOL busca_cercano(Info_sec *s, Secu_amb *sec, int isec, BOOL ind_abs=FALSE);
|
||||
virtual double dame_coste(Secu_amb * sec, int ini, int fin, Info_sec *s, BOOL ind_abs=FALSE);
|
||||
BOOL permuta(Secu_amb * sec, int ini, int fin, int p, Secu_amb * sec_out);
|
||||
double dame_coste_ex( Secu_amb * sec , int ini, int fin, Info_sec *s, int pos_old, int pos_new, int entr );
|
||||
void cambia_elem(Secu_amb * sec,int pos_old, int pos_new, int entr);
|
||||
BOOL esta_repe( Secu_amb *sec, int nsec, BOOL log=FALSE );
|
||||
void pon_info_resul();
|
||||
double dame_mima(int nsec, Info_sec *ss, double *mini=NULL);
|
||||
double dame_dif_mima(int nsec, Info_sec *ss);
|
||||
BOOL rellena_amb_cercanos_por_carretera(int namb, Info_amb_sec *aa, Secu_amb * ord_sec);
|
||||
double dis_min_amb(int ids[2], int id_nod_ini, Secu_amb * ord_sec, BOOL res_nod, int iamb);
|
||||
virtual void pon_ptos_ctrl(Info_planif *pp, int npt_ctrl, double cost_ctrl);
|
||||
|
||||
/////////////////////////////
|
||||
virtual BOOL pon_nodos_planta(double pt[3]);
|
||||
virtual BOOL busca_conjs_planta(double pt[3], int *nod);
|
||||
virtual BOOL calcula_cost_plant();
|
||||
void dame_h_m_s(double tt, int *h, int *m, int *s);
|
||||
virtual BOOL guarda_cols_ruta(char *path_shp);
|
||||
BOOL guarda_cols_ctrl(char *path_shp);
|
||||
virtual BOOL guarda_cols_insta(char *path_shp);
|
||||
virtual void pon_t_desp(Info_sec *s, Secu_amb *sec);
|
||||
virtual BOOL comprueba_descarg(int iamb);
|
||||
virtual void dame_observ_cont(int iamb,char *observ);
|
||||
BOOL quita_islas(int namb, Info_amb_sec *aa, Secu_amb * ord_sec);
|
||||
|
||||
//Guardado de matrices
|
||||
BOOL guarda_mats();
|
||||
void guarda_mats_sub(int ithr);
|
||||
BOOL guarda_mats_fin();
|
||||
BOOL guarda_iaso();
|
||||
|
||||
//Cálculo en tasks de costes entre ámbitos
|
||||
BOOL lanza_tasks(int nthr_def=-1);
|
||||
BOOL task_dj_escucha();
|
||||
BOOL task_dj_fin();
|
||||
void borra_temp_files(BOOL todo=TRUE);
|
||||
|
||||
//Para los viajes
|
||||
void cuenta_tramos();
|
||||
virtual void rellena_tramos();
|
||||
BOOL combina_rut_insta();
|
||||
virtual int rellena_insta_tramos();
|
||||
virtual BOOL guarda_cols_ruta_tram(char *path_shp);
|
||||
void ini_infotask(int ntasks);
|
||||
};
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,371 @@
|
|||
#include "stdafx.h"
|
||||
#ifdef OLIVIA_COMPILA
|
||||
#include "olv_reco.h"
|
||||
#include "olv_reco_thr.h"
|
||||
#include "olv_geom.h"
|
||||
#include "olv_sens_ws.h"
|
||||
#include "ini_file.h"
|
||||
/**
|
||||
* @file olv_reco.cpp
|
||||
* Archivo de definiciones y variables de la utilidad de recogida de residuos del programa Olivia.
|
||||
*/
|
||||
Colv_reco::Colv_reco(COlivia *olv) : Colv_limp(olv)
|
||||
{
|
||||
this->olv = olv;
|
||||
thr_reco = new Colv_reco_thr(this);
|
||||
|
||||
//rellena_campos();
|
||||
t_vaci=t_sal=0;
|
||||
kg_max=kg_reco_def=0;
|
||||
anch_vehi=0;
|
||||
giro_vehi=OLV_LIMP_GIRO_VEHIC;
|
||||
memset(coor_plant,0,3*sizeof(double));
|
||||
nod_instal=nod_plant=-1;
|
||||
ptos_vaci=NULL;
|
||||
dens_frac=150;
|
||||
info_carg=NULL;
|
||||
//
|
||||
}
|
||||
|
||||
Colv_reco::~Colv_reco(void)
|
||||
{
|
||||
|
||||
cancela();
|
||||
delete(thr_reco);
|
||||
|
||||
if(ptos_vaci)
|
||||
free(ptos_vaci);
|
||||
|
||||
if(info_carg)
|
||||
free(info_carg);
|
||||
|
||||
if(ord_sec_plan)
|
||||
{
|
||||
if(ord_sec_plan[1].ctnod[0] && ord_sec_plan[1].ctnod[0]==ord_sec_plan[0].ctnod[0])
|
||||
ord_sec_plan[1].ctnod[0]=NULL;
|
||||
|
||||
//solo libera la segunda parte parte, el destructor de limp hace el resto
|
||||
if(ord_sec_plan[1].ctnod[0])
|
||||
{
|
||||
ord_sec_plan[1].libera(0,conjs.n);
|
||||
free(ord_sec_plan[1].ctnod[0]);
|
||||
}
|
||||
ord_sec_plan[1].ctnod[0]=NULL;
|
||||
}
|
||||
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Termina las tareas
|
||||
*/
|
||||
void Colv_reco::cancela()
|
||||
{
|
||||
thr_reco->termina_th();
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Inicia las variables que son propias de limpieza
|
||||
*/
|
||||
void Colv_reco::inicia_limp()
|
||||
{
|
||||
res_circ=OLV_RES_RECOGER_SOLO_LADO_Y_GIROS;
|
||||
t_tto=t_vaci;
|
||||
//ang_lim = giro_vehi*OLV_PI/180;
|
||||
tipo_ambit=OLV_AMB_PUN;
|
||||
v_despl=0;
|
||||
uds_tto=OliviaDef::GeneralDef::OlvTipTtoMin;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Rellena los campos de la dbf
|
||||
*/
|
||||
void Colv_reco::rellena_campos()
|
||||
{
|
||||
camps_r.campo_uds[0]=0;
|
||||
camps_r.campo_capa[0]=0;
|
||||
camps_r.campo_kgcont[0]=0;
|
||||
Colv_limp::rellena_campos();
|
||||
rellena_campos_sens();
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Pone las opciones de configuración de lo que recibe por el socket
|
||||
*/
|
||||
int Colv_reco::pon_config(char *config_)
|
||||
{
|
||||
int j;
|
||||
char *token;
|
||||
char config[2048];
|
||||
|
||||
if(!config)
|
||||
return 0;
|
||||
|
||||
strcpy_s(config,2048,config_);
|
||||
|
||||
j=Colv_limp::pon_config(config);
|
||||
|
||||
//los parámetros son:
|
||||
token = strtok(config, OliviaDef::GeneralDef::EjecGeoParamSep);
|
||||
//avanza al siguiente token, el primero indica "\CONFIGURACION"
|
||||
token = strtok(NULL, OliviaDef::GeneralDef::EjecGeoParamSep);
|
||||
|
||||
while (token != NULL)
|
||||
{
|
||||
if(strstr(token,OliviaDef::GeneralDef::GR_kgM))
|
||||
{
|
||||
if(!olv->dame_param(token, &kg_max))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_dens))
|
||||
{
|
||||
if(!olv->dame_param(token, &dens_frac))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_camp_uds))
|
||||
{
|
||||
if(!olv->dame_param(token, camps_r.campo_uds,sizeof(camps_r.campo_uds)))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_camp_kgrec))
|
||||
{
|
||||
if(!olv->dame_param(token, camps_r.campo_kgcont,sizeof(camps_r.campo_kgcont)))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_camp_cap))
|
||||
{
|
||||
if(!olv->dame_param(token, camps_r.campo_capa,sizeof(camps_r.campo_capa)))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_kgrecog))
|
||||
{
|
||||
if(!olv->dame_param(token, &kg_reco_def))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_tvc))
|
||||
{
|
||||
if(!olv->dame_param(token, &t_vaci))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_tdca))
|
||||
{
|
||||
if(!olv->dame_param(token, &t_descarg))
|
||||
break;
|
||||
t_descarg=t_descarg*60;//porque viene en minutos
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_tsal))
|
||||
{
|
||||
if(!olv->dame_param(token, &t_sal))
|
||||
break;
|
||||
t_sal=t_sal*60;//porque viene en minutos
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_anc))
|
||||
{
|
||||
if(!olv->dame_param(token, &anch_vehi))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_gir))
|
||||
{
|
||||
if(!olv->dame_param(token, &giro_vehi))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_descx))
|
||||
{
|
||||
if(!olv->dame_param(token, &coor_plant[0]))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_descy))
|
||||
{
|
||||
if(!olv->dame_param(token, &coor_plant[1]))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_carga_cont))
|
||||
{
|
||||
if(!olv->dame_param(token, &info_sens.porc_lim))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_sens_modo))
|
||||
{
|
||||
if(!olv->dame_param(token, &info_sens.modo_pet))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_sens_url))
|
||||
{
|
||||
if(!olv->dame_param(token, info_sens.url,sizeof(info_sens.url)))
|
||||
break;
|
||||
for(int i=0;info_sens.url[i]; i++ )
|
||||
{
|
||||
if(info_sens.url[i]=='\\')
|
||||
info_sens.url[i]='/';
|
||||
}
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_sens_id))
|
||||
{
|
||||
if(!olv->dame_param(token, info_sens.camps.id,sizeof(info_sens.camps.id)))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_sens_fecha))
|
||||
{
|
||||
if(!olv->dame_param(token, info_sens.fecha_ini,sizeof(info_sens.fecha_ini)))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token,OliviaDef::GeneralDef::GR_sens_fechaf))
|
||||
{
|
||||
if(!olv->dame_param(token, info_sens.fecha_fin,sizeof(info_sens.fecha_fin)))
|
||||
break;
|
||||
}
|
||||
else if(strstr(token, OliviaDef::GeneralDef::GR_lateral))
|
||||
{
|
||||
if(!olv->dame_param(token, &lateral))
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
token = strtok(NULL, OliviaDef::GeneralDef::EjecGeoParamSep);
|
||||
continue;
|
||||
}
|
||||
token = strtok(NULL, OliviaDef::GeneralDef::EjecGeoParamSep);
|
||||
j++;
|
||||
}
|
||||
|
||||
strcpy_s(olv->paths.path_res_rut,MAX_PATH,olv->paths.path_data);
|
||||
strcpy_s(olv->paths.path_res_pt,MAX_PATH,olv->paths.path_data);
|
||||
|
||||
inicia_limp();
|
||||
|
||||
return j;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Inicia las tareas de la utilidad de limpieza viaria
|
||||
*/
|
||||
BOOL Colv_reco::inicia()
|
||||
{
|
||||
//arranca el thread
|
||||
thr_reco->inicia_th();
|
||||
//empieza importando
|
||||
thr_reco->encola(thr_reco->OLV_LIMP_EV_ABRE_DAT,NULL,FALSE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
void Colv_reco::dame_cost( double ltot, int ia, float *cost, float *cost2 )
|
||||
{
|
||||
Colv_limp::dame_cost(ltot,ia,cost,cost2);
|
||||
//sustituye el caso de que sea contenedor
|
||||
if((iaso[ia].flgs & OLV_LIMP_FLG_AMB) && (tipo_ambit==OLV_AMB_PUN))
|
||||
{
|
||||
*cost=*cost2=(float)(t_tto*iaso[ia].inf_r.uds); //en segundos, el tiempo que tarda en vaciar un contenedor, por el número de contenedores
|
||||
}
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Rellena los campos del método POST para lectura de los sensores
|
||||
*/
|
||||
void Colv_reco::rellena_campos_sens()
|
||||
{
|
||||
//info para el cuerpo del envío post
|
||||
sprintf_s(info_sens.camps.fn,OLV_MAX_CAMP_HTTP,"fn");
|
||||
sprintf_s(info_sens.camps.id,OLV_MAX_CAMP_HTTP,"id");
|
||||
sprintf_s(info_sens.camps.usr,OLV_MAX_CAMP_HTTP,"usr");
|
||||
sprintf_s(info_sens.camps.pwd,OLV_MAX_CAMP_HTTP,"pwd");
|
||||
sprintf_s(info_sens.camps.startdate,OLV_MAX_CAMP_HTTP,"startdate");
|
||||
sprintf_s(info_sens.camps.enddate,OLV_MAX_CAMP_HTTP,"enddate");
|
||||
|
||||
//el envío del POST al web service
|
||||
sprintf_s(info_sens.fn_cont_status,OLV_MAX_URL,"get_container_status");
|
||||
sprintf_s(info_sens.usr,OLV_MAX_CAMP_HTTP,"VSM");
|
||||
sprintf_s(info_sens.pwd,OLV_MAX_CAMP_HTTP,"VSM2017");
|
||||
sprintf_s(info_sens.url,OLV_MAX_URL,"http://localiza.info/Utilidades/APIManager.aspx");
|
||||
|
||||
//la respuesta del servicio en JSON
|
||||
sprintf_s(info_sens.camps_json.histo,OLV_MAX_CAMP_HTTP_LONG,"HistoricalFillingData");
|
||||
sprintf_s(info_sens.camps_json.id,OLV_MAX_CAMP_HTTP_LONG,"ContainerID");
|
||||
sprintf_s(info_sens.camps_json.porc,OLV_MAX_CAMP_HTTP_LONG,"FillingPercentage");
|
||||
sprintf_s(info_sens.camps_json.resp_code,OLV_MAX_CAMP_HTTP_LONG,"ResponseCode");
|
||||
sprintf_s(info_sens.camps_json.resp_code_err,OLV_MAX_CAMP_HTTP_LONG,"ERROR");
|
||||
sprintf_s(info_sens.camps_json.resp_data,OLV_MAX_CAMP_HTTP_LONG,"ResponseData");
|
||||
|
||||
CTime tt = CTime::GetCurrentTime();
|
||||
sprintf_s(info_sens.fecha_fin,OLV_MAX_CAMP_HTTP_LONG,"%04d-%02d-%02dT%02d%%%%3A00%02d%%%%3A00%02d",tt.GetYear(),tt.GetMonth(),tt.GetDay(),
|
||||
tt.GetHour(),tt.GetMinute(),tt.GetSecond());//"2017-10-19T13:44:00");
|
||||
|
||||
tt = tt - CTimeSpan(0,1,0,0); //una hora menos
|
||||
sprintf_s(info_sens.fecha_ini,OLV_MAX_CAMP_HTTP_LONG,"%04d-%02d-%02dT%02d%%%%3A00%02d%%%%3A00%02d",tt.GetYear(),tt.GetMonth(),tt.GetDay(),
|
||||
tt.GetHour(),tt.GetMinute(),tt.GetSecond());//"2017-10-19T13:44:00");
|
||||
|
||||
info_sens.modo_pet=OLV_SENS_PET_UNICO;
|
||||
info_sens.porc_lim= 0;
|
||||
|
||||
if(olv->paths.path_cfg_geo[0])
|
||||
{
|
||||
if(!lee_campos_sens_ini(olv->paths.path_cfg_geo))
|
||||
guarda_campos_sens_ini(olv->paths.path_cfg_geo);
|
||||
}
|
||||
}
|
||||
//*************************************************************************************
|
||||
BOOL Colv_reco::lee_campos_sens_ini(char *path)
|
||||
{
|
||||
Cini_file ini;
|
||||
int ig;
|
||||
|
||||
if(!ini.lee(path))
|
||||
return FALSE;
|
||||
ig=ini.get_grupo(OLV_RECO_GRUPO_SENS);
|
||||
if(ig<0)
|
||||
return FALSE;//no existe grupo
|
||||
|
||||
//leer campos del ini
|
||||
ini.dame_valor(ig,OLV_RECO_PARAM_FN,info_sens.camps.fn,"fn");
|
||||
ini.dame_valor(ig,OLV_RECO_PARAM_ID,info_sens.camps.id,"id");
|
||||
ini.dame_valor(ig,OLV_RECO_PARAM_USR,info_sens.camps.usr,"usr");
|
||||
ini.dame_valor(ig,OLV_RECO_PARAM_PWD,info_sens.camps.pwd,"pwd");
|
||||
ini.dame_valor(ig,OLV_RECO_PARAM_STRD,info_sens.camps.startdate,"startdate");
|
||||
ini.dame_valor(ig,OLV_RECO_PARAM_ENDD,info_sens.camps.enddate,"enddate");
|
||||
|
||||
ini.dame_valor(ig,OLV_RECO_PARAM_FN_STAT,info_sens.fn_cont_status,"get_container_status");
|
||||
ini.dame_valor(ig,OLV_RECO_PARAM_USR_USR,info_sens.usr,"VSM");
|
||||
ini.dame_valor(ig,OLV_RECO_PARAM_PWD_PWD,info_sens.pwd,"VSM2017");
|
||||
|
||||
ini.dame_valor(ig,OLV_RECO_PARAM_JS_ID,info_sens.camps_json.id,"ContainerID");
|
||||
ini.dame_valor(ig,OLV_RECO_PARAM_JS_HISTO,info_sens.camps_json.histo,"HistoricalFillingData");
|
||||
ini.dame_valor(ig,OLV_RECO_PARAM_JS_PORC,info_sens.camps_json.porc,"FillingPercentage");
|
||||
ini.dame_valor(ig,OLV_RECO_PARAM_JS_R_CODE,info_sens.camps_json.resp_code,"ResponseCode");
|
||||
ini.dame_valor(ig,OLV_RECO_PARAM_JS_R_CODE_ERR,info_sens.camps_json.resp_code_err,"ERROR");
|
||||
ini.dame_valor(ig,OLV_RECO_PARAM_JS_R_DATA,info_sens.camps_json.resp_data,"ResponseData");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
BOOL Colv_reco::guarda_campos_sens_ini(char *path)
|
||||
{
|
||||
Cini_file ini;
|
||||
|
||||
int ig =ini.add_grupo(OLV_RECO_GRUPO_SENS);
|
||||
if(ig<0)
|
||||
return FALSE;
|
||||
|
||||
ini.add(ig,OLV_RECO_PARAM_FN,info_sens.camps.fn);
|
||||
ini.add(ig,OLV_RECO_PARAM_ID,info_sens.camps.id);
|
||||
ini.add(ig,OLV_RECO_PARAM_USR,info_sens.camps.usr);
|
||||
ini.add(ig,OLV_RECO_PARAM_PWD,info_sens.camps.pwd);
|
||||
ini.add(ig,OLV_RECO_PARAM_STRD,info_sens.camps.startdate);
|
||||
ini.add(ig,OLV_RECO_PARAM_ENDD,info_sens.camps.enddate);
|
||||
|
||||
ini.add(ig,OLV_RECO_PARAM_FN_STAT,info_sens.fn_cont_status);
|
||||
ini.add(ig,OLV_RECO_PARAM_USR_USR,info_sens.usr);
|
||||
ini.add(ig,OLV_RECO_PARAM_PWD_PWD,info_sens.pwd);
|
||||
|
||||
ini.add(ig,OLV_RECO_PARAM_JS_ID,info_sens.camps_json.id);
|
||||
ini.add(ig,OLV_RECO_PARAM_JS_HISTO,info_sens.camps_json.histo);
|
||||
ini.add(ig,OLV_RECO_PARAM_JS_PORC,info_sens.camps_json.porc);
|
||||
ini.add(ig,OLV_RECO_PARAM_JS_R_CODE,info_sens.camps_json.resp_code);
|
||||
ini.add(ig,OLV_RECO_PARAM_JS_R_CODE_ERR,info_sens.camps_json.resp_code_err);
|
||||
ini.add(ig,OLV_RECO_PARAM_JS_R_DATA,info_sens.camps_json.resp_data);
|
||||
|
||||
if(!ini.guarda(path))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
#endif
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
#pragma once
|
||||
#ifdef OLIVIA_COMPILA
|
||||
#include "olv_limp.h"
|
||||
#include "olv_sens_ws.h"
|
||||
|
||||
class COlivia;
|
||||
class Colv_reco_thr;
|
||||
|
||||
#define OLV_RECO_GRUPO_SENS "CAMPOS_SENS"
|
||||
#define OLV_RECO_PARAM_FN "fn"
|
||||
#define OLV_RECO_PARAM_ID "id"
|
||||
#define OLV_RECO_PARAM_USR "usr"
|
||||
#define OLV_RECO_PARAM_PWD "pwd"
|
||||
#define OLV_RECO_PARAM_STRD "startd"
|
||||
#define OLV_RECO_PARAM_ENDD "endd"
|
||||
#define OLV_RECO_PARAM_FN_STAT "fn_status"
|
||||
#define OLV_RECO_PARAM_USR_USR "usr_usr"
|
||||
#define OLV_RECO_PARAM_PWD_PWD "pwd_pwd"
|
||||
#define OLV_RECO_PARAM_JS_ID "js_id"
|
||||
#define OLV_RECO_PARAM_JS_HISTO "js_histo"
|
||||
#define OLV_RECO_PARAM_JS_PORC "js_porc"
|
||||
#define OLV_RECO_PARAM_JS_R_CODE "js_r_cd"
|
||||
#define OLV_RECO_PARAM_JS_R_CODE_ERR "js_r_cd_err"
|
||||
#define OLV_RECO_PARAM_JS_R_DATA "js_r_dt"
|
||||
|
||||
/**
|
||||
* @file olv_reco.h
|
||||
* Archivo de definiciones y variables de la utilidad de recogida de residuos del programa Olivia.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Estructura que contiene los nombres de los campos a leer
|
||||
*/
|
||||
typedef struct Campos_dbf_reco
|
||||
{
|
||||
char campo_uds[OLV_LIMP_MAX_CAMP];
|
||||
char campo_capa[OLV_LIMP_MAX_CAMP];
|
||||
char campo_kgcont[OLV_LIMP_MAX_CAMP];
|
||||
}Campos_dbf_reco;
|
||||
|
||||
/**
|
||||
* Enumeración para identificar si es instalación de salida llegada o planta de descarga
|
||||
*/
|
||||
enum InstalPlant{
|
||||
OLV_INSTAL,
|
||||
OLV_PLANT,
|
||||
};
|
||||
/**
|
||||
* Clase de definiciones y variables de la utilidad de recogida de residuos del programa Olivia.
|
||||
*/
|
||||
class Colv_reco : public Colv_limp
|
||||
{
|
||||
public:
|
||||
//*************************************************************************************
|
||||
//Variables
|
||||
Colv_reco_thr *thr_reco; ///<Instancia del thread de recogida, que hace las operaciones
|
||||
Campos_dbf_reco camps_r; ///<Campos a leer de la dbf
|
||||
short *ptos_vaci; ///<Array de tamaño Namb, donde indica si en ese ámbito va a vaciar o a descargar
|
||||
int *info_carg; ///<Array para guardar la info de carga de los sensores
|
||||
int t_vaci; ///<Tiempo de vaciado de cada contenedor, en segundos
|
||||
int t_descarg; ///<Tiempo de descarga en planta, en segundos
|
||||
double dens_frac; ///<Densidad de la fracción a recoger, en kg/m3
|
||||
double kg_max; ///<Kg máximos de recogida por vehículo en cada ruta
|
||||
double kg_reco_def; ///<Kg por defecto que se recogen en cada contenedor
|
||||
double anch_vehi; ///<Ancho del vehículo, en metros
|
||||
double giro_vehi; ///<Giro mínimo del vehículo, en º
|
||||
double coor_plant[3]; ///<Coordenadas de la planta donde va a descargar
|
||||
Info_sens info_sens; ///<Información para la conexión al ws de los sensores
|
||||
|
||||
//*************************************************************************************
|
||||
//Funciones
|
||||
Colv_reco(COlivia *olv);
|
||||
~Colv_reco(void);
|
||||
void rellena_campos();
|
||||
int pon_config(char *config);
|
||||
void inicia_limp();
|
||||
BOOL inicia();
|
||||
void dame_cost(double ltot, int ia, float *cost, float *cost2);
|
||||
void cancela();
|
||||
void rellena_campos_sens();
|
||||
BOOL lee_campos_sens_ini(char *path);
|
||||
BOOL guarda_campos_sens_ini(char *path);
|
||||
};
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,76 @@
|
|||
#pragma once
|
||||
#ifdef OLIVIA_COMPILA
|
||||
#include "olv_limp_def.h"
|
||||
#include "olv_limp_thr.h"
|
||||
//#include "vector.h"
|
||||
|
||||
/**
|
||||
* @file olv_reco_thr.h
|
||||
* Archivo de definiciones del thread de control de la utilidad de recogida de residuos del programa Olivia.
|
||||
*/
|
||||
class Colv_reco;
|
||||
struct Info_conjs;
|
||||
|
||||
/////////////////////////
|
||||
/**
|
||||
* Clase del thread de control de la utilidad de recogida de residuos del programa Olivia.
|
||||
*/
|
||||
class Colv_reco_thr : public Colv_limp_thr
|
||||
{
|
||||
public:
|
||||
//*************************************************************************************
|
||||
enum Ev_olv_reco_thr
|
||||
{
|
||||
OLV_RECO_EV_SENS = Colv_limp_thr::OLV_LIMP_EV_N,
|
||||
OLV_RECO_EV_SENS_SUB,
|
||||
OLV_RECO_EV_SENS_FIN,
|
||||
OLV_RECO_EV_N
|
||||
}Ev_olv_reco_thr;
|
||||
|
||||
//*************************************************************************************
|
||||
//Variables
|
||||
Colv_reco *olv_reco;
|
||||
|
||||
//*************************************************************************************
|
||||
//Constructor
|
||||
Colv_reco_thr(Colv_reco *olv_reco);
|
||||
~Colv_reco_thr(void);
|
||||
|
||||
//*************************************************************************************
|
||||
//Funciones
|
||||
void inicia_th();
|
||||
static void cola_proc(int evento,OlvAsync_cola<Param_olv_limp_thr> *clase,Param_olv_limp_thr *e);
|
||||
void lanza_subthrs(int tar, int nthr_def=-1);
|
||||
|
||||
/////////////////////
|
||||
BOOL rellena_datos();
|
||||
BOOL pide_info_sens();
|
||||
void pide_info_sens_sub(int ithr);
|
||||
BOOL pide_info_sens_fin(int nno);
|
||||
|
||||
//calcular el nodo de la planta
|
||||
BOOL pon_nodos_planta(double pt[3]);
|
||||
BOOL busca_conjs_planta(double pt[3], int *nod);
|
||||
BOOL calcula_cost_plant();
|
||||
|
||||
//costes para planificación
|
||||
double dame_cost_jornada();
|
||||
double dame_coste( Secu_amb * sec, int ini, int fin, Info_sec *s, BOOL ind_abs);
|
||||
void planifica_sub_1(int ithr, Matrix2d<float> &cost_amb);
|
||||
double dame_coste_pon_viajes( Secu_amb * sec, int ini, int fin, Info_sec *s, int *nvac);
|
||||
|
||||
//Funciones para informes de planificación
|
||||
BOOL genera_planif_vaci(int is, int ini, int fin, int *secu, int tip_viaje);
|
||||
BOOL genera_list_fila_vaci(Colv_csv *cc, char *fila0, int ielem, int isec, int secu, double tt, double *t0,BOOL is_fin);
|
||||
void quita_t_ult_desc(int s, double *t);
|
||||
BOOL guarda_cols_ruta(char *path_shp);
|
||||
void pon_t_desp(Info_sec *s, Secu_amb *sec);
|
||||
BOOL comprueba_descarg(int iamb);
|
||||
void dame_observ_cont(int iamb, char *observ);
|
||||
BOOL guarda_cols_insta(char *path_shp);
|
||||
void pon_ptos_ctrl(Info_planif *pp, int npt_ctrl, double cost_ctrl);
|
||||
void rellena_tramos();
|
||||
BOOL guarda_cols_ruta_tram(char *path_shp);
|
||||
int rellena_insta_tramos();
|
||||
};
|
||||
#endif
|
||||
|
|
@ -0,0 +1,243 @@
|
|||
#include "stdafx.h"
|
||||
#ifdef OLIVIA_COMPILA
|
||||
#include "olv_sens_ws.h"
|
||||
#ifndef OLIVIA_NSENS
|
||||
|
||||
#include <curl.h>
|
||||
#include <json.h>
|
||||
#include <time.h>
|
||||
#endif
|
||||
/**
|
||||
* @file olv_sens_ws.cpp
|
||||
* Archivo de implementaciones de la utilidad para conexión al Web Service para lectura de los sensores de la herramienta Olivia.
|
||||
*/
|
||||
/**
|
||||
* Clase para conexión al Web Service para lectura de los sensores de la herramienta Olivia.
|
||||
*/
|
||||
Colv_sens_ws::Colv_sens_ws(void)
|
||||
{
|
||||
info=NULL;
|
||||
cuerpo[0]=0;
|
||||
}
|
||||
|
||||
Colv_sens_ws::~Colv_sens_ws(void)
|
||||
{
|
||||
}
|
||||
//*************************************************************************************
|
||||
void Colv_sens_ws::inicia(Info_sens *info_)
|
||||
{
|
||||
info=info_;
|
||||
|
||||
strcpy_s(url,OLV_MAX_URL,info->url );
|
||||
|
||||
sprintf_s(cuerpo,OLV_MAX_CUERPO,"?%s=%s&id=%s&%s=%s&%s=%s&%s=%s&%s=%s",
|
||||
info->camps.fn,info->fn_cont_status,
|
||||
"%s",//deja abierto para meter el id del sensor que toque
|
||||
info->camps.startdate,info->fecha_ini,
|
||||
info->camps.enddate,info->fecha_fin,
|
||||
info->camps.usr,info->usr,
|
||||
info->camps.pwd,info->pwd);
|
||||
|
||||
}
|
||||
//*************************************************************************************
|
||||
/*
|
||||
Pide el porcentaje de llenado en tanto por cien del contenedor id
|
||||
*/
|
||||
double Colv_sens_ws::dame_porc_cont_i(char *id)
|
||||
{
|
||||
int ndata;
|
||||
int ini;
|
||||
int *data_vol;
|
||||
double perc;
|
||||
|
||||
//manda pregunta
|
||||
if(!get_status_cont_i(id))
|
||||
return FALSE;
|
||||
|
||||
//recibe respuesta
|
||||
ndata=0;
|
||||
data_vol=NULL;
|
||||
if(!answer_json(id,&ndata,&data_vol))
|
||||
return FALSE;
|
||||
|
||||
perc=0;
|
||||
if(ndata>0)
|
||||
{
|
||||
if(info->modo_pet==OLV_SENS_PET_UNICO)
|
||||
ini=ndata-1;//solo se queda con el valor único último
|
||||
else if(info->modo_pet==OLV_SENS_PET_MEDIA)
|
||||
ini=0;
|
||||
for (int i=ini;i<ndata;i++)
|
||||
{
|
||||
perc+=data_vol[i]*1./(ndata-ini);
|
||||
}
|
||||
}
|
||||
if(data_vol)
|
||||
free(data_vol);
|
||||
return perc;
|
||||
}
|
||||
//*************************************************************************************
|
||||
BOOL Colv_sens_ws::get_status_cont_i(char *id)
|
||||
{
|
||||
////////////
|
||||
//Monta el cuerpo POST
|
||||
char cuerpo_aux[OLV_MAX_CUERPO+OLV_MAX_URL];
|
||||
strcpy_s(cuerpo_aux,OLV_MAX_URL,url);
|
||||
sprintf_s(&cuerpo_aux[strlen(cuerpo_aux)],OLV_MAX_CUERPO,cuerpo,id);
|
||||
|
||||
//envía el Post
|
||||
if(!post_curl(cuerpo_aux))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
BOOL Colv_sens_ws::post_curl(char *body)
|
||||
{
|
||||
#ifndef OLIVIA_NSENS
|
||||
|
||||
//envía el Post
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
BOOL mal=FALSE;
|
||||
|
||||
/* In windows, this will init the winsock stuff */
|
||||
res=curl_global_init(CURL_GLOBAL_ALL);
|
||||
if(res != CURLE_OK)
|
||||
{
|
||||
sprintf_s(err_str, "Error al iniciar conexión con servicio web: %s\n",
|
||||
curl_easy_strerror(res));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* get a curl handle */
|
||||
curl = curl_easy_init();
|
||||
if(!curl)
|
||||
{
|
||||
sprintf_s(err_str, "Error al iniciar conexión con servicio web: %s\n",
|
||||
curl_easy_strerror(res));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* First set the URL that is about to receive our POST. This URL can
|
||||
just as well be a https:// URL if that is what should receive the
|
||||
data. */
|
||||
curl_easy_setopt(curl, CURLOPT_URL, body);
|
||||
cURL_JSON_data.clear();
|
||||
|
||||
/* Specify which function will parse the answer */
|
||||
res=curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, Colv_sens_ws::writeJSONURLCallback);
|
||||
|
||||
/* Specify variable to parse data */
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)this);
|
||||
|
||||
/* Perform the request, res will get the return code */
|
||||
res = curl_easy_perform(curl);
|
||||
/* Check for errors */
|
||||
if(res != CURLE_OK)
|
||||
{
|
||||
sprintf_s(err_str, "Error al enviar POST en el servicio web: %s\n",
|
||||
curl_easy_strerror(res));
|
||||
mal=TRUE;
|
||||
}
|
||||
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
curl_global_cleanup();
|
||||
|
||||
return !mal;
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
//*************************************************************************************
|
||||
size_t Colv_sens_ws::writeJSONURLCallback(char* buf, size_t siz, size_t nmemb, void* up)//Callback function to store the URL's data
|
||||
{
|
||||
#ifndef OLIVIA_NSENS
|
||||
|
||||
if(!up)
|
||||
return siz*nmemb;
|
||||
Colv_sens_ws *cl=(Colv_sens_ws*)up;
|
||||
for (int c = 0; c<(int)(siz*nmemb); c++)
|
||||
{
|
||||
cl->cURL_JSON_data.push_back(buf[c]);
|
||||
}
|
||||
return siz*nmemb;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
//*************************************************************************************
|
||||
BOOL Colv_sens_ws::answer_json(char *id_, int *ndata_, int **data_vol_)
|
||||
{
|
||||
#ifndef OLIVIA_NSENS
|
||||
int ndata,i;
|
||||
int *data_vol;
|
||||
std::string id;
|
||||
std::string err_code;
|
||||
Json::Reader jsonReader;
|
||||
Json::Value jsonData;
|
||||
Json::Value histoData;
|
||||
|
||||
ndata=0;
|
||||
data_vol=0;
|
||||
|
||||
if (jsonReader.parse(cURL_JSON_data, jsonData))
|
||||
{
|
||||
//comprueba que sea el id elegido
|
||||
id = jsonData[info->camps_json.id].asString();
|
||||
if(id.length()==0)
|
||||
{
|
||||
//mira a ver si ha habido error
|
||||
err_code=jsonData[info->camps_json.resp_code].asString();
|
||||
if(err_code.length()>0 && err_code.compare(info->camps_json.resp_code_err))
|
||||
{
|
||||
sprintf_s(err_str, "Error en la petición %s\n",jsonData[info->camps_json.resp_data].asString());
|
||||
jsonData.clear();
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
if(strcmp(id.data(),id_))
|
||||
{
|
||||
sprintf_s(err_str, "Error, no se ha recibido el id del contenedor solicitado %s %s\n",id,id_);
|
||||
jsonData.clear();
|
||||
return FALSE;
|
||||
}
|
||||
//coge la info histórica de carga
|
||||
histoData = jsonData[info->camps_json.histo];
|
||||
ndata = (int) histoData.size();
|
||||
//crea el array para almacenar los valores de carga
|
||||
data_vol=(int*)malloc(ndata*sizeof(int));
|
||||
if(!data_vol)
|
||||
{
|
||||
sprintf_s(err_str, "Error, sin memoria al leer info JSON\n");
|
||||
jsonData.clear();
|
||||
return FALSE;
|
||||
}
|
||||
i=0;
|
||||
for (Json::ValueConstIterator it = histoData.begin(); it != histoData.end(); ++it)
|
||||
{
|
||||
const Json::Value data = *it;
|
||||
data_vol[i]=data[info->camps_json.porc].asInt();
|
||||
i++;
|
||||
}
|
||||
if(i!=ndata)
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf_s(err_str, "Error al leer info JSON: %s\n",
|
||||
jsonReader.getFormattedErrorMessages());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
jsonData.clear();
|
||||
|
||||
*data_vol_=data_vol;
|
||||
*ndata_=ndata;
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
#pragma once
|
||||
#ifndef OLIVIA_NSENS
|
||||
#endif
|
||||
#ifdef OLIVIA_COMPILA
|
||||
#include "olv.h"
|
||||
#include <string>
|
||||
/**
|
||||
* @file olv_sens_ws.h
|
||||
* Archivo de definiciones y variables de la utilidad para conexión al Web Service para lectura de los sensores de la herramienta Olivia.
|
||||
*/
|
||||
|
||||
#define OLV_MAX_CAMP_HTTP 16
|
||||
#define OLV_MAX_CAMP_HTTP_LONG 32
|
||||
#define OLV_MAX_URL 256
|
||||
#define OLV_MAX_CUERPO 1024
|
||||
|
||||
enum ModosPet
|
||||
{
|
||||
OLV_SENS_PET_UNICO,
|
||||
OLV_SENS_PET_MEDIA,
|
||||
};
|
||||
/**
|
||||
* Estructura para campos de los parámetros del método HTTP POST
|
||||
*/
|
||||
typedef struct Camps_post
|
||||
{
|
||||
char fn[OLV_MAX_CAMP_HTTP];
|
||||
char id[OLV_MAX_CAMP_HTTP];
|
||||
char usr[OLV_MAX_CAMP_HTTP];
|
||||
char pwd[OLV_MAX_CAMP_HTTP];
|
||||
char startdate[OLV_MAX_CAMP_HTTP];
|
||||
char enddate[OLV_MAX_CAMP_HTTP];
|
||||
}Camps_post;
|
||||
|
||||
/**
|
||||
* Estructura para campos de los parámetros de la respuesta del servicio en formato JSON
|
||||
*/
|
||||
typedef struct Camps_json
|
||||
{
|
||||
char id[OLV_MAX_CAMP_HTTP_LONG];
|
||||
char histo[OLV_MAX_CAMP_HTTP_LONG];
|
||||
char porc[OLV_MAX_CAMP_HTTP_LONG];
|
||||
char resp_code[OLV_MAX_CAMP_HTTP_LONG];
|
||||
char resp_code_err[OLV_MAX_CAMP_HTTP_LONG];
|
||||
char resp_data[OLV_MAX_CAMP_HTTP_LONG];
|
||||
}Camps_json;
|
||||
|
||||
/**
|
||||
* Estructura para conexión al web service de los sensores
|
||||
*/
|
||||
typedef struct Info_sens
|
||||
{
|
||||
char url[OLV_MAX_URL];
|
||||
char fn_cont_status[OLV_MAX_URL];
|
||||
char usr[OLV_MAX_CAMP_HTTP];
|
||||
char pwd[OLV_MAX_CAMP_HTTP];
|
||||
char fecha_ini[OLV_MAX_CAMP_HTTP_LONG];
|
||||
char fecha_fin[OLV_MAX_CAMP_HTTP_LONG];
|
||||
int modo_pet;
|
||||
double porc_lim;//en %
|
||||
Camps_post camps;
|
||||
Camps_json camps_json;
|
||||
}Info_sens;
|
||||
|
||||
class Colv_sens_ws
|
||||
{
|
||||
public:
|
||||
//*************************************************************************************
|
||||
//Variables
|
||||
Info_sens *info;
|
||||
char cuerpo[OLV_MAX_CUERPO];
|
||||
char err_str[OLV_MAX_ERR];
|
||||
char url[OLV_MAX_URL];
|
||||
std::string cURL_JSON_data;
|
||||
//*************************************************************************************
|
||||
//Funciones
|
||||
Colv_sens_ws(void);
|
||||
~Colv_sens_ws(void);
|
||||
void inicia(Info_sens *info_);
|
||||
double dame_porc_cont_i(char *id);
|
||||
BOOL get_status_cont_i(char *id);
|
||||
BOOL post_curl(char *body);
|
||||
static size_t writeJSONURLCallback(char* buf, size_t size, size_t nmemb, void* up);
|
||||
BOOL answer_json(char *id_, int *ndata_, int **data_vol_);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
#include "stdafx.h"
|
||||
#ifdef OLIVIA_COMPILA
|
||||
#include "olv.h"
|
||||
#include "olv_sock.h"
|
||||
|
||||
Colv_sock::Colv_sock(COlivia *olv)
|
||||
{
|
||||
this->olv = olv;
|
||||
sprintf_s(ip,32,"0.0.0.0");
|
||||
puerto=19933;
|
||||
}
|
||||
|
||||
Colv_sock::~Colv_sock(void)
|
||||
{
|
||||
}
|
||||
//*************************************************************************************
|
||||
BOOL Colv_sock::on_datos_recibidos( char *txt )
|
||||
{
|
||||
int pr;
|
||||
char *ch = NULL;
|
||||
const int SZMSG = OLV_MAX_TAREA+OLV_MAX_MSG_PROCE+10;
|
||||
char msgtar[SZMSG];
|
||||
char *secto=NULL;
|
||||
BOOL ret=TRUE;
|
||||
|
||||
if((strstr(txt,OliviaDef::GeneralDef::SockConf)) || (strstr(txt,OliviaDef::GeneralDef::SockConfPlan)) ||
|
||||
(strstr(txt,OliviaDef::GeneralDef::SockConfTodo)) && !olv->ya_config)
|
||||
{
|
||||
if(olv->pon_config(txt))
|
||||
{
|
||||
ch = strdup(OliviaDef::GeneralDef::SockConfOk);
|
||||
}
|
||||
else
|
||||
{
|
||||
ch = strdup(OliviaDef::GeneralDef::SockConfNOk);
|
||||
}
|
||||
if(!envia(ch))
|
||||
{
|
||||
ret= FALSE;
|
||||
}
|
||||
}
|
||||
else if(strcmp(txt,OliviaDef::GeneralDef::SockProgr)==0)
|
||||
{
|
||||
pr=olv->dame_progre();
|
||||
if(!envia("%ld", pr))
|
||||
{
|
||||
ret= FALSE;
|
||||
}
|
||||
}
|
||||
else if(strcmp(txt,OliviaDef::GeneralDef::SockTarea)==0)
|
||||
{
|
||||
pr=olv->dame_tarea();
|
||||
strcpy_s(msgtar, SZMSG,olv->tareas_str[pr]);
|
||||
if(strlen(olv->msg_proce)>0)
|
||||
strcat_s(msgtar,olv->msg_proce);
|
||||
///////////////////
|
||||
if(!envia("%s", msgtar ))
|
||||
{
|
||||
ret= FALSE;
|
||||
}
|
||||
}
|
||||
else if(strcmp(txt,OliviaDef::GeneralDef::SockCanc)==0)
|
||||
{
|
||||
//Cancela...
|
||||
ch = strdup(OliviaDef::GeneralDef::SockCancOk);
|
||||
if(!envia(ch))
|
||||
ret= FALSE;
|
||||
olv->cancela();
|
||||
}
|
||||
|
||||
txt[0]=0;
|
||||
|
||||
if(ch)
|
||||
free(ch);
|
||||
if(secto)
|
||||
free(secto);
|
||||
|
||||
return ret;
|
||||
}
|
||||
//*************************************************************************************
|
||||
Cstr_socket_srv* Colv_sock::crea_cliente()
|
||||
{
|
||||
Colv_sock *s;
|
||||
s= new Colv_sock(olv);
|
||||
return s;
|
||||
}
|
||||
//*************************************************************************************
|
||||
#endif
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
#ifdef OLIVIA_COMPILA
|
||||
#include "str_socket.h"
|
||||
|
||||
/**
|
||||
* @file olv_sock.h
|
||||
* Archivo de definiciones del socket de comunicaciones del programa Olivia.
|
||||
*/
|
||||
class COlivia;
|
||||
/**
|
||||
* Clase extendida de socket para conexión con Olivia AddIn
|
||||
*/
|
||||
class Colv_sock : public Cstr_socket_srv
|
||||
{
|
||||
public:
|
||||
//*************************************************************************************
|
||||
//Variables
|
||||
char ip[32]; ///<Ip local para conexión del socket
|
||||
int puerto; ///<Puerto para conexión del socket
|
||||
COlivia *olv; ///<Instancia general de la utilidad
|
||||
|
||||
//*************************************************************************************
|
||||
//Funciones
|
||||
Colv_sock(COlivia *olv);
|
||||
~Colv_sock(void);
|
||||
|
||||
virtual BOOL on_datos_recibidos( char *txt );
|
||||
virtual Cstr_socket_srv* crea_cliente();
|
||||
};
|
||||
#endif
|
||||
|
|
@ -0,0 +1,154 @@
|
|||
#include "StdAfx.h"
|
||||
#include "olv_tasks.h"
|
||||
#include <winbase.h>
|
||||
#include <shlwapi.h>
|
||||
#include "olv_tasks_def.h"
|
||||
#include "olv.h"
|
||||
#include "sock_task.h"
|
||||
#include "StrArray.h"
|
||||
#include "dir_manager.h"
|
||||
Colv_tasks::Colv_tasks(COlivia *ool)
|
||||
{
|
||||
olv = ool;
|
||||
path_ang[0]=path_cconj[0]=file_iaso[0]=path_temp[0]=0;
|
||||
}
|
||||
|
||||
Colv_tasks::~Colv_tasks(void)
|
||||
{
|
||||
}
|
||||
//*************************************************************************************
|
||||
/*
|
||||
* Arranca una aplicación
|
||||
*/
|
||||
BOOL Colv_tasks::lanza_app(char *appName, char *comline)
|
||||
{
|
||||
// additional information
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
BOOL is_alive=FALSE;
|
||||
|
||||
// set the size of the structures
|
||||
ZeroMemory( &si, sizeof(si) );
|
||||
si.cb = sizeof(si);
|
||||
ZeroMemory( &pi, sizeof(pi) );
|
||||
|
||||
// start the program up
|
||||
CreateProcess( appName, // the path
|
||||
comline, // Command line
|
||||
NULL, // Process handle not inheritable
|
||||
NULL, // Thread handle not inheritable
|
||||
FALSE, // Set handle inheritance to FALSE
|
||||
0, // No creation flags
|
||||
NULL, // Use parent's environment block
|
||||
NULL, // Use parent's starting directory
|
||||
&si, // Pointer to STARTUPINFO structure
|
||||
&pi // Pointer to PROCESS_INFORMATION structure (removed extra parentheses)
|
||||
);
|
||||
|
||||
//check is alive
|
||||
DWORD lpExitCode;
|
||||
GetExitCodeProcess(pi.hProcess,&lpExitCode);
|
||||
is_alive=(lpExitCode==STILL_ACTIVE);
|
||||
|
||||
// Close process and thread handles.
|
||||
CloseHandle( pi.hProcess );
|
||||
CloseHandle( pi.hThread );
|
||||
|
||||
return is_alive;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/*
|
||||
* Consigue el dir de una dll
|
||||
*/
|
||||
void Colv_tasks::get_dll_dir(char *dlldir)
|
||||
{
|
||||
char path[MAX_PATH];
|
||||
HMODULE hm = NULL;
|
||||
|
||||
path[0]=0;
|
||||
|
||||
hm=GetModuleHandle(OLV_DLL_NAME);
|
||||
|
||||
if (GetModuleFileName(hm, path, sizeof(path)) == 0)
|
||||
{
|
||||
int ret = GetLastError();
|
||||
fprintf(stderr, "GetModuleFileName failed, error = %d\n", ret);
|
||||
}
|
||||
|
||||
strcpy_s(dlldir,MAX_PATH,path);
|
||||
}
|
||||
//*************************************************************************************
|
||||
/*
|
||||
* Inicializa la ruta de los dirs
|
||||
*/
|
||||
void Colv_tasks::inidirs( char *path_temp )
|
||||
{
|
||||
char st1[MAX_PATH];
|
||||
strcpy_s(st1,MAX_PATH,path_temp);
|
||||
if(path_temp[strlen(path_temp)-1]=='\\')
|
||||
{
|
||||
st1[strlen(st1)-1]=0;
|
||||
}
|
||||
sprintf_s(path_cconj,MAX_PATH,"%s\\%s\\",st1,TASKS_NOMB_COSTCONJ);
|
||||
sprintf_s(path_costamb,MAX_PATH,"%s\\%s\\",st1,TASKS_NOMB_COSTAMB);
|
||||
sprintf_s(path_ang,MAX_PATH,"%s\\%s\\",st1,TASKS_NOMB_COSTANG);
|
||||
sprintf_s(file_iaso,MAX_PATH,"%s\\%s.%s",st1,TASKS_NOMB_IASO,TASKS_EXT_MAT);
|
||||
strcpy_s(this->path_temp,MAX_PATH,st1);
|
||||
|
||||
Cdir_manager dm;
|
||||
dm.crea_dir(st1);
|
||||
dm.crea_dir(path_cconj);
|
||||
dm.crea_dir(path_costamb);
|
||||
dm.crea_dir(path_ang);
|
||||
}
|
||||
//*************************************************************************************
|
||||
float minFloat(float a, float b)
|
||||
{
|
||||
return min(a,b);
|
||||
}
|
||||
//*************************************************************************************
|
||||
BOOL Colv_tasks::lee_cost_amb(Matrix2d<float> &cost_amb)
|
||||
{
|
||||
class floatMinCom: public ComClasFunction<float>
|
||||
{
|
||||
public:
|
||||
floatMinCom(){}
|
||||
virtual float comp(float a, float b)
|
||||
{
|
||||
return min(a, b);
|
||||
}
|
||||
};
|
||||
floatMinCom ccom;
|
||||
StrArray files;
|
||||
//pilla archivos-----------------------
|
||||
if(!Cdir_manager::listar(path_costamb, &files))
|
||||
return FALSE;
|
||||
char *f;
|
||||
for (int i = 0; i<files.size(); i++)
|
||||
{
|
||||
f=files.get(i);
|
||||
|
||||
if(strcmp(Cdir_manager::extension_archivo(f),TASKS_EXT_MAT))
|
||||
continue;
|
||||
if(!cost_amb.fileMix(f, &ccom))
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
BOOL Colv_tasks::guarda_cost_amb()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
//*************************************************************************************
|
||||
|
||||
//#ifdef OLV_UTILES32
|
||||
Cproceso_cliente* Colv_tasks::crea_cliente( BOOL *pirate )
|
||||
{
|
||||
Csock_task *soc = new Csock_task(olv);
|
||||
soc->pirate_soc = pirate;
|
||||
soc->olv = olv;
|
||||
|
||||
return soc;
|
||||
}
|
||||
//#endif
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
|
||||
class COlivia;
|
||||
class CoptiMemo;
|
||||
#include "sock_sv.h"
|
||||
/**
|
||||
* Clase para ejecución de Olivia en modo multitask EN DESUSO EN VERSIÓN 2.0
|
||||
*/
|
||||
class Colv_tasks : public Cescucha_sock_sv
|
||||
|
||||
{
|
||||
public:
|
||||
////////////////////////////////////
|
||||
//variables
|
||||
COlivia *olv;
|
||||
char path_temp[MAX_PATH];
|
||||
char path_cconj[MAX_PATH];
|
||||
char path_costamb[MAX_PATH];
|
||||
char path_ang[MAX_PATH];
|
||||
char file_iaso[MAX_PATH];
|
||||
////////////////////////////////////
|
||||
//métodos
|
||||
Colv_tasks(COlivia *ool);
|
||||
~Colv_tasks(void);
|
||||
|
||||
virtual Cproceso_cliente* crea_cliente(BOOL *pirate);
|
||||
|
||||
void inidirs(char *path_temp);
|
||||
BOOL lanza_app(char *appName, char *comline);
|
||||
void get_dll_dir(char *dlldir);
|
||||
BOOL lee_cost_amb(Matrix2d<float> &cost_amb);
|
||||
BOOL guarda_cost_amb();
|
||||
};
|
||||
|
|
@ -0,0 +1,200 @@
|
|||
#pragma once
|
||||
#include <psapi.h>
|
||||
#include "windows.h"
|
||||
|
||||
#define OLV_TASKS_MAXCONJROW 100
|
||||
#define OLV_TASKS_PORCMEM32 0.9
|
||||
#define OLV_TASKS_PORCMEM64 0.9
|
||||
#define OLV_TASKS_PORCCOLADJ 0.25
|
||||
#define OLV_TASKS_MAXMEMNOMULTI 600*1024*1024
|
||||
#define OLV_TASKS_MAXMEM32 1200*1024*1024
|
||||
#define OLV_TASKS_MARGENMEM 20*1024*1024
|
||||
#define TASKS_APP_NAME "OliviaTasks.exe"
|
||||
#define TASKS_FOLDER_NAME "OliviaTasks"
|
||||
#define OLV_DLL_NAME "Olivia.dll"
|
||||
#define TASKS_PORT 19996
|
||||
#define TASKS_NOMB_COSTCONJ "costconj"
|
||||
#define TASKS_NOMB_COSTAMB "costamb"
|
||||
#define TASKS_NOMB_COSTANG "costang"
|
||||
#define TASKS_NOMB_IASO "iaso"
|
||||
#define TASKS_EXT_MAT "otk"
|
||||
#define TASKS_EXT_DIS "dis"
|
||||
#define TASKS_PARAM_SEP " "
|
||||
|
||||
typedef enum TareasMultitask
|
||||
{
|
||||
CALC_COST_AMB=1,
|
||||
}TareasMultitask;
|
||||
|
||||
typedef struct HeadInfoAso
|
||||
{
|
||||
int nint; //número de enteros guardados (3xnamb)
|
||||
}HeadInfoAso;
|
||||
|
||||
typedef struct InfoIniTask
|
||||
{
|
||||
char path_temp[MAX_PATH];
|
||||
char path_cconj[MAX_PATH];
|
||||
char path_ang[MAX_PATH];
|
||||
char path_costamb[MAX_PATH];
|
||||
char file_iaso[MAX_PATH];
|
||||
char ext[8];
|
||||
bool usa_angs;
|
||||
int KK;
|
||||
int namb;//numero de ambitos
|
||||
int nthr;//numero de threads
|
||||
int ntsks;//numero de tasks
|
||||
int n;//numero de nodos
|
||||
int id_instal;
|
||||
int id_planta;
|
||||
}InfoIniTask;
|
||||
|
||||
class CoptiMemo
|
||||
{
|
||||
|
||||
public:
|
||||
//*********************************
|
||||
//Variables
|
||||
int div; //es 8 si es multitask, porque la mat de visto_ang ocupa n*n/8, si no es 1, porque ocupa n*n
|
||||
INT64 memo;
|
||||
double porc;
|
||||
//*********************************
|
||||
//Métodos
|
||||
CoptiMemo(BOOL mm=FALSE)
|
||||
{
|
||||
if(mm)
|
||||
{
|
||||
div=8;
|
||||
memo = dame_AvailPhysMem64();
|
||||
porc = OLV_TASKS_PORCMEM64;
|
||||
}
|
||||
else
|
||||
{
|
||||
div=1;
|
||||
memo= dame_AvailPhysMem64();
|
||||
porc = OLV_TASKS_PORCMEM32;
|
||||
}
|
||||
}
|
||||
~CoptiMemo(void)
|
||||
{
|
||||
}
|
||||
//*************************************************************************************
|
||||
/*
|
||||
* Pide la memoria disponible del sistema
|
||||
*/
|
||||
inline INT64 CoptiMemo::dame_AvailPhysMem64()
|
||||
{
|
||||
MEMORYSTATUSEX status;
|
||||
status.dwLength = sizeof(status);
|
||||
GlobalMemoryStatusEx(&status);
|
||||
return (INT64)status.ullAvailPhys;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/*
|
||||
* Pide la memoria disponible en 32, que es 1,2 GB aprox menos la usada por el proceso
|
||||
*/
|
||||
inline INT64 CoptiMemo::dame_AvailPhysMem32()
|
||||
{
|
||||
return (INT64)OLV_TASKS_MAXMEM32-dame_UsedPhysMem();
|
||||
}
|
||||
//*************************************************************************************
|
||||
/*
|
||||
* Pide la memoria usada por el proceso
|
||||
*/
|
||||
inline INT64 CoptiMemo::dame_UsedPhysMem()
|
||||
{
|
||||
PROCESS_MEMORY_COUNTERS_EX pmc;
|
||||
GetProcessMemoryInfo(GetCurrentProcess(), (PROCESS_MEMORY_COUNTERS*)&pmc, (DWORD)sizeof(pmc));
|
||||
//SIZE_T virtualMemUsedByMe = pmc.PrivateUsage;
|
||||
|
||||
return (INT64) pmc.WorkingSetSize;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/*
|
||||
* Calcula el número de filas de mapmatrix que pueden ser vector en el master
|
||||
*/
|
||||
inline int CoptiMemo::calc_nvect_master(int nconj)
|
||||
{
|
||||
//lo calcula en base a lo que van a ocupar aprox las matrices
|
||||
/*mem_cost=(nvectxnconj+(nconj-nvect)*OLV_TASKS_MAXCONJROW)*sizeof(float)
|
||||
mem_tip=(nvectxnconj+(nconj-nvect)*OLV_TASKS_MAXCONJROW)*sizeof(int)
|
||||
mem_ang=nconj*OLV_TASKS_MAXCONJROW*sizeof(BYTE)
|
||||
mem_cost_amb, se va a calcular, cuando llegue el momento, si no cabe y se hace multitask
|
||||
margen=OLV_TASKS_MARGENMEM
|
||||
mem_cost+mem_tip+mem_ang+margen<=mem_memo*porc*/
|
||||
INT64 a,b,c,d;
|
||||
INT64 nvect;
|
||||
int sf, si;
|
||||
sf=sizeof(float);
|
||||
si=sizeof(int);
|
||||
|
||||
if(memo<0)
|
||||
return -1;
|
||||
|
||||
a=(INT64)((double)memo*porc);
|
||||
b=(INT64)nconj*OLV_TASKS_MAXCONJROW*(1+sf+si);
|
||||
c=(INT64)OLV_TASKS_MARGENMEM;
|
||||
d=(INT64)(sf+si)*(nconj-OLV_TASKS_MAXCONJROW);
|
||||
nvect = (a-b-c)/d;
|
||||
|
||||
nvect=min(nconj,nvect);
|
||||
nvect=max(nvect,0);
|
||||
|
||||
return (int)nvect;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/*
|
||||
* Calcula el número de filas de mapmatrix que pueden ser vector en multitask
|
||||
* se tiene que tener en cuenta que luego se va a pedir para nthr el cálculo de cost_amb
|
||||
*/
|
||||
inline int CoptiMemo::calc_nvect_multi(int nconj, int nthr, int nbcola)
|
||||
{
|
||||
//lo calcula en base a lo que van a ocupar aprox las matrices
|
||||
/*mem_cost=(nvectxnconj+(nconj-nvect)*OLV_TASKS_MAXCONJROW)*sizeof(float)
|
||||
mem_tip=(nvectxnconj+(nconj-nvect)*OLV_TASKS_MAXCONJROW)*sizeof(int)
|
||||
mem_ang=nconj*OLV_TASKS_MAXCONJROW*sizeof(BYTE)
|
||||
mem_cost_amb=nthr*(nconj*nconj*sizeof(byte)*1/8+nconj*OLV_TASKS_PORCCOLADJ*sizeof(cola))
|
||||
margen=OLV_TASKS_MARGENMEM
|
||||
mem_cost+mem_tip+mem_ang+margen<=mem_disp*porc*/
|
||||
INT64 a,b,c,d, e;
|
||||
INT64 nvect;
|
||||
int sf, si;
|
||||
sf=sizeof(float);
|
||||
si=sizeof(int);
|
||||
|
||||
if(memo<0)
|
||||
return -1;
|
||||
|
||||
a=(INT64)((double)memo*porc);
|
||||
b=((INT64)nconj)*OLV_TASKS_MAXCONJROW*(1+sf+si);
|
||||
c=(INT64)OLV_TASKS_MARGENMEM;
|
||||
e=(INT64)((INT64)nthr)*((INT64)nconj)*((INT64)(nconj*1.0/div+OLV_TASKS_PORCCOLADJ*nbcola));
|
||||
d=(INT64)(sf+si)*(nconj-OLV_TASKS_MAXCONJROW);
|
||||
nvect = (a-b-c-e)/d;
|
||||
|
||||
nvect=min(nconj,nvect);
|
||||
nvect=max(nvect,0);
|
||||
|
||||
return (int)nvect;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/*
|
||||
* Calcula si se va a poder hacer en monotask o no
|
||||
* para ello, deben caber en memoria al menos los 8 thr de cálculo de dj
|
||||
*/
|
||||
inline int is_multi(int nconj, int nthr, int nbcola)
|
||||
{
|
||||
//mem_cost_amb=nthr*(nconj*nconj*sizeof(byte)+nconj*OLV_TASKS_PORCCOLADJ*sizeof(cola))
|
||||
//mem_cost_amb+margen<=mem_disp*porc
|
||||
INT64 a,b,c;
|
||||
|
||||
if(memo<0)
|
||||
return FALSE;
|
||||
|
||||
a=(INT64)((double)memo*porc);
|
||||
b=(INT64)OLV_TASKS_MARGENMEM;
|
||||
c=(INT64)((INT64)nthr)*((INT64)nconj)*((INT64)(nconj+OLV_TASKS_PORCCOLADJ*nbcola));
|
||||
|
||||
return (a-b-c<0);
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
#include "stdafx.h"
|
||||
#ifdef OLIVIA_COMPILA
|
||||
//olivia
|
||||
#include "olv_thr.h"
|
||||
#include "olv.h"
|
||||
#include "lock.h"
|
||||
|
||||
Colv_thr::Colv_thr(COlivia *olv)
|
||||
{
|
||||
this->olv=olv;
|
||||
progreso=tarea=0;
|
||||
msg_proce[0]=0;
|
||||
}
|
||||
|
||||
Colv_thr::~Colv_thr(void)
|
||||
{
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Actualiza el progreso y la tarea por la que va
|
||||
*/
|
||||
void Colv_thr::pon_mi_progre(int tar, int prog)
|
||||
{
|
||||
tarea=tar;
|
||||
progreso=prog;
|
||||
|
||||
pon_olv_progre();
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Actualiza el mensaje de tarea
|
||||
*/
|
||||
void Colv_thr::pon_mi_msg(char *fmt, ...)
|
||||
{
|
||||
//formatea el string que llega
|
||||
int k;
|
||||
va_list arg_ptr;
|
||||
|
||||
if(strlen(fmt)==0)
|
||||
{
|
||||
msg_proce[0]=0;
|
||||
return;
|
||||
}
|
||||
va_start(arg_ptr, fmt);
|
||||
k = _vsnprintf(msg_proce,OLV_MAX_MSG_PROCE, fmt, arg_ptr);
|
||||
va_end(arg_ptr);
|
||||
if(k<0)
|
||||
msg_proce[0]=0;
|
||||
|
||||
olvlog(LOG_TODO,"olv_limp_t",msg_proce);
|
||||
|
||||
pon_olv_progre();
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Actualiza el progreso y la tarea por la que va al olivia general
|
||||
*/
|
||||
void Colv_thr::pon_olv_progre()
|
||||
{
|
||||
olv->lock->entro();
|
||||
olv->progreso=progreso;
|
||||
olv->tarea=tarea;
|
||||
strcpy_s(olv->msg_proce,OLV_MAX_MSG_PROCE,msg_proce);
|
||||
olv->lock->salgo();
|
||||
}
|
||||
//*************************************************************************************
|
||||
#endif
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
#pragma once
|
||||
#ifdef OLIVIA_COMPILA
|
||||
#include "olv.h"
|
||||
/**
|
||||
* @file olv_thr.h
|
||||
* Archivo de variables comunes a los threads de cálculo de Olivia.
|
||||
*/
|
||||
class COlivia;
|
||||
#define OLV_MILIS_COLA 200 //! Milisegundos de iteración de la cola
|
||||
/**
|
||||
* Clase de variables y funciones comunes a los threads de cálculo de Olivia.
|
||||
*/
|
||||
class Colv_thr
|
||||
{
|
||||
public:
|
||||
//*************************************************************************************
|
||||
//Variables
|
||||
int progreso;
|
||||
int tarea;
|
||||
char msg_proce[OLV_MAX_MSG_PROCE];
|
||||
COlivia *olv;
|
||||
//*************************************************************************************
|
||||
//Funciones
|
||||
public:
|
||||
Colv_thr(COlivia *olv);
|
||||
~Colv_thr(void);
|
||||
|
||||
void pon_mi_progre(int tar, int prog);
|
||||
void pon_mi_msg(char *fmt, ...);
|
||||
void pon_olv_progre();
|
||||
};
|
||||
#endif
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
//
|
||||
// Olivia.RC2 - resources Microsoft Visual C++ does not edit directly
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Add manually edited resources here...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
|
|
@ -0,0 +1,149 @@
|
|||
#include "StdAfx.h"
|
||||
//#ifdef OLV_UTILES32
|
||||
#include "sock_task.h"
|
||||
#include "olv.h"
|
||||
#include "olv_limp.h"
|
||||
#include "olv_limp_thr.h"
|
||||
#include "olv_reco.h"
|
||||
#include "olv_reco_thr.h"
|
||||
#include "sock_sv.h"
|
||||
#include "utiles_def.h"
|
||||
//#include "wvarios.h"
|
||||
|
||||
Csock_task::Csock_task(COlivia *ol)
|
||||
{
|
||||
olv=ol;
|
||||
}
|
||||
|
||||
Csock_task::~Csock_task(void)
|
||||
{
|
||||
}
|
||||
//*************************************************************************************
|
||||
void Csock_task::run()
|
||||
{
|
||||
int id, ithr;
|
||||
BOOL sal=FALSE;
|
||||
BOOL fin_ok=FALSE;
|
||||
__int64 t1=_time64(NULL);
|
||||
__int64 timeout;
|
||||
timeout=20000;//20 seg
|
||||
ithr=-1;
|
||||
Param_olv_limp_thr pp;
|
||||
pp.id_e=0;
|
||||
BOOL *pirate=NULL;
|
||||
#ifndef _DEBUG
|
||||
__int64 t2;
|
||||
#endif
|
||||
|
||||
if(olv->olv_limp)
|
||||
pirate=&olv->olv_limp->thr_limp->pirate;
|
||||
else if(olv->olv_reco)
|
||||
pirate=&olv->olv_reco->thr_limp->pirate;
|
||||
if (pirate==NULL)
|
||||
{
|
||||
pirate=new BOOL();
|
||||
*pirate=FALSE;
|
||||
}
|
||||
do
|
||||
{
|
||||
#ifndef _DEBUG
|
||||
t2 = _time64(NULL);
|
||||
if((t2-t1)>=timeout)
|
||||
{
|
||||
sal=TRUE;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if(!soc->recibe_package(0))
|
||||
{
|
||||
Sleep(1);
|
||||
continue;
|
||||
}
|
||||
t1=_time64(NULL);
|
||||
|
||||
if(soc->nb<sizeof(int))
|
||||
{
|
||||
sal=TRUE;
|
||||
continue;
|
||||
}
|
||||
switch(*(int*)soc->buf)
|
||||
{
|
||||
case PETICION_GENERAL_OK:
|
||||
{
|
||||
id=PETICION_GENERAL_OK;
|
||||
if(!soc->envia_package((BYTE*)&id,sizeof(int)))
|
||||
{
|
||||
sal=TRUE;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case PETICION_GENERAL_PRESENTA:
|
||||
{
|
||||
if(soc->nb<2*sizeof(int))
|
||||
{
|
||||
sal=TRUE;
|
||||
continue;
|
||||
}
|
||||
//pilla ithr, contesta ok
|
||||
ithr = ((int*)soc->buf)[1];
|
||||
id=PETICION_GENERAL_OK;
|
||||
if(!soc->envia_package((BYTE*)&id,sizeof(int)))
|
||||
{
|
||||
sal=TRUE;
|
||||
continue;
|
||||
}
|
||||
//envía la info de la task
|
||||
if(!soc->envia_package((BYTE*)&olv->infotask,sizeof(InfoIniTask)))
|
||||
{
|
||||
sal=TRUE;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case PETICION_GENERAL_FIN:
|
||||
{
|
||||
sal=TRUE;
|
||||
if(soc->nb<2*sizeof(int))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if(((int*)soc->buf)[1]==PETICION_GENERAL_OK)
|
||||
fin_ok=TRUE;
|
||||
id=PETICION_GENERAL_FIN;
|
||||
if(!soc->envia_package((BYTE*)&id,sizeof(id)))
|
||||
{
|
||||
sal=TRUE;
|
||||
continue;
|
||||
}
|
||||
//mira si ok o no
|
||||
break;
|
||||
}
|
||||
case PETICION_GENERAL_DAME_LOG:
|
||||
{
|
||||
soc->buf[soc->nb-1] = 0;
|
||||
olvlog(LOG_TODO,"LogSock",(char*)&((int*)soc->buf)[1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (!*soc->pirate && !sal && !*pirate_soc && !soc->sock_cerrado && !*pirate);
|
||||
|
||||
if(ithr>=0)
|
||||
{
|
||||
if(!fin_ok && (sal || soc->sock_cerrado))
|
||||
{
|
||||
//avisar en encola de que ha ido mal
|
||||
pp.id_e=-1;
|
||||
}
|
||||
}
|
||||
else
|
||||
pp.id_e=-2;
|
||||
|
||||
if(olv->olv_limp)
|
||||
olv->olv_limp->thr_limp->encola(olv->olv_limp->thr_limp->OLV_LIMP_EV_TASK_FIN,&pp,FALSE);
|
||||
else if(olv->olv_reco)
|
||||
olv->olv_reco->thr_reco->encola(olv->olv_reco->thr_limp->OLV_LIMP_EV_TASK_FIN,&pp,FALSE);
|
||||
olvlog(LOG_TODO,"LogSock","Saliendo sock ithr %ld %s", ithr, fin_ok ? "Bien" : "Mal");
|
||||
|
||||
}
|
||||
//#endif
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
#pragma once
|
||||
//#ifdef OLV_UTILES32
|
||||
#include "proceso_cliente.h"
|
||||
class COlivia;
|
||||
class Csock_task : public Cproceso_cliente
|
||||
{
|
||||
public:
|
||||
COlivia *olv;
|
||||
BOOL *pirate_soc;
|
||||
virtual void run();
|
||||
Csock_task(COlivia *ol);
|
||||
~Csock_task(void);
|
||||
};
|
||||
//#endif
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// Olivia.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef VC_EXTRALEAN
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
#endif
|
||||
|
||||
#include "targetver.h"
|
||||
|
||||
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
|
||||
#ifndef _AFX_NO_OLE_SUPPORT
|
||||
#include <afxole.h> // MFC OLE classes
|
||||
#include <afxodlgs.h> // MFC OLE dialog classes
|
||||
#include <afxdisp.h> // MFC Automation classes
|
||||
#endif // _AFX_NO_OLE_SUPPORT
|
||||
|
||||
#ifndef _AFX_NO_DB_SUPPORT
|
||||
#include <afxdb.h> // MFC ODBC database classes
|
||||
#endif // _AFX_NO_DB_SUPPORT
|
||||
|
||||
#ifndef _AFX_NO_DAO_SUPPORT
|
||||
#include <afxdao.h> // MFC DAO database classes
|
||||
#endif // _AFX_NO_DAO_SUPPORT
|
||||
|
||||
#ifndef _AFX_NO_OLE_SUPPORT
|
||||
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
|
||||
#endif
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
#include <afxsock.h> // MFC socket extensions
|
||||
#include "base_head.h"
|
||||
#include "olv_dll.h"
|
||||
#include "Matrix2d.h"
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// The following macros define the minimum required platform. The minimum required platform
|
||||
// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
|
||||
// your application. The macros work by enabling all features available on platform versions up to and
|
||||
// including the version specified.
|
||||
|
||||
// Modify the following defines if you have to target a platform prior to the ones specified below.
|
||||
// Refer to MSDN for the latest info on corresponding values for different platforms.
|
||||
#ifndef WINVER // Specifies that the minimum required platform is Windows Vista.
|
||||
#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows.
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista.
|
||||
#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows.
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98.
|
||||
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 7.0.
|
||||
#define _WIN32_IE 0x0700 // Change this to the appropriate value to target other versions of IE.
|
||||
#endif
|
||||
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,173 @@
|
|||
// OliviaTasks.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "OliviaTasks.h"
|
||||
#include "olv_task.h"
|
||||
#include "OlvTaskProcess.h"
|
||||
#include "utl.h"
|
||||
#include "olv_dll.h"
|
||||
#include "olv.h"
|
||||
#include "_log.h"
|
||||
#include "Msmain.h"
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
#include "GeometryFunction.h"
|
||||
#include "StrArray.h"
|
||||
#include "ClienteLicencias.h"
|
||||
#include "_app.h"
|
||||
|
||||
// The one and only application object
|
||||
|
||||
//! Clase principal de OliviaTasks
|
||||
/*!
|
||||
* Es la interface entre el AddIn de Olivia y el core de calculos Olivia.dll
|
||||
*
|
||||
*/
|
||||
|
||||
CWinApp theApp;
|
||||
|
||||
using namespace std;
|
||||
|
||||
BOOL coge_param(char *cmdline, OlvTaskProcess *task);
|
||||
|
||||
//! Funcion principal
|
||||
/**
|
||||
* Funcion principal que inicia la aplicacion al ser llamada por el AddIn
|
||||
*/
|
||||
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
|
||||
int nRetCode = 0;
|
||||
|
||||
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
|
||||
{
|
||||
_tprintf(_T("Fatal Error: MFC initialization failed\n"));
|
||||
nRetCode = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
OlvApp.olv = new COlivia();
|
||||
Msmain mp;
|
||||
OlvApp.olv->mfrm = ∓
|
||||
mp.olv = OlvApp.olv;
|
||||
|
||||
//inicia log-------------------------------------------------
|
||||
C_app* app = C_app::GetApp();
|
||||
app->archi.rellena_dirs_ejecucion();
|
||||
#ifdef _DEBUG
|
||||
|
||||
HWND Stealth;
|
||||
AllocConsole();
|
||||
|
||||
Stealth = FindWindowA("ConsoleWindowClass", NULL);
|
||||
ShowWindow(Stealth,SW_SHOWNORMAL);
|
||||
|
||||
#endif
|
||||
//pilla path temporal
|
||||
StrArray buf;
|
||||
strcpy(app->log.nombre,"Olivia");
|
||||
int nn = Cutl::stringSplit(lpCmdLine,"/path_temp:", &buf)->n_i;
|
||||
if(nn>=2 && Cutl::stringSplit(buf.get(1)," /", &buf)->n_i>nn)
|
||||
strcpy(app->log.path,buf.get(nn));
|
||||
buf.borra();
|
||||
|
||||
//verifica versión-----------------------------------
|
||||
#ifdef _DEBUG
|
||||
system("pause");
|
||||
#endif;
|
||||
ClienteLicencias lic;
|
||||
char strtem[MAX_PATH];
|
||||
app->archi.rellena_dirs_ejecucion();
|
||||
strcpy_s(strtem,MAX_PATH,app->archi.path_ejecutable);
|
||||
Cdir_manager::dir_anterior(strtem);
|
||||
sprintf(lic.dirLic,"%s\\", strtem);
|
||||
sprintf(lic.dirTemp,"%s\\", app->log.path);
|
||||
if(!lic.cargaLicencia())
|
||||
{
|
||||
C_log::log("_tmain", "Error al comprobar versión");
|
||||
#ifdef _DEBUG
|
||||
system("pause");
|
||||
#endif;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
system("pause");
|
||||
#endif;
|
||||
C_log::log("_tmain","Inicio OliviaTask: %s", lpCmdLine);
|
||||
mp.Despacha_log();
|
||||
//verifica modo debug----------------------------------------
|
||||
if(strstr(lpCmdLine,"debug"))
|
||||
{
|
||||
OlvApp.olv->modo_ejec=OLV_EJEC_DEBUG_SIGUE;
|
||||
}
|
||||
|
||||
|
||||
char err[1024];
|
||||
if(!OlvApp.olv->inicia(lpCmdLine, err,1024))
|
||||
{
|
||||
C_log::log("_tmain",err);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(OlvApp.olv->isDebug)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
system("pause");
|
||||
#endif;
|
||||
OlvApp.olv->prueba();
|
||||
}
|
||||
mp.Despacha();
|
||||
}
|
||||
C_log::log("_tmain","Final feliz!!");
|
||||
mp.Despacha_log();
|
||||
OlvApp.olv->mfrm =NULL;
|
||||
|
||||
#ifdef _DEBUG
|
||||
system("pause");
|
||||
#endif
|
||||
}
|
||||
|
||||
return nRetCode;
|
||||
}
|
||||
//*************************************************************************************
|
||||
/**
|
||||
* Dada la línea de comandos, la divide en los parámetros necesarios
|
||||
* (Funcion para modo multitask)
|
||||
*/
|
||||
BOOL coge_param(char *cmdline, OlvTaskProcess *task)
|
||||
{
|
||||
char *token;
|
||||
int j;
|
||||
|
||||
//los parámetros son:
|
||||
//\olivia \tipo_oliv \cfg.ini \ip \puerto \toutsock
|
||||
token = strtok(cmdline, TASKS_PARAM_SEP);
|
||||
|
||||
//Lee parámetros
|
||||
j=0;
|
||||
while (token != NULL)
|
||||
{
|
||||
if(j==0)
|
||||
{
|
||||
//ip
|
||||
strcpy_s(OlvApp.ip,64,token);
|
||||
}
|
||||
else if(j==1)
|
||||
{
|
||||
//puerto
|
||||
OlvApp.port=atoi(token);
|
||||
}
|
||||
else if(j==2)
|
||||
{
|
||||
//ithr
|
||||
task->ithr = atoi(token);
|
||||
}
|
||||
token = strtok(NULL, TASKS_PARAM_SEP);
|
||||
j++;
|
||||
}
|
||||
if(j<3)
|
||||
return FALSE; //no ha leído los param suficientes
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
#include "resource.h"
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_APP_TITLE "OliviaTasks"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Spanish resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ESN)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_MODERN
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
MAINICON ICON "favicon.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 2,0,0,3
|
||||
PRODUCTVERSION 2,0,0,3
|
||||
FILEFLAGSMASK 0x17L
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "0c0a04b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "VSM"
|
||||
VALUE "FileDescription", "Launcher de la aplicación Olivia"
|
||||
VALUE "FileVersion", "2.0.0.3"
|
||||
VALUE "InternalName", "OliviaTasks"
|
||||
VALUE "LegalCopyright", "OLIVIA (c) VSM 2020. All rights reserved."
|
||||
VALUE "OriginalFilename", "OliviaTasks.exe"
|
||||
VALUE "ProductName", "OliviaTasks"
|
||||
VALUE "ProductVersion", "2.0.0.3"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0xc0a, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // Spanish resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
|
|
@ -0,0 +1,247 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{A8C66186-EDEF-4041-B7DD-B4FAFCC528EA}</ProjectGuid>
|
||||
<RootNamespace>OliviaTasks</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>15.0.28127.55</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules />
|
||||
<CodeAnalysisRuleAssemblies />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules />
|
||||
<CodeAnalysisRuleAssemblies />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules />
|
||||
<CodeAnalysisRuleAssemblies />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules />
|
||||
<CodeAnalysisRuleAssemblies />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\includes\Utiles;..\Olivia\;..\includes\olivia;..\includes\ClientLic;..\includes\FileTransfer;..\includes\LicUtiles</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;OLIVIA_COMPILA;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>utiles.lib;psapi.lib;Olivia.lib;ClientLic.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\lib\$(IntDir)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy $(OutDir)$(TargetFileName) ..\bin\$(IntDir)
|
||||
copy ..\Licencia\OliviaTasks.lic ..\bin\$(IntDir)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\includes\Utiles;..\Olivia\;..\includes\olivia;..\includes\ClientLic;..\includes\FileTransfer;..\includes\LicUtiles</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;OLIVIA_COMPILA;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>utiles.lib;psapi.lib;Olivia.lib;ClientLic.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\lib\$(IntDir)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EntryPointSymbol />
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy $(OutDir)$(TargetFileName) ..\bin\$(IntDir)
|
||||
copy ..\Licencia\OliviaTasks.lic ..\bin\$(IntDir)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\includes\Utiles;..\Olivia\;..\includes\olivia;..\includes\ClientLic;..\includes\FileTransfer;..\includes\LicUtiles</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;OLIVIA_COMPILA;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>utiles.lib;psapi.lib;Olivia.lib;ClientLic.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\lib\$(IntDir)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy $(OutDir)$(TargetFileName) ..\bin\$(IntDir)
|
||||
copy ..\Licencia\OliviaTasks.lic ..\bin\$(IntDir)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\includes\Utiles;..\Olivia\;..\includes\olivia;..\includes\ClientLic;..\includes\FileTransfer;..\includes\LicUtiles</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;OLIVIA_COMPILA;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>utiles.lib;psapi.lib;Olivia.lib;ClientLic.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\lib\$(IntDir)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<EntryPointSymbol />
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy $(OutDir)$(TargetFileName) ..\bin\$(IntDir)
|
||||
copy ..\Licencia\OliviaTasks.lic ..\bin\$(IntDir)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="OliviaTasks.cpp" />
|
||||
<ClCompile Include="OlvTaskProcess.cpp" />
|
||||
<ClCompile Include="olv_task.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="OliviaTasks.h" />
|
||||
<ClInclude Include="OlvTaskProcess.h" />
|
||||
<ClInclude Include="olv_task.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="favicon.ico" />
|
||||
<None Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="OliviaTasks.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Olivia\Olivia.vcxproj">
|
||||
<Project>{192bcb82-d8b4-4fb0-807a-7cc9b6ea623b}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="OliviaTasks.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="olv_task.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="OlvTaskProcess.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="OliviaTasks.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="olv_task.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="OlvTaskProcess.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="stdafx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="favicon.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="OliviaTasks.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LocalDebuggerWorkingDirectory>..\bin\$(IntDir)</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LocalDebuggerWorkingDirectory>..\bin\$(IntDir)</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LocalDebuggerWorkingDirectory>..\bin\$(IntDir)</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LocalDebuggerWorkingDirectory>..\bin\$(IntDir)</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,497 @@
|
|||
#include "StdAfx.h"
|
||||
#include "OlvTaskProcess.h"
|
||||
#include "olivia_def.h"
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include "olv_task.h"
|
||||
|
||||
#define MODULO "OlvTaskProcess"
|
||||
|
||||
std::string to_string(double& d)
|
||||
{
|
||||
char dig[256];
|
||||
dig[0]=0;
|
||||
return dig;
|
||||
}
|
||||
|
||||
//*******************************************************************************************************
|
||||
OlvTaskProcess::OlvTaskProcess(void)
|
||||
{
|
||||
costes.clear();
|
||||
va_mal=FALSE;
|
||||
angs=NULL;
|
||||
}
|
||||
OlvTaskProcess::~OlvTaskProcess( void )
|
||||
{
|
||||
costes.clear();
|
||||
if(angs)
|
||||
{
|
||||
for(int i=0;i<info.n;i++)
|
||||
{
|
||||
angs[i].libera();
|
||||
}
|
||||
free(angs);
|
||||
angs=NULL;
|
||||
}
|
||||
ia.clear();
|
||||
cost_amb.clear();
|
||||
}
|
||||
//*******************************************************************************************************
|
||||
void OlvTaskProcess::preTask()
|
||||
{
|
||||
//pilla informacion de socket necesaria
|
||||
//el tread no esta currando
|
||||
//presentacion-----------------------------------------
|
||||
int aux[2];
|
||||
aux[0]= PETICION_GENERAL_PRESENTA;
|
||||
aux[1]=ithr;
|
||||
if(!envia(aux,sizeof(aux)))
|
||||
{
|
||||
C_log::log(MODULO, "error al enviar presentacion");
|
||||
cancela();
|
||||
return;
|
||||
}
|
||||
int nb;
|
||||
void *data = recibe(&nb);
|
||||
if(nb < sizeof(int) || (*(int*)data)!=PETICION_GENERAL_OK)
|
||||
{
|
||||
C_log::log(MODULO, "error al recibir contestacion de presentacion");
|
||||
cancela();
|
||||
return;
|
||||
}
|
||||
data = recibe(&nb);
|
||||
if(nb<sizeof(InfoIniTask))
|
||||
{
|
||||
C_log::log(MODULO, "error al recibir contestacion de presentacion");
|
||||
cancela();
|
||||
return;
|
||||
}
|
||||
memcpy(&info,data,sizeof(InfoIniTask));
|
||||
//------------------------------------------------------
|
||||
}
|
||||
//*******************************************************************************************************
|
||||
void OlvTaskProcess::inTask()
|
||||
{
|
||||
//envia sigue vivo----------------------
|
||||
|
||||
int aux = PETICION_GENERAL_OK;
|
||||
if(!envia(&aux,sizeof(aux)))
|
||||
{
|
||||
C_log::log(MODULO, "error al enviar Ok");
|
||||
cancela();
|
||||
return;
|
||||
}
|
||||
int nb;
|
||||
void *data = recibe(&nb);
|
||||
if(nb<sizeof(int))
|
||||
{
|
||||
C_log::log(MODULO, "error al recibir contestacion ok");
|
||||
cancela();
|
||||
return;
|
||||
}
|
||||
//mira contstacion------------------------
|
||||
switch(*(int*)data)
|
||||
{
|
||||
case(PETICION_GENERAL_OK):
|
||||
break;
|
||||
default://PETICION_GENERAL_NO
|
||||
C_log::log(MODULO, "Recibida peticion de cancelacion");
|
||||
cancela();
|
||||
}
|
||||
//envia log
|
||||
enviaLog();
|
||||
}
|
||||
void OlvTaskProcess::enviaLog()
|
||||
{
|
||||
StrArray msgs;
|
||||
if(OlvApp.colaLog.dame(msgs))
|
||||
{
|
||||
char buf[1028];
|
||||
int *id =(int*) buf;
|
||||
char* msg = (char*)&id[1];
|
||||
*id = PETICION_GENERAL_DAME_LOG;
|
||||
for (int i = 0; i<msgs.n_i; i++)
|
||||
{
|
||||
strcpy(msg,msgs.get(i));
|
||||
|
||||
if(!envia(&buf,(int)(sizeof(int)+strlen(msg)+1)))
|
||||
{
|
||||
C_log::log(MODULO, "error al enviar Log");
|
||||
cancela();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//*******************************************************************************************************
|
||||
void OlvTaskProcess::postTask()
|
||||
{
|
||||
enviaLog();
|
||||
int aux[2];
|
||||
aux[0]= PETICION_GENERAL_FIN;
|
||||
if(va_mal)
|
||||
{
|
||||
aux[1]=PETICION_GENERAL_NO; //dependiendo del estado
|
||||
}
|
||||
else
|
||||
{
|
||||
aux[1]=PETICION_GENERAL_OK; //dependiendo del estado
|
||||
C_log::log(MODULO,"Task %ld, Enviando final feliz",ithr);
|
||||
|
||||
}
|
||||
if(!envia(aux,sizeof(aux)))
|
||||
{
|
||||
C_log::log(MODULO, "Task %ld, Error al enviar terminado",ithr);
|
||||
cancela();
|
||||
}
|
||||
int nb;
|
||||
void *data = recibe(&nb);
|
||||
if(nb<sizeof(int)|| *(int*)data != PETICION_GENERAL_FIN)
|
||||
{
|
||||
C_log::log(MODULO, "Task %ld, Error al recibir fin",ithr);
|
||||
}
|
||||
}
|
||||
//*******************************************************************************************************
|
||||
void OlvTaskProcess::run()
|
||||
{
|
||||
//tarea a realizar
|
||||
//lee archivos de costes, angulos e informacion asociada
|
||||
//si !usa_angs, angs=NULL;
|
||||
if(!lee_mats())
|
||||
{
|
||||
C_log::log(MODULO,"Task %ld,Error en lee_mats", ithr);
|
||||
|
||||
va_mal=TRUE;
|
||||
goto sal;
|
||||
}
|
||||
|
||||
if(!calcula_cost_ambThr())
|
||||
{
|
||||
C_log::log(MODULO,"Task %ld,Error en calcula_cost_amb_sub", ithr);
|
||||
|
||||
va_mal=TRUE;
|
||||
goto sal;
|
||||
}
|
||||
|
||||
//guarda mat de cost_amb
|
||||
if(!guarda_cost_amb())
|
||||
{
|
||||
C_log::log(MODULO,"Task %ld,Error en guarda_cost_amb", ithr);
|
||||
|
||||
va_mal=TRUE;
|
||||
goto sal;
|
||||
}
|
||||
sal:
|
||||
C_log::log(MODULO, "Task de tarea saliendo %ld %s",ithr, va_mal ? "Mal" : "Bien");
|
||||
|
||||
}
|
||||
//*******************************************************************************************************
|
||||
BOOL OlvTaskProcess::calcula_cost_ambThr()
|
||||
{
|
||||
//inicializa archivo----------------------
|
||||
char p[MAX_PATH];
|
||||
BOOL mal=FALSE;
|
||||
|
||||
sprintf_s(p,MAX_PATH,"%s\\%s",info.path_temp,NOMB_ARCH_DIJ_DEF);
|
||||
if(!arch_dj.inicia(p, TRUE,FALSE, info.n))
|
||||
{
|
||||
C_log::log(MODULO,"Task %ld,Error %ld no se ha podido crear ndj", ithr,GetLastError());
|
||||
mal = TRUE;
|
||||
goto final;
|
||||
}
|
||||
//C_log::log(MODULO,"sizeof %ld %ld %ld %ld", sizeof(Head_dj_arch),sizeof(Djkt_nodo), sizeof(Djkt_ids_pdr), arch_dj.sizn);
|
||||
if(!arch_dj.inicia_inf_amb(&ia,info.namb,info.KK,info.id_instal, info.id_planta))
|
||||
{
|
||||
C_log::log(MODULO,"Task %ld,Error %ld no se ha podido crear info de ambitos", ithr,GetLastError());
|
||||
mal = TRUE;
|
||||
goto final;
|
||||
|
||||
}
|
||||
//pilla memoria necesaria para coste de ambitos--------------
|
||||
if(!cost_amb.inicia(info.namb,info.namb))
|
||||
{
|
||||
C_log::log(MODULO,"Task %ld,Error %ld no se ha podido iniciar cost_amb, sin memoria", ithr,GetLastError());
|
||||
|
||||
//sin memoria
|
||||
mal = TRUE;
|
||||
goto final;
|
||||
|
||||
}
|
||||
for(int i = 0; i<info.namb; i++)
|
||||
for(int j = 0; j<info.namb; j++)
|
||||
cost_amb[i][j] = (float)MAYUSCULO;
|
||||
|
||||
//////////////////////////////////////
|
||||
//lanza los threads
|
||||
mal=lanza_thr_calc();
|
||||
//////////////////////////////////////
|
||||
|
||||
//termina de guardar
|
||||
if(!mal && !arch_dj.graba_dis(ithr))
|
||||
{
|
||||
C_log::log(MODULO,"Task %ld,Error %ld no se ha podido guardar la info de ambitos", ithr,GetLastError());
|
||||
mal = TRUE;
|
||||
}
|
||||
|
||||
final:
|
||||
return !mal;
|
||||
}
|
||||
//*******************************************************************************************************
|
||||
BOOL OlvTaskProcess::lanza_thr_calc()
|
||||
{
|
||||
ThCalcCostes th[MAX_THREAD_LEE];
|
||||
int nth = min(info.nthr,MAX_THREAD_LEE);
|
||||
int ntsk=(int)ceil(info.namb*1./(info.ntsks));
|
||||
int n = (int)ceil(ntsk*1./(nth));
|
||||
int asig = 0;
|
||||
int i=0;
|
||||
for(i=0; i<nth && asig<info.namb; i++)
|
||||
{
|
||||
th[i].ithr = i;
|
||||
th[i].pclas = this;
|
||||
th[i].mal = FALSE;
|
||||
th[i].ini = i*n+ithr*ntsk;
|
||||
th[i].fin = min((i+1)*n+ithr*ntsk,info.namb);
|
||||
asig=th[i].fin;
|
||||
th[i].lanza();
|
||||
}
|
||||
BOOL mal=FALSE;
|
||||
for(int ic=0; ic<i; ic++)
|
||||
{
|
||||
th[ic].join();
|
||||
mal|=th[ic].mal;
|
||||
}
|
||||
return mal;
|
||||
}
|
||||
//*******************************************************************************************************
|
||||
void ThCalcCostes::run()
|
||||
{
|
||||
mal = FALSE;
|
||||
if(!pclas->calcula_cost_amb_sub(ini,fin,ithr))
|
||||
mal=TRUE;
|
||||
}
|
||||
//*******************************************************************************************************
|
||||
BOOL OlvTaskProcess::calcula_cost_amb_sub(int amb_ini,int amb_fin, int ith)
|
||||
{
|
||||
int na,i,k;
|
||||
int seg;
|
||||
Djkt_nodo *costes_nodos;
|
||||
BOOL mal=FALSE;
|
||||
|
||||
//----------------------------------------
|
||||
////////////////
|
||||
int na_desp = amb_fin-amb_ini;
|
||||
costes_nodos=NULL;
|
||||
////////////////
|
||||
FlagsArray visto_ang;//buffer de flags
|
||||
|
||||
C_log::log(MODULO,"Subthr %ld, Ambs %04d a %04d, numero ambitos totales %ld", ith,amb_ini, amb_fin, info.namb);
|
||||
|
||||
seg = GetTickCount();
|
||||
/////////////////////////////////////
|
||||
//Bucle por cada ámbito de los que le tocan a este thread
|
||||
/////////////////////////////////////
|
||||
//el coste de un ámbito a sí mismo es el de trabajar ese ámbito,
|
||||
//que es el coste de ir de su conj inicial a la final
|
||||
//na=na_ini;
|
||||
/////////////////////////////////////
|
||||
for(na=amb_ini;na<amb_fin && !pirate; na++)
|
||||
{
|
||||
//En olv_limp->ias[i].ic_ini está almacenado el índice de la conjunción del nodo inicial del ámbito
|
||||
//y en olv_limp->ias[i].ic_fin el del final. Se puede acceder con i directamente al array ias porque
|
||||
//la info asociada está añadida por orden, primero los ámbitos
|
||||
/////////////////////////////////////////////
|
||||
//calcula el coste máximo del ámbito na a todos los demás
|
||||
//los añade a la fila na de la matriz de costes
|
||||
//es coste máximo porque hace el máximo de:
|
||||
//inicio(na)->inicio(ni), inicio(na)->final(ni), final(na)->inicio(ni), final(na)->final(ni)
|
||||
/////////////////////////////////////////////
|
||||
//k==0, calcula las distancias del nodo inicial de ese ámbito a todas las demás conjunciones
|
||||
//k==1, calucla las distancias del nodo final
|
||||
|
||||
for(k=0;k<info.KK;k++)
|
||||
{
|
||||
costes_nodos=NULL;
|
||||
if(!DijkstraUtiles::dijkstra_ang_inv_ok(costes, angs, info.n,
|
||||
(1-k)*ia.get(na,0)+k*ia.get(na,1),
|
||||
&costes_nodos, &visto_ang))
|
||||
{
|
||||
C_log::log(MODULO,"Subthr %ld,Error en dijkstra_ang_inv_ok", ith);
|
||||
|
||||
mal=TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//recorre todos los demás ámbitos buscando el coste a ellos en el array de costes devuelto, y los almacena
|
||||
//almacena el coste a su nodo inicial y a su nodo final
|
||||
if(ia.getFlags(na) & OLV_LIMP_FLG_AMB_NO)
|
||||
{
|
||||
for (i=0; i<info.n; i++)
|
||||
{
|
||||
costes_nodos[i].dis=(float)MAYUSCULO;
|
||||
costes_nodos[i].id_padre=-1;
|
||||
costes_nodos[i].ids_ady.nady=0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(i=0;i<info.namb;i++)
|
||||
{
|
||||
if(ia.getFlags(i) & OLV_LIMP_FLG_AMB_NO)
|
||||
continue;
|
||||
if(na==i)
|
||||
{
|
||||
//el coste de un ámbito a sí mismo es el de trabajar ese ámbito
|
||||
cost_amb[na][na]=costes[ia.get(na,0)][ia.get(na,1)];
|
||||
continue;
|
||||
}
|
||||
|
||||
if(cost_amb[i][na]>costes_nodos[ia.get(i,0)].dis)
|
||||
cost_amb[i][na]=costes_nodos[ia.get(i,0)].dis;
|
||||
if(info.KK==OLV_AMB_LIN)
|
||||
{
|
||||
if(cost_amb[i][na]>costes_nodos[ia.get(i,1)].dis)
|
||||
cost_amb[i][na]=costes_nodos[ia.get(i,1)].dis;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!arch_dj.add_b(costes_nodos, na, k, TRUE))
|
||||
{
|
||||
C_log::log(MODULO,"Subthr %ld,Error %ld no se ha podido guardar dj iref: %ld k: %ld", ith,
|
||||
GetLastError(),na,k);
|
||||
}
|
||||
}
|
||||
if(mal)
|
||||
break;
|
||||
//avisa de progreso
|
||||
if(((na-amb_ini)%20==0))
|
||||
{
|
||||
C_log::log(MODULO,"Subthr %ld, Rellenando matriz de dist entre ambs %ld de %ld", ith,
|
||||
(na-amb_ini+1),na_desp);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(mal || pirate)
|
||||
{
|
||||
C_log::log(MODULO,"Subthr %ld, Error en cálculo de matriz de distancias entre ámbitos", ith);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
C_log::log(MODULO,"Subthr %ld, Fin Matriz de dist entre ambs, %.3f seg", ith, 1.0*(GetTickCount()-seg)/1000);
|
||||
|
||||
return TRUE;
|
||||
|
||||
/////////////////////////////////////
|
||||
}
|
||||
//*******************************************************************************************************
|
||||
BOOL OlvTaskProcess::lee_mats()
|
||||
{
|
||||
//lee archivos de costes, angulos e informacion asociada
|
||||
//si !usa_angs, angs=NULL;
|
||||
|
||||
BOOL mal=FALSE;
|
||||
CoptiMemo oo(TRUE);
|
||||
C_log::log(MODULO,"Task %ld, Memo disp %I64d",ithr, oo.memo);
|
||||
int nvect=oo.calc_nvect_multi(info.n,info.nthr,sizeof(Djkt_elem_cola));
|
||||
if(nvect<0)
|
||||
{
|
||||
C_log::log(MODULO,"Task %ld, Error sin memoria al calcular nvect",ithr);
|
||||
goto va_mal;
|
||||
}
|
||||
C_log::log(MODULO,"Task %ld, Calculando con nvect %ld de %ld",ithr, nvect,info.n);
|
||||
//inicializa los arrays
|
||||
costes.inicializa(info.n,info.nthr,nvect);
|
||||
|
||||
C_log::log(MODULO,"Task %ld, Lee matriz de costes",ithr);
|
||||
if(!costes.leeThread(info.path_cconj,info.ext,info.nthr,FALSE)) //el false es para forzar a que todos sean vect, que no los haga igual que los archivos
|
||||
{
|
||||
C_log::log(MODULO,"Task %ld, Error al leer matriz de costes: %s",ithr, info.path_cconj );
|
||||
goto va_mal;
|
||||
}
|
||||
|
||||
C_log::log(MODULO,"Task %ld, Lee matriz de angulos",ithr);
|
||||
if(info.usa_angs)
|
||||
{
|
||||
angs = new Djkt_ang_ady[info.n];
|
||||
if(!angs)
|
||||
{
|
||||
C_log::log(MODULO,"Task %ld, Error lee_mat sin memoria para %ld Djkt_ang_ady",ithr, info.n);
|
||||
|
||||
mal=TRUE;
|
||||
}
|
||||
for(int ic=0; ic<info.n && !mal; ic++)
|
||||
{
|
||||
if(!angs[ic].lee(ic,info.path_ang,info.ext))
|
||||
{
|
||||
C_log::log(MODULO,"Task %ld,Error en lee_mats", ithr);
|
||||
|
||||
mal=TRUE;
|
||||
}
|
||||
}
|
||||
if(mal)
|
||||
{
|
||||
C_log::log(MODULO,"Task %ld, Error al leer matriz de angulos: %s",ithr, info.path_ang );
|
||||
goto va_mal;
|
||||
}
|
||||
}
|
||||
|
||||
C_log::log(MODULO,"Task %ld, Lee informacion asociada",ithr);
|
||||
if(!ia.leeFile(info.file_iaso))
|
||||
{
|
||||
C_log::log(MODULO,"Proceso %ld, Error al leer matriz de info aso: %s",ithr, info.file_iaso );
|
||||
|
||||
goto va_mal;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
va_mal:
|
||||
return FALSE;
|
||||
}
|
||||
//*******************************************************************************************************
|
||||
BOOL OlvTaskProcess::guarda_cost_amb()
|
||||
{
|
||||
C_log::log(MODULO,"Task %ld, Guardando costes entre ambitos",ithr);
|
||||
char path[MAX_PATH];
|
||||
|
||||
sprintf_s(path,MAX_PATH,"%s%02d.%s",info.path_costamb,ithr,info.ext);
|
||||
|
||||
if(!Cdir_manager::crea_dir(info.path_costamb)||!cost_amb.graba(path))
|
||||
{
|
||||
C_log::log(MODULO,"Task %ld, Error al guardar matriz de costes de ambitos: %s",ithr,path);
|
||||
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
//*******************************************************************************************************
|
||||
void OlvTaskProcess::desconecta()
|
||||
{
|
||||
OlvApp.isConnected = FALSE;
|
||||
TaskProcess::desconecta();
|
||||
}
|
||||
//*******************************************************************************************************
|
||||
|
||||
BOOL InfoIndiceEx::leeFile( char* path )
|
||||
{
|
||||
Cb_file file;
|
||||
dat.borra();
|
||||
if(!file.abre(path,1,FALSE,TRUE))
|
||||
{
|
||||
C_log::log(MODULO,"Error en apertura de archivo InfoIndiceEx::leeFile: %s", path);
|
||||
|
||||
return false;
|
||||
}
|
||||
if(!dat.leer(&file))
|
||||
{
|
||||
C_log::log(MODULO,"Error en lectura de archivo InfoIndiceEx::leeFile: %s", path);
|
||||
|
||||
return false;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
//*******************************************************************************************************
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
#pragma once
|
||||
#include "TaskProcess.h"
|
||||
#include "mapmatrix.h"
|
||||
#include "DijkstraUtiles.h"
|
||||
#include "b_file.h"
|
||||
#include "olv_tasks_def.h"
|
||||
#include "Matrix2d.h"
|
||||
|
||||
|
||||
class InfoIndiceEx: public InfoIndice
|
||||
{
|
||||
public:
|
||||
|
||||
Cgarray<int> dat;
|
||||
int getFlags(int na)
|
||||
{
|
||||
return dat[na*3+2];
|
||||
}
|
||||
virtual int get(int iamb, int iextremo)
|
||||
{
|
||||
return dat[iamb*3+iextremo];
|
||||
}
|
||||
inline void clear()
|
||||
{
|
||||
dat.borra();
|
||||
}
|
||||
|
||||
BOOL leeFile(char* path);
|
||||
};
|
||||
|
||||
struct InfoIniTask;
|
||||
/*!
|
||||
* Clase para cálculos de Olivia en modo Multitask
|
||||
*
|
||||
*/
|
||||
class OlvTaskProcess : public TaskProcess
|
||||
{
|
||||
public:
|
||||
//info de procesos
|
||||
bool va_mal;
|
||||
int ithr;//id del thread, lo recibe al arrancar como arg
|
||||
int amb_ini;//ambito inicio, lo calcula
|
||||
int amb_fin;//ambito fin, lo calcula
|
||||
/////////////////////////
|
||||
//variables para run
|
||||
Cdijkstra_arch arch_dj;
|
||||
InfoIndiceEx ia;//puntero a info asoc
|
||||
CmapMatFloat costes;//matriz de costes entre nodos
|
||||
Djkt_ang_ady *angs;//angulos entre nodos
|
||||
Matrix2d<float> cost_amb;//matriz de costes entre ambitos
|
||||
/////////////////////////
|
||||
//recibe por socket
|
||||
InfoIniTask info;
|
||||
//////////////////////////
|
||||
OlvTaskProcess(void);
|
||||
~OlvTaskProcess(void);
|
||||
virtual void preTask();
|
||||
virtual void inTask();
|
||||
virtual void postTask();
|
||||
virtual void run();
|
||||
virtual void desconecta();
|
||||
/////////////////////////
|
||||
//funciones run
|
||||
BOOL calcula_cost_amb_sub(int amb_ini,int amb_fin, int ith);
|
||||
BOOL lee_mats();
|
||||
BOOL guarda_cost_amb();
|
||||
void enviaLog();
|
||||
BOOL calcula_cost_ambThr();
|
||||
BOOL lanza_thr_calc();
|
||||
};
|
||||
|
||||
class ThCalcCostes: public Cth
|
||||
{
|
||||
public:
|
||||
OlvTaskProcess *pclas;
|
||||
int ithr;
|
||||
int ini;//fila inicio
|
||||
int fin;//fila fin
|
||||
BOOL mal;//indica si ha ido bien
|
||||
virtual void run();
|
||||
};
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
========================================================================
|
||||
CONSOLE APPLICATION : OliviaTasks Project Overview
|
||||
========================================================================
|
||||
|
||||
AppWizard has created this OliviaTasks application for you.
|
||||
|
||||
This file contains a summary of what you will find in each of the files that
|
||||
make up your OliviaTasks application.
|
||||
|
||||
|
||||
OliviaTasks.vcproj
|
||||
This is the main project file for VC++ projects generated using an Application Wizard.
|
||||
It contains information about the version of Visual C++ that generated the file, and
|
||||
information about the platforms, configurations, and project features selected with the
|
||||
Application Wizard.
|
||||
|
||||
OliviaTasks.cpp
|
||||
This is the main application source file.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
AppWizard has created the following resources:
|
||||
|
||||
OliviaTasks.rc
|
||||
This is a listing of all of the Microsoft Windows resources that the
|
||||
program uses. It includes the icons, bitmaps, and cursors that are stored
|
||||
in the RES subdirectory. This file can be directly edited in Microsoft
|
||||
Visual C++.
|
||||
|
||||
Resource.h
|
||||
This is the standard header file, which defines new resource IDs.
|
||||
Microsoft Visual C++ reads and updates this file.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other standard files:
|
||||
|
||||
StdAfx.h, StdAfx.cpp
|
||||
These files are used to build a precompiled header (PCH) file
|
||||
named OliviaTasks.pch and a precompiled types file named StdAfx.obj.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other notes:
|
||||
|
||||
AppWizard uses "TODO:" comments to indicate parts of the source code you
|
||||
should add to or customize.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by OliviaTasks.rc
|
||||
//
|
||||
#define IDI_ICON1 102
|
||||
#define IDS_APP_TITLE 103
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 103
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
|
|
@ -0,0 +1,59 @@
|
|||
#pragma once
|
||||
//////////////////////////////////////////////////
|
||||
//Defines
|
||||
#define OLV_LIMP_AMB_NW_NODEF USHRT_MAX//-1 //<Indica que no hay índice del ámbito a la carretera asignada
|
||||
#define OLV_LIMP_MILIS_PROGRE 500 //<Milisegundos cada los que se actualiza el progreso de la tarea
|
||||
#define OLV_LIMP_N_DMIN_NW 3 //<Número de carreteras que almacena más cercanas
|
||||
#define OLV_LIMP_N_PTOS_MED 4 //<Número de puntos con los que calcular distancia media entre ámbito y carretera
|
||||
#define OLV_LIMP_N_PTOS_DIST 2.5 //<Distancia entre los puntos de la media
|
||||
#define OLV_LIMP_M_CONJ 32 //<Incrementos de memoria en el array de conjunciones
|
||||
#define OLV_LIMP_MAX_CAMP 64 //<Longitud máxima de la cadena de caracteres del campo de la dbf
|
||||
#define OLV_LIMP_ANCH_DEF 2.2 //<El ancho por defecto por si hubiera algún error
|
||||
#define OLV_LIMP_COST_SEGM 3 //<El coste asignado a los segmentos de unión, en segundos
|
||||
#define OLV_LIMP_VELO_PEAT 5 //<La velocidad de circulación en calles prohibidas y peatonales, muy bajita, en km/h
|
||||
#define OLV_LIMP_VELO_DEF 10 //<La velocidad por defecto cuando viene a 0 en la nw, en km/h
|
||||
#define OLV_LIMP_GIRO_VEHIC 135 //<El giro máximo del vehículo por defecto
|
||||
//defines para ini de configuracion campos dbf-------------------------
|
||||
#define OLV_LIMP_GRUPO_DBF "CONF_CAMPOS_DBF"
|
||||
#define OLV_LIMP_PARAM_OBS "Observaciones"
|
||||
#define OLV_LIMP_PARAM_ANCHO "Ancho_tipo"
|
||||
#define OLV_LIMP_PARAM_TIPO_AP "Tipo_ap"
|
||||
#define OLV_LIMP_PARAM_TIPO_ENT "Tipo_entrada"
|
||||
#define OLV_LIMP_PARAM_TIPO_ENT_APARCA "Banda_aparcamiento"
|
||||
#define OLV_LIMP_PARAM_TIPO_ENT_PEATO "Entidad_peatonal"
|
||||
#define OLV_LIMP_PARAM_TIPO_ENT_ACERA "Entidad_acera"
|
||||
#define OLV_LIMP_PARAM_TIPO_AP_LIN "Aparcamiento_linea"
|
||||
#define OLV_LIMP_PARAM_TIPO_AP_BAT "Aparcamiento_bateria"
|
||||
#define OLV_LIMP_GRUPO_OTROS "OTROS_PARAM"
|
||||
#define OLV_LIMP_PARAM_GIRO_VEHIC "Giro_max_vehiculo"
|
||||
//flags de la info de la inw-------------------------
|
||||
#define OLV_LIMP_FLG_CIRC_FT 0x0001 //<Indica sentido de circulación FT , ningún flag indica sentido BOTH
|
||||
#define OLV_LIMP_FLG_CIRC_TF 0x0002 //<Indica sentido de circulación TF
|
||||
#define OLV_LIMP_FLG_CIRC_NONE 0x0004 //<Indica sentido de circulación NONE
|
||||
#define OLV_LIMP_FLG_CIRC_NO_DOB 0x0007 //<Indica sentido de circulación FT+TF+NONE
|
||||
#define OLV_LIMP_FLG_NW_REP 0x0008 //<Indica si la entidad es una réplica de calle de nw
|
||||
#define OLV_LIMP_FLG_NO_NW 0x7FF0 //<Indica que no es nw, es combinación de los anteriores
|
||||
#define OLV_LIMP_FLG_DER 0x0010 //<Indica que el ámbito está a la derecha de la carretera asignada, tomado su sentido FT
|
||||
#define OLV_LIMP_FLG_AMB 0x0020 //<Indica si la entidad es un ámbito, ausencia de este y el de seg indica que es nw
|
||||
#define OLV_LIMP_FLG_SEG_LIN 0x0040 //<Indica si la entidad es un segmento de unión con los ámbitos lineales
|
||||
#define OLV_LIMP_FLG_SEG_PUN 0x0080 //<Indica si la entidad es un segmento de unión con los ámbitos puntuales
|
||||
#define OLV_LIMP_FLG_PEAT 0x0100 //<Indica si la entidad es un ámbito peatonal
|
||||
#define OLV_LIMP_FLG_PEAT_REP 0x0200 //<Indica si la entidad es un ámbito peatonal replicado
|
||||
#define OLV_LIMP_FLG_PEAT_SEG 0x0400 //<Indica si la entidad es un segmento de unión de peatonal, de coste 0
|
||||
#define OLV_LIMP_FLG_EJE 0x0800 //<Indica si la entidad es un ámbito tipo eje de calle
|
||||
#define OLV_LIMP_FLG_EJE_SEG 0x1000 //<Indica si la entidad es un segmento de ámbito tipo eje de calle
|
||||
#define OLV_LIMP_FLG_FIN 0x2000 //<Indica que es final del ámbito
|
||||
#define OLV_LIMP_FLG_SEG_AMB 0x4000 //<Indica que es segmento de unión entre ámbitos
|
||||
#define OLV_LIMP_FLG_AMB_NO 0x8000 //<indica que el ambito no se va a usar para la secto ni planif
|
||||
#define OLV_LIMP_FLG_SEC_INFO_BLOCK 0x0001 //<Indica que ese sector esta bloqueado (no se puede quitar ni poner ambitos)
|
||||
#define OLV_LIMP_FLG_SEC_DISTINTO 0x0002 //<Indica que ese sector puede ser distinto a los demás para cuadrar jornadas
|
||||
#define OLV_LIMP_FLG_SEC_CAMB 0x0004 //<Indica que ese sector se ha cambiado
|
||||
//////////////////////////////////////////////////
|
||||
/**
|
||||
* Para identificar los tipos de ámbitos
|
||||
*/
|
||||
enum TipoAmbit
|
||||
{
|
||||
OLV_AMB_PUN=1, //tiene que empezar siempre en 1 porque se usa para multiplicar, y el lineal ser el 2, no cambiar!
|
||||
OLV_AMB_LIN,
|
||||
};
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
#include "StdAfx.h"
|
||||
#include "olv_task.h"
|
||||
#include "olv_dll.h"
|
||||
#include "olv.h"
|
||||
|
||||
Colv_task OlvApp;
|
||||
//************************************************************************************
|
||||
Colv_task::Colv_task(void)
|
||||
{
|
||||
isConnected = true;
|
||||
olv = NULL;
|
||||
//log.l_lisener=this;
|
||||
#ifdef _DEBUG
|
||||
//strcpy(log.path,"C:\\Proyectos\\Olivia\\Instal\\temp");
|
||||
//strcpy(log.nombre,"OlvTask");
|
||||
#endif
|
||||
}
|
||||
//************************************************************************************
|
||||
|
||||
void Colv_task::log_ext( __time64_t tiemp, char *modulo, char *fmt )
|
||||
{
|
||||
char tiem[32];
|
||||
char str[1024];
|
||||
strftime(tiem, 20, "%Y-%m-%d %H:%M:%S", localtime(&tiemp));
|
||||
sprintf_s(str,1024, "%s %-12s %s\r\n",
|
||||
(char *) LPCTSTR (tiem),
|
||||
(char *) LPCTSTR (modulo),
|
||||
(char *) LPCTSTR (fmt));
|
||||
if(isConnected)
|
||||
colaLog.pon(str);
|
||||
//_tprintf(str);
|
||||
//OutputDebugString(str);
|
||||
}
|
||||
|
||||
Colv_task::~Colv_task( void )
|
||||
{
|
||||
if(olv)
|
||||
delete olv;
|
||||
}
|
||||
|
||||
//************************************************************************************
|
||||
bool Cstr_arrayEx::dame( StrArray& stout )
|
||||
{
|
||||
if(n_i<=0)
|
||||
return false;
|
||||
lock_cola.entro();
|
||||
|
||||
stout.ind=ind;
|
||||
stout.str=str;
|
||||
stout.m_str=m_str;
|
||||
stout.m_i=m_i;
|
||||
stout.n_str=n_str;
|
||||
stout.n_i=n_i;
|
||||
|
||||
m_str=m_i=n_i=n_str=0;
|
||||
str=NULL;
|
||||
ind=NULL;
|
||||
lock_cola.salgo();
|
||||
return true;
|
||||
}
|
||||
//************************************************************************************
|
||||
void Cstr_arrayEx::pon( char* str)
|
||||
{
|
||||
lock_cola.entro();
|
||||
add(str);
|
||||
lock_cola.salgo();
|
||||
}
|
||||
//************************************************************************************
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
#pragma once
|
||||
#include "StrArray.h"
|
||||
#include "lock.h"
|
||||
|
||||
class COlivia;
|
||||
|
||||
/*!
|
||||
* Clase extendida para manejo de la cola de mensajes del log
|
||||
*
|
||||
*/
|
||||
class Cstr_arrayEx : public StrArray
|
||||
{
|
||||
Clock lock_cola;//lock de la cola
|
||||
public:
|
||||
bool dame(StrArray& stout);
|
||||
void pon(char* str);
|
||||
};
|
||||
/*!
|
||||
* Clase extendida para manejo del log
|
||||
*
|
||||
*/
|
||||
class Colv_task : public C_escucha_log
|
||||
{
|
||||
public:
|
||||
char ip[64];
|
||||
int port;
|
||||
bool isConnected;
|
||||
COlivia *olv;
|
||||
Cstr_arrayEx colaLog;//! Cola de mensajes del log
|
||||
|
||||
Colv_task(void);
|
||||
~Colv_task(void);
|
||||
|
||||
virtual void log_ext(__time64_t tiemp, char *modulo, char *fmt);
|
||||
};
|
||||
extern Colv_task OlvApp;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// OliviaTasks.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: reference any additional headers you need in STDAFX.H
|
||||
// and not in this file
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "targetver.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <tchar.h>
|
||||
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
|
||||
|
||||
#ifndef VC_EXTRALEAN
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
#endif
|
||||
|
||||
#include <afx.h>
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
#ifndef _AFX_NO_OLE_SUPPORT
|
||||
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
|
||||
#endif
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
#include <iostream>
|
||||
#include <_app.h>
|
||||
#include "garray.h"
|
||||
#include "utiles_def.h"
|
||||
// TODO: reference additional headers your program requires here
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
#pragma once
|
||||
|
||||
// The following macros define the minimum required platform. The minimum required platform
|
||||
// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
|
||||
// your application. The macros work by enabling all features available on platform versions up to and
|
||||
// including the version specified.
|
||||
|
||||
// Modify the following defines if you have to target a platform prior to the ones specified below.
|
||||
// Refer to MSDN for the latest info on corresponding values for different platforms.
|
||||
#ifndef WINVER // Specifies that the minimum required platform is Windows Vista.
|
||||
#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows.
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista.
|
||||
#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows.
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98.
|
||||
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 7.0.
|
||||
#define _WIN32_IE 0x0700 // Change this to the appropriate value to target other versions of IE.
|
||||
#endif
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,4 @@
|
|||
2020-04-05 23:08:31 _tmain Inicio OliviaTask:
|
||||
2020-04-05 23:08:31 _tmain Error al iniciar OliviaTasks para OLIVIA:
|
||||
Error al leer parámetros, menos de los esperados
|
||||
2020-04-05 23:08:31 _tmain Final feliz!!
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue