Skip to content
Snippets Groups Projects
Commit 03440d89 authored by tobiglaser's avatar tobiglaser
Browse files

removed dynamicLoad example

parent 7e2d37c5
No related branches found
No related tags found
No related merge requests found
...@@ -69,27 +69,6 @@ if(WIN32) ...@@ -69,27 +69,6 @@ if(WIN32)
endif(WIN32) endif(WIN32)
add_executable(LoaderDemo
src/main.cpp
examples/dynamicLoadDummy.cpp
)
target_include_directories(LoaderDemo PRIVATE
include
)
# Set the WIN32_EXECUTABLE property conditionally for Release, MinSizeRel, and RelWithDebInfo builds.
# This lets the exe run without a terminal, making stdout inaccessible for now.
if(WIN32)
set_target_properties(LoaderDemo PROPERTIES WIN32_EXECUTABLE $<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>,$<CONFIG:RelWithDebInfo>>)
endif(WIN32)
# Use this command to copy the .dll from the lib folder next to the freshly built .exe. Which is the most simple way to get it working.
#add_custom_command(TARGET LoaderDemo POST_BUILD # Adds a post-build event to DynamicDemo
# COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
# "${PROJECT_SOURCE_DIR}/lib/cute.dll" # <--this is in-file
# $<TARGET_FILE_DIR:LoaderDemo>) # <--this is out-file path
add_executable(TSP add_executable(TSP
src/main.cpp src/main.cpp
examples/TSP.cpp examples/TSP.cpp
......
#include "cute.h"
void superDummy();
void advancedDummy();
void bubblesort();
// Is run once at startup.
void setup()
{
//cute::setPlotTitle(0, "Hallo");
//cute::setPlotTitle(1, "Hochschule");
//cute::setPlotTitle(2, "Reutlingen");
cute::logMessage("Hello CuteLib! :D");
cute::setProgress(69);
//cute::setPlotVisible(1);
cute::setStatusMessage("Hallo TEC");
cute::registerAlgorithm(superDummy, "DummyAlgo");
cute::registerAlgorithm(advancedDummy, "Problem");
cute::setProblemFile("example.csv");
cute::setProblemSize(4);
cute::enableAutorun();
}
void superDummy()
{
int prog = 0;
while (cute::ok())
{
cute::setProgress(prog);
cute::setStatusMessage(std::to_string(prog));
++prog;
if (prog > 100)
prog = 0;
cute::delay(200);
}
cute::logMessage("Ended cleanly \\(^-^)/");
cute::setProgress(0);
}
std::string fvec2str(std::vector<float> v)
{
std::string s;
for (size_t i = 0; i < v.size() - 1; i++)
{
s += std::to_string(v[i]);
while (s.back() == '0')
{
s.pop_back();
}
s += ", ";
}
s += std::to_string(v.back());
while (s.back() == '0')
{
s.pop_back();
}
return s;
}
std::string point2str(cute::Point p)
{
std::string s = "( " + std::to_string(p.x);
while (s.back() == '0')
s.pop_back();
s += " , ";
s += std::to_string(p.y);
while (s.back() == '0')
s.pop_back();
s += " )";
return s;
}
void advancedDummy()
{
std::vector<float> problem1D = cute::getProblemData1D();
cute::logMessage(fvec2str(problem1D));
cute::setPlotTheme(problem1D.size() - 1);
std::vector<cute::Point> problem2D = cute::getProblemData2D();
for (auto&& p : problem2D)
{
cute::logMessage(point2str(p));
}
cute::setStatusMessage("Done already!");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment