• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ jccl::ConfigElementPtr类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中jccl::ConfigElementPtr的典型用法代码示例。如果您正苦于以下问题:C++ ConfigElementPtr类的具体用法?C++ ConfigElementPtr怎么用?C++ ConfigElementPtr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ConfigElementPtr类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: config

bool User::config(jccl::ConfigElementPtr element)
{
   vprASSERT(element.get() != NULL);
   vprASSERT(element->getID() == "user");

   vprDEBUG_BEGIN(vrjDBG_KERNEL, vprDBG_STATE_LVL)
      << "vjUser::config: Creating a new user\n" << vprDEBUG_FLUSH;

   // Assign user id
   mUserId = mNextUserId++;

   // Setup user name
   mName = element->getName();

   // Initialize the head stuff
   std::string head_alias = element->getProperty<std::string>("head_position");
   mHead.init(head_alias);

   // Initialize interocular distance
   mInterocularDist = element->getProperty<float>("interocular_distance");

   if(mInterocularDist == 0.0f)
   {
      vprDEBUG(vrjDBG_KERNEL,vprDBG_CONFIG_LVL) << clrOutNORM(clrRED, "WARNING:") << "User: " << mName << " has interocular distance is set to 0.0f.  This is probably not what you wanted.\n" << vprDEBUG_FLUSH;
   }

   vprDEBUG(vrjDBG_KERNEL,vprDBG_STATE_LVL) << "id: " << mUserId << "   Name:" << mName.c_str()
                           << "   head_positon:" << head_alias.c_str()
                           << "   interocular_distance:" << mInterocularDist
                           << std::endl << vprDEBUG_FLUSH;

   return true;
}
开发者ID:Michael-Lfx,项目名称:vrjuggler,代码行数:33,代码来源:User.cpp


示例2: removeProxyAlias

/**
 * Removes a proxy aliases in config database.
 * @pre none
 * @post (alias not in list) ==> returns = false<br>
 *       (alias is in list) ==> (alias is removed from list) returns true
 */
bool InputManager::removeProxyAlias(jccl::ConfigElementPtr element)
{
vpr::DebugOutputGuard dbg_output(gadgetDBG_INPUT_MGR, vprDBG_STATE_LVL,
                        std::string("gadget::InputManager::removeProxyAlias\n"),
                        std::string("...done removing alias.\n"));

   vprASSERT(element->getID() == "alias");

   std::string alias_name, proxy_name;  // The string of the alias, name of proxy to pt to

   alias_name = element->getName();

   if(mProxyAliases.end() == mProxyAliases.find(alias_name))
   {
      vprDEBUG(vprDBG_ERROR,vprDBG_CRITICAL_LVL)
         << clrOutNORM(clrRED,"ERROR:")
         << "gadget::InputManager::RemoveProxyAlias: Alias: " << alias_name
         << "  cannot find proxy: " << proxy_name.c_str() << std::endl
         << vprDEBUG_FLUSH;
      return false;
   }

   mProxyAliases.erase(alias_name);

   vprDEBUG(gadgetDBG_INPUT_MGR,vprDBG_CONFIG_LVL)
      << "   alias:" << alias_name.c_str() << "   index:"
      << mProxyAliases[proxy_name] << "  has been removed." << std::endl
      << vprDEBUG_FLUSH;

   return true;
}
开发者ID:rpavlik,项目名称:vrjuggler-2.2-debs,代码行数:37,代码来源:InputManager.cpp


示例3: configAddDisplay

/**
 * Adds the element to the configuration.
 *
 * @pre configCanHandle(element) == true
 * @post (display of same name already loaded) ==> old display closed, new one opened<br>
 *       (display is new) ==> (new display is added)<br>
 *       Draw Manager is notified of the display change.
 */
bool DisplayManager::configAddDisplay(jccl::ConfigElementPtr element)
{
   vprASSERT(configCanHandle(element)); // We must be able to handle it first of all

   vprDEBUG_BEGIN(vrjDBG_DISP_MGR,vprDBG_STATE_LVL) << "------- DisplayManager::configAddDisplay -------\n" << vprDEBUG_FLUSH;

   // Find out if we already have a window of this name
   // If so, then close it before we open a new one of the same name
   // This basically allows re-configuration of a window
   DisplayPtr cur_disp = findDisplayNamed(element->getName());
   if (cur_disp != NULL)                         // We have an old display
   {
      vprDEBUG(vrjDBG_DISP_MGR,vprDBG_CONFIG_LVL) << "Removing old window: " << cur_disp->getName().c_str() << vprDEBUG_FLUSH;
      closeDisplay(cur_disp,true);              // Close the display and notify the draw manager to close the window
   }

   // --- Add a display (of the correct type) ---- //
   if (element->getID() == std::string("display_window"))       // Display window
   {
      DisplayPtr newDisp = Display::create();      // Create the display
      newDisp->config(element);
      addDisplay(newDisp,true);                    // Add it
      vprDEBUG(vrjDBG_DISP_MGR,vprDBG_STATE_LVL) << "Adding display: " << newDisp->getName().c_str() << std::endl << vprDEBUG_FLUSH;
      vprDEBUG(vrjDBG_DISP_MGR,vprDBG_STATE_LVL) << "Display: "  << newDisp << std::endl << vprDEBUG_FLUSH;
   }

   vprDEBUG_END(vrjDBG_DISP_MGR,vprDBG_STATE_LVL) << "------- DisplayManager::configAddDisplay Done. --------\n" << vprDEBUG_FLUSH;
   return true;
}
开发者ID:Michael-Lfx,项目名称:vrjuggler,代码行数:37,代码来源:DisplayManager.cpp


示例4: configure

void SignalGrabStrategy::configure(jccl::ConfigElementPtr elt)
{
   vprASSERT(elt->getID() == getElementType());

   const unsigned int req_cfg_version(1);

   // Check for correct version of plugin configuration.
   if ( elt->getVersion() < req_cfg_version )
   {
      std::stringstream msg;
      msg << "Configuration of SignalGrabStrategy failed.  Required config "
          << "element version is " << req_cfg_version << ", but element '"
          << elt->getName() << "' is version " << elt->getVersion();
      throw PluginException(msg.str(), VRKIT_LOCATION);
   }

   const std::string choose_btn_prop("choose_button_nums");
   const std::string grab_btn_prop("grab_button_nums");
   const std::string release_btn_prop("release_button_nums");

   mChooseBtn.configure(elt->getProperty<std::string>(choose_btn_prop),
                        mWandInterface);
   mGrabBtn.configure(elt->getProperty<std::string>(grab_btn_prop),
                      mWandInterface);
   mReleaseBtn.configure(elt->getProperty<std::string>(release_btn_prop),
                         mWandInterface);

   // Determine if grab and release are activated using the same button
   // sequence. This indicates that the grab/release operation is a toggle
   // and must be handled differently than if the two operations are
   // separate.
   mGrabReleaseToggle = mGrabBtn == mReleaseBtn;
}
开发者ID:patrickhartling,项目名称:vrkit,代码行数:33,代码来源:SignalGrabStrategy.cpp


示例5: configure

void MultiObjectGrabStrategy::configure(jccl::ConfigElementPtr elt)
{
   vprASSERT(elt->getID() == getElementType());

   const unsigned int req_cfg_version(1);

   // Check for correct version of plugin configuration.
   if ( elt->getVersion() < req_cfg_version )
   {
      std::stringstream msg;
      msg << "Configuration of MultiObjectGrabStrategy failed.  Required "
          << "config element version is " << req_cfg_version
          << ", but element '" << elt->getName() << "' is version "
          << elt->getVersion();
      throw PluginException(msg.str(), VRKIT_LOCATION);
   }

   const std::string choose_btn_prop("choose_button_nums");
   const std::string grab_btn_prop("grab_button_nums");
   const std::string release_btn_prop("release_button_nums");

   mChooseBtn.configure(elt->getProperty<std::string>(choose_btn_prop),
                        mWandInterface);
   mGrabBtn.configure(elt->getProperty<std::string>(grab_btn_prop),
                      mWandInterface);
   mReleaseBtn.configure(elt->getProperty<std::string>(release_btn_prop),
                         mWandInterface);
}
开发者ID:patrickhartling,项目名称:vrkit,代码行数:28,代码来源:MultiObjectGrabStrategy.cpp


示例6: configCanHandle

/**
 * Is it a display configuration element?
 *
 * @return true if we have a display config element; false if we don't.
 */
bool DisplayManager::configCanHandle(jccl::ConfigElementPtr element)
{
   return (    (element->getID() == std::string("surfaceDisplay"))
            || (element->getID() == std::string("simDisplay"))
            || (element->getID() == std::string("display_system"))
            || (element->getID() == std::string("display_window"))
           );
}
开发者ID:Michael-Lfx,项目名称:vrjuggler,代码行数:13,代码来源:DisplayManager.cpp


示例7: configCanHandle

// Return true if:
//  It is recognized device, proxy, or alias.
bool InputManager::configCanHandle(jccl::ConfigElementPtr element)
{           // NEED TO FIX!!!!
   return ( (DeviceFactory::instance()->recognizeDevice(element) &&
             !cluster::ClusterManager::instance()->recognizeRemoteDeviceConfig(element)) ||
            ProxyFactory::instance()->recognizeProxy(element) ||
            recognizeProxyAlias(element) ||
            (element->getID() == std::string("display_system")) ||
            (element->getID() == std::string("input_manager")) ||
            (element->getID() == std::string("gadget_logger"))
          );
}
开发者ID:rpavlik,项目名称:vrjuggler-2.2-debs,代码行数:13,代码来源:InputManager.cpp


示例8: config

bool CyberGlove::config(jccl::ConfigElementPtr e)
{
   if(! (Input::config(c) && Glove::config(c) ))
   {
      return false;
   }

   vprASSERT(mThread == NULL);      // This should have been set by Input(c)

   mPortName = e->getProperty<std::string>("port");
   mBaudRate = e->getProperty<int>("baud");

   char* home_dir = e->getProperty("calibration_dir").cstring();
   if (home_dir != NULL)
   {
       mCalDir = new char [strlen(home_dir) + 1];
       strcpy(mCalDir,home_dir);
   }

   std::string glove_pos_proxy = e->getProperty("glove_position");    // Get the name of the pos_proxy
   if(glove_pos_proxy == std::string(""))
   {
      vprDEBUG(gadgetDBG_INPUT_MGR, vprDBG_CRITICAL_LVL)
         << clrOutNORM(clrRED, "ERROR:") << " Cyberglove has no posProxy."
         << std::endl << vprDEBUG_FLUSH;
      return false;
   }

   // init glove proxy interface
   /* XXX: Doesn't appear to be used
   int proxy_index = gadget::InputManager::instance()->getProxyIndex(glove_pos_proxy);
   if(proxy_index != -1)
   {
      mGlovePos[0] = gadget::InputManager::instance()->->getPosProxy(proxy_index);
   }
   else
   {
      vprDEBUG(gadgetDBG_INPUT_MGR, vprDBG_CRITICAL_LVL)
         << clrOutNORM(clrRED, "ERROR:")
         << " CyberGlove::CyberGlove: Can't find posProxy."
         << std::endl << std::endl << vprDEBUG_FLUSH;
   }
   */

   mGlove = new CyberGloveBasic( mCalDir, mPortName, mBaudRate );

   return true;
}
开发者ID:baibaiwei,项目名称:vrjuggler,代码行数:48,代码来源:CyberGlove.cpp


示例9: depSatisfied

bool ClusterDepChecker::depSatisfied(jccl::ConfigElementPtr element)
{
   if (element->getID() == ClusterNetwork::getClusterNodeElementType())
   {
      // Machine Specific elements should have no dependencies since we are
      // simply inserting the child elements into the pending list. This is
      // to fix errors like the embedded keyboard window in a DisplayWindow
      // would always create a dependancy loop.
      debugOutDependencies( element, vprDBG_WARNING_LVL );
      return true;
   }
   /*
   else if (cluster::ClusterManager::instance()->recognizeRemoteDeviceConfig(element))
   {
      // Remote devices should have no dependencies since we are not actually
      // configuring anything, we are only creating a data structure that we
      // can determine without any other elements.
      // Virtual devices should not have any dependencies.

      // RemoteDeviceConfig has only two dependencies
      //   - deivceHost exists in Active List
      //   - Node exists and is connected
      //   - Remote Device needs to be configured

      bool pass = true;

      jccl::ConfigManager* cfg_mgr = jccl::ConfigManager::instance();

      // device_host exists in active configuration
      std::string device_host = element->getProperty<std::string>( "device_host" );
      gadget::NodePtr node = cluster::ClusterManager::instance()->getNetwork()->getNodeByName( device_host );

      if (!cfg_mgr->isElementInActiveList(device_host) || NULL == node)
      {
         pass = false;
      }
      else if (gadget::Node::DISCONNECTED == node->getStatus())
      {
         pass = false;
         
         node->setStatus( gadget::Node::PENDING );
      }
      else if (gadget::Node::PENDING == node->getStatus() ||
               gadget::Node::NEWCONNECTION == node->getStatus())
      {
         // Wait until we are fully connected.
         pass = false;
      }

      return pass;
   }
   */
   else
   {
      vprDEBUG(gadgetDBG_RIM, vprDBG_CRITICAL_LVL)
         << "ERROR, Something is seriously wrong, we should never get here\n"
         << vprDEBUG_FLUSH;
      return true;
   }
}
开发者ID:Michael-Lfx,项目名称:vrjuggler,代码行数:60,代码来源:ClusterDepChecker.cpp


示例10: configureProxy

/**
 * Check if the device factory or proxy factory can handle the element.
 */
bool InputManager::configureProxy(jccl::ConfigElementPtr element)
{
   std::string proxy_name = element->getFullName();

vpr::DebugOutputGuard dbg_output(gadgetDBG_INPUT_MGR, vprDBG_STATE_LVL,
                                 std::string("gadget::InputManager::configureProxy: Named: ") + proxy_name + std::string("\n"),
                                 std::string("done configuring proxy\n"));

   Proxy* new_proxy;

   // Tell the factory to load the proxy
   // NOTE: The config for the proxy registers it with the input manager
   new_proxy = ProxyFactory::instance()->loadProxy(element);

   // Check for success
   if(NULL == new_proxy)
   {
      vprDEBUG(vprDBG_ERROR,vprDBG_CRITICAL_LVL)
         << clrOutNORM(clrRED,"ERROR:")
         << " gadget::InputManager::configureProxy: Proxy construction failed:"
         << proxy_name << std::endl << vprDEBUG_FLUSH;
      return false;
   }
   vprASSERT(proxy_name == new_proxy->getName());

   // -- Add to proxy table
   if(false == addProxy(new_proxy))
   {
      return false;
   }

   return true;
}
开发者ID:rpavlik,项目名称:vrjuggler-2.2-debs,代码行数:36,代码来源:InputManager.cpp


示例11: configRemove

/**
 * Removes the element from the current configuration.
 * @pre configCanHandle(element) == true
 */
bool DisplayManager::configRemove(jccl::ConfigElementPtr element)
{
   vprASSERT(configCanHandle(element));

   const std::string element_type(element->getID());

   if ( (element_type == std::string("surfaceDisplay")) ||
        (element_type == std::string("simDisplay")) )
   {
      vprDEBUG(vprDBG_ALL, vprDBG_CRITICAL_LVL)
         << "Element of type: " << element_type
         << " is no longer supported.  Use display_window type instead.\n"
         << vprDEBUG_FLUSH;
      return false;
   }
   else if (element_type == std::string("display_window"))
   {
      return configRemoveDisplay(element);
   }
   else if (element_type == std::string("display_system"))
   {
      // XXX: Put signal here to tell draw manager to lookup new stuff
      mDisplaySystemElement.reset();   // Keep track of the display system element
      return true;                     // We successfully configured.
                                       // This tell processPending to remove it to the active config
   }
   else
   {
      return false;
   }

}
开发者ID:Michael-Lfx,项目名称:vrjuggler,代码行数:36,代码来源:DisplayManager.cpp


示例12: configureProxyAlias

/**
 * Configures proxy aliases in config database.
 * @pre none
 * @post (alias not already in list) ==> Alias is added to proxyAlias list<br>
 *       (alias was already is list) ==> Alias is set to point to the new proxy instead
 */
bool InputManager::configureProxyAlias(jccl::ConfigElementPtr element)
{
vpr::DebugOutputGuard dbg_output(gadgetDBG_INPUT_MGR, vprDBG_STATE_LVL,
                           std::string("gadget::InputManager: Configuring proxy alias\n"),
                           std::string("...done configuring alias.\n"));

   vprASSERT(element->getID() == "alias");

   std::string alias_name, proxy_name;  // The string of the alias, name of proxy to pt to

   alias_name = element->getName();
   proxy_name = element->getProperty<std::string>("proxy");

   addProxyAlias(alias_name, proxy_name);

   return true;
}
开发者ID:rpavlik,项目名称:vrjuggler-2.2-debs,代码行数:23,代码来源:InputManager.cpp


示例13: setDisplaySystemElement

void DisplayManager::setDisplaySystemElement(jccl::ConfigElementPtr elt)
{
   if ( elt->getVersion() < 3 )
   {
      vprDEBUG(vrjDBG_DISP_MGR, vprDBG_WARNING_LVL)
         << clrOutBOLD(clrYELLOW, "WARNING") << ": Display system element '"
         << elt->getName() << "'" << std::endl;
      vprDEBUG_NEXTnl(vrjDBG_DISP_MGR, vprDBG_WARNING_LVL)
         << "         is out of date.\n";
      vprDEBUG_NEXTnl(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL)
         << "         Expected version 3 but found version "
         << elt->getVersion() << ".  Pipe\n";
      vprDEBUG_NEXTnl(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL)
         << "         configurations will not work.\n" << vprDEBUG_FLUSH;
   }

   mDisplaySystemElement = elt;
}
开发者ID:Michael-Lfx,项目名称:vrjuggler,代码行数:18,代码来源:DisplayManager.cpp


示例14: configAdd

/** Add the pending elm to the configuration.
 *  @pre configCanHandle (elm) == true.
 *  @return true iff elm was successfully added to configuration.
 */
bool RIMPlugin::configAdd(jccl::ConfigElementPtr elm)
{
   vprASSERT(ClusterManager::instance()->recognizeRemoteDeviceConfig(elm));
   vprASSERT(ClusterManager::instance()->isClusterActive());
   std::string device_name = elm->getName();

   vprDEBUG(gadgetDBG_RIM,vprDBG_CONFIG_STATUS_LVL)
      << clrOutBOLD(clrCYAN,"[RIMPlugin] ")
      << "Adding device: " << device_name
      << std::endl << vprDEBUG_FLUSH;

   vprASSERT(cluster::ClusterManager::instance()->isClusterActive() && "RIM called in non-cluster mode.");
   bool master = cluster::ClusterManager::instance()->isMaster();
   bool result(false);

   // If we are the master, configure the device and tell all slaves to prepare
   // virtual devices.
   if (master)
   {
      vprDEBUG(gadgetDBG_RIM,vprDBG_CONFIG_STATUS_LVL)
         << clrOutBOLD(clrMAGENTA, "[RemoteInputManager]")
         << "Configuring device on master node: " << device_name
         << std::endl << vprDEBUG_FLUSH;

      gadget::InputManager::instance()->configureDevice(elm);
      gadget::InputPtr input_device = gadget::InputManager::instance()->getDevice(device_name);
      if ( input_device != NULL )
      {
         result = addDeviceServer(device_name, input_device);
         DeviceServerPtr device_server = getDeviceServer(device_name);
         vprASSERT(NULL != device_server.get() && "Must have device server.");

         const vpr::Uint16 dev_type_id(input_device->getTypeId());
         const vpr::GUID& temp_guid(device_server->getId());
         DeviceAckPtr device_ack = DeviceAck::create(mHandlerGUID, temp_guid,
                                                     device_name, dev_type_id,
                                                     true);

         vprDEBUG(gadgetDBG_RIM,vprDBG_CONFIG_STATUS_LVL)
            << clrOutBOLD(clrMAGENTA, "[RemoteInputManager]")
            << "Sending device ack [" << device_name << "] to all cluster nodes."
            << std::endl << vprDEBUG_FLUSH;
         cluster::ClusterManager::instance()->getNetwork()->sendToAll(device_ack);
      }
   }
   else
   {
      vprDEBUG(gadgetDBG_RIM,vprDBG_CONFIG_STATUS_LVL)
         << clrOutBOLD(clrMAGENTA, "[RemoteInputManager]")
         << "Configuring device on slave node: " << device_name
         << std::endl << vprDEBUG_FLUSH;

      result = true;
   }

   return result;
}
开发者ID:Michael-Lfx,项目名称:vrjuggler,代码行数:61,代码来源:RIMPlugin.cpp


示例15: config

bool SimAnalog::config(jccl::ConfigElementPtr element)
{
   //vprDEBUG(vprDBG_ALL, vprDBG_VERB_LVL)<<"*** SimAnalog::config()\n"<< vprDEBUG_FLUSH;
   if (! (Input::config(element) && Analog::config(element) &&
          SimInput::config(element)) )
   {
      return false;
   }

   std::vector<jccl::ConfigElementPtr> key_inc_list, key_dec_list;

   int key_count = element->getNum("increment_keypress");

   for ( int i = 0; i < key_count; ++i )
   {
      key_inc_list.push_back(element->getProperty<jccl::ConfigElementPtr>("increment_keypress", i));
   }

   key_count = element->getNum("decrement_keypress");

   for ( int i = 0; i < key_count; ++i )
   {
      key_dec_list.push_back(element->getProperty<jccl::ConfigElementPtr>("decrement_keypress", i));
   }

   mSimKeysUp = readKeyList(key_inc_list);
   mSimKeysDown = readKeyList(key_dec_list);

   mAnaStep = element->getProperty<float>("delta");
   mInitialValue = element->getProperty<float>("initial_value");

   // Initialize all the data to the inital_value
   size_t num_pairs = mSimKeysUp.size();
   mAnaData = std::vector<AnalogData>(num_pairs);
   for (size_t i=0; i<num_pairs; ++i)
   {
      mAnaData[i].setValue(mInitialValue);
   }

   mAutoReturn = element->getProperty<bool>("auto_return");

   return true;
}
开发者ID:Michael-Lfx,项目名称:vrjuggler,代码行数:43,代码来源:SimAnalog.cpp


示例16: configRemoveDisplay

/**
 * Removes the element from the current configuration.
 *
 * @pre configCanHandle(element) == true
 * @return success
 */
bool DisplayManager::configRemoveDisplay(jccl::ConfigElementPtr element)
{
   vprASSERT(configCanHandle(element)); // We must be able to handle it first of all

   vprDEBUG_BEGIN(vrjDBG_DISP_MGR,vprDBG_STATE_LVL) << "------- DisplayManager::configRemoveDisplay -------\n" << vprDEBUG_FLUSH;

   bool success_flag(false);

   if (element->getID() == std::string("display_window"))      // It is a display
   {
      DisplayPtr remove_disp = findDisplayNamed(element->getName());
      if (remove_disp != NULL)
      {
         closeDisplay(remove_disp, true);                            // Remove it
         success_flag = true;
      }
   }

   vprDEBUG_END(vrjDBG_DISP_MGR,vprDBG_STATE_LVL) << "------- DisplayManager::configRemoveDisplay done. --------\n" << vprDEBUG_FLUSH;
   return success_flag;
}
开发者ID:Michael-Lfx,项目名称:vrjuggler,代码行数:27,代码来源:DisplayManager.cpp


示例17: configRemove

/**
 * Removes the element from the current configuration.
 */
bool InputManager::configRemove(jccl::ConfigElementPtr element)
{
vpr::DebugOutputGuard dbg_output(gadgetDBG_INPUT_MGR, vprDBG_STATE_LVL,
                              std::string("InputManager: Removing config...\n"),
                              std::string("done removing config.\n"));
   vprASSERT(configCanHandle(element));

   bool ret_val = false;      // Flag to return success

   // NEED TO FIX!!!!
   if (cluster::ClusterManager::instance()->recognizeRemoteDeviceConfig(element))
   {
      vprDEBUG(gadgetDBG_INPUT_MGR, vprDBG_CONFIG_LVL)
         << "InputManager can not handle remote devices, we must use Remote Input Manager."
         << vprDEBUG_FLUSH;
      ret_val = false;
   }
   else if(DeviceFactory::instance()->recognizeDevice(element))
   {
      ret_val = removeDevice(element);
   }
   else if(recognizeProxyAlias(element))
   {
      ret_val = removeProxyAlias(element);
   }
   else if(ProxyFactory::instance()->recognizeProxy(element))
   {
      ret_val = removeProxy(element);
   }
   else if(element->getID() == std::string("display_system"))
   {
      mDisplaySystemElement.reset();  // Keep track of the display system element
      ret_val = true;                 // We successfully configured.
                                       // This tell processPending to remove it to the active config
   }
   else
   {
      ret_val = false;
   }

   if(ret_val)
   {
      resetAllDevicesAndProxies();
      updateAllDevices();                             // Update all the input data
      updateAllProxies();                             // Update all the input data
      BaseDeviceInterface::refreshAllInterfaces();      // Refresh all the device interface handles
      vprDEBUG(gadgetDBG_INPUT_MGR,vprDBG_VERB_LVL)
         << "InputManager::configRemove(): Updated all data" << std::endl
         << vprDEBUG_FLUSH;
   }

   return ret_val;         // Return the success flag if we added at all
}
开发者ID:rpavlik,项目名称:vrjuggler-2.2-debs,代码行数:56,代码来源:InputManager.cpp


示例18: configAdd

   bool CorbaPerfPlugin::configAdd(jccl::ConfigElementPtr element)
   {
      const unsigned int min_def_version(2);

      if ( element->getVersion() < min_def_version )
      {
         vprDEBUG(jcclDBG_PLUGIN, vprDBG_WARNING_LVL)
            << clrOutBOLD(clrYELLOW, "WARNING") << ": Element named '"
            << element->getName() << "'" << std::endl;
         vprDEBUG_NEXTnl(jcclDBG_PLUGIN, vprDBG_WARNING_LVL)
            << "is version " << element->getVersion()
            << ", but we expect at least version " << min_def_version
            << ".\n";
         vprDEBUG_NEXTnl(jcclDBG_PLUGIN, vprDBG_WARNING_LVL)
            << "Default values will be used for some settings.\n"
            << vprDEBUG_FLUSH;
      }

      // If the ORB is already running, we need to shut it down first.  One big
      // reason for doing this is to release the resources (memory and so on)
      // allocated previously.
      if ( mInterface != NULL || mCorbaManager != NULL )
      {
         vprDEBUG(vrjDBG_PLUGIN, vprDBG_STATE_LVL)
            << "[CorbaPerfPlugin::configAdd()] Attempting to shut down "
            << "existing CORBA instance.\n" << vprDEBUG_FLUSH;

         // stopCorba() will call disable() if we are still in the enabled state.
         stopCorba();
      }

      // We'll ignore the return value for now.  startCorba() prints out enough
      // warning information on its own if something goes wrong.
      this->startCorba(element->getProperty<std::string>("endpoint_addr"),
                       element->getProperty<vpr::Uint16>("endpoint_port"));

      return true;
   }
开发者ID:Michael-Lfx,项目名称:vrjuggler,代码行数:38,代码来源:CorbaPerfPlugin.cpp


示例19: configAdd

   /** Add the pending element to the configuration.
    *  @pre configCanHandle (element) == true.
    *  @return true iff element was successfully added to configuration.
    */
   bool RIMPlugin::configAdd(jccl::ConfigElementPtr element)
   {
      // XXX: We may still use this to handle the configuration 
      //      of clustered RIM connections.
      if ( ClusterManager::instance()->recognizeRemoteDeviceConfig(element) )
      {
         std::string device_host = element->getProperty<std::string>("device_host");
         gadget::Node* node = ClusterManager::instance()->getNetwork()->getNodeByName(device_host);
         std::string device_name = element->getName();

         vprDEBUG(gadgetDBG_RIM,vprDBG_CONFIG_LVL)
            << clrOutBOLD(clrCYAN,"[RIMPlugin] ")
            << "Adding the Remote Device: " << device_name
            << " to the RIM Pending List"
            << std::endl << vprDEBUG_FLUSH;

         if ( node == NULL )
         {
            vprDEBUG(gadgetDBG_RIM,vprDBG_CONFIG_STATUS_LVL)
               << clrOutBOLD(clrCYAN,"[RIMPlugin] ")
               << clrOutBOLD(clrRED, "WARNING:") << " Cluster node: " << device_host
               << " does not exist, there must be an error in the ClusterDepChecker."
               << std::endl << vprDEBUG_FLUSH;
            return false;
         }
         else if ( !node->isConnected() )
         {
            vprDEBUG(gadgetDBG_RIM,vprDBG_CONFIG_LVL)
               << clrOutBOLD(clrCYAN,"[RIMPlugin] ")
               << clrOutBOLD(clrRED, "WARNING:") << " Cluster node: " << device_host
               << " is not connected, there must be an error in the ClusterDepChecker."
               << std::endl << vprDEBUG_FLUSH;
            return false;
         }

         DeviceRequest* device_req = new DeviceRequest(getHandlerGUID(), device_name);
         mRIM.addPendingDeviceRequest(device_req, node);
         setActive(true);
         return(true);
      }
      else
      {
         vprDEBUG(gadgetDBG_RIM,vprDBG_CRITICAL_LVL)
            << clrOutBOLD(clrCYAN,"[RIMPlugin] ")
            << clrOutBOLD(clrRED, "ERROR: ")
            << "recognizeRemoteDeviceConfig is broken."
            << std::endl << vprDEBUG_FLUSH;
         return(false);
      }
   }
开发者ID:rpavlik,项目名称:vrjuggler-2.2-debs,代码行数:54,代码来源:RIMPlugin.cpp


示例20: configRemove

   /**
    * Removes the element from the current configuration.
    * @pre configCanHandle(element) == true
    */
   bool SoundManagerSonix::configRemove(jccl::ConfigElementPtr element)
   {
      // remove any specified sounds...
      int size = element->getNum("sound");
      for (int x = 0; x < size; ++x)
      {
         jccl::ConfigElementPtr sound_element =
            element->getProperty<jccl::ConfigElementPtr>("sound", x);
         std::string alias(sound_element->getName());
         snx::sonix::instance()->remove(alias);
      }

      return true;
   }
开发者ID:rpavlik,项目名称:vrjuggler-2.2-debs,代码行数:18,代码来源:SoundManagerSonix.cpp



注:本文中的jccl::ConfigElementPtr类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ js::AutoFilename类代码示例发布时间:2022-05-31
下一篇:
C++ java::TrivialClass类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap