Glucose - Bloodsugar Diary

Plasma 4 Widgets

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
Score 68.0%
Description:

Glucose is an applet for diabetics (like me).

It can store your bloodsugar readings and show a curve for them.
- Zoomable, scrollable.
- Add / change / remove readings.
- Diagram points are clickable and show a tooltip.
- With KDE trunk (4.5) the curve view can be scrolled like the other views (diary and statistics) using Plasma::ScrollWidget. It then automatically loads new data from the data engine while scrolling.

It can also show some statistics:
- For all readings / last 24 hours / last week / last month / ...
- Limit to time spans (whole day / morning / noon / evening / night).
- Show information like mean, estimated HbA1c, standard deviation, range, percentages in/above/below target range, number of readings per day, ...

Settings:
- Unit for bloodsugar readings: mg/dl or mmol/l.
- Target range.
- Day times.
- Colors.

Data Engine "bloodsugardiary":
- Stores diary entries in an SQLite database.
- Can be queried for readings in a given time range.
- Can be queried for statistics in a given time range.
- Provides a service for adding/changing/removing readings.


Previously I made a scripted plasmoid here http://kde-look.org/content/show.php/Glucose+-+Bloodsugar+Diary+%28KDE+trunk%29?content=123606. But C++ is easier for me (especially with syntax completion etc. in KDevelop ;)). It also allows me to use some stuff, that isn't currently available for scripted plasmoids (like the calendar widget).

To compile you need development package for plasma.
Packagers are welcome :)
You could use BuildService to build packages for eg. openSuse (http://en.opensuse.org/Portal:Packaging) or Debian/Ubuntu (http://en.opensuse.org/openSUSE:Build_Service_Debian_builds).

Comments are appreciated.
Last changelog:

8 years ago

14.02.2011
Version 0.1.1

- Fixed compilation problems with KDE 4.6.

17.05.2010
Version 0.1

- initial version

mkyral

7 years ago

Hi,
thanks for your applet. It looks good, but I've found a bug. I added Glucose applet to my desktop, did some tests, but as I don't have actual data (my daughter is still in hospital), I deleted all my testing data.

But in this case, plasma-desktop is crashing on start. See Backtrace below. It seems that Glucose::showCurve does not expect that there are no data.

I also noticed, that the 'Go to current day' (I can't verify the name now) button does not work. Or I'm doing something wrong.

[KCrash Handler]
#6 0x00007faf2f138ac0 in ?? () from /usr/lib64/kde4/plasma_applet_yawp.so
#7 0x00007faf2f1094b5 in ?? () from /usr/lib64/kde4/plasma_applet_yawp.so
#8 0x00007faf4b60ff93 in QMetaObject::activate (sender=0x70c370, m=<optimized out>, local_signal_index=<optimized out>, argv=0x0) at kernel/qobject.cpp:3547
#9 0x00007faf4e195625 in Plasma::ThemePrivate::notifyOfChanged (this=0x6a2530) at /var/tmp/portage/kde-base/kdelibs-4.8.1-r1/work/kdelibs-4.8.1/plasma/theme.cpp:366
#10 0x00007faf4e1958b1 in Plasma::Theme::qt_static_metacall (_o=0x70c370, _c=<optimized out>, _id=8, _a=0x7fff8430c920) at /var/tmp/portage/kde-base/kdelibs-4.8.1-r1/work/kdelibs-4.8.1_build/plasma/theme.moc:102
#11 0x00007faf4b60ff93 in QMetaObject::activate (sender=0x704b50, m=<optimized out>, local_signal_index=<optimized out>, argv=0x0) at kernel/qobject.cpp:3547
#12 0x00007faf4b60f109 in QObject::event (this=0x704b50, e=<optimized out>) at kernel/qobject.cpp:1157
#13 0x00007faf4a77a224 in QApplicationPrivate::notify_helper (this=0x6fdbe0, receiver=0x704b50, e=0x7fff8430d080) at kernel/qapplication.cpp:4550
#14 0x00007faf4a77ee1f in QApplication::notify (this=<optimized out>, receiver=0x704b50, e=0x7fff8430d080) at kernel/qapplication.cpp:4411
#15 0x00007faf4c320222 in KApplication::notify (this=0x6a0360, receiver=0x704b50, event=0x7fff8430d080) at /var/tmp/portage/kde-base/kdelibs-4.8.1-r1/work/kdelibs-4.8.1/kdeui/kernel/kapplication.cpp:311
#16 0x00007faf4b5fa7bb in QCoreApplication::notifyInternal (this=0x6a0360, receiver=0x704b50, event=0x7fff8430d080) at kernel/qcoreapplication.cpp:876
#17 0x00007faf4b62c15e in sendEvent (event=0x7fff8430d080, receiver=<optimized out>) at kernel/qcoreapplication.h:231
#18 QTimerInfoList::activateTimers (this=0x700950) at kernel/qeventdispatcher_unix.cpp:611
#19 0x00007faf4b6291ad in timerSourceDispatch (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:186
#20 0x00007faf42223672 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#21 0x00007faf42223e68 in ?? () from /usr/lib64/libglib-2.0.so.0
#22 0x00007faf42224041 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#23 0x00007faf4b6298ff in QEventDispatcherGlib::processEvents (this=0x603ad0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#24 0x00007faf4a81f61e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#25 0x00007faf4b5fe38f in QCoreApplication::processEvents (flags=...) at kernel/qcoreapplication.cpp:1063
#26 0x00007faf35459f92 in Glucose::showCurve (this=0x9927f0) at /home/marian/Stažené soubory/glucose/glucose-0.1.1/plasma-applet-glucose-0.1.1/glucose.cpp:934
#27 0x00007faf3545a7b3 in Glucose::setCurrentView (this=0x9927f0, newView=...) at /home/marian/Stažené soubory/glucose/glucose-0.1.1/plasma-applet-glucose-0.1.1/glucose.cpp:875
#28 0x00007faf3545b12d in Glucose::init (this=0x9927f0) at /home/marian/Stažené soubory/glucose/glucose-0.1.1/plasma-applet-glucose-0.1.1/glucose.cpp:208
#29 0x00007faf4e0e989f in Plasma::ContainmentPrivate::initApplets (this=0x8b9db0) at /var/tmp/portage/kde-base/kdelibs-4.8.1-r1/work/kdelibs-4.8.1/plasma/containment.cpp:463
#30 0x00007faf4e0fd519 in Plasma::CoronaPrivate::importLayout (this=0x8784b0, conf=..., mergeConfig=240) at /var/tmp/portage/kde-base/kdelibs-4.8.1-r1/work/kdelibs-4.8.1/plasma/corona.cpp:1067
#31 0x00007faf4e0fdc7f in Plasma::Corona::loadLayout (this=0x93d260, configName=...) at /var/tmp/portage/kde-base/kdelibs-4.8.1-r1/work/kdelibs-4.8.1/plasma/corona.cpp:278
#32 0x00007faf4e0fdd0e in Plasma::Corona::initializeLayout (this=0x93d260, configName=...) at /var/tmp/portage/kde-base/kdelibs-4.8.1-r1/work/kdelibs-4.8.1/plasma/corona.cpp:181
#33 0x00007faf4e934434 in PlasmaApp::corona (this=0x6a0360, createIfMissing=<optimized out>) at /var/tmp/portage/kde-base/plasma-workspace-4.8.1/work/plasma-workspace-4.8.1/plasma/desktop/shell/plasmaapp.cpp:833
#34 0x00007faf4e9346e3 in PlasmaApp::setupDesktop (this=0x6a0360) at /var/tmp/portage/kde-base/plasma-workspace-4.8.1/work/plasma-workspace-4.8.1/plasma/desktop/shell/plasmaapp.cpp:312
#35 0x00007faf4e9355c2 in PlasmaApp::qt_static_metacall (_o=0x6a0360, _c=<optimized out>, _id=14, _a=0x840970) at /var/tmp/portage/kde-base/plasma-workspace-4.8.1/work/plasma-workspace-4.8.1_build/plasma/desktop/shell/plasmaapp.moc:119
#36 0x00007faf4b60f3d6 in QObject::event (this=0x6a0360, e=<optimized out>) at kernel/qobject.cpp:1195
#37 0x00007faf4a77c8c6 in QApplication::event (this=0x6a0360, e=0x7b89a0) at kernel/qapplication.cpp:2532
#38 0x00007faf4a77a224 in QApplicationPrivate::notify_helper (this=0x6fdbe0, receiver=0x6a0360, e=0x7b89a0) at kernel/qapplication.cpp:4550
#39 0x00007faf4a77ee1f in QApplication::notify (this=<optimized out>, receiver=0x6a0360, e=0x7b89a0) at kernel/qapplication.cpp:4411
#40 0x00007faf4c320222 in KApplication::notify (this=0x6a0360, receiver=0x6a0360, event=0x7b89a0) at /var/tmp/portage/kde-base/kdelibs-4.8.1-r1/work/kdelibs-4.8.1/kdeui/kernel/kapplication.cpp:311
#41 0x00007faf4b5fa7bb in QCoreApplication::notifyInternal (this=0x6a0360, receiver=0x6a0360, event=0x7b89a0) at kernel/qcoreapplication.cpp:876
#42 0x00007faf4b5fdd77 in sendEvent (event=0x7b89a0, receiver=0x6a0360) at kernel/qcoreapplication.h:231
#43 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x6021f0) at kernel/qcoreapplication.cpp:1500
#44 0x00007faf4b629763 in sendPostedEvents () at kernel/qcoreapplication.h:236
#45 postEventSourceDispatch (s=<optimized out>) at kernel/qeventdispatcher_glib.cpp:279
#46 0x00007faf42223672 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#47 0x00007faf42223e68 in ?? () from /usr/lib64/libglib-2.0.so.0
#48 0x00007faf42224041 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#49 0x00007faf4b6298ff in QEventDispatcherGlib::processEvents (this=0x603ad0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#50 0x00007faf4a81f61e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#51 0x00007faf4b5f97e2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#52 0x00007faf4b5f9a95 in QEventLoop::exec (this=0x7fff8430eaa0, flags=...) at kernel/qeventloop.cpp:204
#53 0x00007faf4b5fe21b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1148
#54 0x00007faf4e91af82 in kdemain (argc=1, argv=0x7fff8430eee8) at /var/tmp/portage/kde-base/plasma-workspace-4.8.1/work/plasma-workspace-4.8.1/plasma/desktop/shell/main.cpp:120
#55 0x00007faf4e56622d in __libc_start_main (main=0x400880 <main(int, char**)>, argc=1, ubp_av=0x7fff8430eee8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff8430eed8) at libc-start.c:226
#56 0x00000000004007a9 in _start ()

Report

buschmann23

8 years ago

Packages for openSUSE can now be found in OBS project KDE:Extra

https://build.opensuse.org/package/show?package=plasmoid-glucose&project=KDE%3AExtra

Repositories:

http://download.opensuse.org/repositories/KDE:/Extra/

Report

buschmann23

8 years ago

When I try to build this on openSUSE 11.3 with KDE 4.4.4 and Qt 4.6.3 I get the following error:

Quote:
[ 44%] Building CXX object CMakeFiles/plasma_applet_glucose.dir/diagram.o
/usr/bin/c++ -DMAKE_PLASMA_APPLET_GLUCOSE_LIB -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -DQT_NO_STL -DQT_NO_CAST_TO_ASCII -D_REENTRANT -DKDE_DEPRECATED_WARNINGS -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -fvisibility-inlines-hidden -O2 -DNDEBUG -DQT_NO_DEBUG -fPIC -I/usr/src/packages/BUILD/glucose-0.1/plasma-applet-glucose-0.1/builddir -I/usr/src/packages/BUILD/glucose-0.1/plasma-applet-glucose-0.1 -I/usr/include/KDE -I/usr/include/QtXmlPatterns -I/usr/include/QtXml -I/usr/include/QtWebKit -I/usr/include/QtUiTools -I/usr/include/QtTest -I/usr/include/QtSvg -I/usr/include/QtSql -I/usr/include/QtScriptTools -I/usr/include/QtScript -I/usr/include/QtOpenGL -I/usr/include/QtNetwork -I/usr/include/QtMultimedia -I/usr/include/QtHelp -I/usr/include/QtDesigner -I/usr/include/QtDBus -I/usr/include/QtAssistant -I/usr/include/Qt3Support -I/usr/include/QtGui -I/usr/include/QtCore -I/usr/include/Qt -I/usr/share/qt4/mkspecs/default -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -o CMakeFiles/plasma_applet_glucose.dir/diagram.o -c /usr/src/packages/BUILD/glucose-0.1/plasma-applet-glucose-0.1/diagram.cpp
/usr/src/packages/BUILD/glucose-0.1/plasma-applet-glucose-0.1/glucose.cpp:762:6: warning: unused parameter 'name'
/usr/src/packages/BUILD/glucose-0.1/plasma-applet-glucose-0.1/glucose.cpp:762:6: warning: unused parameter 'data'
/usr/src/packages/BUILD/glucose-0.1/plasma-applet-glucose-0.1/diagram.cpp:458:6: warning: unused parameter 'newSize'
/usr/src/packages/BUILD/glucose-0.1/plasma-applet-glucose-0.1/diagram.cpp: In member function 'void Diagram::scrollValueChanged(qreal, qreal)':
/usr/src/packages/BUILD/glucose-0.1/plasma-applet-glucose-0.1/diagram.cpp:492:7: warning: unused variable 'mouseDown'
/usr/src/packages/BUILD/glucose-0.1/plasma-applet-glucose-0.1/diagram.cpp: At global scope:
/usr/src/packages/BUILD/glucose-0.1/plasma-applet-glucose-0.1/diagram.cpp:481:6: warning: unused parameter 'oldScrollPositionX'
/usr/src/packages/BUILD/glucose-0.1/plasma-applet-glucose-0.1/diagram.cpp:605:6: warning: unused parameter 'oldState'
/usr/src/packages/BUILD/glucose-0.1/plasma-applet-glucose-0.1/diagram.cpp: In member function 'virtual void Diagram::resizeEvent(QGraphicsSceneResizeEvent*)':
/usr/src/packages/BUILD/glucose-0.1/plasma-applet-glucose-0.1/diagram.cpp:1071:43: error: cannot call constructor 'QTransform::QTransform' directly
/usr/src/packages/BUILD/glucose-0.1/plasma-applet-glucose-0.1/diagram.cpp:1071:43: error: for a function-style cast, remove the redundant '::QTransform'
/usr/src/packages/BUILD/glucose-0.1/plasma-applet-glucose-0.1/diagram.cpp: At global scope:
/usr/src/packages/BUILD/glucose-0.1/plasma-applet-glucose-0.1/diagram.cpp:1128:6: warning: unused parameter 'option'
make[2]: *** [CMakeFiles/plasma_applet_glucose.dir/diagram.o] Error 1


I downloaded the plasmoid today from kde-look.org. All namings are with version 0.1.

Report

C

fpuelz

8 years ago

Ah, I had build files in the archive and it was too big.. kde-look.org silently didn't accept it.
Now it should be 0.1.1 and it should work :)

Report

gibgio

9 years ago

Hi!
Nice plasmoid!
It works on Slackware current.

There's a bug in the configuration dialog:

Unit set to mg/dl
Target range expressed in mmol/l

Report

C

fpuelz

9 years ago

Thanks ;)
The units are only changed in the plasmoid itself currently (should be everywhere except for the config dialog). But I will add that in a future version :)

Report

thecrazyzorro

9 years ago

I tried to use the installer in Kubuntu 10.04. The result was


>Chosen: (1)
>
> Data engine directory not found!
> ********************************

using cmake ~/Downloads/glucose-0.1/plasma-dataengine-bloodsugardiary-0.1 resulted in


>CMake Warning (dev) in >CMakeLists.txt:
> No cmake_minimum_required >command is present. A line of >code such as
>
> cmake_minimum_required(VERSION 2.8)

> should be added at the top of >the file. The version specified >may be lower
> if you wish to support older >CMake versions for this project. >For more
> information run "cmake --help->policy CMP0000".
>This warning is for project >developers. Use -Wno-dev to >suppress it.

> -- Configuring incomplete, >errors occurred!

Now I guess, I'm missusing things

Report

C

fpuelz

9 years ago

a bit late but.. Have you installed the KDE sources? They are needed to compile the plasmoid.

Report

thecrazyzorro

9 years ago

compiling the data-engine runs fine now, there's only a problem with the widget itself:


~/glucose-0.1/build$ make
[ 0%] Built target plasma_applet_glucose_automoc
[ 11%] Building CXX object CMakeFiles/plasma_applet_glucose.dir/glucose.o
~/glucose-0.1/plasma-applet-glucose-0.1/glucose.cpp:47:34: error: plasmaclock/calendar.h: No such file or directory
~/glucose-0.1/plasma-applet-glucose-0.1/glucose.cpp: In member function ‘virtual void Glucose::initExtenderItem(Plasma::ExtenderItem*)’:
~/glucose-0.1/plasma-applet-glucose-0.1/glucose.cpp:583: error: no matching function for call to ‘Plasma::ExtenderItem::setWidget(Plasma::Calendar*)’
/usr/include/KDE/Plasma/../../plasma/extenderitem.h:112: note: candidates are: void Plasma::ExtenderItem::setWidget(QGraphicsItem*)
~/glucose-0.1/plasma-applet-glucose-0.1/glucose.cpp: At global scope:
~/glucose-0.1/plasma-applet-glucose-0.1/glucose.cpp:762: warning: unused parameter ‘name’
~/glucose-0.1/plasma-applet-glucose-0.1/glucose.cpp:762: warning: unused parameter ‘data’
make[2]: *** [CMakeFiles/plasma_applet_glucose.dir/glucose.o] Fehler 1
make[1]: *** [CMakeFiles/plasma_applet_glucose.dir/all] Fehler 2
make: *** [all] Fehler 2

Report

thecrazyzorro

9 years ago

The system is Kubuntu 10.04 with KDE SC 4.5

Report

thecrazyzorro

9 years ago

Unfortunately neither the installer works, nor to compile it (no makefile found).

Report

C

fpuelz

9 years ago

For me the installer works on Kubuntu 10.04, what's the problem, is there an error message?
And how did you try to compile? CMake is needed to generate the makefile, eg. cmake . -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix`.

Report

8 years ago

14.02.2011
Version 0.1.1

- Fixed compilation problems with KDE 4.6.

17.05.2010
Version 0.1

- initial version

12345678910
15
product-maker mononoke Jul 10 2011 9 excellent
product-maker Telperien May 19 2011 9 excellent
product-maker thecrazyzorro Mar 28 2011 9 excellent
product-maker schleby Feb 14 2011 9 excellent
product-maker YAFU Feb 14 2011 9 excellent
product-maker vitoubien Feb 14 2011 3 bad
product-maker Count: 4 Rating: 5.0
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs ocs-url or ocs-store to install things
Pling
Details
license
version
0.1.1
updated Feb 15 2011
added May 17 2010
downloads 24h
0
page views 24h 1