python+MSVC: reorganize headers to reduce req. includes
Signed-off-by: Thorsten Liebig <liebig@imst.de>
This commit is contained in:
parent
fbfccc4110
commit
e7475a3bd1
@ -188,7 +188,7 @@ set(SOURCES
|
|||||||
openems.cpp
|
openems.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(PUB_HEADERS openems.h)
|
set(PUB_HEADERS openems.h openems_global.h)
|
||||||
|
|
||||||
# libs
|
# libs
|
||||||
ADD_SUBDIRECTORY( tools )
|
ADD_SUBDIRECTORY( tools )
|
||||||
|
@ -55,7 +55,7 @@ else()
|
|||||||
INSTALL(TARGETS nf2ff DESTINATION lib${LIB_SUFFIX})
|
INSTALL(TARGETS nf2ff DESTINATION lib${LIB_SUFFIX})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
INSTALL(FILES ${HEADERS} DESTINATION include/openEMS)
|
INSTALL(FILES nf2ff.h DESTINATION include/openEMS)
|
||||||
|
|
||||||
|
|
||||||
#TODO tarball, debug, release
|
#TODO tarball, debug, release
|
||||||
|
@ -133,6 +133,32 @@ void nf2ff::SetMirror(int type, int dir, float pos)
|
|||||||
m_nf2ff.at(fn)->SetMirror(type, dir, pos);
|
m_nf2ff.at(fn)->SetMirror(type, dir, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
double nf2ff::GetTotalRadPower(size_t f_idx) const
|
||||||
|
{
|
||||||
|
return m_nf2ff.at(f_idx)->GetTotalRadPower();
|
||||||
|
}
|
||||||
|
|
||||||
|
double nf2ff::GetMaxDirectivity(size_t f_idx) const
|
||||||
|
{
|
||||||
|
return m_nf2ff.at(f_idx)->GetMaxDirectivity();
|
||||||
|
}
|
||||||
|
|
||||||
|
complex<double>** nf2ff::GetETheta(size_t f_idx) const
|
||||||
|
{
|
||||||
|
return m_nf2ff.at(f_idx)->GetETheta();
|
||||||
|
}
|
||||||
|
|
||||||
|
complex<double>** nf2ff::GetEPhi(size_t f_idx) const
|
||||||
|
{
|
||||||
|
return m_nf2ff.at(f_idx)->GetEPhi();
|
||||||
|
}
|
||||||
|
|
||||||
|
double** nf2ff::GetRadPower(size_t f_idx) const
|
||||||
|
{
|
||||||
|
return m_nf2ff.at(f_idx)->GetRadPower();
|
||||||
|
}
|
||||||
|
|
||||||
bool nf2ff::AnalyseXMLNode(TiXmlElement* ti_nf2ff)
|
bool nf2ff::AnalyseXMLNode(TiXmlElement* ti_nf2ff)
|
||||||
{
|
{
|
||||||
if (ti_nf2ff==NULL)
|
if (ti_nf2ff==NULL)
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include "nf2ff_calc.h"
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -39,6 +38,7 @@ using namespace std;
|
|||||||
|
|
||||||
|
|
||||||
class TiXmlElement;
|
class TiXmlElement;
|
||||||
|
class nf2ff_calc;
|
||||||
|
|
||||||
class NF2FF_EXPORT nf2ff
|
class NF2FF_EXPORT nf2ff
|
||||||
{
|
{
|
||||||
@ -54,12 +54,12 @@ public:
|
|||||||
|
|
||||||
void SetMirror(int type, int dir, float pos);
|
void SetMirror(int type, int dir, float pos);
|
||||||
|
|
||||||
double GetTotalRadPower(size_t f_idx) const {return m_nf2ff.at(f_idx)->GetTotalRadPower();}
|
double GetTotalRadPower(size_t f_idx) const;
|
||||||
double GetMaxDirectivity(size_t f_idx) const {return m_nf2ff.at(f_idx)->GetMaxDirectivity();}
|
double GetMaxDirectivity(size_t f_idx) const;
|
||||||
|
|
||||||
complex<double>** GetETheta(size_t f_idx) const {return m_nf2ff.at(f_idx)->GetETheta();}
|
complex<double>** GetETheta(size_t f_idx) const;
|
||||||
complex<double>** GetEPhi(size_t f_idx) const {return m_nf2ff.at(f_idx)->GetEPhi();}
|
complex<double>** GetEPhi(size_t f_idx) const;
|
||||||
double** GetRadPower(size_t f_idx) const {return m_nf2ff.at(f_idx)->GetRadPower();}
|
double** GetRadPower(size_t f_idx) const;
|
||||||
|
|
||||||
//! Write results to a hdf5 file
|
//! Write results to a hdf5 file
|
||||||
bool Write2HDF5(string filename);
|
bool Write2HDF5(string filename);
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#define OPENEMS_H
|
#define OPENEMS_H
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#ifdef WIN32
|
#ifndef __GNUC__
|
||||||
#include <Winsock2.h> // for struct timeval
|
#include <Winsock2.h> // for struct timeval
|
||||||
#else
|
#else
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
@ -27,7 +27,7 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "tools/global.h"
|
#include "openems_global.h"
|
||||||
|
|
||||||
#define __OPENEMS_STAT_FILE__ "openEMS_stats.txt"
|
#define __OPENEMS_STAT_FILE__ "openEMS_stats.txt"
|
||||||
#define __OPENEMS_RUN_STAT_FILE__ "openEMS_run_stats.txt"
|
#define __OPENEMS_RUN_STAT_FILE__ "openEMS_run_stats.txt"
|
||||||
|
31
openems_global.h
Normal file
31
openems_global.h
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2019 Thorsten Liebig (Thorsten.Liebig@gmx.de)
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef OPENEMS_GLOBAL_H
|
||||||
|
#define OPENEMS_GLOBAL_H
|
||||||
|
|
||||||
|
#if defined(WIN32)
|
||||||
|
#ifdef BUILD_OPENEMS_LIB
|
||||||
|
#define OPENEMS_EXPORT __declspec(dllexport)
|
||||||
|
#else
|
||||||
|
#define OPENEMS_EXPORT __declspec(dllimport)
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define OPENEMS_EXPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // OPENEMS_GLOBAL_H
|
@ -21,16 +21,7 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#define _USE_MATH_DEFINES
|
#define _USE_MATH_DEFINES
|
||||||
|
|
||||||
#include "tools/array_ops.h"
|
#include "openems_global.h"
|
||||||
#if defined(WIN32)
|
|
||||||
#ifdef BUILD_OPENEMS_LIB
|
|
||||||
#define OPENEMS_EXPORT __declspec(dllexport)
|
|
||||||
#else
|
|
||||||
#define OPENEMS_EXPORT __declspec(dllimport)
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define OPENEMS_EXPORT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// declare a parameter as unused
|
// declare a parameter as unused
|
||||||
#define UNUSED(x) (void)(x);
|
#define UNUSED(x) (void)(x);
|
||||||
|
Loading…
Reference in New Issue
Block a user