diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | Doxyfile.in | 2 | ||||
-rw-r--r-- | docs/amb.idl | 40 | ||||
-rw-r--r-- | examples/bluemonkey/bluemonkeyconfig.in | 3 | ||||
-rw-r--r-- | examples/opencvdbusconfig.in | 2 | ||||
-rw-r--r-- | lib/abstractpropertytype.h | 41 | ||||
-rw-r--r-- | lib/libamb.h | 32 | ||||
-rw-r--r-- | lib/listplusplus.h | 1 | ||||
-rw-r--r-- | lib/mappropertytype.hpp | 9 | ||||
-rw-r--r-- | lib/vehicleproperty.cpp | 14 | ||||
-rw-r--r-- | lib/vehicleproperty.h | 19 | ||||
-rw-r--r-- | plugins/bluemonkey/bluemonkey.cpp | 70 | ||||
-rw-r--r-- | plugins/bluemonkey/bluemonkey.h | 5 | ||||
-rw-r--r-- | plugins/bluemonkey/config.js | 73 | ||||
-rw-r--r-- | plugins/common/ambpluginimpl.cpp | 3 | ||||
-rw-r--r-- | plugins/dbus/maintenance.h | 21 | ||||
-rw-r--r-- | plugins/dbus/runningstatus.h | 10 | ||||
-rw-r--r-- | plugins/opencvlux/opencvluxplugin.cpp | 111 | ||||
-rw-r--r-- | plugins/opencvlux/opencvluxplugin.h | 2 | ||||
-rw-r--r-- | xwalk/CMakeLists.txt | 7 | ||||
-rw-r--r-- | xwalk/js/js-test-post.js | 28 | ||||
-rw-r--r-- | xwalk/js/js-test-pre.js | 604 | ||||
-rw-r--r-- | xwalk/vehicle.cc | 111 | ||||
-rw-r--r-- | xwalk/vehicle.h | 1 | ||||
-rw-r--r-- | xwalk/vehicle.html | 95 | ||||
-rw-r--r-- | xwalk/vehicle_api.cc | 2 | ||||
-rw-r--r-- | xwalk/vehicle_api.js | 22 |
27 files changed, 1135 insertions, 195 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a91fcf0d..dd98be8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_BUILD_TYPE, Debug) include(FindPkgConfig) set(PROJECT_NAME "automotive-message-broker") -set(PROJECT_VERSION "0.12.800") +set(PROJECT_VERSION "0.12.802") set(PROJECT_CODENAME "agera") set(PROJECT_QUALITY "alpha") diff --git a/Doxyfile.in b/Doxyfile.in index 7d069378..015c9ad7 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -1,3 +1,3 @@ PROJECT_NAME = @PROJECT_NAME@ PROJECT_NUMBER = @PROJECT_VERSION@ -INPUT = @CMAKE_CURRENT_SOURCE_DIR@/lib/ @CMAKE_CURRENT_SOURCE_DIR@/docs +INPUT = @CMAKE_CURRENT_SOURCE_DIR@/lib/ diff --git a/docs/amb.idl b/docs/amb.idl index 941ae7eb..df427e4e 100644 --- a/docs/amb.idl +++ b/docs/amb.idl @@ -1341,7 +1341,7 @@ interface org.automotive.BrakeOperation extends VehiclePropertyType { attribute Boolean BrakePedalDepressed readonly } -enum VehicleButton { +enum Button { home = "home", back = "back", search = "search", @@ -1359,23 +1359,51 @@ enum VehicleButton { down = "down" } -enum PressType { +enum ButtonEventType { press = "press", long_press = "long_press", release = "release" }; +interface VehicleButton { + /*! + * \brief must return the button corresponding to the event. + */ + attribute Button button readonly; + + /*! + * \brief must return the type of event + */ + attribute ButtonEventType state readonly; +} + interface org.automotive.ButtonEvent extends VehiclePropertyType { /*! - * \brief must return the button events tha occured. This supports multiple simultanious button events. + * \brief must return the button events that occured. This supports multiple simultanious button events. */ - attribute array Button of VehicleButton readonly + attribute array Button of VehicleButton readonly; +} + +interface org.automotive.TransmissionOil extends VehiclePropertyType { + + /*! + * \brief must return current temperature of the transmission oil(Unit: celsius). + */ + attribute Int8 Temperature readonly; + + /*! + * \brief must return transmission oil wear (Unit: percentage, 0: no wear, 100: completely worn). + */ + attribute UInt8 Wear readonly +} + +interface org.automotive.TransmissionClutch extends VehiclePropertyType { /*! - * \brief must return the type of event + * \brief must return transmission clutch wear (Unit: percentage, 0: no wear, 100: completely worn). */ - attribute PressType State readonly + attribute UInt8 Wear readonly } } diff --git a/examples/bluemonkey/bluemonkeyconfig.in b/examples/bluemonkey/bluemonkeyconfig.in index 64f299c3..0ba2c813 100644 --- a/examples/bluemonkey/bluemonkeyconfig.in +++ b/examples/bluemonkey/bluemonkeyconfig.in @@ -12,6 +12,9 @@ { "path" : "@PLUGIN_INSTALL_PATH@/examplesinkplugin.so" + }, + { + "path" : "@PLUGIN_INSTALL_PATH@/dbussinkplugin.so" } ] } diff --git a/examples/opencvdbusconfig.in b/examples/opencvdbusconfig.in index a3743987..b85bc4b2 100644 --- a/examples/opencvdbusconfig.in +++ b/examples/opencvdbusconfig.in @@ -4,7 +4,7 @@ { "name" : "OpenCV LUX", "path" : "@PLUGIN_INSTALL_PATH@/opencvluxplugin.so", - "threaded" : "true", + "threaded" : "false", "cuda" : "false", "opencl" : "true", "fps" : "30", diff --git a/lib/abstractpropertytype.h b/lib/abstractpropertytype.h index 5b7128e0..340b66f5 100644 --- a/lib/abstractpropertytype.h +++ b/lib/abstractpropertytype.h @@ -294,11 +294,27 @@ template <> class GVS<uint8_t> { public: + static const char* signature() { return "y"; } + + static uint8_t value(GVariant* v) + { + return g_variant_get_byte(v); + } + static std::string stringize(std::string v) + { + return v; + } +}; + +template <> +class GVS<int8_t> +{ +public: static const char* signature() { return "q"; } - static uint16_t value(GVariant* v) + static int8_t value(GVariant* v) { - return g_variant_get_uint16(v); + return g_variant_get_int16(v); } static std::string stringize(std::string v) { @@ -626,6 +642,14 @@ private: class StringPropertyType: public AbstractPropertyType { public: + + + StringPropertyType() + :AbstractPropertyType("") + { + setValue(std::string()); + } + StringPropertyType(std::string propertyName) :AbstractPropertyType(propertyName) { @@ -667,6 +691,12 @@ public: return *this; } + bool operator < (const StringPropertyType& other) const + { + return value<std::string>() < other.value<std::string>(); + } + + void fromString(std::string val) { setValue(val); @@ -735,8 +765,9 @@ public: } /** append - appends a property to the list - * @arg property - property to be appended. Property will be copied and owned by ListPropertyType. - * You are responsible for freeing property after append is called. + * @arg property - property to be appended. + * ListPropertyType makes a copy of the property. + * You are responsible for freeing property. **/ void append(AbstractPropertyType* property) { @@ -842,7 +873,7 @@ public: { GVariant *childvariant = g_variant_get_child_value(v,i); GVariant *innervariant = g_variant_get_variant(childvariant); - T *t = new T(); + T *t = new T(""); t->fromVariant(innervariant); appendPriv(t); } diff --git a/lib/libamb.h b/lib/libamb.h new file mode 100644 index 00000000..7a23034a --- /dev/null +++ b/lib/libamb.h @@ -0,0 +1,32 @@ +/** + \mainpage Automotive Message Broker Library Documentation + + \section intro Introduction + AMB Library documentation outlines the internal classes and structures for building + plugins for AMB. + + \section architecture General Architecture + AMB has 3 main parts. Source plugins which provide data, a routing engine that + routes data and sink plugins that consume the data. + + \section plugins Plugins + There are two types of plugins: plugins that provide data, called "sources" + (AbstractSource) and plugins that consume data, called "sinks" (AbstractSink). + A typical source would get data from the vehicle and then translate the raw data + into AMB property types. Sinks then subscribe to the property types and do useful + things with the data. + + Example plugins can be found in plugins/exampleplugin.{h,cpp} for an example + source plugin and plugins/examplesink.{h,cpp} for an example sink plugin. There + are also many different types of plugins useful for testing and development in the + plugins/ directory. + + \section routing_engine Routing Engine Plugins + As of 0.12, the routing engine itself can be exchanged for a plugin. This allows + users to swap in routing engines with different behaviors, additional security, + and custom throttling and filtering features. + + The easiest way to get started creating a routing engine plugin would be to look at + AbstractRoutingEngine, the base class for all routing engines and the default + routing engine in ambd/core.cpp. +**/ diff --git a/lib/listplusplus.h b/lib/listplusplus.h index 23826df4..750f3211 100644 --- a/lib/listplusplus.h +++ b/lib/listplusplus.h @@ -22,6 +22,7 @@ #include <list> #include <algorithm> +#include <functional> template <class T, class V> bool contains(const T & iteratable, V value) diff --git a/lib/mappropertytype.hpp b/lib/mappropertytype.hpp index ff0cc0af..4ddbfbb7 100644 --- a/lib/mappropertytype.hpp +++ b/lib/mappropertytype.hpp @@ -44,9 +44,9 @@ public: if(str.str() != "{") str << ", "; - auto t = *itr; + auto t = *itr; - str <<"'"<< t.first.toString() <<"':'"<<t.second.toString()<<"'"; + str <<"'"<< t.first.toString() <<"':'"<<t.second.toString()<<"'"; } str << "}"; @@ -81,7 +81,7 @@ public: { T one("", key); N two("", std::string(json_object_get_string(val))); - append(one,two); + append(one, two); } json_object_put(rootobject); @@ -107,7 +107,6 @@ public: void fromVariant(GVariant* variant) { clear(); - /// TODO: fill this in gsize dictsize = g_variant_n_children(variant); for (int i=0;i<dictsize;i++) { @@ -125,7 +124,7 @@ public: appendPriv(t,n); } } - + } void setMap(std::map<T, N> m) diff --git a/lib/vehicleproperty.cpp b/lib/vehicleproperty.cpp index d4cd94c9..bbc74079 100644 --- a/lib/vehicleproperty.cpp +++ b/lib/vehicleproperty.cpp @@ -220,6 +220,9 @@ const VehicleProperty::Property VehicleProperty::IgnitionTimeOn = "IgnitionTimeO const VehicleProperty::Property VehicleProperty::IgnitionTimeOff = "IgnitionTimeOff"; const VehicleProperty::Property VehicleProperty::YawRate = "YawRate"; const VehicleProperty::Property VehicleProperty::ButtonEventW3C = "ButtonEventW3C"; +const VehicleProperty::Property VehicleProperty::TransmissionOilWear = "TransmissionOilWear"; +const VehicleProperty::Property VehicleProperty::TransmissionOilTemperature = "TransmissionOilTemperature"; +const VehicleProperty::Property VehicleProperty::TransmissionClutchWear = "TransmissionClutchWear"; PropertyList VehicleProperty::mCapabilities; PropertyList VehicleProperty::mCustomProperties; @@ -386,7 +389,16 @@ VehicleProperty::VehicleProperty() REGISTERPROPERTY(IgnitionTimeOff, 0); REGISTERPROPERTY(IgnitionTimeOn, 0); REGISTERPROPERTY(YawRate, 0); - REGISTERPROPERTY(ButtonEventW3C, ""); + registerPropertyPriv(ButtonEventW3C, [](){ + ButtonEventW3CType* t = new ButtonEventW3CType(); + StringPropertyType k, v; + t->append(k, v); + return t; + }); + + REGISTERPROPERTY(TransmissionOilWear, 0); + REGISTERPROPERTY(TransmissionOilTemperature, 0); + REGISTERPROPERTY(TransmissionClutchWear, 0); } void VehicleProperty::factory() diff --git a/lib/vehicleproperty.h b/lib/vehicleproperty.h index a79e4ce1..758c7ece 100644 --- a/lib/vehicleproperty.h +++ b/lib/vehicleproperty.h @@ -481,7 +481,15 @@ public: PROPERTYTYPE(ButtonEvent, ButtonEventType, BasicPropertyType<ButtonEvents::ButtonEventType>, ButtonEvents::ButtonEventType) static const Property ButtonEventW3C; - PROPERTYTYPE(ButtonEventW3C, ButtonEventW3CType, StringPropertyType, std::string) + class ButtonEventW3CType: public MapPropertyType<StringPropertyType, StringPropertyType> + { + public: + ButtonEventW3CType() : MapPropertyType(ButtonEventW3C) {} + }; + + + + /**< Air intake temperature in degrees celcius */ static const Property AirIntakeTemperature; @@ -697,6 +705,15 @@ public: PROPERTYTYPEBASIC(TransmissionFluidLevel, uint16_t) //typedef BasicPropertyType<uint16_t> TransmissionFluidLevelType; + static const Property TransmissionOilWear; + PROPERTYTYPEBASIC(TransmissionOilWear, uint8_t) + + static const Property TransmissionOilTemperature; + PROPERTYTYPEBASIC(TransmissionOilTemperature, int8_t) + + static const Property TransmissionClutchWear; + PROPERTYTYPEBASIC(TransmissionClutchWear, uint8_t) + /**< Brake Fluid Level 0-100%. **/ static const Property BrakeFluidLevel; diff --git a/plugins/bluemonkey/bluemonkey.cpp b/plugins/bluemonkey/bluemonkey.cpp index f2fb0489..632f26f7 100644 --- a/plugins/bluemonkey/bluemonkey.cpp +++ b/plugins/bluemonkey/bluemonkey.cpp @@ -1,19 +1,19 @@ /* - Copyright (C) 2012 Intel Corporation + 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 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. + 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 + 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 */ @@ -322,34 +322,38 @@ void BluemonkeySink::getHistory(QStringList properties, QDateTime begin, QDateTi routingEngine->getRangePropertyAsync(request); } -void BluemonkeySink::createCustomProperty(QString name, QJSValue defaultValue, int zone = Zone::None) +void BluemonkeySink::createCustomProperty(QString name, QJSValue defaultValue, int zone) { + QVariant var = defaultValue.toVariant(); - auto create = [defaultValue, name]() -> AbstractPropertyType* + auto create = [defaultValue, name, var]() -> AbstractPropertyType* { - QVariant var = defaultValue.toVariant(); - - if(!var.isValid()) - return nullptr; - - if(var.type() == QVariant::UInt) - return new BasicPropertyType<uint>(name.toStdString(), var.toUInt()); - else if(var.type() == QVariant::Double) - return new BasicPropertyType<double>(name.toStdString(), var.toDouble()); - else if(var.type() == QVariant::Bool) - return new BasicPropertyType<bool>(name.toStdString(), var.toBool()); - else if(var.type() == QVariant::Int) - return new BasicPropertyType<int>(name.toStdString(), var.toInt()); - else if(var.type() == QVariant::String) - return new StringPropertyType(name.toStdString(), var.toString().toStdString()); - - + if(!var.isValid()) return nullptr; + + if(var.type() == QVariant::UInt) + return new BasicPropertyType<uint>(name.toStdString(), var.toUInt()); + else if(var.type() == QVariant::Double) + return new BasicPropertyType<double>(name.toStdString(), var.toDouble()); + else if(var.type() == QVariant::Bool) + return new BasicPropertyType<bool>(name.toStdString(), var.toBool()); + else if(var.type() == QVariant::Int) + return new BasicPropertyType<int>(name.toStdString(), var.toInt()); + else if(var.type() == QVariant::String) + return new StringPropertyType(name.toStdString(), var.toString().toStdString()); + + return nullptr; }; addPropertySupport(zone, create); + AsyncSetPropertyRequest request; + request.property = name.toStdString(); + request.zoneFilter = zone; + request.value = VehicleProperty::getPropertyTypeForPropertyNameValue(name.toStdString(), var.toString().toStdString()); + routingEngine->updateSupported(supported(), PropertyList(), &source); + routingEngine->setProperty(request); } @@ -384,6 +388,10 @@ void Property::setValue(QVariant v) { propertyChanged(reply->value); } + else + { + DebugOut(DebugOut::Warning) << "Error, trying to set value: " << reply->error << endl; + } delete reply; }; routingEngine->setProperty(request); diff --git a/plugins/bluemonkey/bluemonkey.h b/plugins/bluemonkey/bluemonkey.h index 2a08856e..99cbf636 100644 --- a/plugins/bluemonkey/bluemonkey.h +++ b/plugins/bluemonkey/bluemonkey.h @@ -141,6 +141,11 @@ public Q_SLOTS: mSilentMode = m; } + void createCustomProperty(QString name, QJSValue defaultValue) + { + createCustomProperty(name, defaultValue, Zone::None); + } + void createCustomProperty(QString name, QJSValue defaultValue, int zone); private: diff --git a/plugins/bluemonkey/config.js b/plugins/bluemonkey/config.js index dd51234e..7f388af7 100644 --- a/plugins/bluemonkey/config.js +++ b/plugins/bluemonkey/config.js @@ -1,19 +1,68 @@ -var speedProperty = bluemonkey.subscribeTo("VehicleSpeed"); +bluemonkey.createCustomProperty("VehicleSpeed", 10); +bluemonkey.createCustomProperty("EngineSpeed", 5000); +bluemonkey.createCustomProperty("PowertrainTorque", 324); +bluemonkey.createCustomProperty("AcceleratorPedalPosition", 50); +bluemonkey.createCustomProperty("ThrottlePosition", 50); +bluemonkey.createCustomProperty("TransmissionModeW3C", "park"); +bluemonkey.createCustomProperty("TransmissionGearPosition", 1); +bluemonkey.createCustomProperty("CruiseControlActive", false); +bluemonkey.createCustomProperty("CruiseControlSpeed", 10); + +///LightStatus: +bluemonkey.createCustomProperty("LightHead", false); +bluemonkey.createCustomProperty("LightRightTurn", false); +bluemonkey.createCustomProperty("LightLeftTurn", false); +bluemonkey.createCustomProperty("LightBrake", false); +bluemonkey.createCustomProperty("LightFog", true); +bluemonkey.createCustomProperty("LightHazard", false); +bluemonkey.createCustomProperty("LightParking", false); +bluemonkey.createCustomProperty("LightHighBeam", false); +bluemonkey.createCustomProperty("LightAutomatic", true); +bluemonkey.createCustomProperty("LightDynamicHighBeam", false); + +bluemonkey.createCustomProperty("Horn", false); +bluemonkey.createCustomProperty("Chime", false); -bluemonkey.log("Javascript engine works!!!!"); +///Fuel: +bluemonkey.createCustomProperty("FuelLevel", 90); +bluemonkey.createCustomProperty("FuelRange", 100); +bluemonkey.createCustomProperty("FuelConsumption", 10); +bluemonkey.createCustomProperty("FuelEconomy", 10); +bluemonkey.createCustomProperty("FuelAverageEconomy", 10); +bluemonkey.createCustomProperty("FuelAverageConsumption", 10); +bluemonkey.createCustomProperty("FuelConsumptionSinceRestart", 10); +bluemonkey.createCustomProperty("LightHighBeam", false); +bluemonkey.createCustomProperty("LightAutomatic", true); +bluemonkey.createCustomProperty("FuelTimeSinceRestart", 10000); -bluemonkey.createCustomProperty("BluemonkeyTest", false); +///EngineOil: +bluemonkey.createCustomProperty("EngineOilTemperature", 60); +bluemonkey.createCustomProperty("EngineOilPressure", 60); +bluemonkey.createCustomProperty("EngineOilChangeIndicator", false); +bluemonkey.createCustomProperty("EngineOilLifeRemaining", 30); -var bluemonkeyTest = bluemonkey.subscribeTo("BluemonkeyTest"); +bluemonkey.createCustomProperty("AccelerationX", 0); +bluemonkey.createCustomProperty("AccelerationY", 0); +bluemonkey.createCustomProperty("AccelerationZ", 10); -bluemonkeyTest.value = true; +bluemonkey.createCustomProperty("SteeringWheelAngleW3C", 10); +bluemonkey.createCustomProperty("WheelTick", 1000); -var timer = bluemonkey.createTimer(); +bluemonkey.createCustomProperty("EngineCoolantLevel", 100); +bluemonkey.createCustomProperty("EngineCoolantTemperature", 60); -timer.interval = 1000; -timer.singleShot = false; -timer.timeout.connect(function() { - bluemonkeyTest.value = !bluemonkeyTest.value; -}); +bluemonkey.createCustomProperty("IgnitionTimeOn", 5000); +bluemonkey.createCustomProperty("IgnitionTimeOff", 5000); + +bluemonkey.createCustomProperty("YawRate", 128); +bluemonkey.createCustomProperty("WheelBrake", false); + +var speedProperty = bluemonkey.subscribeTo("VehicleSpeed"); -timer.start(); +var testTimer = bluemonkey.createTimer(); + testTimer.interval = 3000; + testTimer.singleShot = false; + testTimer.timeout.connect(function() { + //VehicleSpeed + speedProperty.value = Math.floor((Math.random() * 100) + 1); + }); diff --git a/plugins/common/ambpluginimpl.cpp b/plugins/common/ambpluginimpl.cpp index c956dd34..66f6ee6f 100644 --- a/plugins/common/ambpluginimpl.cpp +++ b/plugins/common/ambpluginimpl.cpp @@ -154,7 +154,8 @@ std::shared_ptr<AbstractPropertyType> AmbPluginImpl::addPropertySupport(Zone::Ty { registeredType = VehicleProperty::registerProperty(name, typeFactory); } - if(!registeredType){ // Property type wasn't registered by us. Is it predefined in AMB API or some other source plug-in has already registered it ??? + if(!registeredType) + { // Property type wasn't registered by us. Is it predefined in AMB API or some other source plug-in has already registered it ??? std::shared_ptr<AbstractPropertyType> registeredPropertyType(VehicleProperty::getPropertyTypeForPropertyNameValue(name)); if(!registeredPropertyType) return nullptr; diff --git a/plugins/dbus/maintenance.h b/plugins/dbus/maintenance.h index 6f1cd941..a56a5c57 100644 --- a/plugins/dbus/maintenance.h +++ b/plugins/dbus/maintenance.h @@ -131,4 +131,25 @@ public: } }; +class TransmissionOil: public DBusSink +{ +public: + TransmissionOil(AbstractRoutingEngine* re, GDBusConnection* connection) + :DBusSink("TransmissionOil", re, connection, map<string, string>()) + { + wantPropertyVariant(VehicleProperty::TransmissionOilWear, "Wear", AbstractProperty::Read); + wantPropertyVariant(VehicleProperty::TransmissionOilTemperature, "Temperature", AbstractProperty::Read); + } +}; + +class TransmissionClutch: public DBusSink +{ +public: + TransmissionClutch(AbstractRoutingEngine* re, GDBusConnection* connection) + :DBusSink("TransmissionClutch", re, connection, map<string, string>()) + { + wantPropertyVariant(VehicleProperty::TransmissionClutchWear, "Wear", AbstractProperty::Read); + } +}; + #endif diff --git a/plugins/dbus/runningstatus.h b/plugins/dbus/runningstatus.h index d66d4c64..b557f486 100644 --- a/plugins/dbus/runningstatus.h +++ b/plugins/dbus/runningstatus.h @@ -433,4 +433,14 @@ public: } }; +class ButtonEvent: public DBusSink +{ +public: + ButtonEvent(AbstractRoutingEngine *re, GDBusConnection *connection) + :DBusSink("ButtonEvent", re, connection, map<string, string>()) + { + wantPropertyVariant(VehicleProperty::YawRate, "Value", AbstractProperty::Read); + } +}; + #endif diff --git a/plugins/opencvlux/opencvluxplugin.cpp b/plugins/opencvlux/opencvluxplugin.cpp index 46fa62e6..b0caf1b4 100644 --- a/plugins/opencvlux/opencvluxplugin.cpp +++ b/plugins/opencvlux/opencvluxplugin.cpp @@ -42,6 +42,7 @@ using namespace std; const std::string VideoLogging = "VideoLogging"; const std::string DriverDrowsiness = "DriverDrowsiness"; +const std::string OpenCL = "OpenCL"; #include "debugout.h" @@ -55,6 +56,10 @@ extern "C" AbstractSource * create(AbstractRoutingEngine* routingengine, map<str return new OpenCvLuxPlugin::DriverDrowsinessType(DriverDrowsiness, false); }); + VehicleProperty::registerProperty(OpenCL, [](){ + return new BasicPropertyType<bool>(OpenCL, false); + }); + return new OpenCvLuxPlugin(routingengine, config); } @@ -62,6 +67,7 @@ OpenCvLuxPlugin::OpenCvLuxPlugin(AbstractRoutingEngine* re, map<string, string> :AbstractSource(re, config), lastLux(0), speed(0), latitude(0), longitude(0), extBrightness(new VehicleProperty::ExteriorBrightnessType(0)) { driverDrowsiness = amb::make_unique(new DriverDrowsinessType(DriverDrowsiness, false)); + openCl = amb::make_unique(new BasicPropertyType<bool>(OpenCL, false)); shared = amb::make_unique(new Shared); shared->parent = this; @@ -112,7 +118,6 @@ OpenCvLuxPlugin::OpenCvLuxPlugin(AbstractRoutingEngine* re, map<string, string> } } - if(config.find("pixelUpperBound") != config.end()) { shared->pixelUpperBound = boost::lexical_cast<int>(config["pixelUpperBound"]); @@ -125,6 +130,7 @@ OpenCvLuxPlugin::OpenCvLuxPlugin(AbstractRoutingEngine* re, map<string, string> { #ifdef OPENCL shared->useOpenCl = config["opencl"] == "true"; + openCl->setValue(shared->useOpenCl); #else DebugOut(DebugOut::Warning) << "You really don't have openCL support. Disabling." << endl; shared->useOpenCl = false; @@ -151,39 +157,38 @@ OpenCvLuxPlugin::OpenCvLuxPlugin(AbstractRoutingEngine* re, map<string, string> #ifdef OPENCL - if(shared->useOpenCl) - { - cv::ocl::PlatformsInfo platforms; - cv::ocl::getOpenCLPlatforms(platforms); - for(auto p : platforms) - { - DebugOut(1)<<"platform: "<<p->platformName<<" vendor: "<<p->platformVendor<<endl; - } + cv::ocl::PlatformsInfo platforms; + cv::ocl::getOpenCLPlatforms(platforms); - cv::ocl::DevicesInfo info; - cv::ocl::getOpenCLDevices(info, cv::ocl::CVCL_DEVICE_TYPE_ALL); + for(auto p : platforms) + { + DebugOut(1)<<"platform: "<<p->platformName<<" vendor: "<<p->platformVendor<<endl; + } - DebugOut(1)<<"There are "<<info.size()<<" OpenCL devices on this system"<<endl; + cv::ocl::DevicesInfo info; + cv::ocl::getOpenCLDevices(info, cv::ocl::CVCL_DEVICE_TYPE_ALL); - if(!info.size()) - { - DebugOut(1)<<"No CL devices. Disabling OpenCL"<<endl; - shared->useOpenCl = false; - } - else - { - cv::ocl::setDevice(info[0]); - } + DebugOut(1)<<"There are "<<info.size()<<" OpenCL devices on this system"<<endl; - for(auto i : info) + if(!info.size()) + { + DebugOut(1)<<"No CL devices. Disabling OpenCL"<<endl; + shared->useOpenCl = false; + } + else + { + cv::ocl::setDevice(info[0]); + } + + for(auto i : info) + { + for(auto name : i->deviceName) { - for(auto name : i->deviceName) - { - DebugOut(1)<<"OpenCLDeviceName: "<<name<<endl; - } + DebugOut(1)<<"OpenCLDeviceName: "<<name<<endl; } } + #endif #ifdef CUDA @@ -211,17 +216,12 @@ OpenCvLuxPlugin::OpenCvLuxPlugin(AbstractRoutingEngine* re, map<string, string> if(shared->ddd) { #ifdef OPENCL - if(shared->useOpenCl) - { - faceCascade = amb::make_unique(new cv::ocl::OclCascadeClassifier()); - eyeCascade = amb::make_unique(new cv::ocl::OclCascadeClassifier()); - } - else + faceCascade = amb::make_unique(new cv::ocl::OclCascadeClassifier()); + eyeCascade = amb::make_unique(new cv::ocl::OclCascadeClassifier()); +#else + faceCascade = amb::make_unique(new cv::CascadeClassifier()); + eyeCascade = amb::make_unique(new cv::CascadeClassifier()); #endif - { - faceCascade = amb::make_unique(new cv::CascadeClassifier()); - eyeCascade = amb::make_unique(new cv::CascadeClassifier()); - } std::string faceFile = CV_DATA "/haarcascades/haarcascade_frontalface_alt.xml"; if(!faceCascade->load(faceFile)) @@ -383,7 +383,16 @@ static int grabImage(void *data) } if(shared->ddd) - shared->parent->detectEyes(m_image); + { + try + { + shared->parent->detectEyes(m_image); + } + catch(...) + { + DebugOut(DebugOut::Warning) << "DDD detection exception: "<< endl; + } + } if(shared->threaded) { @@ -398,9 +407,18 @@ static int grabImage(void *data) else { shared->parent->writeVideoFrame(m_image); - int lux = evalImage(m_image, shared); + try + { + int lux = evalImage(m_image, shared); + shared->parent->updateProperty(lux); + } + catch(...) + { + DebugOut(DebugOut::Warning) << "Exception caught "<< __FUNCTION__ << endl; + } + //detectLight(m_image,shared); - shared->parent->updateProperty(lux); + } if(shared->mRequests.size()) @@ -602,12 +620,19 @@ void OpenCvLuxPlugin::updateProperty(uint lux) void OpenCvLuxPlugin::imgProcResult() { - QFutureWatcher<uint> *watcher = dynamic_cast<QFutureWatcher<uint>*>(sender()); + try + { + QFutureWatcher<uint> *watcher = dynamic_cast<QFutureWatcher<uint>*>(sender()); - uint lux = watcher->result(); - shared->parent->updateProperty(lux); + uint lux = watcher->result(); + shared->parent->updateProperty(lux); - watcher->deleteLater(); + watcher->deleteLater(); + } + catch(...) + { + DebugOut(DebugOut::Warning) << "exception caught getting img processing result" << endl; + } } TrafficLight::Color detectLight(cv::Mat img, OpenCvLuxPlugin::Shared *shared) diff --git a/plugins/opencvlux/opencvluxplugin.h b/plugins/opencvlux/opencvluxplugin.h index 9bb79302..7fbee9ac 100644 --- a/plugins/opencvlux/opencvluxplugin.h +++ b/plugins/opencvlux/opencvluxplugin.h @@ -107,6 +107,8 @@ private: std::unique_ptr<cv::CascadeClassifier> eyeCascade; std::unique_ptr<DriverDrowsinessType> driverDrowsiness; + + std::unique_ptr<BasicPropertyType<bool>> openCl; }; static int grabImage(void *data); diff --git a/xwalk/CMakeLists.txt b/xwalk/CMakeLists.txt index 4cfd571b..3e0410d8 100644 --- a/xwalk/CMakeLists.txt +++ b/xwalk/CMakeLists.txt @@ -18,6 +18,11 @@ add_dependencies(vehicle_extension js3cc) configure_file (${CMAKE_CURRENT_SOURCE_DIR}/vehicle_api.js ${CMAKE_CURRENT_SOURCE_DIR}/vehicle_api.js @ONLY) configure_file (${CMAKE_CURRENT_SOURCE_DIR}/vehicle.html ${CMAKE_CURRENT_SOURCE_DIR}/vehicle.html @ONLY) +set(html_files ${CMAKE_CURRENT_SOURCE_DIR}/vehicle.html) +set(js_files ${CMAKE_CURRENT_SOURCE_DIR}/js/js-test-pre.js ${CMAKE_CURRENT_SOURCE_DIR}/js/js-test-post.js) + install(TARGETS vehicle_extension LIBRARY DESTINATION "${LIB_INSTALL_DIR}/${XWALK_EXTENSION_PATH}") -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/vehicle.html DESTINATION /usr/share/automotive-message-broker/xwalk/examples) +install(FILES ${html_files} DESTINATION /usr/share/automotive-message-broker/xwalk/examples) +install(FILES ${js_files} DESTINATION /usr/share/automotive-message-broker/xwalk/examples/js) endif(xwalk_vehicle_extension) + diff --git a/xwalk/js/js-test-post.js b/xwalk/js/js-test-post.js new file mode 100644 index 00000000..9218c561 --- /dev/null +++ b/xwalk/js/js-test-post.js @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2013 Google Inc. All rights reserved. + * Copyright (C) 2013 Intel Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +wasPostTestScriptParsed = true; +finishJSTest(); diff --git a/xwalk/js/js-test-pre.js b/xwalk/js/js-test-pre.js new file mode 100644 index 00000000..3a2d181d --- /dev/null +++ b/xwalk/js/js-test-pre.js @@ -0,0 +1,604 @@ +/* + * Copyright (C) 2013 Google Inc. All rights reserved. + * Copyright (C) 2013 Intel Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// svg/dynamic-updates tests set enablePixelTesting=true, as we want to dump text + pixel results +var description, debug, successfullyParsed, errorMessage; + +(function() { + + function getOrCreate(id, tagName) + { + var element = document.getElementById(id); + if (element) + return element; + + element = document.createElement(tagName); + element.id = id; + var refNode; + var parent = document.body || document.documentElement; + if (id == 'description') + refNode = getOrCreate('console', 'div'); + else + refNode = parent.firstChild; + + parent.insertBefore(element, refNode); + return element; + } + + description = function description(msg, quiet) + { + // For MSIE 6 compatibility + var span = document.createElement('span'); + if (quiet) + span.innerHTML = '<p>' + msg + + '</p><p>' + + 'On success, you will see no "<span class="fail">FAIL</span>" messages, ' + + 'followed by "<span class="pass">TEST COMPLETE</span>".' + + '</p>'; + else + span.innerHTML = '<p>' + msg + + '</p><p>' + + 'On success, you will see a series of "<span class="pass">PASS</span>" messages, ' + + 'followed by "<span class="pass">TEST COMPLETE</span>".' + + '</p>'; + + var description = getOrCreate('description', 'p'); + if (description.firstChild) + description.replaceChild(span, description.firstChild); + else + description.appendChild(span); + }; + + debug = function debug(msg) + { + var span = document.createElement('span'); + getOrCreate('console', 'div').appendChild(span); // insert it first so XHTML knows the namespace + span.innerHTML = msg + '<br />'; + }; + + var css = + '.pass {' + + 'font-weight: bold;' + + 'color: green;' + + '}' + + '.fail {' + + 'font-weight: bold;' + + 'color: red;' + + '}' + + '#console {' + + 'white-space: pre-wrap;' + + 'font-family: monospace;' + + '}'; + + function insertStyleSheet() + { + var styleElement = document.createElement('style'); + styleElement.textContent = css; + (document.head || document.documentElement).appendChild(styleElement); + } + + insertStyleSheet(); + + if (!self.isOnErrorTest) { + self.onerror = function(message) + { + errorMessage = message; + }; + } + +})(); + +function descriptionQuiet(msg) { description(msg, true); } + +function escapeHTML(text) +{ + return text.replace(/&/g, '&').replace(/</g, '<').replace(/\0/g, '\\0'); +} + +function testPassed(msg) +{ + debug('<span><span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>'); +} + +function testFailed(msg) +{ + debug('<span><span class="fail">FAIL</span> ' + escapeHTML(msg) + '</span>'); +} + +function areArraysEqual(_a, _b) +{ + try { + if (_a.length !== _b.length) + return false; + for (var i = 0; i < _a.length; i++) + if (_a[i] !== _b[i]) + return false; + } catch (ex) { + return false; + } + return true; +} + +function isMinusZero(n) +{ + // the only way to tell 0 from -0 in JS is the fact that 1/-0 is + // -Infinity instead of Infinity + return n === 0 && 1 / n < 0; +} + +function isResultCorrect(_actual, _expected) +{ + if (_expected === 0) + return _actual === _expected && (1 / _actual) === (1 / _expected); + if (_actual === _expected) + return true; + if (typeof(_expected) == 'number' && isNaN(_expected)) + return typeof(_actual) == 'number' && isNaN(_actual); + if (_expected && + (Object.prototype.toString.call(_expected) == Object.prototype.toString.call([]))) + return areArraysEqual(_actual, _expected); + return false; +} + +function stringify(v) +{ + if (v === 0 && 1 / v < 0) + return '-0'; + else return '' + v; +} + +function evalAndLog(_a, _quiet) +{ + if (typeof _a != 'string') + debug('WARN: tryAndLog() expects a string argument'); + + // Log first in case things go horribly wrong or this causes a sync event. + if (!_quiet) + debug(_a); + + var _av; + try { + _av = eval(_a); + } catch (e) { + testFailed(_a + ' threw exception ' + e); + } + return _av; +} + +function shouldBe(_a, _b, quiet) +{ + if (typeof _a != 'string' || typeof _b != 'string') + debug('WARN: shouldBe() expects string arguments'); + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + var _bv = eval(_b); + + if (exception) + testFailed(_a + ' should be ' + _bv + '. Threw exception ' + exception); + else if (isResultCorrect(_av, _bv)) { + if (!quiet) { + testPassed(_a + ' is ' + _b); + } + } else if (typeof(_av) == typeof(_bv)) + testFailed(_a + ' should be ' + _bv + '. Was ' + stringify(_av) + '.'); + else + testFailed(_a + ' should be ' + _bv + ' (of type ' + typeof _bv + '). Was ' + + _av + ' (of type ' + typeof _av + ').'); +} + +// Execute condition every 5 milliseconds until it succeed or failureTime is reached. +// completionHandler is executed on success, failureHandler is executed on timeout. +function _waitForCondition(condition, failureTime, completionHandler, failureHandler) +{ + if (condition()) { + completionHandler(); + } else if (Date.now() > failureTime) { + failureHandler(); + } else { + setTimeout(_waitForCondition, 5, condition, failureTime, completionHandler, failureHandler); + } +} + +function shouldBecomeEqual(_a, _b, completionHandler, timeout) +{ + if (typeof _a != 'string' || typeof _b != 'string') + debug('WARN: shouldBecomeEqual() expects string arguments'); + + if (timeout === undefined) + timeout = 500; + + var condition = function() { + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + var _bv = eval(_b); + if (exception) + testFailed(_a + ' should become ' + _bv + '. Threw exception ' + exception); + if (isResultCorrect(_av, _bv)) { + testPassed(_a + ' became ' + _b); + return true; + } + return false; + }; + var failureTime = Date.now() + timeout; + var failureHandler = function() { + testFailed(_a + ' failed to change to ' + _b + ' in ' + (timeout / 1000) + ' seconds.'); + completionHandler(); + }; + _waitForCondition(condition, failureTime, completionHandler, failureHandler); +} + +function shouldBecomeEqualToString(value, reference, completionHandler, timeout) +{ + if (typeof value !== 'string' || typeof reference !== 'string') + debug('WARN: shouldBecomeEqualToString() expects string arguments'); + var unevaledString = JSON.stringify(reference); + shouldBecomeEqual(value, unevaledString, completionHandler, timeout); +} + +function shouldBeType(_a, _type) { + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + + var _typev = eval(_type); + if (_av instanceof _typev) { + testPassed(_a + ' is an instance of ' + _type); + } else { + testFailed(_a + ' is not an instance of ' + _type); + } +} + +// Variant of shouldBe()--confirms that result of eval(_to_eval) is within +// numeric _tolerance of numeric _target. +function shouldBeCloseTo(_to_eval, _target, _tolerance, quiet) +{ + if (typeof _to_eval != 'string') { + testFailed('shouldBeCloseTo() requires string argument _to_eval. was type ' + typeof _to_eval); + return; + } + if (typeof _target != 'number') { + testFailed('shouldBeCloseTo() requires numeric argument _target. was type ' + typeof _target); + return; + } + if (typeof _tolerance != 'number') { + testFailed('shouldBeCloseTo() requires numeric argument _tolerance. was type ' + + typeof _tolerance); + return; + } + + var _result; + try { + _result = eval(_to_eval); + } catch (e) { + testFailed(_to_eval + ' should be within ' + _tolerance + ' of ' + + _target + '. Threw exception ' + e); + return; + } + + if (typeof(_result) != typeof(_target)) { + testFailed(_to_eval + ' should be of type ' + typeof _target + + ' but was of type ' + typeof _result); + } else if (Math.abs(_result - _target) <= _tolerance) { + if (!quiet) { + testPassed(_to_eval + ' is within ' + _tolerance + ' of ' + _target); + } + } else { + testFailed(_to_eval + ' should be within ' + _tolerance + ' of ' + _target + + '. Was ' + _result + '.'); + } +} + +function shouldNotBe(_a, _b, quiet) +{ + if (typeof _a != 'string' || typeof _b != 'string') + debug('WARN: shouldNotBe() expects string arguments'); + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + var _bv = eval(_b); + + if (exception) + testFailed(_a + ' should not be ' + _bv + '. Threw exception ' + exception); + else if (!isResultCorrect(_av, _bv)) { + if (!quiet) { + testPassed(_a + ' is not ' + _b); + } + } else + testFailed(_a + ' should not be ' + _bv + '.'); +} + +function shouldBecomeDifferent(_a, _b, completionHandler, timeout) +{ + if (typeof _a != 'string' || typeof _b != 'string') + debug('WARN: shouldBecomeDifferent() expects string arguments'); + if (timeout === undefined) + timeout = 500; + + var condition = function() { + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + var _bv = eval(_b); + if (exception) + testFailed(_a + ' should became not equal to ' + _bv + '. Threw exception ' + exception); + if (!isResultCorrect(_av, _bv)) { + testPassed(_a + ' became different from ' + _b); + return true; + } + return false; + }; + var failureTime = Date.now() + timeout; + var failureHandler = function() { + testFailed(_a + ' did not become different from ' + + _b + ' in ' + (timeout / 1000) + ' seconds.'); + completionHandler(); + }; + _waitForCondition(condition, failureTime, completionHandler, failureHandler); +} + +function shouldBeTrue(_a) { shouldBe(_a, 'true'); } +function shouldBeTrueQuiet(_a) { shouldBe(_a, 'true', true); } +function shouldBeFalse(_a) { shouldBe(_a, 'false'); } +function shouldBeNaN(_a) { shouldBe(_a, 'NaN'); } +function shouldBeNull(_a) { shouldBe(_a, 'null'); } +function shouldBeZero(_a) { shouldBe(_a, '0'); } + +function shouldBeEqualToString(a, b) +{ + if (typeof a !== 'string' || typeof b !== 'string') + debug('WARN: shouldBeEqualToString() expects string arguments'); + var unevaledString = JSON.stringify(b); + shouldBe(a, unevaledString); +} + +function shouldBeEmptyString(_a) { shouldBeEqualToString(_a, ''); } + +function shouldEvaluateTo(actual, expected) { + // A general-purpose comparator. 'actual' should be a string to be + // evaluated, as for shouldBe(). 'expected' may be any type and will be + // used without being eval'ed. + if (expected == null) { + // Do this before the object test, since null is of type 'object'. + shouldBeNull(actual); + } else if (typeof expected == 'undefined') { + shouldBeUndefined(actual); + } else if (typeof expected == 'function') { + // All this fuss is to avoid the string-arg warning from shouldBe(). + try { + actualValue = eval(actual); + } catch (e) { + testFailed('Evaluating ' + actual + ': Threw exception ' + e); + return; + } + shouldBe("'" + actualValue.toString().replace(/\n/g, '') + "'", + "'" + expected.toString().replace(/\n/g, '') + "'"); + } else if (typeof expected == 'object') { + shouldBeTrue(actual + " == '" + expected + "'"); + } else if (typeof expected == 'string') { + shouldBe(actual, expected); + } else if (typeof expected == 'boolean') { + shouldBe('typeof ' + actual, "'boolean'"); + if (expected) + shouldBeTrue(actual); + else + shouldBeFalse(actual); + } else if (typeof expected == 'number') { + shouldBe(actual, stringify(expected)); + } else { + debug(expected + ' is unknown type ' + typeof expected); + shouldBeTrue(actual, "'" + expected.toString() + "'"); + } +} + +function shouldBeNonZero(_a) +{ + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + + if (exception) + testFailed(_a + ' should be non-zero. Threw exception ' + exception); + else if (_av != 0) + testPassed(_a + ' is non-zero.'); + else + testFailed(_a + ' should be non-zero. Was ' + _av); +} + +function shouldBeNonNull(_a) +{ + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + + if (exception) + testFailed(_a + ' should be non-null. Threw exception ' + exception); + else if (_av != null) + testPassed(_a + ' is non-null.'); + else + testFailed(_a + ' should be non-null. Was ' + _av); +} + +function shouldBeUndefined(_a) +{ + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + + if (exception) + testFailed(_a + ' should be undefined. Threw exception ' + exception); + else if (typeof _av == 'undefined') + testPassed(_a + ' is undefined.'); + else + testFailed(_a + ' should be undefined. Was ' + _av); +} + +function shouldBeDefined(_a) +{ + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + + if (exception) + testFailed(_a + ' should be defined. Threw exception ' + exception); + else if (_av !== undefined) + testPassed(_a + ' is defined.'); + else + testFailed(_a + ' should be defined. Was ' + _av); +} + +function shouldBeGreaterThanOrEqual(_a, _b) { + if (typeof _a != 'string' || typeof _b != 'string') + debug('WARN: shouldBeGreaterThanOrEqual expects string arguments'); + + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + var _bv = eval(_b); + + if (exception) + testFailed(_a + ' should be >= ' + _b + '. Threw exception ' + exception); + else if (typeof _av == 'undefined' || _av < _bv) + testFailed(_a + ' should be >= ' + _b + '. Was ' + _av + ' (of type ' + typeof _av + ').'); + else + testPassed(_a + ' is >= ' + _b); +} + +function shouldNotThrow(_a) { + try { + eval(_a); + testPassed(_a + ' did not throw exception.'); + } catch (e) { + testFailed(_a + ' should not throw exception. Threw exception ' + e + '.'); + } +} + +function shouldThrow(_a, _e) +{ + var exception; + var _av; + try { + _av = eval(_a); + } catch (e) { + exception = e; + } + + var _ev; + if (_e) + _ev = eval(_e); + + if (exception) { + // Handle WebAPIException and WebAPIError. + if (exception instanceof tizen.WebAPIException || exception instanceof tizen.WebAPIError) { + exception = exception.name; + _ev = _ev.name; + } + + if (typeof _e == 'undefined' || exception == _ev) + testPassed(_a + ' threw exception ' + exception + '.'); + else + testFailed(_a + ' should throw ' + (typeof _e == 'undefined' ? 'an exception' : _ev) + + '. Threw exception ' + exception + '.'); + } else if (typeof _av == 'undefined') { + testFailed(_a + ' should throw ' + (typeof _e == 'undefined' ? 'an exception' : _ev) + + '. Was undefined.'); + } else { + testFailed(_a + ' should throw ' + (typeof _e == 'undefined' ? 'an exception' : _ev) + + '. Was ' + _av + '.'); + } +} + +function shouldHaveHadError(message) +{ + if (errorMessage) { + if (!message) + testPassed('Got expected error'); + else if (errorMessage.indexOf(message) !== -1) + testPassed("Got expected error: '" + message + "'"); + else + testFailed("Unexpexted error '" + message + "'"); + } else + testFailed('Missing expexted error'); + errorMessage = undefined; +} + +function isSuccessfullyParsed() +{ + // FIXME: Remove this and only report unexpected syntax errors. + if (!errorMessage) + successfullyParsed = true; + shouldBeTrue('successfullyParsed'); + debug('<br /><span class="pass">TEST COMPLETE</span>'); +} + +function finishJSTest() +{ + wasFinishJSTestCalled = true; + if (!self.wasPostTestScriptParsed) + return; + isSuccessfullyParsed(); +} diff --git a/xwalk/vehicle.cc b/xwalk/vehicle.cc index 3eda44ef..2fa2fb65 100644 --- a/xwalk/vehicle.cc +++ b/xwalk/vehicle.cc @@ -289,9 +289,38 @@ static void SignalCallback(GDBusConnection* connection, Vehicle::Vehicle(common::Instance* instance) : main_loop_(g_main_loop_new(0, FALSE)), thread_(Vehicle::SetupMainloop, this), - instance_(instance) { + instance_(instance), + manager_proxy_(nullptr){ CallbackInfo::instance = instance_; thread_.detach(); + + GError* error = nullptr; + + dbus_connection_ = amb::make_super(g_bus_get_sync(G_BUS_TYPE_SYSTEM, + nullptr, + &error)); + + auto errorPtr = amb::make_super(error); + if (errorPtr) { + DebugOut(DebugOut::Error) << "getting bus: " + << errorPtr->message << std::endl; + } + + GError* error_manager = nullptr; + manager_proxy_ = amb::make_super(g_dbus_proxy_new_sync(dbus_connection_.get(), + G_DBUS_PROXY_FLAGS_NONE, NULL, + amb_service, + "/", + "org.automotive.Manager", + NULL, + &error)); + + auto error_ptr = amb::make_super(error_manager); + + if (error_ptr) { + DebugOut(DebugOut::Error) << "calling GetAutomotiveManager: " + << error_ptr->message << endl; + } } Vehicle::~Vehicle() { @@ -348,16 +377,10 @@ void Vehicle::Get(const std::string& property, Zone::Type zone, double ret_id) { } void Vehicle::GetZones(const std::string& object_name, double ret_id) { - auto manager_proxy = amb::make_super(GetAutomotiveManager()); - - if (!manager_proxy) { - return; - } - GError* error(nullptr); auto zones_variant = amb::make_super( - g_dbus_proxy_call_sync(manager_proxy.get(), + g_dbus_proxy_call_sync(manager_proxy_.get(), "ZonesForObjectName", g_variant_new("(s)", object_name.c_str()), @@ -411,35 +434,29 @@ void Vehicle::GetZones(const std::string& object_name, double ret_id) { } std::string Vehicle::FindProperty(const std::string& object_name, int zone, std::string& error_str) { - GDBusProxy* manager_proxy = GetAutomotiveManager(); - - if (!manager_proxy) { - return ""; - } - GError* error(nullptr); auto object_path_variant = amb::make_super( - g_dbus_proxy_call_sync(manager_proxy, - "FindObjectForZone", - g_variant_new("(si)", - object_name.c_str(), - zone), - G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error)); + g_dbus_proxy_call_sync(manager_proxy_.get(), + "FindObjectForZone", + g_variant_new("(si)", + object_name.c_str(), + zone), + G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error)); auto error_ptr = amb::make_super(error); if (error_ptr) { - DebugOut() << "error calling FindObjectForZone: " - << error_ptr->message << endl; + DebugOut() << "error calling FindObjectForZone: " + << error_ptr->message << endl; - DebugOut() << "Could not find object in zone: " << zone << endl; - return ""; + DebugOut() << "Could not find object in zone: " << zone << endl; + return ""; } if (!object_path_variant) { - DebugOut() << "Could not find object in zone: " << zone << endl; - return ""; + DebugOut() << "Could not find object in zone: " << zone << endl; + return ""; } gchar* obj_path = nullptr; @@ -453,29 +470,6 @@ std::string Vehicle::FindProperty(const std::string& object_name, int zone, std: return obj_path; } -GDBusProxy* Vehicle::GetAutomotiveManager() { - if (manager_proxy_) - return manager_proxy_.get(); - - GError* error = nullptr; - manager_proxy_ = amb::make_super(g_dbus_proxy_new_sync(dbus_connection_.get(), - G_DBUS_PROXY_FLAGS_NONE, NULL, - amb_service, - "/", - "org.automotive.Manager", - NULL, - &error)); - - auto error_ptr = amb::make_super(error); - - if (error_ptr) { - DebugOut() << "error calling GetAutomotiveManager: " - << error_ptr->message << endl; - } - - return manager_proxy_.get(); -} - void Vehicle::SetupMainloop(void* data) { Vehicle* self = reinterpret_cast<Vehicle*>(data); GMainContext* ctx = g_main_context_default(); @@ -507,14 +501,14 @@ void Vehicle::Subscribe(const std::string& object_name, Zone::Type zone) { GError* proxy_error = nullptr; auto properties_proxy = - amb::make_super(g_dbus_proxy_new_sync(dbus_connection_.get(), - G_DBUS_PROXY_FLAGS_NONE, - NULL, - amb_service, - object_path.c_str(), - prop_iface, - NULL, - &proxy_error)); + amb::make_super(g_dbus_proxy_new_sync(dbus_connection_.get(), + G_DBUS_PROXY_FLAGS_NONE, + NULL, + amb_service, + object_path.c_str(), + prop_iface, + NULL, + &proxy_error)); auto proxy_error_ptr = amb::make_super(proxy_error); @@ -635,6 +629,7 @@ void Vehicle::Set(const std::string &object_name, picojson::object value, if (proxy_error_ptr) { DebugOut(DebugOut::Error) << "Error creating property proxy for " << object_path << std::endl; + PostError(&callback, vehicle_error_unknown); return; } @@ -680,6 +675,7 @@ void Vehicle::Set(const std::string &object_name, picojson::object value, if (!v) { DebugOut(DebugOut::Error) << "Error converting value to GVariant" << endl; PostError(&callback, vehicle_error_unknown); + return; } GError* set_error = nullptr; @@ -701,6 +697,7 @@ void Vehicle::Set(const std::string &object_name, picojson::object value, { DebugOut(DebugOut::Error) << "permission denied" << endl; PostError(&callback, vehicle_error_permission_denied); + return; } PostError(&callback, vehicle_error_unknown); return; diff --git a/xwalk/vehicle.h b/xwalk/vehicle.h index 63eebd43..1b638457 100644 --- a/xwalk/vehicle.h +++ b/xwalk/vehicle.h @@ -73,7 +73,6 @@ class Vehicle { private: std::string FindProperty(const std::string& object_name, int zone, string &error_str); - GDBusProxy* GetAutomotiveManager(); static void SetupMainloop(void* data); GMainLoop* main_loop_; diff --git a/xwalk/vehicle.html b/xwalk/vehicle.html index b4eecf7c..474b5f3d 100644 --- a/xwalk/vehicle.html +++ b/xwalk/vehicle.html @@ -3,19 +3,29 @@ <body> <pre id="console"></pre> +<script src="js/js-test-pre.js"></script> <script> -function debug(stuff) { - console.log(stuff); -} - vehicle = navigator.vehicle; -debug('vehicle.vehicleSpeed ' + vehicle.vehicleSpeed); +function get(objName) { + + vehicle[objName].get().then(function(data) { + try { + debug("get " + objName + ": " + JSON.stringify(data)); + } catch(error) { + debug("error " + error.message); + } + }, + function(error) { + debug("error getting " + objName + ": " + error.message); + }); +} +debug("testing zones..."); var zone = new Zone; -console.log('Driver zone: ' + zone.driver.value); +debug('Driver zone: ' + zone.driver.value); var zone1 = new Zone(["Front", "Left"]); var zone2 = new Zone(["Left", "Front"]); @@ -27,19 +37,8 @@ debug("zone1 == zone3 ? " + zone1.equals(zone3)); debug("zone1 == zone1 ? " + zone1.equals(zone1)); debug("zone1 == empty zone ? " + zone1.equals(zone4)); -vehicle.vehicleSpeed.get().then(function(vehicleSpeed) { - try { - console.log("vehicle speed " + JSON.stringify(vehicleSpeed)); - debug("Vehicle speed: " + vehicleSpeed.speed); - } catch(error) { - console.log("error " + error.message); - } -}, -function(error) { - debug("There was an error"); -}); +debug("testing subscribe()"); -//test subscribe: var subReplies = 0; var handle = vehicle.vehicleSpeed.subscribe(function(data) { console.log("got subscribe callback"); @@ -52,10 +51,68 @@ var handle = vehicle.vehicleSpeed.subscribe(function(data) { } }); -//test errors: +debug("test invalid zone error"); vehicle.vehicleSpeed.get("invalidzone").then(function() { }, function(error) { debug("Invalid zone: " + error.message); }); +///test set() +debug("testing set()"); + +vehicle.lightStatus.set({"fog" : false}).then(function() { + debug("set success!"); +}, function(error) { + debug("set fail! " + error.message); +}); + +debug("testing running status api's"); +debug("vehicle.vehicleSpeed " + vehicle.vehicleSpeed); +debug("vehicle.engineSpeed " + vehicle.engineSpeed); +debug("vehicle.powertrainTorque " + vehicle.powertrainTorque); +debug("vehicle.acceleratorPedalPosition " + vehicle.acceleratorPedalPosition); +debug("vehicle.throttlePosition " + vehicle.throttlePosition); +debug("vehicle.transmission " + vehicle.transmission); +debug("vehicle.cruiseControlStatus " + vehicle.cruiseControlStatus); +debug("vehicle.lightStatus " + vehicle.lightStatus); +debug("vehicle.horn " + vehicle.horn); +debug("vehicle.chime " + vehicle.chime); +debug("vehicle.fuel " + vehicle.fuel); +debug("vehicle.engineOil " + vehicle.engineOil); +debug("vehicle.acceleration " + vehicle.acceleration); +debug("vehicle.engineCoolant " + vehicle.engineCoolant); +debug("vehicle.steeringWheel " + vehicle.steeringWheel); +debug("vehicle.wheelTick " + vehicle.wheelTick); +debug("vehicle.ignitionTime " + vehicle.ignitionTime); +debug("vehicle.yawRate " + vehicle.yawRate); +debug("vehicle.brakeOperation " + vehicle.brakeOperation); +debug("vehicle.buttonEvent " + vehicle.buttonEvent); +debug("vehicle.nightMode " + vehicle.nightMode); +debug("vehicle.drivingMode " + vehicle.drivingMode); + +debug("getting data from running status attributes"); + +get("vehicleSpeed"); +get("engineSpeed"); +get("powertrainTorque"); +get("acceleratorPedalPosition"); +get("throttlePosition"); +get("transmission"); +get("cruiseControlStatus"); +get("lightStatus"); +get("horn"); +get("chime"); +get("fuel"); +get("engineOil"); +get("acceleration"); +get("engineCoolant"); +get("steeringWheel"); +get("wheelTick"); +get("ignitionTime"); +get("yawRate"); +get("brakeOperation"); +get("nightMode"); +get("drivingMode"); + </script> +<script src="js/js-test-post.js"></script> </body> </html> diff --git a/xwalk/vehicle_api.cc b/xwalk/vehicle_api.cc index aaeb6a06..0567dd42 100644 --- a/xwalk/vehicle_api.cc +++ b/xwalk/vehicle_api.cc @@ -1,2 +1,2 @@ extern const char kSource_vehicle_api[]; -const char kSource_vehicle_api[] = { 47, 47, 32, 67, 111, 112, 121, 114, 105, 103, 104, 116, 32, 40, 99, 41, 32, 50, 48, 49, 52, 32, 73, 110, 116, 101, 108, 32, 67, 111, 114, 112, 111, 114, 97, 116, 105, 111, 110, 46, 32, 65, 108, 108, 32, 114, 105, 103, 104, 116, 115, 32, 114, 101, 115, 101, 114, 118, 101, 100, 46, 10, 47, 47, 32, 85, 115, 101, 32, 111, 102, 32, 116, 104, 105, 115, 32, 115, 111, 117, 114, 99, 101, 32, 99, 111, 100, 101, 32, 105, 115, 32, 103, 111, 118, 101, 114, 110, 101, 100, 32, 98, 121, 32, 97, 32, 66, 83, 68, 45, 115, 116, 121, 108, 101, 32, 108, 105, 99, 101, 110, 115, 101, 32, 116, 104, 97, 116, 32, 99, 97, 110, 32, 98, 101, 10, 47, 47, 32, 102, 111, 117, 110, 100, 32, 105, 110, 32, 116, 104, 101, 32, 76, 73, 67, 69, 78, 83, 69, 32, 102, 105, 108, 101, 46, 10, 10, 118, 97, 114, 32, 110, 101, 120, 116, 95, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 95, 105, 100, 32, 61, 32, 48, 59, 10, 118, 97, 114, 32, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 115, 32, 61, 32, 123, 125, 59, 10, 10, 118, 97, 114, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 32, 61, 32, 91, 93, 59, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 118, 101, 104, 105, 99, 108, 101, 73, 110, 116, 101, 114, 102, 97, 99, 101, 67, 111, 109, 109, 111, 110, 67, 111, 110, 116, 114, 117, 99, 116, 111, 114, 40, 111, 98, 106, 44, 32, 97, 116, 116, 110, 97, 109, 101, 41, 32, 123, 10, 32, 32, 111, 98, 106, 46, 97, 116, 116, 114, 105, 98, 117, 116, 101, 78, 97, 109, 101, 32, 61, 32, 97, 116, 116, 110, 97, 109, 101, 59, 10, 10, 32, 32, 118, 97, 114, 32, 109, 115, 103, 32, 61, 32, 123, 125, 59, 10, 32, 32, 109, 115, 103, 91, 39, 109, 101, 116, 104, 111, 100, 39, 93, 32, 61, 32, 39, 122, 111, 110, 101, 115, 39, 59, 10, 32, 32, 109, 115, 103, 91, 39, 110, 97, 109, 101, 39, 93, 32, 61, 32, 111, 98, 106, 46, 97, 116, 116, 114, 105, 98, 117, 116, 101, 78, 97, 109, 101, 59, 10, 10, 32, 32, 111, 98, 106, 46, 95, 122, 111, 110, 101, 115, 32, 61, 32, 110, 101, 119, 32, 90, 111, 110, 101, 59, 10, 10, 32, 32, 118, 97, 114, 32, 99, 97, 108, 108, 32, 61, 32, 110, 101, 119, 32, 65, 115, 121, 110, 99, 67, 97, 108, 108, 40, 102, 117, 110, 99, 116, 105, 111, 110, 40, 100, 97, 116, 97, 41, 32, 123, 10, 32, 32, 32, 32, 111, 98, 106, 46, 95, 122, 111, 110, 101, 115, 32, 61, 32, 100, 97, 116, 97, 59, 10, 32, 32, 125, 41, 59, 10, 10, 32, 32, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 115, 91, 110, 101, 120, 116, 95, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 95, 105, 100, 93, 32, 61, 32, 99, 97, 108, 108, 59, 10, 32, 32, 109, 115, 103, 46, 97, 115, 121, 110, 99, 67, 97, 108, 108, 73, 100, 32, 61, 32, 110, 101, 120, 116, 95, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 95, 105, 100, 59, 10, 32, 32, 43, 43, 110, 101, 120, 116, 95, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 95, 105, 100, 59, 10, 10, 32, 32, 101, 120, 116, 101, 110, 115, 105, 111, 110, 46, 112, 111, 115, 116, 77, 101, 115, 115, 97, 103, 101, 40, 74, 83, 79, 78, 46, 115, 116, 114, 105, 110, 103, 105, 102, 121, 40, 109, 115, 103, 41, 41, 59, 10, 10, 32, 32, 79, 98, 106, 101, 99, 116, 46, 100, 101, 102, 105, 110, 101, 80, 114, 111, 112, 101, 114, 116, 121, 40, 111, 98, 106, 44, 32, 39, 122, 111, 110, 101, 115, 39, 44, 32, 123, 32, 103, 101, 116, 58, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 41, 32, 123, 32, 114, 101, 116, 117, 114, 110, 32, 111, 98, 106, 46, 95, 122, 111, 110, 101, 115, 32, 125, 32, 125, 41, 59, 10, 125, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 86, 101, 104, 105, 99, 108, 101, 73, 110, 116, 101, 114, 102, 97, 99, 101, 40, 97, 116, 116, 110, 97, 109, 101, 41, 32, 123, 10, 32, 32, 118, 101, 104, 105, 99, 108, 101, 73, 110, 116, 101, 114, 102, 97, 99, 101, 67, 111, 109, 109, 111, 110, 67, 111, 110, 116, 114, 117, 99, 116, 111, 114, 40, 116, 104, 105, 115, 44, 32, 97, 116, 116, 110, 97, 109, 101, 41, 59, 10, 125, 10, 10, 86, 101, 104, 105, 99, 108, 101, 73, 110, 116, 101, 114, 102, 97, 99, 101, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 103, 101, 116, 32, 61, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 122, 111, 110, 101, 41, 32, 123, 10, 32, 32, 118, 97, 114, 32, 109, 115, 103, 32, 61, 32, 123, 125, 59, 10, 32, 32, 109, 115, 103, 91, 39, 109, 101, 116, 104, 111, 100, 39, 93, 32, 61, 32, 39, 103, 101, 116, 39, 59, 10, 32, 32, 109, 115, 103, 91, 39, 110, 97, 109, 101, 39, 93, 32, 61, 32, 116, 104, 105, 115, 46, 97, 116, 116, 114, 105, 98, 117, 116, 101, 78, 97, 109, 101, 59, 10, 32, 32, 109, 115, 103, 91, 39, 122, 111, 110, 101, 39, 93, 32, 61, 32, 122, 111, 110, 101, 59, 10, 10, 32, 32, 114, 101, 116, 117, 114, 110, 32, 99, 114, 101, 97, 116, 101, 80, 114, 111, 109, 105, 115, 101, 40, 109, 115, 103, 41, 59, 10, 125, 59, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 73, 110, 116, 101, 114, 102, 97, 99, 101, 40, 97, 116, 116, 110, 97, 109, 101, 41, 32, 123, 10, 32, 32, 118, 101, 104, 105, 99, 108, 101, 73, 110, 116, 101, 114, 102, 97, 99, 101, 67, 111, 109, 109, 111, 110, 67, 111, 110, 116, 114, 117, 99, 116, 111, 114, 40, 116, 104, 105, 115, 44, 32, 97, 116, 116, 110, 97, 109, 101, 41, 59, 10, 125, 10, 10, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 73, 110, 116, 101, 114, 102, 97, 99, 101, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 32, 61, 32, 86, 101, 104, 105, 99, 108, 101, 73, 110, 116, 101, 114, 102, 97, 99, 101, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 59, 10, 10, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 73, 110, 116, 101, 114, 102, 97, 99, 101, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 115, 117, 98, 115, 99, 114, 105, 98, 101, 32, 61, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 99, 97, 108, 108, 98, 97, 99, 107, 44, 32, 122, 111, 110, 101, 41, 32, 123, 10, 32, 32, 105, 102, 32, 40, 33, 122, 111, 110, 101, 41, 32, 122, 111, 110, 101, 32, 61, 32, 110, 101, 119, 32, 90, 111, 110, 101, 40, 41, 59, 10, 10, 32, 32, 118, 97, 114, 32, 109, 115, 103, 32, 61, 32, 123, 125, 59, 10, 32, 32, 109, 115, 103, 91, 39, 109, 101, 116, 104, 111, 100, 39, 93, 32, 61, 32, 39, 115, 117, 98, 115, 99, 114, 105, 98, 101, 39, 59, 10, 32, 32, 109, 115, 103, 91, 39, 110, 97, 109, 101, 39, 93, 32, 61, 32, 116, 104, 105, 115, 46, 97, 116, 116, 114, 105, 98, 117, 116, 101, 78, 97, 109, 101, 59, 10, 32, 32, 109, 115, 103, 91, 39, 122, 111, 110, 101, 39, 93, 32, 61, 32, 122, 111, 110, 101, 59, 10, 10, 32, 32, 101, 120, 116, 101, 110, 115, 105, 111, 110, 46, 112, 111, 115, 116, 77, 101, 115, 115, 97, 103, 101, 40, 74, 83, 79, 78, 46, 115, 116, 114, 105, 110, 103, 105, 102, 121, 40, 109, 115, 103, 41, 41, 59, 10, 10, 32, 32, 109, 115, 103, 91, 39, 99, 97, 108, 108, 98, 97, 99, 107, 39, 93, 32, 61, 32, 99, 97, 108, 108, 98, 97, 99, 107, 59, 10, 10, 32, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 46, 112, 117, 115, 104, 40, 109, 115, 103, 41, 59, 10, 10, 32, 32, 114, 101, 116, 117, 114, 110, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 46, 108, 101, 110, 103, 116, 104, 32, 45, 32, 49, 59, 10, 125, 59, 10, 10, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 73, 110, 116, 101, 114, 102, 97, 99, 101, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 117, 110, 115, 117, 98, 115, 99, 114, 105, 98, 101, 32, 61, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 104, 97, 110, 100, 108, 101, 41, 32, 123, 10, 32, 32, 118, 97, 114, 32, 111, 98, 106, 32, 61, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 91, 104, 97, 110, 100, 108, 101, 93, 59, 10, 32, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 46, 115, 112, 108, 105, 99, 101, 40, 104, 97, 110, 100, 108, 101, 44, 32, 49, 41, 59, 10, 10, 32, 32, 118, 97, 114, 32, 117, 110, 115, 117, 98, 115, 99, 114, 105, 98, 101, 32, 61, 32, 116, 114, 117, 101, 59, 10, 10, 32, 32, 102, 111, 114, 32, 40, 118, 97, 114, 32, 105, 32, 61, 32, 48, 59, 32, 105, 32, 60, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 46, 108, 101, 110, 103, 116, 104, 59, 32, 105, 43, 43, 41, 32, 123, 10, 32, 32, 32, 32, 118, 97, 114, 32, 116, 101, 115, 116, 79, 98, 106, 32, 61, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 91, 105, 93, 59, 10, 10, 32, 32, 32, 32, 105, 102, 32, 40, 116, 101, 115, 116, 79, 98, 106, 46, 110, 97, 109, 101, 32, 61, 61, 61, 32, 111, 98, 106, 46, 110, 97, 109, 101, 32, 38, 38, 32, 116, 101, 115, 116, 79, 98, 106, 46, 122, 111, 110, 101, 46, 101, 113, 117, 97, 108, 115, 40, 111, 98, 106, 46, 122, 111, 110, 101, 41, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 117, 110, 115, 117, 98, 115, 99, 114, 105, 98, 101, 32, 61, 32, 102, 97, 108, 115, 101, 59, 10, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 125, 10, 32, 32, 125, 10, 10, 32, 32, 105, 102, 32, 40, 117, 110, 115, 117, 98, 115, 99, 114, 105, 98, 101, 41, 32, 123, 10, 32, 32, 32, 32, 118, 97, 114, 32, 109, 115, 103, 32, 61, 32, 123, 125, 59, 10, 32, 32, 32, 32, 109, 115, 103, 91, 39, 109, 101, 116, 104, 111, 100, 39, 93, 32, 61, 32, 39, 117, 110, 115, 117, 98, 115, 99, 114, 105, 98, 101, 39, 59, 10, 32, 32, 32, 32, 109, 115, 103, 91, 39, 110, 97, 109, 101, 39, 93, 32, 61, 32, 116, 104, 105, 115, 46, 97, 116, 116, 114, 105, 98, 117, 116, 101, 78, 97, 109, 101, 59, 10, 32, 32, 32, 32, 109, 115, 103, 91, 39, 122, 111, 110, 101, 39, 93, 32, 61, 32, 111, 98, 106, 46, 122, 111, 110, 101, 59, 10, 10, 32, 32, 32, 32, 101, 120, 116, 101, 110, 115, 105, 111, 110, 46, 112, 111, 115, 116, 77, 101, 115, 115, 97, 103, 101, 40, 74, 83, 79, 78, 46, 115, 116, 114, 105, 110, 103, 105, 102, 121, 40, 109, 115, 103, 41, 41, 59, 10, 32, 32, 125, 10, 125, 59, 10, 10, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 73, 110, 116, 101, 114, 102, 97, 99, 101, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 115, 101, 116, 32, 61, 32, 102, 117, 110, 99, 116, 105, 111, 110, 32, 40, 118, 97, 108, 117, 101, 44, 32, 122, 111, 110, 101, 41, 32, 123, 10, 32, 32, 118, 97, 114, 32, 109, 115, 103, 32, 61, 32, 123, 125, 59, 10, 32, 32, 109, 115, 103, 91, 39, 109, 101, 116, 104, 111, 100, 39, 93, 32, 61, 32, 39, 115, 101, 116, 39, 59, 10, 32, 32, 109, 115, 103, 91, 39, 110, 97, 109, 101, 39, 93, 32, 61, 32, 116, 104, 105, 115, 46, 97, 116, 116, 114, 105, 98, 117, 116, 101, 78, 97, 109, 101, 59, 10, 32, 32, 109, 115, 103, 91, 39, 122, 111, 110, 101, 39, 93, 32, 61, 32, 122, 111, 110, 101, 59, 10, 32, 32, 109, 115, 103, 91, 39, 118, 97, 108, 117, 101, 39, 93, 32, 61, 32, 118, 97, 108, 117, 101, 59, 10, 10, 32, 32, 114, 101, 116, 117, 114, 110, 32, 99, 114, 101, 97, 116, 101, 80, 114, 111, 109, 105, 115, 101, 40, 109, 115, 103, 41, 59, 10, 125, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 65, 115, 121, 110, 99, 67, 97, 108, 108, 40, 114, 101, 115, 111, 108, 118, 101, 44, 32, 114, 101, 106, 101, 99, 116, 41, 32, 123, 10, 32, 32, 116, 104, 105, 115, 46, 114, 101, 115, 111, 108, 118, 101, 32, 61, 32, 114, 101, 115, 111, 108, 118, 101, 59, 10, 32, 32, 116, 104, 105, 115, 46, 114, 101, 106, 101, 99, 116, 32, 61, 32, 114, 101, 106, 101, 99, 116, 59, 10, 125, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 99, 114, 101, 97, 116, 101, 80, 114, 111, 109, 105, 115, 101, 40, 109, 115, 103, 41, 32, 123, 10, 32, 32, 118, 97, 114, 32, 112, 114, 111, 109, 105, 115, 101, 32, 61, 32, 110, 101, 119, 32, 80, 114, 111, 109, 105, 115, 101, 40, 102, 117, 110, 99, 116, 105, 111, 110, 40, 114, 101, 115, 111, 108, 118, 101, 44, 32, 114, 101, 106, 101, 99, 116, 41, 32, 123, 10, 32, 32, 32, 32, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 115, 91, 110, 101, 120, 116, 95, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 95, 105, 100, 93, 32, 61, 32, 110, 101, 119, 32, 65, 115, 121, 110, 99, 67, 97, 108, 108, 40, 114, 101, 115, 111, 108, 118, 101, 44, 32, 114, 101, 106, 101, 99, 116, 41, 59, 10, 32, 32, 125, 41, 59, 10, 10, 32, 32, 109, 115, 103, 46, 97, 115, 121, 110, 99, 67, 97, 108, 108, 73, 100, 32, 61, 32, 110, 101, 120, 116, 95, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 95, 105, 100, 59, 10, 32, 32, 101, 120, 116, 101, 110, 115, 105, 111, 110, 46, 112, 111, 115, 116, 77, 101, 115, 115, 97, 103, 101, 40, 74, 83, 79, 78, 46, 115, 116, 114, 105, 110, 103, 105, 102, 121, 40, 109, 115, 103, 41, 41, 59, 10, 32, 32, 43, 43, 110, 101, 120, 116, 95, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 95, 105, 100, 59, 10, 32, 32, 114, 101, 116, 117, 114, 110, 32, 112, 114, 111, 109, 105, 115, 101, 59, 10, 125, 10, 10, 119, 105, 110, 100, 111, 119, 46, 90, 111, 110, 101, 32, 61, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 122, 111, 110, 101, 41, 32, 123, 10, 32, 32, 116, 104, 105, 115, 46, 118, 97, 108, 117, 101, 32, 61, 32, 122, 111, 110, 101, 32, 63, 32, 122, 111, 110, 101, 32, 58, 32, 91, 93, 59, 10, 10, 32, 32, 79, 98, 106, 101, 99, 116, 46, 100, 101, 102, 105, 110, 101, 80, 114, 111, 112, 101, 114, 116, 121, 40, 116, 104, 105, 115, 44, 32, 39, 100, 114, 105, 118, 101, 114, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 123, 32, 101, 110, 117, 109, 101, 114, 97, 98, 108, 101, 58, 32, 102, 97, 108, 115, 101, 44, 32, 103, 101, 116, 58, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 110, 101, 119, 32, 90, 111, 110, 101, 40, 91, 39, 70, 114, 111, 110, 116, 39, 44, 32, 39, 76, 101, 102, 116, 39, 93, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 125, 32, 125, 41, 59, 10, 125, 59, 10, 10, 119, 105, 110, 100, 111, 119, 46, 90, 111, 110, 101, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 101, 113, 117, 97, 108, 115, 32, 61, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 122, 111, 110, 101, 41, 32, 123, 10, 32, 32, 118, 97, 114, 32, 105, 115, 95, 101, 113, 117, 97, 108, 32, 61, 32, 116, 114, 117, 101, 59, 10, 10, 32, 32, 102, 111, 114, 32, 40, 118, 97, 114, 32, 105, 32, 61, 32, 48, 59, 32, 105, 32, 60, 32, 122, 111, 110, 101, 46, 118, 97, 108, 117, 101, 46, 108, 101, 110, 103, 116, 104, 59, 32, 105, 43, 43, 41, 32, 123, 10, 32, 32, 32, 32, 105, 115, 95, 101, 113, 117, 97, 108, 32, 38, 61, 32, 116, 104, 105, 115, 46, 118, 97, 108, 117, 101, 46, 105, 110, 100, 101, 120, 79, 102, 40, 122, 111, 110, 101, 46, 118, 97, 108, 117, 101, 91, 105, 93, 41, 32, 33, 61, 61, 32, 45, 49, 59, 10, 32, 32, 125, 10, 10, 32, 32, 102, 111, 114, 32, 40, 118, 97, 114, 32, 105, 32, 61, 32, 48, 59, 32, 105, 32, 60, 32, 116, 104, 105, 115, 46, 118, 97, 108, 117, 101, 46, 108, 101, 110, 103, 116, 104, 59, 32, 105, 43, 43, 41, 32, 123, 10, 32, 32, 32, 32, 105, 115, 95, 101, 113, 117, 97, 108, 32, 38, 61, 32, 122, 111, 110, 101, 46, 118, 97, 108, 117, 101, 46, 105, 110, 100, 101, 120, 79, 102, 40, 116, 104, 105, 115, 46, 118, 97, 108, 117, 101, 91, 105, 93, 41, 32, 33, 61, 61, 32, 45, 49, 59, 10, 32, 32, 125, 10, 10, 32, 32, 114, 101, 116, 117, 114, 110, 32, 105, 115, 95, 101, 113, 117, 97, 108, 59, 10, 125, 59, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 80, 114, 111, 112, 101, 114, 116, 121, 40, 111, 98, 106, 44, 32, 112, 114, 111, 112, 41, 32, 123, 10, 32, 32, 79, 98, 106, 101, 99, 116, 46, 100, 101, 102, 105, 110, 101, 80, 114, 111, 112, 101, 114, 116, 121, 40, 111, 98, 106, 44, 32, 112, 114, 111, 112, 44, 32, 123, 32, 101, 110, 117, 109, 101, 114, 97, 98, 108, 101, 58, 32, 116, 114, 117, 101, 44, 32, 118, 97, 108, 117, 101, 58, 32, 110, 101, 119, 32, 86, 101, 104, 105, 99, 108, 101, 73, 110, 116, 101, 114, 102, 97, 99, 101, 40, 112, 114, 111, 112, 41, 32, 125, 41, 59, 10, 125, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 111, 98, 106, 44, 32, 112, 114, 111, 112, 41, 32, 123, 10, 32, 32, 79, 98, 106, 101, 99, 116, 46, 100, 101, 102, 105, 110, 101, 80, 114, 111, 112, 101, 114, 116, 121, 40, 111, 98, 106, 44, 32, 112, 114, 111, 112, 44, 32, 123, 32, 101, 110, 117, 109, 101, 114, 97, 98, 108, 101, 58, 32, 116, 114, 117, 101, 44, 32, 118, 97, 108, 117, 101, 58, 32, 110, 101, 119, 32, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 73, 110, 116, 101, 114, 102, 97, 99, 101, 40, 112, 114, 111, 112, 41, 32, 125, 41, 59, 10, 125, 10, 10, 101, 120, 116, 101, 110, 115, 105, 111, 110, 46, 115, 101, 116, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 40, 102, 117, 110, 99, 116, 105, 111, 110, 40, 106, 115, 111, 110, 41, 32, 123, 10, 32, 32, 116, 114, 121, 32, 123, 10, 32, 32, 32, 32, 118, 97, 114, 32, 109, 115, 103, 32, 61, 32, 74, 83, 79, 78, 46, 112, 97, 114, 115, 101, 40, 106, 115, 111, 110, 41, 59, 10, 10, 32, 32, 32, 32, 115, 119, 105, 116, 99, 104, 32, 40, 109, 115, 103, 46, 109, 101, 116, 104, 111, 100, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 103, 101, 116, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 104, 97, 110, 100, 108, 101, 80, 114, 111, 109, 105, 115, 101, 82, 101, 112, 108, 121, 40, 109, 115, 103, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 122, 111, 110, 101, 115, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 104, 97, 110, 100, 108, 101, 90, 111, 110, 101, 115, 82, 101, 112, 108, 121, 40, 109, 115, 103, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 115, 117, 98, 115, 99, 114, 105, 98, 101, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 104, 97, 110, 100, 108, 101, 83, 117, 98, 115, 99, 114, 105, 98, 101, 82, 101, 112, 108, 121, 40, 109, 115, 103, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 115, 101, 116, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 104, 97, 110, 100, 108, 101, 80, 114, 111, 109, 105, 115, 101, 82, 101, 112, 108, 121, 40, 109, 115, 103, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 100, 101, 102, 97, 117, 108, 116, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 125, 10, 32, 32, 125, 32, 99, 97, 116, 99, 104, 32, 40, 101, 114, 114, 111, 114, 41, 32, 123, 10, 32, 32, 32, 32, 99, 111, 110, 115, 111, 108, 101, 46, 108, 111, 103, 40, 39, 69, 114, 114, 111, 114, 32, 105, 110, 32, 109, 101, 115, 115, 97, 103, 101, 32, 108, 105, 115, 116, 101, 110, 101, 114, 58, 32, 39, 32, 43, 32, 101, 114, 114, 111, 114, 41, 59, 10, 32, 32, 125, 10, 125, 41, 59, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 104, 97, 110, 100, 108, 101, 80, 114, 111, 109, 105, 115, 101, 82, 101, 112, 108, 121, 40, 109, 115, 103, 41, 32, 123, 10, 32, 32, 118, 97, 114, 32, 99, 98, 111, 98, 106, 32, 61, 32, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 115, 91, 109, 115, 103, 46, 97, 115, 121, 110, 99, 67, 97, 108, 108, 73, 100, 93, 59, 10, 10, 32, 32, 105, 102, 32, 40, 109, 115, 103, 46, 101, 114, 114, 111, 114, 41, 32, 123, 10, 32, 32, 32, 32, 118, 97, 114, 32, 101, 114, 114, 111, 114, 32, 61, 32, 123, 125, 59, 10, 32, 32, 32, 32, 101, 114, 114, 111, 114, 46, 101, 114, 114, 111, 114, 32, 61, 32, 109, 115, 103, 46, 118, 97, 108, 117, 101, 59, 10, 32, 32, 32, 32, 115, 119, 105, 116, 99, 104, 32, 40, 109, 115, 103, 46, 118, 97, 108, 117, 101, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 112, 101, 114, 109, 105, 115, 115, 105, 111, 110, 95, 100, 101, 110, 105, 101, 100, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 101, 114, 114, 111, 114, 46, 109, 101, 115, 115, 97, 103, 101, 32, 61, 32, 39, 80, 101, 114, 109, 105, 115, 115, 105, 111, 110, 32, 100, 101, 110, 105, 101, 100, 39, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 105, 110, 118, 97, 108, 105, 100, 95, 111, 112, 101, 114, 97, 116, 105, 111, 110, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 101, 114, 114, 111, 114, 46, 109, 101, 115, 115, 97, 103, 101, 32, 61, 32, 39, 73, 110, 118, 97, 108, 105, 100, 32, 111, 112, 101, 114, 97, 116, 105, 111, 110, 39, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 116, 105, 109, 101, 111, 117, 116, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 101, 114, 114, 111, 114, 46, 109, 101, 115, 115, 97, 103, 101, 32, 61, 32, 39, 79, 112, 101, 114, 97, 116, 105, 111, 110, 32, 116, 105, 109, 101, 100, 32, 111, 117, 116, 39, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 105, 110, 118, 97, 108, 105, 100, 95, 122, 111, 110, 101, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 101, 114, 114, 111, 114, 46, 109, 101, 115, 115, 97, 103, 101, 32, 61, 32, 39, 90, 111, 110, 101, 32, 105, 110, 118, 97, 108, 105, 100, 32, 111, 114, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 39, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 117, 110, 107, 110, 111, 119, 110, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 101, 114, 114, 111, 114, 46, 109, 101, 115, 115, 97, 103, 101, 32, 61, 32, 39, 65, 110, 32, 117, 110, 107, 110, 111, 119, 110, 32, 101, 114, 114, 111, 114, 32, 111, 99, 99, 117, 114, 101, 100, 39, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 100, 101, 102, 97, 117, 108, 116, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 125, 10, 10, 32, 32, 32, 32, 99, 98, 111, 98, 106, 46, 114, 101, 106, 101, 99, 116, 40, 101, 114, 114, 111, 114, 41, 59, 10, 32, 32, 125, 32, 101, 108, 115, 101, 32, 123, 10, 32, 32, 32, 32, 99, 98, 111, 98, 106, 46, 114, 101, 115, 111, 108, 118, 101, 40, 109, 115, 103, 46, 118, 97, 108, 117, 101, 41, 59, 10, 32, 32, 125, 10, 10, 32, 32, 100, 101, 108, 101, 116, 101, 32, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 115, 91, 109, 115, 103, 46, 97, 115, 121, 110, 99, 67, 97, 108, 108, 73, 100, 93, 59, 10, 125, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 104, 97, 110, 100, 108, 101, 90, 111, 110, 101, 115, 82, 101, 112, 108, 121, 40, 109, 115, 103, 41, 32, 123, 10, 32, 32, 118, 97, 114, 32, 99, 98, 111, 98, 106, 32, 61, 32, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 115, 91, 109, 115, 103, 46, 97, 115, 121, 110, 99, 67, 97, 108, 108, 73, 100, 93, 59, 10, 10, 32, 32, 105, 102, 32, 40, 99, 98, 111, 98, 106, 41, 10, 32, 32, 32, 32, 99, 98, 111, 98, 106, 46, 114, 101, 115, 111, 108, 118, 101, 40, 110, 101, 119, 32, 90, 111, 110, 101, 40, 109, 115, 103, 46, 118, 97, 108, 117, 101, 41, 41, 59, 10, 125, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 104, 97, 110, 100, 108, 101, 83, 117, 98, 115, 99, 114, 105, 98, 101, 82, 101, 112, 108, 121, 40, 109, 115, 103, 41, 32, 123, 10, 32, 32, 100, 101, 108, 101, 116, 101, 32, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 115, 91, 109, 115, 103, 46, 97, 115, 121, 110, 99, 67, 97, 108, 108, 73, 100, 93, 59, 10, 32, 32, 118, 97, 114, 32, 118, 97, 108, 117, 101, 32, 61, 32, 109, 115, 103, 46, 118, 97, 108, 117, 101, 59, 10, 32, 32, 118, 97, 108, 117, 101, 46, 122, 111, 110, 101, 32, 61, 32, 110, 101, 119, 32, 90, 111, 110, 101, 40, 118, 97, 108, 117, 101, 46, 122, 111, 110, 101, 41, 59, 10, 10, 32, 32, 102, 111, 114, 32, 40, 118, 97, 114, 32, 105, 32, 61, 32, 48, 59, 32, 105, 32, 60, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 46, 108, 101, 110, 103, 116, 104, 59, 32, 105, 43, 43, 41, 32, 123, 10, 32, 32, 32, 32, 118, 97, 114, 32, 105, 116, 114, 32, 61, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 91, 105, 93, 59, 10, 32, 32, 32, 32, 118, 97, 114, 32, 105, 102, 97, 99, 101, 73, 115, 32, 61, 32, 40, 118, 97, 108, 117, 101, 46, 105, 110, 116, 101, 114, 102, 97, 99, 101, 78, 97, 109, 101, 46, 116, 111, 76, 111, 119, 101, 114, 67, 97, 115, 101, 40, 41, 32, 61, 61, 61, 32, 105, 116, 114, 46, 110, 97, 109, 101, 46, 116, 111, 76, 111, 119, 101, 114, 67, 97, 115, 101, 40, 41, 41, 59, 10, 32, 32, 32, 32, 105, 102, 32, 40, 105, 102, 97, 99, 101, 73, 115, 32, 61, 61, 61, 32, 116, 114, 117, 101, 32, 38, 38, 32, 118, 97, 108, 117, 101, 46, 122, 111, 110, 101, 46, 101, 113, 117, 97, 108, 115, 40, 105, 116, 114, 46, 122, 111, 110, 101, 41, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 105, 116, 114, 46, 99, 97, 108, 108, 98, 97, 99, 107, 40, 118, 97, 108, 117, 101, 41, 59, 10, 32, 32, 32, 32, 125, 10, 32, 32, 125, 10, 125, 10, 47, 47, 47, 32, 82, 117, 110, 110, 105, 110, 103, 115, 116, 97, 116, 117, 115, 32, 97, 116, 116, 114, 105, 98, 117, 116, 101, 115, 58, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 118, 101, 104, 105, 99, 108, 101, 83, 112, 101, 101, 100, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 101, 110, 103, 105, 110, 101, 83, 112, 101, 101, 100, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 112, 111, 119, 101, 114, 116, 114, 97, 105, 110, 84, 111, 114, 113, 117, 101, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 97, 99, 99, 101, 108, 101, 114, 97, 116, 111, 114, 80, 101, 100, 97, 108, 80, 111, 115, 105, 116, 105, 111, 110, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 116, 104, 114, 111, 116, 116, 108, 101, 80, 111, 115, 105, 116, 105, 111, 110, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 116, 114, 97, 110, 115, 109, 105, 115, 115, 105, 111, 110, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 99, 114, 117, 105, 115, 101, 67, 111, 110, 116, 114, 111, 108, 83, 116, 97, 116, 117, 115, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 108, 105, 103, 104, 116, 83, 116, 97, 116, 117, 115, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 104, 111, 114, 110, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 99, 104, 105, 109, 101, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 102, 117, 101, 108, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 101, 110, 103, 105, 110, 101, 79, 105, 108, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 97, 99, 99, 101, 108, 101, 114, 97, 116, 105, 111, 110, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 101, 110, 103, 105, 110, 101, 67, 111, 111, 108, 97, 110, 116, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 115, 116, 101, 101, 114, 105, 110, 103, 87, 104, 101, 101, 108, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 119, 104, 101, 101, 108, 84, 105, 99, 107, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 105, 103, 110, 105, 116, 105, 111, 110, 84, 105, 109, 101, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 121, 97, 119, 82, 97, 116, 101, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 98, 114, 97, 107, 101, 79, 112, 101, 114, 97, 116, 105, 111, 110, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 98, 117, 116, 116, 111, 110, 69, 118, 101, 110, 116, 39, 41, 59, 10, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 110, 105, 103, 104, 116, 77, 111, 100, 101, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 100, 114, 105, 118, 105, 110, 103, 77, 111, 100, 101, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 98, 114, 97, 107, 101, 79, 112, 101, 114, 97, 116, 105, 111, 110, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 116, 105, 114, 101, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 100, 111, 111, 114, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 100, 101, 102, 114, 111, 115, 116, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 99, 108, 105, 109, 97, 116, 101, 67, 111, 110, 116, 114, 111, 108, 39, 41, 59, 10, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 98, 97, 116, 116, 101, 114, 121, 83, 116, 97, 116, 117, 115, 39, 41, 59, 10, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 116, 101, 109, 112, 101, 114, 97, 116, 117, 114, 101, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 111, 100, 111, 109, 101, 116, 101, 114, 39, 41, 59, 10, 10, 10, 0 }; +const char kSource_vehicle_api[] = { 47, 47, 32, 67, 111, 112, 121, 114, 105, 103, 104, 116, 32, 40, 99, 41, 32, 50, 48, 49, 52, 32, 73, 110, 116, 101, 108, 32, 67, 111, 114, 112, 111, 114, 97, 116, 105, 111, 110, 46, 32, 65, 108, 108, 32, 114, 105, 103, 104, 116, 115, 32, 114, 101, 115, 101, 114, 118, 101, 100, 46, 10, 47, 47, 32, 85, 115, 101, 32, 111, 102, 32, 116, 104, 105, 115, 32, 115, 111, 117, 114, 99, 101, 32, 99, 111, 100, 101, 32, 105, 115, 32, 103, 111, 118, 101, 114, 110, 101, 100, 32, 98, 121, 32, 97, 32, 66, 83, 68, 45, 115, 116, 121, 108, 101, 32, 108, 105, 99, 101, 110, 115, 101, 32, 116, 104, 97, 116, 32, 99, 97, 110, 32, 98, 101, 10, 47, 47, 32, 102, 111, 117, 110, 100, 32, 105, 110, 32, 116, 104, 101, 32, 76, 73, 67, 69, 78, 83, 69, 32, 102, 105, 108, 101, 46, 10, 10, 118, 97, 114, 32, 110, 101, 120, 116, 95, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 95, 105, 100, 32, 61, 32, 48, 59, 10, 118, 97, 114, 32, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 115, 32, 61, 32, 123, 125, 59, 10, 10, 118, 97, 114, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 32, 61, 32, 91, 93, 59, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 118, 101, 104, 105, 99, 108, 101, 73, 110, 116, 101, 114, 102, 97, 99, 101, 67, 111, 109, 109, 111, 110, 67, 111, 110, 116, 114, 117, 99, 116, 111, 114, 40, 111, 98, 106, 44, 32, 97, 116, 116, 110, 97, 109, 101, 41, 32, 123, 10, 32, 32, 111, 98, 106, 46, 97, 116, 116, 114, 105, 98, 117, 116, 101, 78, 97, 109, 101, 32, 61, 32, 97, 116, 116, 110, 97, 109, 101, 59, 10, 10, 32, 32, 118, 97, 114, 32, 109, 115, 103, 32, 61, 32, 123, 125, 59, 10, 32, 32, 109, 115, 103, 91, 39, 109, 101, 116, 104, 111, 100, 39, 93, 32, 61, 32, 39, 122, 111, 110, 101, 115, 39, 59, 10, 32, 32, 109, 115, 103, 91, 39, 110, 97, 109, 101, 39, 93, 32, 61, 32, 111, 98, 106, 46, 97, 116, 116, 114, 105, 98, 117, 116, 101, 78, 97, 109, 101, 59, 10, 10, 32, 32, 111, 98, 106, 46, 95, 122, 111, 110, 101, 115, 32, 61, 32, 110, 101, 119, 32, 90, 111, 110, 101, 59, 10, 10, 32, 32, 118, 97, 114, 32, 99, 97, 108, 108, 32, 61, 32, 110, 101, 119, 32, 65, 115, 121, 110, 99, 67, 97, 108, 108, 40, 102, 117, 110, 99, 116, 105, 111, 110, 40, 100, 97, 116, 97, 41, 32, 123, 10, 32, 32, 32, 32, 111, 98, 106, 46, 95, 122, 111, 110, 101, 115, 32, 61, 32, 100, 97, 116, 97, 59, 10, 32, 32, 125, 41, 59, 10, 10, 32, 32, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 115, 91, 110, 101, 120, 116, 95, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 95, 105, 100, 93, 32, 61, 32, 99, 97, 108, 108, 59, 10, 32, 32, 109, 115, 103, 46, 97, 115, 121, 110, 99, 67, 97, 108, 108, 73, 100, 32, 61, 32, 110, 101, 120, 116, 95, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 95, 105, 100, 59, 10, 32, 32, 43, 43, 110, 101, 120, 116, 95, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 95, 105, 100, 59, 10, 10, 32, 32, 101, 120, 116, 101, 110, 115, 105, 111, 110, 46, 112, 111, 115, 116, 77, 101, 115, 115, 97, 103, 101, 40, 74, 83, 79, 78, 46, 115, 116, 114, 105, 110, 103, 105, 102, 121, 40, 109, 115, 103, 41, 41, 59, 10, 10, 32, 32, 79, 98, 106, 101, 99, 116, 46, 100, 101, 102, 105, 110, 101, 80, 114, 111, 112, 101, 114, 116, 121, 40, 111, 98, 106, 44, 32, 39, 122, 111, 110, 101, 115, 39, 44, 32, 123, 32, 103, 101, 116, 58, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 41, 32, 123, 32, 114, 101, 116, 117, 114, 110, 32, 111, 98, 106, 46, 95, 122, 111, 110, 101, 115, 32, 125, 32, 125, 41, 59, 10, 125, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 86, 101, 104, 105, 99, 108, 101, 73, 110, 116, 101, 114, 102, 97, 99, 101, 40, 97, 116, 116, 110, 97, 109, 101, 41, 32, 123, 10, 32, 32, 118, 101, 104, 105, 99, 108, 101, 73, 110, 116, 101, 114, 102, 97, 99, 101, 67, 111, 109, 109, 111, 110, 67, 111, 110, 116, 114, 117, 99, 116, 111, 114, 40, 116, 104, 105, 115, 44, 32, 97, 116, 116, 110, 97, 109, 101, 41, 59, 10, 125, 10, 10, 86, 101, 104, 105, 99, 108, 101, 73, 110, 116, 101, 114, 102, 97, 99, 101, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 103, 101, 116, 32, 61, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 122, 111, 110, 101, 41, 32, 123, 10, 32, 32, 118, 97, 114, 32, 109, 115, 103, 32, 61, 32, 123, 125, 59, 10, 32, 32, 109, 115, 103, 91, 39, 109, 101, 116, 104, 111, 100, 39, 93, 32, 61, 32, 39, 103, 101, 116, 39, 59, 10, 32, 32, 109, 115, 103, 91, 39, 110, 97, 109, 101, 39, 93, 32, 61, 32, 116, 104, 105, 115, 46, 97, 116, 116, 114, 105, 98, 117, 116, 101, 78, 97, 109, 101, 59, 10, 32, 32, 109, 115, 103, 91, 39, 122, 111, 110, 101, 39, 93, 32, 61, 32, 122, 111, 110, 101, 59, 10, 10, 32, 32, 114, 101, 116, 117, 114, 110, 32, 99, 114, 101, 97, 116, 101, 80, 114, 111, 109, 105, 115, 101, 40, 109, 115, 103, 41, 59, 10, 125, 59, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 73, 110, 116, 101, 114, 102, 97, 99, 101, 40, 97, 116, 116, 110, 97, 109, 101, 41, 32, 123, 10, 32, 32, 118, 101, 104, 105, 99, 108, 101, 73, 110, 116, 101, 114, 102, 97, 99, 101, 67, 111, 109, 109, 111, 110, 67, 111, 110, 116, 114, 117, 99, 116, 111, 114, 40, 116, 104, 105, 115, 44, 32, 97, 116, 116, 110, 97, 109, 101, 41, 59, 10, 125, 10, 10, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 73, 110, 116, 101, 114, 102, 97, 99, 101, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 32, 61, 32, 86, 101, 104, 105, 99, 108, 101, 73, 110, 116, 101, 114, 102, 97, 99, 101, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 59, 10, 10, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 73, 110, 116, 101, 114, 102, 97, 99, 101, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 115, 117, 98, 115, 99, 114, 105, 98, 101, 32, 61, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 99, 97, 108, 108, 98, 97, 99, 107, 44, 32, 122, 111, 110, 101, 41, 32, 123, 10, 32, 32, 105, 102, 32, 40, 33, 122, 111, 110, 101, 41, 32, 122, 111, 110, 101, 32, 61, 32, 110, 101, 119, 32, 90, 111, 110, 101, 40, 41, 59, 10, 10, 32, 32, 118, 97, 114, 32, 109, 115, 103, 32, 61, 32, 123, 125, 59, 10, 32, 32, 109, 115, 103, 91, 39, 109, 101, 116, 104, 111, 100, 39, 93, 32, 61, 32, 39, 115, 117, 98, 115, 99, 114, 105, 98, 101, 39, 59, 10, 32, 32, 109, 115, 103, 91, 39, 110, 97, 109, 101, 39, 93, 32, 61, 32, 116, 104, 105, 115, 46, 97, 116, 116, 114, 105, 98, 117, 116, 101, 78, 97, 109, 101, 59, 10, 32, 32, 109, 115, 103, 91, 39, 122, 111, 110, 101, 39, 93, 32, 61, 32, 122, 111, 110, 101, 59, 10, 10, 32, 32, 101, 120, 116, 101, 110, 115, 105, 111, 110, 46, 112, 111, 115, 116, 77, 101, 115, 115, 97, 103, 101, 40, 74, 83, 79, 78, 46, 115, 116, 114, 105, 110, 103, 105, 102, 121, 40, 109, 115, 103, 41, 41, 59, 10, 10, 32, 32, 109, 115, 103, 91, 39, 99, 97, 108, 108, 98, 97, 99, 107, 39, 93, 32, 61, 32, 99, 97, 108, 108, 98, 97, 99, 107, 59, 10, 10, 32, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 46, 112, 117, 115, 104, 40, 109, 115, 103, 41, 59, 10, 10, 32, 32, 114, 101, 116, 117, 114, 110, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 46, 108, 101, 110, 103, 116, 104, 32, 45, 32, 49, 59, 10, 125, 59, 10, 10, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 73, 110, 116, 101, 114, 102, 97, 99, 101, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 117, 110, 115, 117, 98, 115, 99, 114, 105, 98, 101, 32, 61, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 104, 97, 110, 100, 108, 101, 41, 32, 123, 10, 32, 32, 118, 97, 114, 32, 111, 98, 106, 32, 61, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 91, 104, 97, 110, 100, 108, 101, 93, 59, 10, 32, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 46, 115, 112, 108, 105, 99, 101, 40, 104, 97, 110, 100, 108, 101, 44, 32, 49, 41, 59, 10, 10, 32, 32, 118, 97, 114, 32, 117, 110, 115, 117, 98, 115, 99, 114, 105, 98, 101, 32, 61, 32, 116, 114, 117, 101, 59, 10, 10, 32, 32, 102, 111, 114, 32, 40, 118, 97, 114, 32, 105, 32, 61, 32, 48, 59, 32, 105, 32, 60, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 46, 108, 101, 110, 103, 116, 104, 59, 32, 105, 43, 43, 41, 32, 123, 10, 32, 32, 32, 32, 118, 97, 114, 32, 116, 101, 115, 116, 79, 98, 106, 32, 61, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 91, 105, 93, 59, 10, 10, 32, 32, 32, 32, 105, 102, 32, 40, 116, 101, 115, 116, 79, 98, 106, 46, 110, 97, 109, 101, 32, 61, 61, 61, 32, 111, 98, 106, 46, 110, 97, 109, 101, 32, 38, 38, 32, 116, 101, 115, 116, 79, 98, 106, 46, 122, 111, 110, 101, 46, 101, 113, 117, 97, 108, 115, 40, 111, 98, 106, 46, 122, 111, 110, 101, 41, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 117, 110, 115, 117, 98, 115, 99, 114, 105, 98, 101, 32, 61, 32, 102, 97, 108, 115, 101, 59, 10, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 125, 10, 32, 32, 125, 10, 10, 32, 32, 105, 102, 32, 40, 117, 110, 115, 117, 98, 115, 99, 114, 105, 98, 101, 41, 32, 123, 10, 32, 32, 32, 32, 118, 97, 114, 32, 109, 115, 103, 32, 61, 32, 123, 125, 59, 10, 32, 32, 32, 32, 109, 115, 103, 91, 39, 109, 101, 116, 104, 111, 100, 39, 93, 32, 61, 32, 39, 117, 110, 115, 117, 98, 115, 99, 114, 105, 98, 101, 39, 59, 10, 32, 32, 32, 32, 109, 115, 103, 91, 39, 110, 97, 109, 101, 39, 93, 32, 61, 32, 116, 104, 105, 115, 46, 97, 116, 116, 114, 105, 98, 117, 116, 101, 78, 97, 109, 101, 59, 10, 32, 32, 32, 32, 109, 115, 103, 91, 39, 122, 111, 110, 101, 39, 93, 32, 61, 32, 111, 98, 106, 46, 122, 111, 110, 101, 59, 10, 10, 32, 32, 32, 32, 101, 120, 116, 101, 110, 115, 105, 111, 110, 46, 112, 111, 115, 116, 77, 101, 115, 115, 97, 103, 101, 40, 74, 83, 79, 78, 46, 115, 116, 114, 105, 110, 103, 105, 102, 121, 40, 109, 115, 103, 41, 41, 59, 10, 32, 32, 125, 10, 125, 59, 10, 10, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 73, 110, 116, 101, 114, 102, 97, 99, 101, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 115, 101, 116, 32, 61, 32, 102, 117, 110, 99, 116, 105, 111, 110, 32, 40, 118, 97, 108, 117, 101, 44, 32, 122, 111, 110, 101, 41, 32, 123, 10, 32, 32, 118, 97, 114, 32, 109, 115, 103, 32, 61, 32, 123, 125, 59, 10, 32, 32, 109, 115, 103, 91, 39, 109, 101, 116, 104, 111, 100, 39, 93, 32, 61, 32, 39, 115, 101, 116, 39, 59, 10, 32, 32, 109, 115, 103, 91, 39, 110, 97, 109, 101, 39, 93, 32, 61, 32, 116, 104, 105, 115, 46, 97, 116, 116, 114, 105, 98, 117, 116, 101, 78, 97, 109, 101, 59, 10, 32, 32, 109, 115, 103, 91, 39, 122, 111, 110, 101, 39, 93, 32, 61, 32, 122, 111, 110, 101, 59, 10, 32, 32, 109, 115, 103, 91, 39, 118, 97, 108, 117, 101, 39, 93, 32, 61, 32, 118, 97, 108, 117, 101, 59, 10, 10, 32, 32, 114, 101, 116, 117, 114, 110, 32, 99, 114, 101, 97, 116, 101, 80, 114, 111, 109, 105, 115, 101, 40, 109, 115, 103, 41, 59, 10, 125, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 65, 115, 121, 110, 99, 67, 97, 108, 108, 40, 114, 101, 115, 111, 108, 118, 101, 44, 32, 114, 101, 106, 101, 99, 116, 41, 32, 123, 10, 32, 32, 116, 104, 105, 115, 46, 114, 101, 115, 111, 108, 118, 101, 32, 61, 32, 114, 101, 115, 111, 108, 118, 101, 59, 10, 32, 32, 116, 104, 105, 115, 46, 114, 101, 106, 101, 99, 116, 32, 61, 32, 114, 101, 106, 101, 99, 116, 59, 10, 125, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 99, 114, 101, 97, 116, 101, 80, 114, 111, 109, 105, 115, 101, 40, 109, 115, 103, 41, 32, 123, 10, 32, 32, 118, 97, 114, 32, 112, 114, 111, 109, 105, 115, 101, 32, 61, 32, 110, 101, 119, 32, 80, 114, 111, 109, 105, 115, 101, 40, 102, 117, 110, 99, 116, 105, 111, 110, 40, 114, 101, 115, 111, 108, 118, 101, 44, 32, 114, 101, 106, 101, 99, 116, 41, 32, 123, 10, 32, 32, 32, 32, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 115, 91, 110, 101, 120, 116, 95, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 95, 105, 100, 93, 32, 61, 32, 110, 101, 119, 32, 65, 115, 121, 110, 99, 67, 97, 108, 108, 40, 114, 101, 115, 111, 108, 118, 101, 44, 32, 114, 101, 106, 101, 99, 116, 41, 59, 10, 32, 32, 125, 41, 59, 10, 10, 32, 32, 109, 115, 103, 46, 97, 115, 121, 110, 99, 67, 97, 108, 108, 73, 100, 32, 61, 32, 110, 101, 120, 116, 95, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 95, 105, 100, 59, 10, 32, 32, 101, 120, 116, 101, 110, 115, 105, 111, 110, 46, 112, 111, 115, 116, 77, 101, 115, 115, 97, 103, 101, 40, 74, 83, 79, 78, 46, 115, 116, 114, 105, 110, 103, 105, 102, 121, 40, 109, 115, 103, 41, 41, 59, 10, 32, 32, 43, 43, 110, 101, 120, 116, 95, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 95, 105, 100, 59, 10, 32, 32, 114, 101, 116, 117, 114, 110, 32, 112, 114, 111, 109, 105, 115, 101, 59, 10, 125, 10, 10, 119, 105, 110, 100, 111, 119, 46, 90, 111, 110, 101, 32, 61, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 122, 111, 110, 101, 41, 32, 123, 10, 32, 32, 116, 104, 105, 115, 46, 118, 97, 108, 117, 101, 32, 61, 32, 122, 111, 110, 101, 32, 63, 32, 122, 111, 110, 101, 32, 58, 32, 91, 93, 59, 10, 10, 32, 32, 79, 98, 106, 101, 99, 116, 46, 100, 101, 102, 105, 110, 101, 80, 114, 111, 112, 101, 114, 116, 121, 40, 116, 104, 105, 115, 44, 32, 39, 100, 114, 105, 118, 101, 114, 39, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 123, 32, 101, 110, 117, 109, 101, 114, 97, 98, 108, 101, 58, 32, 102, 97, 108, 115, 101, 44, 32, 103, 101, 116, 58, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 110, 101, 119, 32, 90, 111, 110, 101, 40, 91, 39, 70, 114, 111, 110, 116, 39, 44, 32, 39, 76, 101, 102, 116, 39, 93, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 125, 32, 125, 41, 59, 10, 125, 59, 10, 10, 119, 105, 110, 100, 111, 119, 46, 90, 111, 110, 101, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 101, 113, 117, 97, 108, 115, 32, 61, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 122, 111, 110, 101, 41, 32, 123, 10, 32, 32, 118, 97, 114, 32, 105, 115, 95, 101, 113, 117, 97, 108, 32, 61, 32, 116, 114, 117, 101, 59, 10, 10, 32, 32, 102, 111, 114, 32, 40, 118, 97, 114, 32, 105, 32, 61, 32, 48, 59, 32, 105, 32, 60, 32, 122, 111, 110, 101, 46, 118, 97, 108, 117, 101, 46, 108, 101, 110, 103, 116, 104, 59, 32, 105, 43, 43, 41, 32, 123, 10, 32, 32, 32, 32, 105, 115, 95, 101, 113, 117, 97, 108, 32, 38, 61, 32, 116, 104, 105, 115, 46, 118, 97, 108, 117, 101, 46, 105, 110, 100, 101, 120, 79, 102, 40, 122, 111, 110, 101, 46, 118, 97, 108, 117, 101, 91, 105, 93, 41, 32, 33, 61, 61, 32, 45, 49, 59, 10, 32, 32, 125, 10, 10, 32, 32, 102, 111, 114, 32, 40, 118, 97, 114, 32, 105, 32, 61, 32, 48, 59, 32, 105, 32, 60, 32, 116, 104, 105, 115, 46, 118, 97, 108, 117, 101, 46, 108, 101, 110, 103, 116, 104, 59, 32, 105, 43, 43, 41, 32, 123, 10, 32, 32, 32, 32, 105, 115, 95, 101, 113, 117, 97, 108, 32, 38, 61, 32, 122, 111, 110, 101, 46, 118, 97, 108, 117, 101, 46, 105, 110, 100, 101, 120, 79, 102, 40, 116, 104, 105, 115, 46, 118, 97, 108, 117, 101, 91, 105, 93, 41, 32, 33, 61, 61, 32, 45, 49, 59, 10, 32, 32, 125, 10, 10, 32, 32, 114, 101, 116, 117, 114, 110, 32, 105, 115, 95, 101, 113, 117, 97, 108, 59, 10, 125, 59, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 80, 114, 111, 112, 101, 114, 116, 121, 40, 111, 98, 106, 44, 32, 112, 114, 111, 112, 41, 32, 123, 10, 32, 32, 79, 98, 106, 101, 99, 116, 46, 100, 101, 102, 105, 110, 101, 80, 114, 111, 112, 101, 114, 116, 121, 40, 111, 98, 106, 44, 32, 112, 114, 111, 112, 44, 32, 123, 32, 101, 110, 117, 109, 101, 114, 97, 98, 108, 101, 58, 32, 116, 114, 117, 101, 44, 32, 118, 97, 108, 117, 101, 58, 32, 110, 101, 119, 32, 86, 101, 104, 105, 99, 108, 101, 73, 110, 116, 101, 114, 102, 97, 99, 101, 40, 112, 114, 111, 112, 41, 32, 125, 41, 59, 10, 125, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 111, 98, 106, 44, 32, 112, 114, 111, 112, 41, 32, 123, 10, 32, 32, 79, 98, 106, 101, 99, 116, 46, 100, 101, 102, 105, 110, 101, 80, 114, 111, 112, 101, 114, 116, 121, 40, 111, 98, 106, 44, 32, 112, 114, 111, 112, 44, 32, 123, 32, 101, 110, 117, 109, 101, 114, 97, 98, 108, 101, 58, 32, 116, 114, 117, 101, 44, 32, 118, 97, 108, 117, 101, 58, 32, 110, 101, 119, 32, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 73, 110, 116, 101, 114, 102, 97, 99, 101, 40, 112, 114, 111, 112, 41, 32, 125, 41, 59, 10, 125, 10, 10, 101, 120, 116, 101, 110, 115, 105, 111, 110, 46, 115, 101, 116, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 40, 102, 117, 110, 99, 116, 105, 111, 110, 40, 106, 115, 111, 110, 41, 32, 123, 10, 32, 32, 116, 114, 121, 32, 123, 10, 32, 32, 32, 32, 118, 97, 114, 32, 109, 115, 103, 32, 61, 32, 74, 83, 79, 78, 46, 112, 97, 114, 115, 101, 40, 106, 115, 111, 110, 41, 59, 10, 10, 32, 32, 32, 32, 115, 119, 105, 116, 99, 104, 32, 40, 109, 115, 103, 46, 109, 101, 116, 104, 111, 100, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 103, 101, 116, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 104, 97, 110, 100, 108, 101, 80, 114, 111, 109, 105, 115, 101, 82, 101, 112, 108, 121, 40, 109, 115, 103, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 122, 111, 110, 101, 115, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 104, 97, 110, 100, 108, 101, 90, 111, 110, 101, 115, 82, 101, 112, 108, 121, 40, 109, 115, 103, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 115, 117, 98, 115, 99, 114, 105, 98, 101, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 104, 97, 110, 100, 108, 101, 83, 117, 98, 115, 99, 114, 105, 98, 101, 82, 101, 112, 108, 121, 40, 109, 115, 103, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 115, 101, 116, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 104, 97, 110, 100, 108, 101, 80, 114, 111, 109, 105, 115, 101, 82, 101, 112, 108, 121, 40, 109, 115, 103, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 100, 101, 102, 97, 117, 108, 116, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 125, 10, 32, 32, 125, 32, 99, 97, 116, 99, 104, 32, 40, 101, 114, 114, 111, 114, 41, 32, 123, 10, 32, 32, 32, 32, 99, 111, 110, 115, 111, 108, 101, 46, 108, 111, 103, 40, 39, 69, 114, 114, 111, 114, 32, 105, 110, 32, 109, 101, 115, 115, 97, 103, 101, 32, 108, 105, 115, 116, 101, 110, 101, 114, 58, 32, 39, 32, 43, 32, 101, 114, 114, 111, 114, 41, 59, 10, 32, 32, 125, 10, 125, 41, 59, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 104, 97, 110, 100, 108, 101, 80, 114, 111, 109, 105, 115, 101, 82, 101, 112, 108, 121, 40, 109, 115, 103, 41, 32, 123, 10, 32, 32, 118, 97, 114, 32, 99, 98, 111, 98, 106, 32, 61, 32, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 115, 91, 109, 115, 103, 46, 97, 115, 121, 110, 99, 67, 97, 108, 108, 73, 100, 93, 59, 10, 10, 32, 32, 105, 102, 32, 40, 109, 115, 103, 46, 101, 114, 114, 111, 114, 41, 32, 123, 10, 32, 32, 32, 32, 118, 97, 114, 32, 101, 114, 114, 111, 114, 32, 61, 32, 123, 125, 59, 10, 32, 32, 32, 32, 101, 114, 114, 111, 114, 46, 101, 114, 114, 111, 114, 32, 61, 32, 109, 115, 103, 46, 118, 97, 108, 117, 101, 59, 10, 32, 32, 32, 32, 115, 119, 105, 116, 99, 104, 32, 40, 109, 115, 103, 46, 118, 97, 108, 117, 101, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 112, 101, 114, 109, 105, 115, 115, 105, 111, 110, 95, 100, 101, 110, 105, 101, 100, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 101, 114, 114, 111, 114, 46, 109, 101, 115, 115, 97, 103, 101, 32, 61, 32, 39, 80, 101, 114, 109, 105, 115, 115, 105, 111, 110, 32, 100, 101, 110, 105, 101, 100, 39, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 105, 110, 118, 97, 108, 105, 100, 95, 111, 112, 101, 114, 97, 116, 105, 111, 110, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 101, 114, 114, 111, 114, 46, 109, 101, 115, 115, 97, 103, 101, 32, 61, 32, 39, 73, 110, 118, 97, 108, 105, 100, 32, 111, 112, 101, 114, 97, 116, 105, 111, 110, 39, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 116, 105, 109, 101, 111, 117, 116, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 101, 114, 114, 111, 114, 46, 109, 101, 115, 115, 97, 103, 101, 32, 61, 32, 39, 79, 112, 101, 114, 97, 116, 105, 111, 110, 32, 116, 105, 109, 101, 100, 32, 111, 117, 116, 39, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 105, 110, 118, 97, 108, 105, 100, 95, 122, 111, 110, 101, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 101, 114, 114, 111, 114, 46, 109, 101, 115, 115, 97, 103, 101, 32, 61, 32, 39, 90, 111, 110, 101, 32, 105, 110, 118, 97, 108, 105, 100, 32, 111, 114, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 39, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 99, 97, 115, 101, 32, 39, 117, 110, 107, 110, 111, 119, 110, 39, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 101, 114, 114, 111, 114, 46, 109, 101, 115, 115, 97, 103, 101, 32, 61, 32, 39, 65, 110, 32, 117, 110, 107, 110, 111, 119, 110, 32, 101, 114, 114, 111, 114, 32, 111, 99, 99, 117, 114, 101, 100, 39, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 32, 32, 100, 101, 102, 97, 117, 108, 116, 58, 10, 32, 32, 32, 32, 32, 32, 32, 32, 101, 114, 114, 111, 114, 46, 109, 101, 115, 115, 97, 103, 101, 32, 61, 32, 39, 85, 110, 107, 110, 111, 119, 110, 39, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 114, 101, 97, 107, 59, 10, 32, 32, 32, 32, 125, 10, 10, 32, 32, 32, 32, 99, 98, 111, 98, 106, 46, 114, 101, 106, 101, 99, 116, 40, 101, 114, 114, 111, 114, 41, 59, 10, 32, 32, 125, 32, 101, 108, 115, 101, 32, 123, 10, 32, 32, 32, 32, 99, 98, 111, 98, 106, 46, 114, 101, 115, 111, 108, 118, 101, 40, 109, 115, 103, 46, 118, 97, 108, 117, 101, 41, 59, 10, 32, 32, 125, 10, 10, 32, 32, 100, 101, 108, 101, 116, 101, 32, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 115, 91, 109, 115, 103, 46, 97, 115, 121, 110, 99, 67, 97, 108, 108, 73, 100, 93, 59, 10, 125, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 104, 97, 110, 100, 108, 101, 90, 111, 110, 101, 115, 82, 101, 112, 108, 121, 40, 109, 115, 103, 41, 32, 123, 10, 32, 32, 118, 97, 114, 32, 99, 98, 111, 98, 106, 32, 61, 32, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 115, 91, 109, 115, 103, 46, 97, 115, 121, 110, 99, 67, 97, 108, 108, 73, 100, 93, 59, 10, 10, 32, 32, 105, 102, 32, 40, 99, 98, 111, 98, 106, 41, 10, 32, 32, 32, 32, 99, 98, 111, 98, 106, 46, 114, 101, 115, 111, 108, 118, 101, 40, 110, 101, 119, 32, 90, 111, 110, 101, 40, 109, 115, 103, 46, 118, 97, 108, 117, 101, 41, 41, 59, 10, 125, 10, 10, 102, 117, 110, 99, 116, 105, 111, 110, 32, 104, 97, 110, 100, 108, 101, 83, 117, 98, 115, 99, 114, 105, 98, 101, 82, 101, 112, 108, 121, 40, 109, 115, 103, 41, 32, 123, 10, 32, 32, 100, 101, 108, 101, 116, 101, 32, 97, 115, 121, 110, 99, 95, 99, 97, 108, 108, 115, 91, 109, 115, 103, 46, 97, 115, 121, 110, 99, 67, 97, 108, 108, 73, 100, 93, 59, 10, 32, 32, 118, 97, 114, 32, 118, 97, 108, 117, 101, 32, 61, 32, 109, 115, 103, 46, 118, 97, 108, 117, 101, 59, 10, 32, 32, 118, 97, 108, 117, 101, 46, 122, 111, 110, 101, 32, 61, 32, 110, 101, 119, 32, 90, 111, 110, 101, 40, 118, 97, 108, 117, 101, 46, 122, 111, 110, 101, 41, 59, 10, 10, 32, 32, 102, 111, 114, 32, 40, 118, 97, 114, 32, 105, 32, 61, 32, 48, 59, 32, 105, 32, 60, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 46, 108, 101, 110, 103, 116, 104, 59, 32, 105, 43, 43, 41, 32, 123, 10, 32, 32, 32, 32, 118, 97, 114, 32, 105, 116, 114, 32, 61, 32, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 91, 105, 93, 59, 10, 32, 32, 32, 32, 118, 97, 114, 32, 105, 102, 97, 99, 101, 73, 115, 32, 61, 32, 40, 118, 97, 108, 117, 101, 46, 105, 110, 116, 101, 114, 102, 97, 99, 101, 78, 97, 109, 101, 46, 116, 111, 76, 111, 119, 101, 114, 67, 97, 115, 101, 40, 41, 32, 61, 61, 61, 32, 105, 116, 114, 46, 110, 97, 109, 101, 46, 116, 111, 76, 111, 119, 101, 114, 67, 97, 115, 101, 40, 41, 41, 59, 10, 32, 32, 32, 32, 105, 102, 32, 40, 105, 102, 97, 99, 101, 73, 115, 32, 61, 61, 61, 32, 116, 114, 117, 101, 32, 38, 38, 32, 118, 97, 108, 117, 101, 46, 122, 111, 110, 101, 46, 101, 113, 117, 97, 108, 115, 40, 105, 116, 114, 46, 122, 111, 110, 101, 41, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 105, 116, 114, 46, 99, 97, 108, 108, 98, 97, 99, 107, 40, 118, 97, 108, 117, 101, 41, 59, 10, 32, 32, 32, 32, 125, 10, 32, 32, 125, 10, 125, 10, 47, 47, 47, 32, 82, 117, 110, 110, 105, 110, 103, 115, 116, 97, 116, 117, 115, 32, 97, 116, 116, 114, 105, 98, 117, 116, 101, 115, 58, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 118, 101, 104, 105, 99, 108, 101, 83, 112, 101, 101, 100, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 101, 110, 103, 105, 110, 101, 83, 112, 101, 101, 100, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 112, 111, 119, 101, 114, 116, 114, 97, 105, 110, 84, 111, 114, 113, 117, 101, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 97, 99, 99, 101, 108, 101, 114, 97, 116, 111, 114, 80, 101, 100, 97, 108, 80, 111, 115, 105, 116, 105, 111, 110, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 116, 104, 114, 111, 116, 116, 108, 101, 80, 111, 115, 105, 116, 105, 111, 110, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 116, 114, 97, 110, 115, 109, 105, 115, 115, 105, 111, 110, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 99, 114, 117, 105, 115, 101, 67, 111, 110, 116, 114, 111, 108, 83, 116, 97, 116, 117, 115, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 108, 105, 103, 104, 116, 83, 116, 97, 116, 117, 115, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 104, 111, 114, 110, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 99, 104, 105, 109, 101, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 102, 117, 101, 108, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 101, 110, 103, 105, 110, 101, 79, 105, 108, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 97, 99, 99, 101, 108, 101, 114, 97, 116, 105, 111, 110, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 101, 110, 103, 105, 110, 101, 67, 111, 111, 108, 97, 110, 116, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 115, 116, 101, 101, 114, 105, 110, 103, 87, 104, 101, 101, 108, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 119, 104, 101, 101, 108, 84, 105, 99, 107, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 105, 103, 110, 105, 116, 105, 111, 110, 84, 105, 109, 101, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 121, 97, 119, 82, 97, 116, 101, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 98, 114, 97, 107, 101, 79, 112, 101, 114, 97, 116, 105, 111, 110, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 98, 117, 116, 116, 111, 110, 69, 118, 101, 110, 116, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 110, 105, 103, 104, 116, 77, 111, 100, 101, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 100, 114, 105, 118, 105, 110, 103, 77, 111, 100, 101, 39, 41, 59, 10, 10, 47, 47, 47, 32, 77, 97, 105, 110, 116, 101, 110, 97, 110, 99, 101, 32, 97, 116, 116, 114, 105, 98, 117, 116, 101, 115, 58, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 111, 100, 111, 109, 101, 116, 101, 114, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 116, 114, 97, 110, 115, 109, 105, 115, 115, 105, 111, 110, 79, 105, 108, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 116, 114, 97, 110, 115, 109, 105, 115, 115, 105, 111, 110, 67, 108, 117, 116, 99, 104, 39, 41, 59, 10, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 98, 97, 116, 116, 101, 114, 121, 83, 116, 97, 116, 117, 115, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 116, 105, 114, 101, 39, 41, 59, 10, 10, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 100, 111, 111, 114, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 116, 101, 109, 112, 101, 114, 97, 116, 117, 114, 101, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 99, 108, 105, 109, 97, 116, 101, 67, 111, 110, 116, 114, 111, 108, 39, 41, 59, 10, 95, 100, 101, 102, 105, 110, 101, 86, 101, 104, 105, 99, 108, 101, 83, 105, 103, 110, 97, 108, 80, 114, 111, 112, 101, 114, 116, 121, 40, 101, 120, 112, 111, 114, 116, 115, 44, 32, 39, 100, 101, 102, 114, 111, 115, 116, 39, 41, 59, 10, 10, 0 }; diff --git a/xwalk/vehicle_api.js b/xwalk/vehicle_api.js index aeb721bf..c84eb02b 100644 --- a/xwalk/vehicle_api.js +++ b/xwalk/vehicle_api.js @@ -195,11 +195,15 @@ function handlePromiseReply(msg) { error.message = 'An unknown error occured'; break; default: + error.message = 'Unknown'; break; } cbobj.reject(error); } else { + if (msg.value.zone) { + msg.value.zone = new Zone(msg.value.zone); + } cbobj.resolve(msg.value); } @@ -247,18 +251,20 @@ _defineVehicleSignalProperty(exports, 'ignitionTime'); _defineVehicleSignalProperty(exports, 'yawRate'); _defineVehicleSignalProperty(exports, 'brakeOperation'); _defineVehicleSignalProperty(exports, 'buttonEvent'); - _defineVehicleSignalProperty(exports, 'nightMode'); _defineVehicleSignalProperty(exports, 'drivingMode'); -_defineVehicleSignalProperty(exports, 'brakeOperation'); -_defineVehicleSignalProperty(exports, 'tire'); -_defineVehicleSignalProperty(exports, 'door'); -_defineVehicleSignalProperty(exports, 'defrost'); -_defineVehicleSignalProperty(exports, 'climateControl'); + +/// Maintenance attributes: +_defineVehicleSignalProperty(exports, 'odometer'); +_defineVehicleSignalProperty(exports, 'transmissionOil'); +_defineVehicleSignalProperty(exports, 'transmissionClutch'); _defineVehicleSignalProperty(exports, 'batteryStatus'); +_defineVehicleSignalProperty(exports, 'tire'); -_defineVehicleSignalProperty(exports, 'temperature'); -_defineVehicleSignalProperty(exports, 'odometer'); +_defineVehicleSignalProperty(exports, 'door'); +_defineVehicleSignalProperty(exports, 'temperature'); +_defineVehicleSignalProperty(exports, 'climateControl'); +_defineVehicleSignalProperty(exports, 'defrost'); |