Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.

Wed, 29 Jun 2022 21:28:13 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 29 Jun 2022 21:28:13 +0200
changeset 316
dcd472be9ae8
parent 315
cf4e83cecdb5
child 317
f78827503fb0

Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.

CMakeLists.txt file | annotate | diff | comparison | revisions
designer/led_plugin.cpp file | annotate | diff | comparison | revisions
designer/led_plugin.h file | annotate | diff | comparison | revisions
designer/manometer_plugin.cpp file | annotate | diff | comparison | revisions
designer/manometer_plugin.h file | annotate | diff | comparison | revisions
designer/thermometer_plugin.cpp file | annotate | diff | comparison | revisions
designer/thermometer_plugin.h file | annotate | diff | comparison | revisions
designer/wallclock_plugin.cpp file | annotate | diff | comparison | revisions
designer/wallclock_plugin.h file | annotate | diff | comparison | revisions
src/analog/abstractmeter.cpp file | annotate | diff | comparison | revisions
src/analog/abstractmeter.h file | annotate | diff | comparison | revisions
src/analog/functions.cpp file | annotate | diff | comparison | revisions
src/analog/functions.h file | annotate | diff | comparison | revisions
src/analog/led.cpp file | annotate | diff | comparison | revisions
src/analog/led.h file | annotate | diff | comparison | revisions
src/analog/manometer.cpp file | annotate | diff | comparison | revisions
src/analog/manometer.h file | annotate | diff | comparison | revisions
src/analog/thermometer.cpp file | annotate | diff | comparison | revisions
src/analog/thermometer.h file | annotate | diff | comparison | revisions
src/analog/wallclock.cpp file | annotate | diff | comparison | revisions
src/analog/wallclock.h file | annotate | diff | comparison | revisions
src/analog/widgetwithbackground.cpp file | annotate | diff | comparison | revisions
src/analog/widgetwithbackground.h file | annotate | diff | comparison | revisions
--- a/CMakeLists.txt	Wed Jun 29 08:44:57 2022 +0200
+++ b/CMakeLists.txt	Wed Jun 29 21:28:13 2022 +0200
@@ -138,6 +138,58 @@
     ${GEN_MOC_FILES3}
   )
 
+  QT_WRAP_CPP(GEN_MOC_FILES4
+    ${SRCDIR}/analog/thermometer.h
+    ${SRCDIR}/analog/abstractmeter.h
+    ${SRCDIR}/analog/widgetwithbackground.h
+    designer/thermometer_plugin.h
+  )
+  add_library(bmsapp_thermometer SHARED
+    ${SRCDIR}/analog/thermometer.cpp
+    ${SRCDIR}/analog/abstractmeter.cpp
+    ${SRCDIR}/analog/widgetwithbackground.cpp
+    designer/thermometer_plugin.cpp
+    ${GEN_MOC_FILES4}
+  )
+
+  QT_WRAP_CPP(GEN_MOC_FILES5
+    ${SRCDIR}/analog/manometer.h
+    ${SRCDIR}/analog/abstractmeter.h
+    ${SRCDIR}/analog/widgetwithbackground.h
+    designer/manometer_plugin.h
+  )
+  add_library(bmsapp_manometer SHARED
+    ${SRCDIR}/analog/manometer.cpp
+    ${SRCDIR}/analog/abstractmeter.cpp
+    ${SRCDIR}/analog/widgetwithbackground.cpp
+    designer/manometer_plugin.cpp
+    ${GEN_MOC_FILES5}
+  )
+
+  QT_WRAP_CPP(GEN_MOC_FILES6
+    ${SRCDIR}/analog/wallclock.h
+    ${SRCDIR}/analog/widgetwithbackground.h
+    designer/wallclock_plugin.h
+  )
+  add_library(bmsapp_wallclock SHARED
+    ${SRCDIR}/analog/wallclock.cpp
+    ${SRCDIR}/analog/widgetwithbackground.cpp
+    designer/wallclock_plugin.cpp
+    ${GEN_MOC_FILES6}
+  )
+
+  QT_WRAP_CPP(GEN_MOC_FILES7
+    ${SRCDIR}/analog/led.h
+    ${SRCDIR}/analog/widgetwithbackground.h
+    designer/led_plugin.h
+  )
+  add_library(bmsapp_led SHARED
+    ${SRCDIR}/analog/led.cpp
+    ${SRCDIR}/analog/widgetwithbackground.cpp
+    designer/led_plugin.cpp
+    ${GEN_MOC_FILES7}
+  )
+
 ELSE()
 
   set( SRCS
@@ -189,6 +241,13 @@
     ${SRCDIR}/RangedSlider.cpp
     ${SRCDIR}/NullDateEdit.cpp
     ${SRCDIR}/LED.cpp
+    ${SRCDIR}/analog/abstractmeter.cpp
+    ${SRCDIR}/analog/functions.cpp
+    ${SRCDIR}/analog/widgetwithbackground.cpp
+    ${SRCDIR}/analog/manometer.cpp
+    ${SRCDIR}/analog/thermometer.cpp
+    ${SRCDIR}/analog/led.cpp
+    ${SRCDIR}/analog/wallclock.cpp
     ${SRCDIR}/global.cpp
   )
 
@@ -240,6 +299,13 @@
     ${SRCDIR}/RangedSlider.h
     ${SRCDIR}/NullDateEdit.h
     ${SRCDIR}/LED.h
+    ${SRCDIR}/analog/abstractmeter.h
+    ${SRCDIR}/analog/functions.h
+    ${SRCDIR}/analog/widgetwithbackground.h
+    ${SRCDIR}/analog/manometer.h
+    ${SRCDIR}/analog/thermometer.h
+    ${SRCDIR}/analog/led.h
+    ${SRCDIR}/analog/wallclock.h
     ${SRCDIR}/global.h
   )
 
@@ -310,8 +376,15 @@
 
 IF( ${BUILD_DESIGNER_PLUGINS} )
 
-	INSTALL(TARGETS bmsapp_rangeslider bmsapp_nulldate bmsapp_LED
-	DESTINATION "${LIBPATH}/plugins/designer"
+  INSTALL(TARGETS
+    bmsapp_rangeslider
+    bmsapp_nulldate
+    bmsapp_LED
+    bmsapp_thermometer
+    bmsapp_manometer
+    bmsapp_led
+    bmsapp_wallclock
+    DESTINATION "${LIBPATH}/plugins/designer"
   )
 
 ELSE()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/designer/led_plugin.cpp	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,118 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *   Adapted for the bmsapp project by Michiel Broek, 2022.                *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include <QObject>
+#include <QtUiPlugin/QDesignerCustomWidgetInterface>
+#include <QString>
+#include <QWidget>
+#include <QIcon>
+#include <QtPlugin>
+
+#include "analog/led.h" 
+#include "led_plugin.h"     
+
+/*------------------------------------------------------------------------------------------------
+ *			     			LED
+ *------------------------------------------------------------------------------------------------*/
+    
+    
+LedPlugin::LedPlugin(QObject *parent)
+        : QObject(parent)
+{
+}
+
+void LedPlugin::initialize(QDesignerFormEditorInterface * /*core*/)
+{
+    if (initialized)
+	return;
+
+    initialized = true;
+}
+
+bool LedPlugin::isInitialized() const
+{
+    return initialized;
+}
+
+QWidget *LedPlugin::createWidget(QWidget *parent)
+{
+    return new Led(parent);
+}
+
+QString LedPlugin::name() const
+{
+    return "Led";
+}
+
+QString LedPlugin::group() const
+{
+    return "BMSapp Widgets";
+}
+
+QIcon LedPlugin::icon() const
+{
+    return QIcon();
+}
+
+QString LedPlugin::toolTip() const
+{
+    return QString();
+}
+
+QString LedPlugin::whatsThis() const
+{
+    return QString();
+}
+
+bool LedPlugin::isContainer() const
+{
+    return false;
+}
+
+QString LedPlugin::domXml() const
+{
+    return "<ui language=\"c++\">\n"
+	   " <widget class=\"Led\" name=\"led\">\n"
+           "  <property name=\"geometry\">\n"
+           "   <rect>\n"
+           "    <x>0</x>\n"
+           "    <y>0</y>\n"
+           "    <width>16</width>\n"
+           "    <height>16</height>\n"
+           "   </rect>\n"
+           "  </property>\n"
+           "  <property name=\"toolTip\" >\n"
+           "   <string>Color Led component</string>\n"
+           "  </property>\n"
+           "  <property name=\"whatsThis\" >\n"
+           "   <string>Led indicator</string>\n"
+           "  </property>\n"
+           " </widget>\n"
+	   "</ui>\n";
+}
+
+QString LedPlugin::includeFile() const
+{
+    return "analog/led.h";
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/designer/led_plugin.h	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,59 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *   Adapted for the bmsapp project by Michiel Broek, 2022.                *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef	_LED_PLUGIN_H
+#define	_LED_PLUGIN_H
+
+#include <QObject>
+#include <QString>
+#include <QWidget>
+#include <QIcon>
+#include <QtUiPlugin/QDesignerCustomWidgetInterface>
+
+class LedPlugin;
+
+class LedPlugin : public QObject, public QDesignerCustomWidgetInterface
+{
+    Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface")
+    Q_INTERFACES(QDesignerCustomWidgetInterface)
+
+public:
+    LedPlugin(QObject *parent = 0);
+    bool isContainer() const;
+    bool isInitialized() const;
+    QIcon icon() const;
+    QString domXml() const;
+    QString group() const;
+    QString includeFile() const;
+    QString name() const;
+    QString toolTip() const;
+    QString whatsThis() const;
+    QWidget *createWidget(QWidget *parent);
+    void initialize(QDesignerFormEditorInterface *core);
+
+private:
+    bool initialized = false;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/designer/manometer_plugin.cpp	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,119 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *   Adapted for the bmsapp project by Michiel Broek, 2022.                *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include <QObject>
+#include <QtUiPlugin/QDesignerCustomWidgetInterface>
+#include <QString>
+#include <QWidget>
+#include <QIcon>
+#include <QtPlugin>
+
+#include "analog/manometer.h" 
+#include "manometer_plugin.h"     
+  
+/*------------------------------------------------------------------------------------------------
+ *			     			MANOMETER    
+ *------------------------------------------------------------------------------------------------*/
+    
+    
+ManoMeterPlugin::ManoMeterPlugin(QObject *parent)
+        : QObject(parent)
+{
+}
+
+void ManoMeterPlugin::initialize(QDesignerFormEditorInterface * /*core*/)
+{
+    if (initialized)
+	return;
+
+    initialized = true;
+}
+
+bool ManoMeterPlugin::isInitialized() const
+{
+    return initialized;
+}
+
+QWidget *ManoMeterPlugin::createWidget(QWidget *parent)
+{
+    return new ManoMeter(parent);
+}
+
+QString ManoMeterPlugin::name() const
+{
+    return "ManoMeter";
+}
+
+QString ManoMeterPlugin::group() const
+{
+    return "BMSapp Widgets";
+}
+
+QIcon ManoMeterPlugin::icon() const
+{
+    return QIcon();
+}
+
+QString ManoMeterPlugin::toolTip() const
+{
+    return QString();
+}
+
+QString ManoMeterPlugin::whatsThis() const
+{
+    return QString();
+}
+
+bool ManoMeterPlugin::isContainer() const
+{
+    return false;
+}
+
+QString ManoMeterPlugin::domXml() const
+{
+    return "<ui language=\"c++\">\n"
+	   " <widget class=\"ManoMeter\" name=\"manometer\">\n"
+           "  <property name=\"geometry\">\n"
+           "   <rect>\n"
+           "    <x>0</x>\n"
+           "    <y>0</y>\n"
+           "    <width>100</width>\n"
+           "    <height>100</height>\n"
+           "   </rect>\n"
+           "  </property>\n"
+           "  <property name=\"toolTip\" >\n"
+           "   <string>Shows the pressure</string>\n"
+           "  </property>\n"
+           "  <property name=\"whatsThis\" >\n"
+           "   <string>The bar meter widget displays "
+           "the pressure attached to it</string>\n"
+           "  </property>\n"
+           " </widget>\n"
+	   "</ui>\n";
+}
+
+QString ManoMeterPlugin::includeFile() const
+{
+    return "analog/manometer.h";
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/designer/manometer_plugin.h	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,59 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *   Adapted for the bmsapp project by Michiel Broek, 2022.                *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef	_MANOMETER_PLUGIN_H
+#define	_MANOMETER_PLUGIN_H
+
+#include <QObject>
+#include <QString>
+#include <QWidget>
+#include <QIcon>
+#include <QtUiPlugin/QDesignerCustomWidgetInterface>
+ 
+class ManoMeterPlugin;
+
+class ManoMeterPlugin : public QObject, public QDesignerCustomWidgetInterface
+{
+    Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface")
+    Q_INTERFACES(QDesignerCustomWidgetInterface)
+
+public:
+    ManoMeterPlugin(QObject *parent = 0);
+    bool isContainer() const;
+    bool isInitialized() const;
+    QIcon icon() const;
+    QString domXml() const;
+    QString group() const;
+    QString includeFile() const;
+    QString name() const;
+    QString toolTip() const;
+    QString whatsThis() const;
+    QWidget *createWidget(QWidget *parent);
+    void initialize(QDesignerFormEditorInterface *core);
+
+private:
+    bool initialized = false;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/designer/thermometer_plugin.cpp	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,119 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *   Adapted for the bmsapp project by Michiel Broek, 2022.		   *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include <QObject>
+#include <QtUiPlugin/QDesignerCustomWidgetInterface>
+#include <QString>
+#include <QWidget>
+#include <QIcon>
+#include <QtPlugin>
+
+#include "analog/thermometer.h"
+#include "thermometer_plugin.h"
+
+/*------------------------------------------------------------------------------------------------
+ *			     			THERMOMETER
+ *------------------------------------------------------------------------------------------------*/
+
+
+ThermoMeterPlugin::ThermoMeterPlugin(QObject *parent)
+        : QObject(parent)
+{
+}
+
+void ThermoMeterPlugin::initialize(QDesignerFormEditorInterface * /*core*/)
+{
+    if (initialized)
+	return;
+
+    initialized = true;
+}
+
+bool ThermoMeterPlugin::isInitialized() const
+{
+    return initialized;
+}
+
+QWidget *ThermoMeterPlugin::createWidget(QWidget *parent)
+{
+    return new ThermoMeter(parent);
+}
+
+QString ThermoMeterPlugin::name() const
+{
+    return "ThermoMeter";
+}
+
+QString ThermoMeterPlugin::group() const
+{
+    return "BMSapp Widgets";
+}
+
+QIcon ThermoMeterPlugin::icon() const
+{
+    return QIcon();
+}
+
+QString ThermoMeterPlugin::toolTip() const
+{
+    return QString();
+}
+
+QString ThermoMeterPlugin::whatsThis() const
+{
+    return QString();
+}
+
+bool ThermoMeterPlugin::isContainer() const
+{
+    return false;
+}
+
+QString ThermoMeterPlugin::domXml() const
+{
+    return "<ui language=\"c++\">\n"
+	   " <widget class=\"ThermoMeter\" name=\"thermometer\">\n"
+           "  <property name=\"geometry\">\n"
+           "   <rect>\n"
+           "    <x>0</x>\n"
+           "    <y>0</y>\n"
+           "    <width>40</width>\n"
+           "    <height>160</height>\n"
+           "   </rect>\n"
+           "  </property>\n"
+           "  <property name=\"toolTip\" >\n"
+           "   <string>Shows the temperature</string>\n"
+           "  </property>\n"
+           "  <property name=\"whatsThis\" >\n"
+           "   <string>The bar meter widget displays "
+           "the temperature attached to it</string>\n"
+           "  </property>\n"
+           " </widget>\n"
+	   "</ui>\n";
+}
+
+QString ThermoMeterPlugin::includeFile() const
+{
+    return "analog/thermometer.h";
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/designer/thermometer_plugin.h	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,59 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *   Adapted for the bmsapp project by Michiel Broek, 2022.                *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef _THERMOMETER_PLUGIN_H
+#define	_THERMOMETER_PLUGIN_H
+
+#include <QObject>
+#include <QString>
+#include <QWidget>
+#include <QIcon>
+#include <QtUiPlugin/QDesignerCustomWidgetInterface>
+
+class ThermoMeterPlugin;
+
+class ThermoMeterPlugin : public QObject, public QDesignerCustomWidgetInterface
+{
+    Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface")
+    Q_INTERFACES(QDesignerCustomWidgetInterface)
+
+public:
+    ThermoMeterPlugin(QObject *parent = 0);
+    bool isContainer() const;
+    bool isInitialized() const;
+    QIcon icon() const;
+    QString domXml() const;
+    QString group() const;
+    QString includeFile() const;
+    QString name() const;
+    QString toolTip() const;
+    QString whatsThis() const;
+    QWidget *createWidget(QWidget *parent);
+    void initialize(QDesignerFormEditorInterface *core);
+
+private:
+    bool initialized = false;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/designer/wallclock_plugin.cpp	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,111 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *   Adapted for the bmsapp project by Michiel Broek, 2022.                *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "analog/wallclock.h"
+#include "wallclock_plugin.h" 
+    
+/*------------------------------------------------------------------------------------------------
+ *			     			WALLCLCOCK    
+ *------------------------------------------------------------------------------------------------*/
+
+WallClockPlugin::WallClockPlugin(QObject *parent)
+        : QObject(parent)
+{
+}
+
+void WallClockPlugin::initialize(QDesignerFormEditorInterface * /*core*/)
+{
+    if (initialized)
+	return;
+
+    initialized = true;
+}
+
+bool WallClockPlugin::isInitialized() const
+{
+    return initialized;
+}
+
+QWidget *WallClockPlugin::createWidget(QWidget *parent)
+{
+    return new WallClock(parent);
+}
+
+QString WallClockPlugin::name() const
+{
+    return "WallClock";
+}
+
+QString WallClockPlugin::group() const
+{
+    return "BMSapp Widgets";
+}
+
+QIcon WallClockPlugin::icon() const
+{
+    return QIcon();
+}
+
+QString WallClockPlugin::toolTip() const
+{
+    return QString();
+}
+
+QString WallClockPlugin::whatsThis() const
+{
+    return QString();
+}
+
+bool WallClockPlugin::isContainer() const
+{
+    return false;
+}
+
+QString WallClockPlugin::domXml() const
+{
+    return "<ui language=\"c++\">\n"
+	   " <widget class=\"WallClock\" name=\"wallclock\">\n"
+           "  <property name=\"geometry\">\n"
+           "   <rect>\n"
+           "    <x>0</x>\n"
+           "    <y>0</y>\n"
+           "    <width>100</width>\n"
+           "    <height>100</height>\n"
+           "   </rect>\n"
+           "  </property>\n"
+           "  <property name=\"toolTip\" >\n"
+           "   <string>The current time and date</string>\n"
+           "  </property>\n"
+           "  <property name=\"whatsThis\" >\n"
+           "   <string>The analog clock widget displays "
+           "the current time and date.</string>\n"
+           "  </property>\n"
+           " </widget>\n"
+	   "</ui>\n";
+}
+
+QString WallClockPlugin::includeFile() const
+{
+    return "analog/wallclock.h";
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/designer/wallclock_plugin.h	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,59 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *   Adapted for the bmsapp project by Michiel Broek, 2022.                *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef _WALLCLOCK_PLUGIN_H
+#define	_WALLCLOCK_PLUGIN_H
+
+#include <QObject>
+#include <QString>
+#include <QWidget>
+#include <QIcon>
+#include <QtUiPlugin/QDesignerCustomWidgetInterface>
+
+class WallClockPlugin;
+
+class WallClockPlugin : public QObject, public QDesignerCustomWidgetInterface
+{
+    Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface")
+    Q_INTERFACES(QDesignerCustomWidgetInterface)
+
+public:
+    WallClockPlugin(QObject *parent = 0);
+    bool isContainer() const;
+    bool isInitialized() const;
+    QIcon icon() const;
+    QString domXml() const;
+    QString group() const;
+    QString includeFile() const;
+    QString name() const;
+    QString toolTip() const;
+    QString whatsThis() const;
+    QWidget *createWidget(QWidget *parent);
+    void initialize(QDesignerFormEditorInterface *core);
+
+private:
+    bool initialized = false;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/analog/abstractmeter.cpp	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,84 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include <assert.h>
+#include "abstractmeter.h"
+#include "functions.h" 
+
+AbstractMeter::AbstractMeter(QWidget * parent )
+ : WidgetWithBackground (parent)
+{
+  m_min=m_minimum=0.0;
+  m_max=m_maximum=1.0;
+  m_digitOffset=1.0;
+  m_nominal=0.25;
+  m_critical=0.75; 
+} 
+
+
+bool AbstractMeter::calcMaxMin()
+{
+ return range(m_minimum,m_maximum,m_min,m_max,8,true); 
+}
+
+void AbstractMeter::setValue( double val )
+{
+  if ( m_value != val )
+  {
+    m_value = val;
+    update(); 
+    emit valueChanged(val);
+    emit valueChanged((int)val); 
+  }
+}
+
+void AbstractMeter::setValue( int val )
+{
+  if ( m_value != val )
+  {
+    m_value = val;
+    update(); // Ciekawe czy tak jest lepiej ??
+    // to znaczy najpierw odmalować a potem generować sygnał ? 
+    emit valueChanged(val);
+    emit valueChanged(double(val));
+  }
+}
+
+void AbstractMeter::setMinimum(double i)
+{
+  if ((m_maximum - i) > 0.00001 )
+  {
+    m_minimum = i;
+    if (calcMaxMin()) updateWithBackground();
+  }
+}
+
+void AbstractMeter::setMaximum(double i)
+{
+  if ( (i - m_minimum) > 0.00001 )
+  {
+    m_maximum = i;
+    if (calcMaxMin()) updateWithBackground();
+  }
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/analog/abstractmeter.h	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,133 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef ABSTRACTMETER_H
+#define ABSTRACTMETER_H
+
+#include "widgetwithbackground.h"
+
+   /**
+   * Abstract class for Meter/Gauge classes 
+   */
+   class AbstractMeter : public WidgetWithBackground
+   {
+	Q_OBJECT
+	Q_PROPERTY (double minimum READ minimum WRITE setMinimum )
+	Q_PROPERTY (double maximum READ maximum WRITE setMaximum )
+	Q_PROPERTY (double value   READ value   WRITE setValue )
+	Q_PROPERTY (double nominal READ nominal WRITE setNominal);
+	Q_PROPERTY (double critical READ critical WRITE setCritical);
+
+	Q_PROPERTY (QString prefix READ prefix WRITE setPrefix)
+	Q_PROPERTY (QString suffix READ suffix WRITE setSuffix)
+	Q_PROPERTY (QFont valueFont READ valueFont   WRITE setValueFont)
+	Q_PROPERTY (double valueOffset READ valueOffset WRITE setValueOffset)
+	Q_PROPERTY (QFont digitFont READ digitFont   WRITE setDigitFont)
+	Q_PROPERTY (double digitOffset READ digitOffset WRITE setDigitOffset)
+
+
+    public:
+
+    	AbstractMeter(QWidget *parent = 0);
+	virtual ~AbstractMeter() {};
+
+	double  minimum() const   { return m_minimum; }
+        void setMinimum(double i);
+        double  maximum() const   { return m_maximum; }
+        void setMaximum(double i);
+        double value() const         { return m_value;}
+
+	double nominal() const	  { return m_nominal; 		}
+	void setNominal(double i)    { m_nominal = i; updateWithBackground();}
+	double critical() const	  { return m_critical;		}
+	void setCritical(double i)   { m_critical = i; updateWithBackground();}
+
+	QFont valueFont() const   { return m_valueFont;        }
+	void setValueFont(QFont f){ m_valueFont = f; updateWithBackground(); }
+
+	double valueOffset() const   { return m_valueOffset;       }
+	void setValueOffset(double v){ m_valueOffset = v; updateWithBackground();}
+
+	double digitOffset() const   { return m_digitOffset;       }
+	void setDigitOffset(double v){ m_digitOffset = v; updateWithBackground();}
+
+	QFont digitFont() const   { return m_digitFont;         }
+	void setDigitFont(QFont f){ m_digitFont = f; updateWithBackground();  }
+
+        QString prefix() const    { return m_prefix;  }
+        void setPrefix(QString s) { m_prefix = s; updateWithBackground(); }
+
+        QString suffix() const    { return m_suffix;  }
+        void setSuffix(QString s) { m_suffix = s; updateWithBackground(); }
+
+    public slots:
+       	void setValue(int val);
+        void setValue(double val); 
+    signals:
+    	void valueChanged(int val);
+    	void valueChanged(double val);
+
+    protected:
+
+       /**
+         * Calculate m_max and m_min values shown on scale 
+	 * @return true if m_max or m_min has been changed
+	 */
+       
+	bool calcMaxMin();
+        
+	/** Starting value on meter  this value is less than m_minimum */
+	double m_min;
+	/** Endgind value on meter this value is more than m_maximum*/
+	double m_max;
+        
+        /** Minimum that has to be on scale */
+	double m_minimum;
+        /** Maximum that has to be on scale */
+	double m_maximum;
+        
+        /** Current value */
+	double m_value;
+        
+        /** Nominal value (allowed value) by convention mark by green look to manometer and thermometer widgets */
+	double m_nominal;
+        /** Critical value (maximum allowed value) by convention mark by red */
+	double m_critical;
+
+        /** Used to place value string on component */
+	double m_valueOffset;
+        /** Used to place scale digits offset. On manometer distance from the center on thermometer distance form left */
+	double m_digitOffset;
+        
+        /** Font used to display value */
+ 	QFont m_valueFont;
+        /** Font used to display scale digit/numbers */
+	QFont m_digitFont;
+        
+        /** Prefix added to value string  like Speed  */
+	QString m_prefix;
+        /** Postfix added to value string like km/h or mph */ 
+	QString m_suffix;
+
+   };// AbstractMeter
+
+#endif // ABSTRACTMETER_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/analog/functions.cpp	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,56 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "functions.h"
+
+#include <iostream>
+using namespace std; 
+
+double minimalStep(double scaleSize, int steps)
+{
+  scaleSize = std::abs(scaleSize); 
+  double ms = scaleSize/steps; 
+  double fractions[]={5,2,1}; 
+  double multiply = 10; 
+  double fraction = 1.0; 
+  double test; 
+  if (static_cast<int>(ms)<=5) multiply = 0.1 ; 
+
+  while (true)
+  {
+     for (int i=0;i<3;i++)
+     {
+      //cout<<"Fractions:"<<fractions[i]<<" scaleSize:"<<scaleSize<<" steps:"<<steps<<" steps*farction:"<<steps*fractions[i]<<endl; 
+       if (fractions[i]<ms)
+          { 
+           fraction =fractions[i]; 
+          }
+       
+         fractions[i]*=multiply; 
+         test = steps * fractions[i]; 
+         if ( (test < scaleSize) && multiply< 1.0 ) return fraction; 
+         if ( (test > scaleSize) && multiply> 1.0 ) return fraction; 
+     }  
+  }
+ 
+  return fraction; 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/analog/functions.h	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,110 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef _FUNCTIONS_H_
+#define _FUNCTIONS_H_
+
+#include <assert.h>
+#include <cmath>
+//#include <iostream> // dla testów 
+
+using namespace std;
+
+/** 
+* Znajduje największą wartość mniejszą od scaleSize/steps i
+* jednocześnie będącą całkowicie podzielną przez wartość 
+* 10^N  gdzie n jest dowolną liczbą całkowitą.
+* dla 5,2,1 jest to  odpowiedniio {...,500,50,5,0.5,...},
+* {...200,20,2,0.2,0.02,...} etc. 
+*/ 
+ 
+
+double minimalStep(double scaleSize, int steps);
+
+
+/**
+* Szablonowa funkcja do wyznaczania skali w zadanym przedziale o wyznaczonej ilości punktów skali.
+* Na podstawie wartości minimalnej oraz maksymalnej, jaką chcemy osiągnać ustawia
+* wartości m_min oraz m_max w taki sposób cały przedział skali (m_max-m_min) był podzielny
+* przez ilość punktów skali a odległość pomiędzy punktami skali była wartoscią która jest
+* wieloktornością liczby 5. Dodatkowo isnieje możliwość przesunięcia skali w lewo lub prawo by
+* rozpoczynała się jak najbliżej wartości minimalnej lub kończyła jak najbliżej wartości
+* maksymalnej.
+*
+* @param m_minimum - wartość minilana na skali jaka ma być widoczna
+* @param m_maximum - wartość maksymalna na skali jaka ma być widoczna
+* @param m_min     - wyliczona wartość początkowa skali
+* @param m_max     - wyliczona wartość końcowa skali
+* @param stesp     - ilość węzłów jaką ma mieć skala
+* @param left      - czy skala ma być wyrównana do lewej czy do prawej (domyślnie do prawej).
+* @return Funkcja zwraca wartość true jeżeli wartości m_min oraz m_max w wyniku zmiany zakresu
+* zmieniły swoją wartość.  Na podstawie tej wartości wiadomo czy należy np. przerysować skalę
+* - podając wcześniej poprzednie wartości zakresu skali.
+*/
+
+template <typename T>
+bool range(T m_minimum,T m_maximum, T & m_min, T & m_max,unsigned int steps, bool left = false,double inc = 5.0)
+{
+  //cout<<"("<<m_minimum<<","<<m_maximum<<")  ("<<m_min<<","<<m_max<<")"<<endl;
+  T max_tmp = m_max, min_tmp = m_min;
+  m_max=m_maximum;
+  m_min=m_minimum;
+  assert( m_max > m_min );
+  //  assert( (m_max - m_min) > 0 );
+  //  if (m_max<0) left!=left; 
+  
+  T diff = abs(m_max - m_min);
+  T scale = 0, factor = 0 ;
+
+  while (inc * steps > (m_maximum-m_minimum))
+  if (inc/10 > 0 ) inc/=10;
+  else break;
+
+  bool done = false;
+  while ( diff > scale ) 
+   { factor+=static_cast<T>(inc);  scale = factor * steps;  }
+   
+  while (!done)
+  {
+    
+    // dirty hack to have zero equal exactly zero 
+    if (m_max<0)  m_max=m_min - fmodf(m_min,steps);
+    else m_max = 0.0; 
+    
+     while ( m_max < m_maximum ) m_max +=factor;
+     m_min = m_max - scale;
+     if (m_min <= m_minimum ) done = true;
+     else { factor+=static_cast<T>(inc); scale = factor * steps; }
+  }
+  // Wprowadzenie koretkty by skala nie przesuwała się w lewo na osi X
+  if (left)
+  	while (m_min + factor <= m_minimum)
+  	{
+	   	m_min+=factor;
+   		m_max+=factor;
+  	}
+//  cout<<"Min:"<<m_min<<" Max:"<<m_max<<endl;
+ return (m_max != max_tmp) | (m_min != min_tmp);
+}
+
+
+#endif // _FUNCTIONS_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/analog/led.cpp	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,123 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include <QtGui> 
+#include "led.h" 
+
+
+Led::Led(QWidget * parent):WidgetWithBackground(parent)
+{
+  m_checked = true; 
+  m_color = Qt::red; 
+  resize(330,330);      
+}
+
+
+bool Led::isChecked () const 
+{
+  return m_checked; 
+}
+
+
+void Led::setChecked(bool i) 
+{
+  m_checked = i; 
+  updateWithBackground();
+  checkChanged( m_checked ); 
+}
+
+
+QColor Led::color() const
+{
+  return m_color; 
+}
+
+
+void Led::setColor(QColor i)
+{ 
+  m_color = i; 
+  updateWithBackground(); 
+}
+
+// Maluje całą diodę - koło o kolorze bazowym a na to nakłada odblask. 
+void Led::paintEvent(QPaintEvent * /* event*/ )
+{
+  QPainter painter(this); 
+  initCoordinateSystem(painter); 
+  // *** Draw circle */ 
+  int h,s,v,a; 
+  QColor c,back = color(); 
+  c=back; 
+  
+  // Kolor diody 
+  if (!m_checked || !isEnabled()) 
+  { 
+    back.getHsv(&h,&s,&v,&a);
+    s*=0.20; 
+    back.setHsv(h,s,v,a); 
+  }
+  painter.setBrush(back); 
+  
+  // obwudka diody 
+  QPen pen;
+  // przyciemnienie obwudki 
+  c.getHsv(&h,&s,&v,&a); 
+  s*=0.5; 
+  c.setHsv(h,s,v,a);  
+
+  pen.setColor(c); 
+  pen.setWidthF(3.0); 
+    
+  painter.drawEllipse(-149,-149,299,299);
+  painter.end(); 
+  
+  // odblask światła diody 
+  drawBackground(); // to maluje na tym co dotychczas to co jest w bitmapce 
+}
+
+
+// Rysuje odblask swiatła na diodzie 
+void Led::paintBackground(QPainter & painter)
+{
+  initCoordinateSystem(painter); 
+  painter.setPen(Qt::NoPen); 
+  QRadialGradient shine(QPointF(-40.0,-40.0),120.0,QPointF(-40,-40));
+  QColor white1(255,255,255,200);
+  QColor white0(255,255,255,0);
+  
+  shine.setColorAt(0.0,white1); 
+  shine.setColorAt(1.0,white0); 
+  
+  painter.setBrush(shine); 
+  painter.drawEllipse(-147,-147,297,297); 
+        
+}
+
+void Led::initCoordinateSystem(QPainter & painter)
+{
+  int side = qMin(width(), height());
+  // inicjalizacja paintera
+  painter.setRenderHint(QPainter::Antialiasing);
+  painter.translate(width() / 2, height() / 2);
+  painter.scale(side / 330.0, side / 330.0);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/analog/led.h	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,79 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef QLED_H
+#define QLED_H
+
+#include <QColor> 
+#include "widgetwithbackground.h"
+
+   /**
+   * Klasa reprezentująca diodę w dowolnym kolorze jako dwustabilny element wskazujący 
+   */
+class Led : public WidgetWithBackground
+{
+     Q_OBJECT 
+     Q_PROPERTY( bool checked READ isChecked 	WRITE setChecked)
+     Q_PROPERTY( QColor color READ color 	WRITE setColor) 
+     
+     
+public:  
+     
+     Led(QWidget *parent = 0);
+     virtual ~Led() {};
+     
+     /** Zdarzenie obsługujące malowanie kontrolki */ 
+     void paintEvent(QPaintEvent * event);
+     
+     bool isChecked () const ; 
+     
+     
+     QColor color() const; 
+     void setColor(QColor); 
+     
+public slots: 
+     
+     void setChecked(bool); 
+     
+signals: 
+     
+     void checkChanged(bool val); 
+     
+protected:
+     
+     /** Inicjuje układ współrzędnych paintera */
+     void initCoordinateSystem(QPainter & painter);
+     
+     /**
+     * Maluje tło kontrolki w tym przypadku pierwszy plan czyli odblask światła kontrolki
+     * @param painter Przestrzeń kontrolki 
+     */
+     void paintBackground(QPainter & painter);
+    
+protected: 
+     
+     bool m_checked; 
+     QColor m_color; 
+
+}; 
+   
+#endif // QLED_H 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/analog/manometer.cpp	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,212 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include <QtGui>
+#include <cmath>
+#include <assert.h>
+
+#include "manometer.h"
+#define PI 3.141592653589793238512808959406186204433
+
+using namespace Qt;
+ManoMeter::ManoMeter(QWidget *parent)
+        : AbstractMeter(parent)
+{
+        m_max=300.0;
+        m_min=0.0;
+
+	m_maximum=300.0; // First we set manualy to call calcMaxMin 
+  	setMinimum(0.0);
+	calcMaxMin(); // Extend max and min to have nice step values 
+
+	setValue(0.0);
+        setNominal(80.0);
+	setCritical(220.0);
+	setValueOffset(-100.0);
+	setDigitOffset(105.0);
+	setSuffix(QString(" [bar]"));
+	m_digitFont.setPointSize(20);
+	m_valueFont.setPointSize(25);
+
+	// QWidget
+        setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
+        setWindowTitle(tr("Analog Barmeter"));
+	resize(311, 311);
+	assert(m_max-m_min != 0);
+}
+
+
+
+void ManoMeter::initCoordinateSystem(QPainter & painter)
+{
+        int side = qMin(width(), height());
+        // painter initialization
+        painter.setRenderHint(QPainter::Antialiasing);
+        painter.translate(width() / 2, height() / 2);
+        painter.scale(side / 335.0, side / 335.0);
+}
+
+void ManoMeter::paintBackground(QPainter & painter)
+{
+	static const int scaleTriangle[6] = { -6,141,6,141,0,129 };
+	initCoordinateSystem(painter);
+
+        // Painting Malowanie obwiedni tarczy. Biała tarcza z czarną skalą
+        QPen Pen(QColor(0,0,0)); Pen.setWidth(4);
+        painter.setPen(Pen);
+
+        QRadialGradient back1(QPointF(0.0,0.0),180.0,QPointF(-35.0,145.0));
+	back1.setColorAt(0.0,QColor(250,250,250));
+	back1.setColorAt(1.0,QColor(20,20,20));
+
+	QRadialGradient back2(QPointF(0.0,0.0),225.0,QPointF(76.5,135.0));
+	back2.setColorAt(0.0,QColor(10,10,10));
+	back2.setColorAt(1.0,QColor(250,250,250));
+
+	painter.setBrush(QBrush(back1));
+	painter.drawEllipse(-162,-162,324,324);
+	painter.setPen(Qt::NoPen);
+        painter.setBrush(QBrush(back2));
+        painter.drawEllipse(-152,-152,304,304);
+
+        QRadialGradient shield(QPointF(0,0),182,QPointF(-12.0,-15.0));
+	shield.setColorAt(0.0,Qt::white);
+	shield.setColorAt(0.5,QColor(240,240,240));
+	shield.setColorAt(1.0,QColor(215,215,215));
+
+
+	// internal scale circle 
+	painter.setBrush(QBrush(shield));
+	painter.setPen(Pen);
+	painter.drawEllipse(-142,-142,284,284);
+
+	  painter.setPen(Qt::NoPen);
+          // nominal
+	  painter.setBrush(QColor(0,200,0));
+	  assert(m_max-m_min != 0);
+	  int angle = static_cast<int>( (3840 * ( m_nominal - m_min ))/(m_max-m_min) );
+	  if (m_min <= m_nominal && m_nominal < m_max )
+           painter.drawPie(QRect(-141,-141,282,282),-480,3840 - angle % 5760 );
+	  // Critical
+
+	  painter.setBrush(QBrush(Qt::red));
+	  angle = static_cast<int>( (3840 * ( m_critical - m_min ))/(m_max-m_min) );
+	  if ( m_min <= m_critical && m_critical < m_max  )
+	  painter.drawPie(QRect(-141,-141,282,282),-480, 3840 - angle % 5760  ); //-480, 3840*( m_max-m_min - critical()-abs(m_min) )/static_cast<double>(m_max-m_min));
+	  // biała obwiednia
+	  painter.setBrush(QBrush(shield));
+	  painter.drawEllipse(-129,-129,258,258);
+
+        // Ustawienie się na początku skali
+
+        painter.rotate(60.0);
+
+ 	// Rysowanie skali kreski
+	painter.save();
+        painter.setBrush(QBrush(Qt::black));
+  	int line_length=10;
+	for (int i=0;i<33;i++)
+	{
+	  painter.setPen(Pen);
+
+          if (i % 4) painter.drawLine(0,140,0,140-line_length);
+          else {
+	    painter.setPen(Qt::NoPen);
+	    painter.drawConvexPolygon(QPolygon(3, scaleTriangle));
+	  }
+
+	  painter.rotate(7.5);
+
+	Pen.setWidth(3);
+
+ 	  if (i % 2)  line_length=10;
+	  else        line_length=5;
+	}
+	painter.restore();
+
+        // Rysowanie skali liczby .
+
+	if (true || digitOffset())
+        {
+          painter.setPen(Qt::black);
+          painter.rotate(-60.0);
+	  painter.setFont(digitFont());
+	  for (int i=0;i<9;i++)
+	  {
+	    double v = m_min + i*(m_max - m_min)/8.0;
+	    if (fabs(v) < 0.000001 ) v = 0.0;
+	    QString val = QString("%1").arg(v);
+            QSize Size = painter.fontMetrics().size(Qt::TextSingleLine, val);
+            painter.save();
+	    painter.translate( digitOffset() * cos((5+i)*PI/6.0), digitOffset() * sin((5+i)*PI/6.0));
+	    painter.drawText( QPointF( Size.width()/ -2.0,  Size.height() / 4.0), val);
+            painter.restore();
+	  }
+	}
+
+
+
+}// paintBackground
+
+void ManoMeter::paintEvent(QPaintEvent * )
+{
+	drawBackground();
+	QPainter painter(this);
+        initCoordinateSystem(painter);
+      // --------------------------------------------- ///
+	static const int hand[12] = {-4, 0, -1, 129, 1, 129, 4, 0, 8,-50, -8,-50};
+
+
+        QPainterPath hand_path;
+        hand_path.moveTo(QPointF(hand[0],hand[1]));
+
+        for (int i=2;i<10;i+=2)
+	 hand_path.lineTo(hand[i],hand[i+1]);
+
+	hand_path.cubicTo ( 8.1,-51.0, 5.0,-48.0,   0.0,-48.0);
+	hand_path.cubicTo(  -5.0,-48.0, -8.1,-51.0, -8.0,-50.0);
+
+        // Rysowanie wskazówki
+	painter.save();
+	painter.rotate(60.0);
+	painter.setPen(Qt::NoPen);
+	painter.setBrush(QBrush(Qt::black));
+   	painter.rotate(  ((  value()-m_min) * 240.0) / static_cast<double> (m_max - m_min) );
+
+	painter.drawPath(hand_path);
+
+	painter.drawEllipse(-10,-10,20,20);
+
+
+        painter.restore();// Przywrocenie do wychylenia o 60 stopni
+
+	// Rysowanie wyświetlanej wartości
+        if (valueOffset())
+        {
+
+	  if (value() >= critical() ) painter.setPen(Qt::red);
+	  painter.setFont(valueFont());
+          QString Str = prefix() + QString("%1").arg(value()) + suffix();
+          QSize Size = painter.fontMetrics().size(Qt::TextSingleLine, Str);
+          painter.drawText( QPointF( Size.width() / -2.0,static_cast<int>( 0 - valueOffset())) , Str);
+        }
+}// paintEvent
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/analog/manometer.h	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,38 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef BARMETER_H
+#define BARMETER_H
+
+#include "abstractmeter.h"
+
+class ManoMeter : public AbstractMeter
+{
+    Q_OBJECT 
+public:
+    ManoMeter(QWidget *parent = 0);
+protected:
+    void paintEvent(QPaintEvent *event); 	 // inherited from WidgetWithBackground 
+    void paintBackground(QPainter & painter);// inherited form WidgetWithBackground 
+    void initCoordinateSystem(QPainter & painter);
+};
+#endif // BARMETER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/analog/thermometer.cpp	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,192 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include <QtGui>
+#include <cmath>
+#include <assert.h>
+#include "thermometer.h"
+
+using namespace std;
+ThermoMeter::ThermoMeter(QWidget *parent)
+        : AbstractMeter(parent)
+{
+        m_max=80;
+        m_min=0;
+
+	m_maximum=80; // najpierw ręcznie potem seterem by wywołać calcMaxMin
+  	setMinimum(0);
+	setValue(0);
+        setNominal(30);
+	calcMaxMin(); // bo nie wiemy czym są zainicjowane limity
+	setCritical(60);
+	setValueOffset(270);
+	setDigitOffset(10);
+	setSuffix(QString(" [C]"));
+	m_digitFont.setPointSize(15);
+	m_valueFont.setPointSize(18);
+
+	// QWidget
+        setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
+        setWindowTitle(tr("Analog Thermometer"));
+	resize(200, 200);
+	assert(m_max-m_min != 0);
+
+}
+
+void ThermoMeter::initCoordinateSystem(QPainter & painter)
+{
+        // inicjalizacja paintera
+        painter.setRenderHint(QPainter::Antialiasing);
+        //painter.translate(width() / 2, height() / 2);
+        painter.translate( width()/2.0,0.0);
+        painter.scale( height()/ 300.0, height()/307.0);
+}
+
+void ThermoMeter::paintBackground(QPainter & painter)
+{
+	initCoordinateSystem(painter);
+	// kształt szkalnej bańki
+
+	QPainterPath glass;
+
+	// początek łuku dolnego po lewej stronie
+	glass.moveTo(12.5,267.5);
+	glass.quadTo(12.5,263.0, 7.5,257.0);
+
+	glass.lineTo(7.5,25.0);
+
+	// łuk górny zamykajac5y bańkę od góry.
+	glass.quadTo(7.5,12.5 , 0,12.5);
+	glass.quadTo(-7.5,12.5,-7.5,25.0);
+	glass.lineTo(-7.5,257.0);
+	// tutaj musi być łuk dolny o promineniu 25
+	glass.quadTo(-12.5,263.0, -12.5,267.5);
+	glass.quadTo(-12.5,278.0,  0.0,280.0);
+	glass.quadTo( 12.5,278.0,  12.5,267.5);
+
+        QLinearGradient linearGrad(QPointF(-2.0, 0.0), QPointF(12.5, 0.0));
+	linearGrad.setSpread(QGradient::ReflectSpread);
+        linearGrad.setColorAt(1.0, QColor(0,150,255,170));
+        linearGrad.setColorAt(0.0, QColor(255,255,255,0));
+
+	painter.setBrush(QBrush(linearGrad));
+	painter.setPen(Qt::black);
+	painter.drawPath(glass);
+
+	/*
+	QRadialGradient radial(0.0,267.5,12.5,-10.0,263.0);
+	radial.setColorAt(1.0,QColor(0,150,255,110));
+	radial.setColorAt(1.0,QColor(255,255,255,0));
+	painter.setPen(Qt::NoPen);
+	painter.drawEllipse(QRectF(-12.5,255.0,25.0,25.0));
+	*/
+	QPen pen;
+	int length = 12;
+	for (int i=0;i<=32;i++)
+	{
+	  pen.setWidthF(1.0);
+	  length = 12;
+	  if (i%4) { length = 8; pen.setWidthF(0.75); }
+	  if (i%2) { length = 5; pen.setWidthF(0.5);  }
+	  painter.setPen(pen);
+	  painter.drawLine(-7,28+i*7, -7+length,28+i*7);
+	}
+
+	if (digitOffset())
+        {
+          painter.setFont(digitFont());
+	  for (int i=0;i<9;i++)
+	  {
+	    QString val = QString("%1").arg(m_min + i*(m_max - m_min)/8.0 );
+	    QSize Size = painter.fontMetrics().size(Qt::TextSingleLine, val);
+
+	    painter.drawText( QPointF( digitOffset(),252 -  i * 28 +Size.width()/4.0) , val);
+
+	  }
+	}
+
+
+}// paintBackground
+
+// Offset by lepiej było widać o co z nim biega - mówiąc oględnie offset to miejsce
+// poniżej zera od którego zaczynamy rysować słupek rtęci.
+#define OFFSET 10
+
+void ThermoMeter::paintEvent(QPaintEvent * )
+{
+      // Inicjalizacja paintera
+	QPainter painter(this);
+        initCoordinateSystem(painter);
+      // --------------------------------------------- ///
+       // Dobór colorów do rysowania
+	QColor color=Qt::blue;
+	if (m_value >= m_nominal )
+	    color=QColor(0,200,0);
+
+	if (m_value >= m_critical)
+	   {
+		color=Qt::red;
+	     	painter.setPen(color); // by potem temp podać na czerwono
+	   }
+
+	if (valueOffset())
+	{
+	  painter.setFont(valueFont());
+          QString Str = prefix() + QString("%1").arg(value()) + suffix();
+          QSize Size = painter.fontMetrics().size(Qt::TextSingleLine, Str);
+          painter.drawText(QPointF (Size.width() / -2,valueOffset() + Size.height()) , Str);
+	}
+
+
+	QLinearGradient slupek(0.0,0.0,5.0,0.0);
+	QRadialGradient zbiornik(0.0,267.0,10.0,-5.0,262.0);
+
+	slupek.setSpread(QGradient::ReflectSpread);
+	zbiornik.setSpread(QGradient::ReflectSpread);
+
+	color.setHsv(color.hue(),color.saturation(),color.value());
+	slupek.setColorAt(1.0,color);
+	zbiornik.setColorAt(1.0,color);
+
+	color.setHsv(color.hue(),color.saturation()-200,color.value());
+	slupek.setColorAt(0.0,color);
+	zbiornik.setColorAt(0.0,color);
+
+        // Wyznaczenie wysokości słupka;
+	double factor =  m_value - m_min;
+	       factor /= m_max - m_min;
+	int temp = static_cast<int> (224.0 *  factor), height = temp + OFFSET;
+	if (231 < temp  ) height = 231 + OFFSET; // by rtęć doszła do końca terometra ale go nie rozwaliła
+	if (OFFSET-5 >= height )  height = OFFSET-5; // by nie zeszlo poniżej pieciu "pixeli" poniżej zera
+	// Narysowanie słupka  wraz z zbiorniczkiem rtęci
+        painter.setPen(Qt::NoPen);
+	painter.setBrush(slupek);
+        painter.drawRect(-5,252+OFFSET - height ,10, height);
+	painter.setBrush(zbiornik);
+	painter.drawEllipse(QRectF(-10.0,257.5,20.0,20.0));
+	painter.end(); // bardzo istotne - inaczej pod Xami jest błąd
+	// nie wiem czy to to powoduje krash pod win98 i brak bańki pod XP.
+	// Nałożenie szklanej bańki
+	drawBackground();
+
+}// paintEvent
+#undef OFFSET
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/analog/thermometer.h	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,38 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef THERMOMETER_H
+#define THERMOMETER_H
+
+#include "abstractmeter.h"
+
+    class ThermoMeter : public AbstractMeter
+    {
+      Q_OBJECT 
+      public:
+    	ThermoMeter(QWidget *parent = 0);
+      protected:
+        void paintEvent(QPaintEvent *event); 	  // inherited form WidgetWithBackground
+	void paintBackground(QPainter & painter); // inherited form WidgetWithBackground
+	void initCoordinateSystem(QPainter & painter);
+    };
+#endif // THERMOMETER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/analog/wallclock.cpp	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,259 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include <QtGui>
+#include <cmath>
+#include "wallclock.h"
+#define PI 3.141592653589793238512808959406186204433
+
+WallClock::WallClock(QWidget *parent)
+    : WidgetWithBackground(parent)
+{
+    m_timer = new QTimer(this);
+    m_timer->setInterval(1000); 
+    connect(m_timer, SIGNAL(timeout()), this, SLOT(updateTime()));
+    
+    
+
+
+    setDigitOffset(75);
+    setDateOffset(0);
+    setTimeOffset(0); // -12
+    setDayOffset(0); // 9
+
+    setDigitColor(QColor(0,0,0));
+    setDateColor(QColor(0,0,0));
+    setTimeColor(QColor(0,0,192));
+    setDayColor(QColor(0,96,0));
+
+    m_digitFont.setPointSize(23);
+    m_dateFont.setPointSize(21);
+    m_timeFont.setPointSize(30);
+    m_dayFont.setPointSize(16);
+
+    // QWidget
+    setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
+    setWindowTitle(tr("Analog Clock"));
+    resize(220, 220);
+    
+    m_dateTime = QDateTime::currentDateTime(); 
+    setShowCurrentDateTime(true); 
+    
+}
+
+void WallClock::initCoordinateSystem(QPainter & painter)
+{
+    int side = qMin(width(), height());
+    painter.setRenderHint(QPainter::Antialiasing);
+    painter.translate(width() / 2, height() / 2);
+    painter.scale(side / 240.0, side / 240.0);
+}
+
+void WallClock::paintBackground(QPainter & painter)
+{
+
+    initCoordinateSystem(painter);
+    // Malowanie obwiedni tarczy.
+    //QColor ramka(17,50,214);// ładny niebieski
+    QColor ramka(215,0,0); // głęboki czerwony
+    // Gradient  zewnętrznego okręgu
+    QRadialGradient back1(QPointF(0,0),135, QPointF(-27.5,110.0));
+    back1.setColorAt(0.0,QColor(255,255,255));
+    back1.setColorAt(1.0,ramka);
+    // Gradient wewnętrznego okręgu
+    QRadialGradient back2(QPoint(0,0),170, QPointF(57.5,100));
+    back2.setColorAt(0.0,ramka);
+    back2.setColorAt(1.0,QColor(255,255,255));
+
+    QRadialGradient shield(QPointF(0,0),122,QPointF(-12.0,-15.0));
+    shield.setColorAt(0.0,Qt::white);
+    shield.setColorAt(0.5,QColor(240,240,240));
+    shield.setColorAt(1.0,QColor(215,215,215));
+
+    QPen Pen(Qt::black);
+    Pen.setWidth(2);
+    painter.setPen(Pen);
+
+    // Koperta zegark
+    painter.setBrush(QBrush(back1));
+    painter.drawEllipse(-116,-116,232,232);
+    painter.setBrush(QBrush(back2));
+
+    painter.setPen(Qt::NoPen);
+    painter.drawEllipse(-109,-109,218,218);
+
+    painter.setPen(Pen);
+    painter.setBrush(QBrush(shield));
+    painter.drawEllipse(-102,-102,204,204);
+
+
+    painter.setBrush(Qt::black);
+    // rysowanie kółek godzin i samych godzin
+    for (int i = 0; i < 12; ++i) {
+        painter.drawEllipse(94, -2, 4, 4);
+        painter.rotate(30.0);
+    }
+
+
+    // rysowanie kresek  minut
+    painter.setPen(Qt::black);
+    Pen.setWidth(2);
+    painter.setPen(Pen);
+    for (int j = 0; j < 60; ++j) {
+        if ((j % 5) != 0)
+            painter.drawLine(94, 0, 97, 0);
+        painter.rotate(6.0);
+    }
+
+    QSize Size;
+    QString Str;
+    // Rysowanie cyfr na tarczy
+    if (digitOffset()!=0.0)
+    {
+      painter.setFont(digitFont());
+      painter.setPen(digitColor());
+      for ( int z = 1; z <= 12; ++z) {
+        QString hour = QString("%1").arg(z);
+        Size = painter.fontMetrics().size(Qt::TextSingleLine, hour);
+        painter.save();
+        painter.translate(digitOffset() * cos(PI*z/6.0-PI/2.0),digitOffset() * sin(PI*z/6.0-PI/2.0));
+        painter.setPen(digitColor());
+        painter.drawText( QPointF ( Size.width()/ -2.0, Size.height() / 4.0), hour);
+        painter.restore();
+      }
+    }
+
+}// paintBackground
+
+
+void WallClock::paintEvent(QPaintEvent *)
+{
+    static const int hourHand[8] = { -2, 18, 2, 18, 2, -60, -2, -60 };
+    static const int minuteHand[8] = { -2, 28, 2, 28, 2, -80, -2, -80 };
+    static const int secondHand[12] = {-1, 0, -1, -90, 1,-90, 1, 0, 4, 35, -4, 35};
+
+    // odmalowywuje tło
+    drawBackground();
+      // inicjalizacja paintera
+
+    QPainter painter(this);
+    initCoordinateSystem(painter);
+
+    // Wyliczanie czasu i daty
+    QTime time = m_dateTime.time(); 
+    QDate date = m_dateTime.date(); 
+    QString Str;
+    QSize Size;
+
+    if (timeOffset()!=0.0)
+    {
+      // Rysowanie tekstów - godziny
+      painter.setFont(timeFont());
+      painter.setPen(timeColor());
+      Str = time.toString("hh:mm");
+      Size = painter.fontMetrics().size(Qt::TextSingleLine, Str );
+      painter.drawText( QPointF (Size.width() / -2.0, Size.height()+ timeOffset()) ,Str);
+    }
+
+    if (dateOffset()!=0.0)
+    {
+      // Rysowanie daty
+      painter.setFont(dateFont());
+      painter.setPen(dateColor());
+      Str = date.toString("dd.MM.yyyy");
+      Size = painter.fontMetrics().size(Qt::TextSingleLine, Str);
+      painter.drawText( QPointF(Size.width() / -2.0,static_cast<int>(0 - dateOffset())), Str);
+    }
+    if (dayOffset()!=0.0)
+    {
+      // Dzień tygodnia
+      painter.setFont(dayFont());
+      painter.setPen(dayColor());
+      Str =  date.toString("dddd");
+      Size = painter.fontMetrics().size(Qt::TextSingleLine, Str);
+      painter.drawText( QPointF (Size.width() / -2.0,static_cast<int>( 0 - dayOffset())) , Str);
+    }
+
+    // rysowanie wskazówki godzin
+    painter.setPen(Qt::NoPen);
+    painter.setBrush(Qt::black);
+    painter.save();
+    painter.rotate(30.0 * ((time.hour() + time.minute() / 60.0)));
+    painter.drawConvexPolygon(QPolygon(4, hourHand));
+    painter.restore();
+
+    // rysowanie minutnika
+    painter.setBrush(Qt::black);
+    painter.save();
+    painter.rotate(6.0 * (time.minute() + time.second() / 60.0));
+    painter.drawConvexPolygon(QPolygon(4, minuteHand));
+    painter.restore();
+
+    // Malowanie wskazówki sekundnika
+    painter.setPen(Qt::NoPen);
+    painter.setBrush(Qt::red);
+    painter.save();
+    painter.rotate(6.0 * ( time.second())); //  + time.msec() / 1000.0) );
+    painter.drawConvexPolygon(QPolygon(6, secondHand));
+    painter.restore();
+    // Kółko sekundnika
+    painter.drawEllipse(-5,-5,10,10);
+}// paintEvent 
+
+
+void   WallClock::setTime ( const QTime & t)
+{
+  m_dateTime.setTime(t);
+  setShowCurrentDateTime(false); 
+  //update(); 
+}
+
+
+void   WallClock::setDate ( const QDate &d )
+{
+  m_dateTime.setDate(d);
+  setShowCurrentDateTime(false); 
+}
+
+
+void   WallClock::setDateTime( const QDateTime &dt)
+{
+  m_dateTime = dt; 
+  setShowCurrentDateTime(false);
+}
+
+void   WallClock::setShowCurrentDateTime(bool showCurrentDateTime)
+{
+  m_showCurrentDateTime = showCurrentDateTime; 
+  if (m_showCurrentDateTime) 
+    m_timer->start(); 
+  else 
+    m_timer->stop(); 
+  update(); 
+}
+
+void WallClock::updateTime()
+{
+  m_dateTime = QDateTime::currentDateTime(); 
+  if (isVisible())
+    update();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/analog/wallclock.h	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,126 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef WALLCLOCK_H
+#define WALLCLOCK_H
+#include <QDateTime> 
+#include <QTimer> 
+
+#include "widgetwithbackground.h"
+ 
+    class WallClock : public WidgetWithBackground 
+    {
+        Q_OBJECT
+	Q_PROPERTY (QFont digitFont READ digitFont WRITE setDigitFont)
+	Q_PROPERTY (QFont dateFont  READ dateFont  WRITE setDateFont)
+	Q_PROPERTY (QFont timeFont  READ timeFont  WRITE setTimeFont)
+	Q_PROPERTY (QFont dayFont   READ dayFont   WRITE setDayFont)
+
+	Q_PROPERTY (int digitOffset READ digitOffset WRITE setDigitOffset) //RESET resetDigitOffset)
+	Q_PROPERTY (int dateOffset  READ dateOffset  WRITE setDateOffset ) //RESET resetDateOffset )
+	Q_PROPERTY (int timeOffset  READ timeOffset  WRITE setTimeOffset ) //RESET resetTimeOffset )
+	Q_PROPERTY (int dayOffset   READ dayOffset   WRITE setDayOffset  ) //RESET resetDayOffset  )
+
+	Q_PROPERTY (QColor digitColor READ digitColor WRITE setDigitColor)
+	Q_PROPERTY (QColor dateColor  READ dateColor  WRITE setDateColor)
+	Q_PROPERTY (QColor timeColor  READ timeColor  WRITE setTimeColor)
+	Q_PROPERTY (QColor dayColor   READ dayColor   WRITE setDayColor)
+        Q_PROPERTY (QDateTime  dateTime       READ dateTime       WRITE setDateTime)
+        Q_PROPERTY (bool showCurrentDateTime READ showCurrentDateTime WRITE setShowCurrentDateTime) 
+    public:
+	WallClock(QWidget *parent = 0);
+
+    	QFont digitFont() const    { return m_digitFont;}
+  	QFont timeFont () const    { return m_timeFont; }
+    	QFont dateFont () const    { return m_dateFont; }
+    	QFont dayFont  () const    { return m_dayFont;  }
+
+    	void setDigitFont(QFont f) {        m_digitFont = f; updateWithBackground();}
+    	void setTimeFont (QFont f) {        m_timeFont  = f; updateWithBackground();}
+    	void setDateFont (QFont f) {        m_dateFont  = f; updateWithBackground();}
+	void setDayFont  (QFont f) {        m_dayFont   = f; updateWithBackground();}
+
+	int     digitOffset () const { return m_digitOffset; }
+	int      dateOffset () const { return m_dateOffset;  }
+	int      timeOffset () const { return m_timeOffset;  }
+	int      dayOffset  () const { return m_dayOffset;   }
+	void  setDigitOffset(int i)  {        m_digitOffset = i; updateWithBackground();}
+	void  setDateOffset (int i)  {        m_dateOffset  = i; updateWithBackground();}
+	void  setTimeOffset (int i)  {        m_timeOffset  = i; updateWithBackground();}
+	void  setDayOffset  (int i)  {        m_dayOffset   = i; updateWithBackground();}
+
+	QColor    digitColor() const  { return m_digitColor;   }
+	QColor    dateColor() const   { return m_dateColor;    }
+	QColor    timeColor() const   { return m_timeColor;    }
+	QColor    dayColor()  const   { return m_dayColor;     }
+        QDateTime dateTime()  const   { return m_dateTime;     }
+        QDate     date()      const   { return m_dateTime.date(); }
+        QTime     time()      const   { return m_dateTime.time(); } 
+        bool      showCurrentDateTime() const { return m_showCurrentDateTime; } 
+        
+	void   setDigitColor(QColor c){        m_digitColor = c; updateWithBackground();}
+	void   setDateColor(QColor c) {        m_dateColor = c;  updateWithBackground();}
+	void   setTimeColor(QColor c) {        m_timeColor = c;  updateWithBackground();}
+	void   setDayColor (QColor c) {        m_dayColor  = c;  updateWithBackground();}
+        
+      public slots:
+        
+        void   setTime ( const QTime & ); 
+        void   setDate ( const QDate & ); 
+        void   setDateTime( const QDateTime &); 
+        void   setShowCurrentDateTime(bool showCurrentDateTime); 
+      protected slots: 
+        void updateTime(); 
+        
+    protected:
+
+	
+        void paintEvent(QPaintEvent *event);
+	void paintBackground(QPainter & painter);
+	void initCoordinateSystem(QPainter & painter);
+	 
+	
+	int resetDigitOffset() const { return 75; }
+	int resetDateOffset()  const { return 0;  }
+	int resetTimeOffset()  const { return -12;}
+	int resetDayOffset()   const { return 29; }
+
+
+        QFont m_digitFont;
+        QFont m_dateFont;
+        QFont m_timeFont;
+        QFont m_dayFont;
+
+        int   m_digitOffset;
+        int   m_dateOffset;
+        int   m_timeOffset;
+        int   m_dayOffset;
+
+        QColor m_digitColor;
+        QColor m_dateColor;
+        QColor m_timeColor;
+        QColor m_dayColor;
+        QDateTime m_dateTime; 
+        bool m_showCurrentDateTime; 
+        QTimer * m_timer; 
+    };
+#endif // WALLCLOCK_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/analog/widgetwithbackground.cpp	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,71 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include <QtGui>
+#include "widgetwithbackground.h"
+
+WidgetWithBackground::WidgetWithBackground(QWidget * parent) : QWidget(parent)
+{
+  m_pixmap = new QPixmap(size());
+  m_modified = false;
+}
+
+WidgetWithBackground::~WidgetWithBackground()
+{
+   if (m_pixmap)
+     {
+	delete m_pixmap;
+	m_pixmap = NULL;
+     }
+}
+
+void WidgetWithBackground::drawBackground()
+{
+  if (m_pixmap->size() != size() || m_modified )
+    {
+	delete m_pixmap;
+	m_pixmap = new QPixmap(size());
+	m_modified=true; // by wiadomo bylo że jest przemalowywane tlo
+	repaintBackground();
+	m_modified=false;
+    }
+    QPainter painter(this);
+    painter.drawPixmap(0,0,*m_pixmap);
+}
+
+void WidgetWithBackground::updateWithBackground()
+{
+  m_modified=true;
+  update();
+}
+
+bool WidgetWithBackground::doRepaintBackground()
+{
+  return m_modified;
+}
+
+void WidgetWithBackground::repaintBackground()
+{
+  m_pixmap->fill(QColor(0,0,0,0));
+  QPainter painter(m_pixmap);
+  paintBackground(painter);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/analog/widgetwithbackground.h	Wed Jun 29 21:28:13 2022 +0200
@@ -0,0 +1,80 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Tomasz Ziobrowski                          *
+ *   http://www.3electrons.com                                             *
+ *   e-mail: t.ziobrowski@3electrons.com                                   *
+ *                                                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef WIDGETWITHBACKGROUND_H
+#define WIDGETWITHBACKGROUND_H
+
+#include <QWidget>
+
+class QPixmap;
+
+class WidgetWithBackground : public QWidget
+{
+	Q_OBJECT
+  public:
+     /** Konstruktor */
+     WidgetWithBackground(QWidget * parent = 0);
+
+     /** Destruktor - usuwa bitmapkę.  */
+     ~WidgetWithBackground ();
+
+     /**
+      * Operacja odmalowywania kontrolki  -
+      * wkleja bitmapę z tłem na kontrolkę -
+      * generująć ją wcześniej jeżeli zajdzie taka potrzeba.
+      */
+     void  drawBackground ();
+
+     /** Odmalowywuje kontrolkę bezwarunkowo odmalowywując tło. */
+     void  updateWithBackground ();
+    
+     /** 
+     * Zawraca informacje czy kontrolka została zmodyfikowana
+     * Ta informacja jest ustawiana gdy bitmapka tła się zmienia 
+     * to znaczy zmienia się rozmiar komponentu lub istnieje 
+     * potrzeba przemalowania tła. 
+     */ 
+     bool doRepaintBackground(); 
+     
+  protected:
+    /** Wywołuje paintBackground - odmalowywując tło na nowo */
+    void repaintBackground();
+
+    /**
+     * Odmalowywuje tło kontrolki
+     * @param painter urządzenie na ktróym mamy malować.
+     * @param background to tło kontrolki
+     */
+    virtual void  paintBackground (QPainter & painer) = 0;
+    
+    
+
+  protected:
+     /** Bufor na tło. */
+     QPixmap * m_pixmap;
+     /**
+     * Ustawia tą zmienną po zmianie właściwości
+     */
+     bool m_modified;
+};
+#endif //WIDGETWITHBACKGROUND_H
+

mercurial