fixed diverse compile errors from CI (Linx: pthreads missing, VS: could not determine template argument)

This commit is contained in:
jkriege2 2020-09-12 13:08:24 +02:00
parent f9b85ba4e8
commit 7296216a3f
2 changed files with 11 additions and 10 deletions

View File

@ -5,6 +5,7 @@ set(EXENAME jkqtptest_${EXAMPLE_NAME})
message( STATUS ".. Building Example ${EXAMPLE_NAME}" ) message( STATUS ".. Building Example ${EXAMPLE_NAME}" )
find_package(Threads REQUIRED)
# Set up source files # Set up source files
set(SOURCES ${EXAMPLE_NAME}.cpp mandelbrotmainwindow.cpp) set(SOURCES ${EXAMPLE_NAME}.cpp mandelbrotmainwindow.cpp)
@ -19,7 +20,7 @@ if(JKQtPlotter_BUILD_STATIC_LIBS)
elseif(JKQtPlotter_BUILD_SHARED_LIBS) elseif(JKQtPlotter_BUILD_SHARED_LIBS)
target_link_libraries(${EXENAME} JKQTPlotterSharedLib) target_link_libraries(${EXENAME} JKQTPlotterSharedLib)
endif() endif()
target_link_libraries(${EXENAME} Threads::Threads)
# Installation # Installation

View File

@ -36,7 +36,7 @@ MandelbrotMainWindow::MandelbrotMainWindow(QWidget *parent) :
graph->setImageColumn(mandelbrot_col_display); graph->setImageColumn(mandelbrot_col_display);
// image color range is calculated manually! // image color range is calculated manually!
graph->setAutoImageRange(false); graph->setAutoImageRange(false);
graph->setImageMin(0); graph->setImageMin(1);
graph->setImageMax(ui->spinMaxIterations->value()); graph->setImageMax(ui->spinMaxIterations->value());
// set image size // set image size
graph->setX(ui->plot->getXMin()); graph->setX(ui->plot->getXMin());
@ -71,9 +71,9 @@ void MandelbrotMainWindow::paletteChanged(JKQTPMathImageColorPalette pal)
void MandelbrotMainWindow::maxIterationsChanged(int/* maxIter*/) void MandelbrotMainWindow::maxIterationsChanged(int/* maxIter*/)
{ {
graph->setAutoImageRange(false); graph->setAutoImageRange(false);
graph->setImageMin(0); graph->setImageMin(1);
if (ui->chkLogScaling->isChecked()) { if (ui->chkLogScaling->isChecked()) {
graph->setImageMax(log10(ui->spinMaxIterations->value())); graph->setImageMax(log(ui->spinMaxIterations->value())/log(10.0));
} else { } else {
graph->setImageMax(ui->spinMaxIterations->value()); graph->setImageMax(ui->spinMaxIterations->value());
} }
@ -83,14 +83,14 @@ void MandelbrotMainWindow::maxIterationsChanged(int/* maxIter*/)
void MandelbrotMainWindow::logScalingChanged(bool en) void MandelbrotMainWindow::logScalingChanged(bool en)
{ {
if (en) { if (en) {
std::transform(ui->plot->getDatastore()->begin(mandelbrot_col), ui->plot->getDatastore()->end(mandelbrot_col), ui->plot->getDatastore()->begin(mandelbrot_col_display), &log10); std::transform(ui->plot->getDatastore()->begin(mandelbrot_col), ui->plot->getDatastore()->end(mandelbrot_col), ui->plot->getDatastore()->begin(mandelbrot_col_display), [](double v)->double { return log(v)/log(10.0); });
} else { } else {
std::copy(ui->plot->getDatastore()->begin(mandelbrot_col), ui->plot->getDatastore()->end(mandelbrot_col), ui->plot->getDatastore()->begin(mandelbrot_col_display)); std::copy(ui->plot->getDatastore()->begin(mandelbrot_col), ui->plot->getDatastore()->end(mandelbrot_col), ui->plot->getDatastore()->begin(mandelbrot_col_display));
} }
graph->setAutoImageRange(false); graph->setAutoImageRange(false);
graph->setImageMin(0); graph->setImageMin(1);
if (ui->chkLogScaling->isChecked()) { if (ui->chkLogScaling->isChecked()) {
graph->setImageMax(log10(ui->spinMaxIterations->value())); graph->setImageMax(log(ui->spinMaxIterations->value())/log(10.0));
} else { } else {
graph->setImageMax(ui->spinMaxIterations->value()); graph->setImageMax(ui->spinMaxIterations->value());
} }
@ -116,7 +116,7 @@ void MandelbrotMainWindow::plotZoomChangedLocally(double newxmin, double newxmax
calculateMandelSet(newxmin, newxmax, newymin, newymax, ui->plot->getXAxis()->getParentPlotWidth(), ui->plot->getYAxis()->getParentPlotWidth(), ui->spinMaxIterations->value()); calculateMandelSet(newxmin, newxmax, newymin, newymax, ui->plot->getXAxis()->getParentPlotWidth(), ui->plot->getYAxis()->getParentPlotWidth(), ui->spinMaxIterations->value());
ui->plot->getDatastore()->copyColumnData(mandelbrot_col_display, mandelbrot_col); ui->plot->getDatastore()->copyColumnData(mandelbrot_col_display, mandelbrot_col);
if (ui->chkLogScaling->isChecked()) { if (ui->chkLogScaling->isChecked()) {
std::transform(ui->plot->getDatastore()->begin(mandelbrot_col), ui->plot->getDatastore()->end(mandelbrot_col), ui->plot->getDatastore()->begin(mandelbrot_col), &log10); std::transform(ui->plot->getDatastore()->begin(mandelbrot_col), ui->plot->getDatastore()->end(mandelbrot_col), ui->plot->getDatastore()->begin(mandelbrot_col), [](double v)->double { return log(v)/log(10.0); });
} }
graph->setX(newxmin); graph->setX(newxmin);
graph->setY(newymin); graph->setY(newymin);