configure_file("${CMAKE_CURRENT_SOURCE_DIR}/RELEASE.in.md" "${CMAKE_CURRENT_SOURCE_DIR}/RELEASE.md" @ONLY)
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/TODO" "${CMAKE_CURRENT_SOURCE_DIR}/TODO.md" @ONLY)
+
# packaging stuff:
# Common things to every type of package
SET(CPACK_PACKAGE_DESCRIPTION "daemon that provides access vehicle data")
add_subdirectory(examples)
add_subdirectory(xwalk)
add_subdirectory(packaging.in)
+
+
~~~~~~~~~~~~~{.json}
{
- "mainloop" : "/usr/lib/x86_64-linux-gnu/automotive-message-broker/qtmainloopplugin.so",
+ "mainloop" : "/usr/lib/i386-linux-gnu/automotive-message-broker/qtmainloopplugin.so",
"plugins" : "/etc/ambd/plugins.d"
}
~~~~~~~~~~~~~
-- Refactor obd2 plugin with AsyncQueue. Use thread safe-update property.
+- Make updateFrequency a normal property
+- Core auto-calculate updateFrequency
+- Create API export class that creates the standardized API regardless of IPC mechanism. That way, the same API can be used over websockets too.
+- Refactor obd2 plugin with AsyncQueue. Use thread-safe updateProperty.
- source export from database plugin does not reflect the source in the database
- grep all the TODOs in the code and do them
#include "glibmainloop.h"
#include "core.h"
-#include <json.h>
#include <gio/gio.h>
#include <picojson.h>
#include <iostream>
+#include <fstream>
#include <stdexcept>
#include <boost/concept_check.hpp>
std::string get_file_contents(const char *filename)
{
std::ifstream in(filename, std::ios::in);
- if(!in.is_open())
+ if(in.fail())
{
- DebugOut(DebugOut::Error) << "Failed to open file: " << filename << endl;
+ DebugOut(DebugOut::Error) << "Failed to open file '" << filename << "':' " << strerror(errno) << endl;
return "";
}
if(!picojsonerr.empty())
{
- DebugOut(DebugOut::Error) << "Failed to parse main config! " << endl;
+ DebugOut(DebugOut::Error) << "Failed to parse main config! " << picojsonerr << endl;
throw std::runtime_error("Error parsing config");
}
{
DebugOut()<<"DEBUG: "<<message.c_str()<<endl;
}
+
+
+void amb::deprecateMethod(const string & methodName, const string &version)
+{
+ DebugOut(DebugOut::Warning) << methodName << " is deprecated in " << version << endl;
+
+ if(version == PROJECT_SERIES)
+ {
+ throw std::runtime_error("Using deprecated function.");
+ }
+}
* DebugOut() << "This will log to stderr." << std::endl;
* \endcode
*/
+
+namespace amb
+{
+/*!
+ * \brief deprecateMethod prints warning if method is used. Throws if version >= PROJECT_SERIES
+ * \param methodName name of method being deprecated.
+ * \param version version in which this method will no longer function in.
+ */
+void deprecateMethod(const string &methodName, const std::string & version);
+}
+
class DebugOut
{
public:
const VehicleProperty::Property VehicleProperty::AccelerationY = "AccelerationY";
const VehicleProperty::Property VehicleProperty::AccelerationZ = "AccelerationZ";
const VehicleProperty::Property VehicleProperty::MassAirFlow = "MassAirFlow";
+[[deprecated("Deprecated in 0.14. Use ButtonEventW3C")]]
const VehicleProperty::Property VehicleProperty::ButtonEvent = "ButtonEvent";
const VehicleProperty::Property VehicleProperty::AirIntakeTemperature = "AirIntakeTemperature";
const VehicleProperty::Property VehicleProperty::BatteryVoltage = "BatteryVoltage";
#include "abstractpropertytype.h"
#include "mappropertytype.hpp"
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-
namespace ButtonEvents {
enum ButtonEventType {
NoButton = 0,
/**< Button Event @see ButtonEvents::ButtonEventType */
///TODO: deprecated. Use ButtonEventW3C. Remove in 0.14
- [[deprecated("Deprecated in 0.14. Use ButtonEventW3C")]]
static const Property ButtonEvent;
PROPERTYTYPE(ButtonEvent, ButtonEventType, BasicPropertyType<ButtonEvents::ButtonEventType>, ButtonEvents::ButtonEventType)
QJSValue value = engine->newQObject(this);
engine->globalObject().setProperty("bluemonkey", value);
+ QThread* thread = new QThread(this);
+
+ engine->moveToThread(thread);
+
+ thread->start();
+
loadConfig(configuration["config"].c_str());
}
///TODO: Deprecated in 0.15
else if(boost::algorithm::starts_with(method, "Get"))
{
+ amb::deprecateMethod(method, "0.15");
std::string propertyName = method.substr(3);
auto propertyMap = iface->getProperties();
if(propertyMap.find(propertyName) == propertyMap.end())