Statistics

Dirk Hohndel dirk at hohndel.org
Fri Aug 25 17:29:33 PDT 2017


Tomaz,

I took a look at the statistics-qwt branch. A few comments:

(1) many of the commits are missing an SOB (and, frankly, better commit
    messages)

(2) CMakeList.txt: at least on ArchLinux (which I thought you used as
    well) there doesn't appear to be Qwt6 cmake integration. Did you write
    a FindQwt6 module that you forgot to commit?
    I added https://raw.githubusercontent.com/qgis/QGIS/master/cmake/FindQwt.cmake
    (which is under a BSD license and therefore fair game) and that seemed
    to do the trick.

(3) I get the following warning
    You have called ADD_LIBRARY for library subsurface_statistics without any source files. This typically indicates a problem with your CMakeLists.txt file


(4) I get the following error
	/home/hohndel/subsurface/desktop-widgets/tab-widgets/TabDiveStatistics.cpp:138:39: error: type 'double' cannot be narrowed to 'int' in initializer list [-Wc++11-narrowing]
		    tempTripValues.push_back({get_temp_units(stats.min_temp, nullptr), 0, get_temp_units(stats.max_temp, nullptr)});
					      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	/home/hohndel/subsurface/desktop-widgets/tab-widgets/TabDiveStatistics.cpp:138:39: note: insert an explicit cast to silence this issue
		    tempTripValues.push_back({get_temp_units(stats.min_temp, nullptr), 0, get_temp_units(stats.max_temp, nullptr)});
					      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
					      static_cast<int>(                      )
	/home/hohndel/subsurface/desktop-widgets/tab-widgets/TabDiveStatistics.cpp:138:83: error: type 'double' cannot be narrowed to 'int' in initializer list [-Wc++11-narrowing]
		    tempTripValues.push_back({get_temp_units(stats.min_temp, nullptr), 0, get_temp_units(stats.max_temp, nullptr)});
											  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	/home/hohndel/subsurface/desktop-widgets/tab-widgets/TabDiveStatistics.cpp:138:83: note: insert an explicit cast to silence this issue

    A cast might silence the error, but it seems to me that maybe there's
    actually something wrong if we expect integers there...)

Once that was addressed I was able to build. The visual right now is
looking a bit crowded on my screen when used inside the tab widget as part
of the normal display. Using Ctrl-4 to just show the tab widget made it a
bit better, but there's definitely room for improvement. The bars touch,
it would be nice to have at least the major y-axis values be represented
by thin grid lines - and overall it's a bit unclear what I am looking at
(i.e., the bar graph might need a legend).
Also, everywhere else we use color to convey information, here we don't.
Not saying that's a problem, just pointing it out. What I will complain
about is that the blue for the bars and the black for the average line
really don't contrast well. Maybe if the bars were narrower this would
work better? Can they be styled at all (instead of being one flat color)?

Having said all this, I think this is promising...

/D


More information about the subsurface mailing list