added engine oil property stub
authorKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 28 Jun 2012 18:49:59 +0000 (11:49 -0700)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 28 Jun 2012 18:49:59 +0000 (11:49 -0700)
docs/runningstatus.txt
lib/CMakeLists.txt
lib/chime.cpp
lib/chime.h
lib/engineoilproperty.cpp [new file with mode: 0644]
lib/engineoilproperty.h [new file with mode: 0644]
tests/testRunningStatus.py

index 50359fa..5fc0b9a 100644 (file)
@@ -97,7 +97,7 @@ Properties    byte VehiclePowerMode [readonly]
                
                        Remaining Oil Percentage (byte)
                        Engine Oil Temperature (byte) in degrees C
-                       Engine Oil Pressure (byte)
+                       Engine Oil Pressure in kPa (uint16)
                        
                struct{ byte, byte } EngineCoolant [readonly]
                
index 874606d..a352105 100644 (file)
@@ -1,5 +1,5 @@
 
-set(amb_sources fuelrangeproperty.cpp fuellevelproperty.cpp chime.cpp hornproperty.cpp interiorlightstatusproperty.cpp lightstatusproperty.cpp wheelbrakeproperty.cpp cruisecontrolstatus.cpp transmissiongearstatus.cpp tripmeterproperty.cpp fueleconomyproperty.cpp vehiclepowermodeproperty.cpp enginespeedproperty.cpp runningstatusinterface.cpp vehiclespeed.cpp abstractdbusinterface.cpp abstractproperty.cpp dbusinterfacemanager.cpp debugout.cpp)
+set(amb_sources engineoilproperty.cpp fuelrangeproperty.cpp fuellevelproperty.cpp chime.cpp hornproperty.cpp interiorlightstatusproperty.cpp lightstatusproperty.cpp wheelbrakeproperty.cpp cruisecontrolstatus.cpp transmissiongearstatus.cpp tripmeterproperty.cpp fueleconomyproperty.cpp vehiclepowermodeproperty.cpp enginespeedproperty.cpp runningstatusinterface.cpp vehiclespeed.cpp abstractdbusinterface.cpp abstractproperty.cpp dbusinterfacemanager.cpp debugout.cpp)
 set(amb_headers_install abstractproperty.h vehiclespeed.h hornproperty.h interiorlightstatusproperty.h lightstatusproperty.h wheelbrakeproperty.h cruisecontrolstatus.h transmissiongearstatus.h tripmeterproperty.h fueleconomyproperty.h vehiclepowermodeproperty.h enginespeedproperty.h chime.h)
 include_directories( ${include_dirs} )
 add_library(amb SHARED ${amb_sources})
index 46976c2..ce933f5 100644 (file)
@@ -27,7 +27,7 @@ void Chime::fromGVariant(GVariant* value)
 
 GVariant* Chime::toGVariant()
 {
-
+       return g_variant_new_boolean(value());
 }
 
 Chime::Chime()
index ef8689b..8e24d7b 100644 (file)
@@ -34,7 +34,7 @@ public:
                return value();
        }
 
-       Chime& operator =  (bool val)
+       Chime& operator =  (bool const & val)
        {
                this->setValue(val);
                return *this;
diff --git a/lib/engineoilproperty.cpp b/lib/engineoilproperty.cpp
new file mode 100644 (file)
index 0000000..c70504d
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+    Copyright (C) 2012  Intel Corporation
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+
+#include "engineoilproperty.h"
+
+void EngineOilProperty::fromGVariant(GVariant* value)
+{
+
+}
+
+GVariant* EngineOilProperty::toGVariant()
+{
+
+}
+
+
+
diff --git a/lib/engineoilproperty.h b/lib/engineoilproperty.h
new file mode 100644 (file)
index 0000000..1ab1bcf
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+    Copyright (C) 2012  Intel Corporation
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+
+#ifndef ENGINEOILPROPERTY_H
+#define ENGINEOILPROPERTY_H
+
+#include <abstractproperty.h>
+
+class EngineOil 
+{
+public:
+       EngineOil():remaining(0), temperature(0), pressure(0) { }
+       
+       uint8_t remaining;
+       uint8_t temperature;
+       uint16_t pressure;
+};
+
+class EngineOilProperty : public AbstractProperty
+{
+
+public:
+
+
+       virtual void fromGVariant(GVariant* value);
+       virtual GVariant* toGVariant();
+    
+    
+};
+
+#endif // ENGINEOILPROPERTY_H
index 4991d0e..53564a1 100755 (executable)
@@ -35,7 +35,7 @@ print "LightStatus: ", lightStatus
 print "InteriorLightStatus", interiorLightStatus
 print "HornSatus", hornStatus
 print "Chime", chimeStatus
-print "FuelLevel: ", fuelLevelStatus
+print "FuelLevel: %i" % fuelLevelStatus
 print "FuelRange", fuelRange
 
 assert type(speed) == dbus.UInt16
@@ -90,6 +90,6 @@ assert type(fuelLevelStatus) == dbus.Byte
 assert fuelLevelStatus == 95
 
 assert type(fuelRange) == dbus.UInt16
-assert fuelRange = 321
+assert fuelRange == 321
 
 print "Passed"