[Xfce4-commits] [panel-plugins/xfce4-sensors-plugin] 01/01: applied patch from bug 14551 and increased version to 1.3.1 git

noreply at xfce.org noreply at xfce.org
Tue Sep 11 22:35:20 CEST 2018


This is an automated email from the git hooks/post-receive script.

t   i   m   y   s   t   e   r   y       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-sensors-plugin.

commit ed2b9977f3504225ac7e1cd28d17791b12c4830e
Author: Fabian <timystery at arcor.de>
Date:   Tue Sep 11 22:34:13 2018 +0200

    applied patch from bug 14551 and increased version to 1.3.1 git
---
 configure.ac.in                |  4 ++--
 include/types.h                |  2 ++
 lib/lmsensors.c                | 47 ++++++++++++++++++++++++++++++++++++++++++
 lib/sensors-interface-common.c |  8 +++++++
 4 files changed, 59 insertions(+), 2 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 0cd3acf..7a4bb8f 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -10,10 +10,10 @@ m4_define([libxfce4sensors_verinfo], [4:1:0])
 
 m4_define([xfce4_sensors_version_major], [1])
 m4_define([xfce4_sensors_version_minor], [3])
-m4_define([xfce4_sensors_version_micro], [0])
+m4_define([xfce4_sensors_version_micro], [1])
 m4_define([xfce4_sensors_version_nano], [])
 m4_define([xfce4_sensors_version_build], [@REVISION@])
-m4_define([xfce4_sensors_version_tag], []) dnl may be set to 'git'
+m4_define([xfce4_sensors_version_tag], [git]) dnl may be set to 'git'
 m4_define([xfce4_sensors_version], [xfce4_sensors_version_major().xfce4_sensors_version_minor().xfce4_sensors_version_micro()ifelse(xfce4_sensors_version_nano(), [], [], [.xfce4_sensors_version_nano()])ifelse(xfce4_sensors_version_tag(), [git], [xfce4_sensors_version_tag()-xfce4_sensors_version_build()], [xfce4_sensors_version_tag()])])
 
 
diff --git a/include/types.h b/include/types.h
index 60c6962..170d1b9 100644
--- a/include/types.h
+++ b/include/types.h
@@ -89,6 +89,8 @@ typedef enum {
     SPEED,
     ENERGY,
     STATE,
+    POWER,
+    CURRENT,
     OTHER
 } t_chipfeature_class;
 
diff --git a/lib/lmsensors.c b/lib/lmsensors.c
index 8fb69d9..6a6acd0 100644
--- a/lib/lmsensors.c
+++ b/lib/lmsensors.c
@@ -170,6 +170,41 @@ categorize_sensor_type_libsensors4 (t_chipfeature *ptr_chipfeature,
                 ptr_chipfeature->max_value = sensorFeature;
             break;
 
+        case SENSORS_FEATURE_POWER:
+            ptr_chipfeature->class = POWER;
+            ptr_chipfeature->min_value = 0.0;
+            ptr_chipfeature->max_value = 120.0;
+
+            if ((sub_feature = sensors_get_subfeature (c_ptr_sensors_chip_name, c_ptr_sensors_feature,
+                    SENSORS_SUBFEATURE_POWER_MAX)) &&
+                    !sensors_get_value (c_ptr_sensors_chip_name, address_chipfeature, &sensorFeature))
+                ptr_chipfeature->max_value = sensorFeature;
+
+            break;
+
+        case SENSORS_FEATURE_ENERGY:
+	    ptr_chipfeature->class = ENERGY;
+            ptr_chipfeature->min_value = 0.0;
+            ptr_chipfeature->max_value = 120.0;
+	    break;
+
+        case SENSORS_FEATURE_CURR:
+	    ptr_chipfeature->class = CURRENT;
+            ptr_chipfeature->min_value = 0.0;
+            ptr_chipfeature->max_value = 100.0;
+
+            if ((sub_feature = sensors_get_subfeature (c_ptr_sensors_chip_name, c_ptr_sensors_feature,
+                    SENSORS_SUBFEATURE_CURR_MIN)) &&
+                    !sensors_get_value (c_ptr_sensors_chip_name, address_chipfeature, &sensorFeature))
+                ptr_chipfeature->min_value = sensorFeature;
+
+            if ((sub_feature = sensors_get_subfeature (c_ptr_sensors_chip_name, c_ptr_sensors_feature,
+                    SENSORS_SUBFEATURE_CURR_MAX)) &&
+                    !sensors_get_value (c_ptr_sensors_chip_name, address_chipfeature, &sensorFeature))
+                ptr_chipfeature->max_value = sensorFeature;
+
+	    break;
+
         case SENSORS_FEATURE_VID:
             ptr_chipfeature->class = VOLTAGE;
             ptr_chipfeature->min_value = 1.0;
@@ -305,6 +340,18 @@ find_chipfeature (const sensors_chip_name *name, t_chip *chip,
             sub_feature = sensors_get_subfeature (name, feature,
                                                  SENSORS_SUBFEATURE_BEEP_ENABLE);
             break;
+        case SENSORS_FEATURE_POWER:
+            sub_feature = sensors_get_subfeature (name, feature,
+                                                 SENSORS_SUBFEATURE_POWER_INPUT);
+            break;
+        case SENSORS_FEATURE_ENERGY:
+            sub_feature = sensors_get_subfeature (name, feature,
+                                                 SENSORS_SUBFEATURE_ENERGY_INPUT);
+            break;
+        case SENSORS_FEATURE_CURR:
+            sub_feature = sensors_get_subfeature (name, feature,
+                                                 SENSORS_SUBFEATURE_CURR_INPUT);
+            break;
         default:
             sub_feature = sensors_get_subfeature (name, feature,
                                                   SENSORS_SUBFEATURE_UNKNOWN);
diff --git a/lib/sensors-interface-common.c b/lib/sensors-interface-common.c
index d50dcc7..a0d7c22 100644
--- a/lib/sensors-interface-common.c
+++ b/lib/sensors-interface-common.c
@@ -155,10 +155,18 @@ format_sensor_value (t_tempscale temperaturescale, t_chipfeature *ptr_chipfeatur
                *dptr_str_formattedvalue = g_strdup_printf(_("%+.3f V"), val_sensorfeature);
                break;
 
+        case CURRENT:
+               *dptr_str_formattedvalue = g_strdup_printf(_("%+.3f A"), val_sensorfeature);
+               break;
+
         case ENERGY:
                *dptr_str_formattedvalue = g_strdup_printf(_("%.0f mWh"), val_sensorfeature);
                break;
 
+        case POWER:
+               *dptr_str_formattedvalue = g_strdup_printf(_("%.0f W"), val_sensorfeature);
+               break;
+
         case STATE:
                 if (val_sensorfeature==0.0)
                     *dptr_str_formattedvalue = g_strdup (_("off"));

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list