Skip to content

Commit

Permalink
#783: Error to Warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaartenHilferink committed Sep 3, 2024
1 parent 70d5407 commit 83fae94
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/dll/DmsPython.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>../../../python_installations/3_9/include;./src;../../sym/dll/src;../../tic/dll/src;../../rtc/dll/src;../../geo/dll/src;../../clc/dll/include;../../stx/dll/src;../../shv/dll/src;../../stg/dll/src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>%PYTHON3_INCLDUE_DIR%;./src;../../sym/dll/src;../../tic/dll/src;../../rtc/dll/src;../../geo/dll/src;../../clc/dll/include;../../stx/dll/src;../../shv/dll/src;../../stg/dll/src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
Expand Down
15 changes: 13 additions & 2 deletions tic/dll/src/TreeItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,17 @@ void TreeItem::MakeCalculator() const

}

void ReportItemType(const TreeItem* self, const TreeItem* refItem)
{
auto msg = mySSPrintF("%s: ItemType %s is incompatible with the result of the calculation which is of type %s"
, self->GetFullName().c_str()
, self->GetDynamicObjClass()->GetName().c_str()
, refItem->GetDynamicObjClass()->GetName().c_str()
);

reportF(SeverityTypeID::ST_Warning, msg.c_str());
}

void FailItemType(const TreeItem* self, const TreeItem* refItem)
{
auto msg = mySSPrintF("ItemType %s is incompatible with the result of the calculation which is of type %s"
Expand All @@ -937,9 +948,9 @@ bool TreeItem::_CheckResultObjType(const TreeItem* refItem) const
return false;
try {
if (IsDataItem(refItem) && !IsDataItem(this))
FailItemType(this, refItem);
ReportItemType(this, refItem);
if (IsUnit(refItem) && !IsUnit(this))
FailItemType(this, refItem);
ReportItemType(this, refItem);

if (refItem->GetDynamicObjClass()->IsDerivedFrom(GetDynamicObjClass()) )
return true;
Expand Down
4 changes: 3 additions & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
"boost",
"cgal",
"gdal",
"geos",
"openssl",
"pybind11",
{
"name": "sqlite3",
"features": [
"rtree"
]
},
"geos"
"python3"
]
}
24 changes: 24 additions & 0 deletions xxx.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.15)
project(PyDms)

# Enable C++17 standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Add the vcpkg toolchain file
if(DEFINED ENV{VCPKG_ROOT})
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
else()
message(FATAL_ERROR "Please set the VCPKG_ROOT environment variable to the root of your vcpkg installation")
endif()

# Find Python and pybind11
find_package(Python3 REQUIRED COMPONENTS Development)
find_package(pybind11 REQUIRED)

# Include directories for Python
include_directories(${Python3_INCLUDE_DIRS})

# Add your executable or library
add_executable(PyDms main.cpp) # Replace main.cpp with your source files
target_link_libraries(PyDms PRIVATE pybind11::module ${Python3_LIBRARIES})

0 comments on commit 83fae94

Please sign in to comment.